You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by sa...@apache.org on 2017/10/31 00:24:50 UTC

atlas git commit: ATLAS-2242: Gremlin3 traversals for discovery service

Repository: atlas
Updated Branches:
  refs/heads/master 3b597fb5e -> 8e40ab15d


ATLAS-2242: Gremlin3 traversals for discovery service

Signed-off-by: Sarath Subramanian <ss...@hortonworks.com>


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/8e40ab15
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/8e40ab15
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/8e40ab15

Branch: refs/heads/master
Commit: 8e40ab15d83c09e3496d5740c31deffdd5c6471f
Parents: 3b597fb
Author: Graham Wallis <gr...@uk.ibm.com>
Authored: Mon Oct 30 17:24:41 2017 -0700
Committer: Sarath Subramanian <ss...@hortonworks.com>
Committed: Mon Oct 30 17:24:41 2017 -0700

----------------------------------------------------------------------
 .../org/apache/atlas/util/AtlasGremlin3QueryProvider.java    | 4 ++--
 .../atlas/discovery/GraphBackedDiscoveryServiceTest.java     | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/8e40ab15/repository/src/main/java/org/apache/atlas/util/AtlasGremlin3QueryProvider.java
----------------------------------------------------------------------
diff --git a/repository/src/main/java/org/apache/atlas/util/AtlasGremlin3QueryProvider.java b/repository/src/main/java/org/apache/atlas/util/AtlasGremlin3QueryProvider.java
index a43e023..a55f261 100644
--- a/repository/src/main/java/org/apache/atlas/util/AtlasGremlin3QueryProvider.java
+++ b/repository/src/main/java/org/apache/atlas/util/AtlasGremlin3QueryProvider.java
@@ -46,9 +46,9 @@ public class AtlasGremlin3QueryProvider extends AtlasGremlin2QueryProvider {
                         "emit(has('__superTypeNames').and().properties('__superTypeNames').hasValue('DataSet'))." +
                         "path().toList()";
             case GREMLIN_SEARCH_RETURNS_VERTEX_ID:
-                return "g.V().range(0,1).valueMap(true).toList()";
+                return "g.V().range(0,1).toList()";
             case GREMLIN_SEARCH_RETURNS_EDGE_ID:
-                return "g.E().range(0,1).valueMap(true).toList()";
+                return "g.E().range(0,1).toList()";
         }
         return super.getQuery(gremlinQuery);
     }

http://git-wip-us.apache.org/repos/asf/atlas/blob/8e40ab15/repository/src/test/java/org/apache/atlas/discovery/GraphBackedDiscoveryServiceTest.java
----------------------------------------------------------------------
diff --git a/repository/src/test/java/org/apache/atlas/discovery/GraphBackedDiscoveryServiceTest.java b/repository/src/test/java/org/apache/atlas/discovery/GraphBackedDiscoveryServiceTest.java
index 11980be..bd730e4 100755
--- a/repository/src/test/java/org/apache/atlas/discovery/GraphBackedDiscoveryServiceTest.java
+++ b/repository/src/test/java/org/apache/atlas/discovery/GraphBackedDiscoveryServiceTest.java
@@ -239,8 +239,7 @@ public class GraphBackedDiscoveryServiceTest extends BaseRepositoryTest {
         gremlinQueryProvider = AtlasGremlinQueryProvider.INSTANCE;
 
         // For tinkerpop2 this query was g.V.range(0,0).collect()
-        // For tinkerpop3 it should be g.V().range(0,1),valueMap(true).toList()
-        // List<Map<String,String>> gremlinResults = discoveryService.searchByGremlin("g.V().range(0,1).valueMap(true).toList()");
+        // For tinkerpop3 it should be g.V().range(0,1).toList()
         final String query = gremlinQueryProvider.getQuery(AtlasGremlinQuery.GREMLIN_SEARCH_RETURNS_VERTEX_ID);
 
         List<Map<String,String>> gremlinResults = discoveryService.searchByGremlin(query);
@@ -259,8 +258,7 @@ public class GraphBackedDiscoveryServiceTest extends BaseRepositoryTest {
         gremlinQueryProvider = AtlasGremlinQueryProvider.INSTANCE;
 
         // For tinkerpop2 this query was g.E.range(0,0).collect()
-        // For tinkerpop3 it should be g.E().range(0,1),valueMap(true).toList()
-        // List<Map<String,String>> gremlinResults = discoveryService.searchByGremlin("g.E().range(0,1).valueMap(true).toList()");
+        // For tinkerpop3 it should be g.E().range(0,1).toList()
         final String query = gremlinQueryProvider.getQuery(AtlasGremlinQuery.GREMLIN_SEARCH_RETURNS_EDGE_ID);
 
         List<Map<String,String>> gremlinResults = discoveryService.searchByGremlin(query);
@@ -268,6 +266,8 @@ public class GraphBackedDiscoveryServiceTest extends BaseRepositoryTest {
         Map<String, String> properties = gremlinResults.get(0);
         Assert.assertTrue(properties.containsKey(GraphBackedDiscoveryService.GREMLIN_ID_KEY));
         Assert.assertTrue(properties.containsKey(GraphBackedDiscoveryService.GREMLIN_LABEL_KEY));
+        Assert.assertTrue(properties.containsKey(GraphBackedDiscoveryService.GREMLIN_INVERTEX_KEY));
+        Assert.assertTrue(properties.containsKey(GraphBackedDiscoveryService.GREMLIN_OUTVERTEX_KEY));
     }