Complete Instruction Set?

Hello there! I'm working on a gremlin to SQL implementation and was wondering if there is a specification of the "instruction set" language? E.g. wikipedia states that
g.V().as("a").out("knows").as("b").
select("a","b").
by("name").
by("age")
g.V().as("a").out("knows").as("b").
select("a","b").
by("name").
by("age")
is compiled to something which can be uniquely stringified into
[GraphStep([],vertex)@[a], VertexStep(OUT,[knows],vertex)@[b], SelectStep([a, b],[value(name), value(age)])]
[GraphStep([],vertex)@[a], VertexStep(OUT,[knows],vertex)@[b], SelectStep([a, b],[value(name), value(age)])]
and I was wondering if the later one is specified somewhere? Thanks in advance!
3 Replies
triggan
triggan16mo ago
There is an ANTLR grammar for Gremlin defined here: https://github.com/apache/tinkerpop/tree/master/gremlin-language/src/main/antlr4 The "compiled" format is called Bytecode - there are Translators that allow you to go from Bytecode back into Gremlin format in many of the supported client languages: https://tinkerpop.apache.org/docs/current/reference/#translators Maybe of help, but there is a utility called sql2gremlin which goes the opposite direction that you're doing. Maybe you can glean from that how to translate in reverse. http://sql2gremlin.com/
GitHub
tinkerpop/gremlin-language/src/main/antlr4 at master · apache/tinke...
Apache TinkerPop - a graph computing framework. Contribute to apache/tinkerpop development by creating an account on GitHub.
aphorisme
aphorisme16mo ago
Thanks a lot! This is fruitful material to explore.
spmallette
spmallette16mo ago
an ANTLR grammar for Gremlin defined here:
we've been asked this question many times and it's sort of neat to offer the ANTLR grammar as a mechanism for defining Gremlin. we still lack extensive developer step documentation. we started this, but it is slow going: https://tinkerpop.apache.org/docs/current/dev/provider/#_steps
Want results from more Discord servers?
Add your server