Re: How to filter out step 3 vertex list based on step 1 vertex


Boxuan Li
 

Hi Ronnie,

Not sure if it's optimal but this should work:

g.V().hasLabel("VertexB").as("B").in("edgeAB").out("edgeAC").as("C").out("edgeCB").as("B2").where("B", eq("B2")).select("C")

You can also do this in two steps:

b = g.V().hasLabel("VertexB").as("B").next()
g.V(b).in("edgeAB").out("edgeAC").where(out("edgeCB").is(b))

FYI, for general gremlin query questions, you can also ask in the gremlin-users mailing list: https://groups.google.com/g/gremlin-users

Best,
Boxuan

Join {janusgraph-users@lists.lfaidata.foundation to automatically receive all group messages.