All Questions
Tagged with tinkerpop gremlinpython
52
questions
0
votes
1
answer
51
views
select and arrange multiple result within single projection
Apologies for not having sample graph.
I’ve a directed acyclic graph mapping where Multiple nodes called "greatgrandparents" have edges to "grandparents" that has edges to ...
1
vote
0
answers
44
views
How to use a single query to retrieve a vertex whose id is given by the traversal?
I have a graph on Azure CosmosDB which involves company hierarchies where a Top Parent exists and there are child companies like
CompanyX(Top Parent) -> CompanyY(Child of X + Parent of A) -> CompanyA(...
2
votes
1
answer
105
views
gremlin query to n hops and traversal of all sub edges and nodes
I am trying to create a graph where i can find all relationships with given person and list of their friends.
the problem statement my graph looks like this
bob ->friends -> jay
jay -> ...
1
vote
1
answer
76
views
What Gremlin query can I write to create custom relationships between all pairs nodes that have a certain number of connections in common?
In AWS Neptune, I have a graph that has many clusters like the one defined below:
g.addV('person').property('name', 'John').as('p1')
.addV('person').property('name', 'Weihua').as('p2')
.addV('...
2
votes
1
answer
683
views
Turn gremlin query result with elementMap into JSON [gremlinpython 3.6.1]
Continuing discussion from here.
I've a query that provides list of paths along-with elementMap().
How do I convert this data to JSON to be consumed by rest of the code.
I did look here that talks ...
0
votes
1
answer
66
views
direct edge traversal omitting paths
I am running into curious problem.
In graph above,I can't run repeat/until due to memory overload issue and vertices names changing at various level. I am trying direct edge traversal through each ...
1
vote
1
answer
96
views
search for value by key within dynamic collection
I am looking to extend discussion held here about filtering vertices based on property value from collection.
However, in my case the collection is dynamic e.g. generated using store
e.g.
following ...
0
votes
1
answer
73
views
How to select two verted id's in one gremlin-python query?
`
g.V().hasLabel('node1') \
.as('prop1', 'prop2', 'prop3', 'prop4', 'prop5', 'prop6', 'prop7', 'node1_id_prop8', 'prop9') \
.inE().hasLabel('edge').outV().hasLabel('node2').id().as('...
1
vote
1
answer
294
views
Gremlin Python "name 'V' is not defined" when using coalesce to chain insert edges
I am trying to batch insert edges using coalesce . And I was trying to follow this format for batch edge insert that I found on Neptune DB documentation:
g.V('v-1')
.outE('KNOWS')
.hasId('e-1')
....
1
vote
0
answers
75
views
Gremlin Python N-hop query
How can I get the list of nodes N-hops away from a given node (where N is a parameter)? Here, N-hops means we need to traverse (minimum) N edges (outward) from the source node to reach the destination ...
1
vote
1
answer
432
views
Gremlin Python shortest path between two nodes
How do we find shortest path between two nodes using gremlin-python?
The example given for gremlin here shows the following gremlin query
g.V(1).repeat(out().simplePath()).until(hasId(5)).path().
...
0
votes
1
answer
417
views
Gremlin-Python find all nodes connected by edges
I have a list of node labels as node_labels, where some of these may exist in a graph.
node_labels = ['a', 'b', 'c']
Using this I can get the node labels or associated attributes.
g.V().has_label(*...
2
votes
1
answer
467
views
Gremlin / tinkerpop: insert key:value property constant in every vertex and edge traversed then return path
Using AWS Neptune with Gremlin query language (last version).
Using sample data inserted this way:
g.addV('test_report').property('name', 'REF').property('creationDateTime','2022-07-01 00:00:00.000000'...
0
votes
1
answer
561
views
Check if a vertex exist, if it doesn't create it using an injected list of properties
UPDATE:
I feel silly. Decided to just query the db for a list of all the names, list_of_names_in_db = g.V().hasLabel('Person').values('name').toList() then comparing list_of_name_in_db to batch and ...
1
vote
0
answers
463
views
Tinkerpop Gremlin: Add both vertex and edge conditionally
need some tips/advise on a gremlin query ... :)
I have these types of vertices ...
orders: id, cid (string), ts (long)
// predicates for the orders
ip: id
phone: id
// few more
and Edges go from ...