Using TinkerPop 3 Java APIs:
My graph looks like this:
james {risk: 'n'} --> chris {risk: 'n'} --> raj {risk: 'n'} --> joanne {risk: 'y'}
The edge label is 'travelledWith' and a property called 'pnrLocator'
Now, I want to traverse from james till a vertex where the risk is set to 'y'. Along the way, I'd want to collect the vertex and edge properties.
This is what I have which only works for vertex properties. How can I add a 'by' and collect the 'pnrLocator' too?
GraphTraversal<Vertex, ?> values =
g.traversal()
.V()
.has("personId", "james")
.repeat(out("travelledWith"))
.until(has("risk", "y"))
.limit(100)
.path()
.by("personId");
values.forEachRemaining(v -> System.out.println(v));