I am new to gremlin.I need to convert my cypher query to gremlin.
My cypher query:
match(s:Student)-[:STUDIED_AT]-(c:College)
with s,c
match(s)-[:LIVES_IN]-(l:Location)
return s,c,l limit 10
I need to convert this to gremlin. My question is , here in cypher with the help of 'WITH' I was able to reuse student Vertex in later part of query .How do I do that in gremlin?
In Gremlin, there is the
asstep that can be used to label part of a traversal/query so that you can refer to it later using aselectstep. However, this is not always needed. For your example the Cypher would end up looking something like the example below.so
might become
Note that I used
bothrather thanoutorinas you did not specify an edge direction in the Cypher query.