You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wanna ask how to convert following gremlin console code using gremlin-scala: g.V().has("uuid", "someUuid").as("a").inE().as("e").outV().as("b").select("a", "b").by("uuid").filter{it.get().get("b").contains(it.get().get("a"))}.select("e").outV().valueMap("name")
select-by isn't supported in a typesafe way yet, there's #241 by @jeremysears to add this
However, since you're using lambdas anyway, you can do the following:
// your schema - define once globally somewhere
val uuid = Key[String]("uuid")
val name = Key[String]("name")
val a = StepLabel[Vertex]()
val b = StepLabel[Vertex]()
val e = StepLabel[Edge]()
val gs = g.V.has(uuid, "someUuid").as(a).inE.as(e).outV.as(b)
gs.select((a, b)).filterOnEnd { case (a, b) => b.value2(uuid) == a.value2(uuid)}
.select(e).outV.value("name")
Note that I only checked that it compiles, since I don't have a test graph to verify it.
Hi,
Wanna ask how to convert following gremlin console code using gremlin-scala:
g.V().has("uuid", "someUuid").as("a").inE().as("e").outV().as("b").select("a", "b").by("uuid").filter{it.get().get("b").contains(it.get().get("a"))}.select("e").outV().valueMap("name")
This is a similar query from:
https://stackoverflow.com/questions/36045141/comparing-vertex-properties-in-gremlin-groovy
Thanks,
Alex
The text was updated successfully, but these errors were encountered: