Reputation: 80166
Is there a type-safe query builder for Gremlin? As of now we are building them by string concatenation hence not type-safe. I am looking for some thing similar to CriteriaBuilder in JPA.
Upvotes: 2
Views: 952
Reputation: 1380
Not sure if that's what you're looking for, but Gremlin-Scala for Tinkerpop3 supports fully typesafe paths.
import gremlin.scala._
import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory
def g = TinkerFactory.createModern.asScala
// select all labelled steps
g.V(1).as("a")
.outE.as("b")
.select
.toList
// returns a `(Vertex, Edge)` for each path
Disclaimer: I am the maintainer of Gremlin-Scala ;)
Upvotes: 1