2

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.

Aravind Yarram
  • 78,777
  • 46
  • 231
  • 327

1 Answers1

1

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 ;)

Michael Pollmeier
  • 1,370
  • 11
  • 20
  • plus one. Is Tinkerpop3 production ready? I am using 2.5 as it is the most recent released version. Also, is there a Java equivalent of this? we are a java shop. – Aravind Yarram Feb 02 '15 at 13:26
  • @Pangea Tinkerpop3 is not production ready as of today - we have a release candidate but still making many big changes.. You could use Gremlin-Java direct (it's what Gremlin-Groovy and Gremlin-Scala are built on) – Michael Pollmeier Feb 04 '15 at 04:56