I am trying to add edges between vertices similar to this question, except there are different properties whose equality I want to consider, e.g. using a TinkerGraph with an index on 'x'
:
g.addV().property("x", "1").
addV().property("x", "2").property("y", "1").
addV().property("x", "3").property("y", "2")
I am trying to add the two edges where x=y so that (x=3,y=2) --link--> (x=2,y=1) --link--> (x=1)
using something like:
g.V().as("a").
V().as("b").
where(has("x", select("a").values("y"))).
addE("link").from("a").to("b")
However this particular query creates more edges then I was expecting (all vertices with 'y'
are connected to all other vertices).
Any help forming the appropriate where-clause would be greatly appreciated.