Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
8e40ab15
Commit
8e40ab15
authored
7 years ago
by
Graham Wallis
Committed by
Sarath Subramanian
7 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2242: Gremlin3 traversals for discovery service
Signed-off-by:
Sarath Subramanian
<
ssubramanian@hortonworks.com
>
parent
3b597fb5
master
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
AtlasGremlin3QueryProvider.java
...ava/org/apache/atlas/util/AtlasGremlin3QueryProvider.java
+2
-2
GraphBackedDiscoveryServiceTest.java
...ache/atlas/discovery/GraphBackedDiscoveryServiceTest.java
+4
-4
No files found.
repository/src/main/java/org/apache/atlas/util/AtlasGremlin3QueryProvider.java
View file @
8e40ab15
...
...
@@ -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
);
}
...
...
This diff is collapsed.
Click to expand it.
repository/src/test/java/org/apache/atlas/discovery/GraphBackedDiscoveryServiceTest.java
View file @
8e40ab15
...
...
@@ -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
));
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment