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
triggan11mo 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
aphorisme11mo ago
Thanks a lot! This is fruitful material to explore.
spmallette
spmallette11mo 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
More Posts
Best Testing Practices?Hi! I'm using Gremlin for the 1st time in one of my projects and one of the goals is to do TDD. WhaRoute from origin to destination between two datetimesHey, I'm attempting to create a graph DB that will allow me to efficiently find a route from origin migrating from Azure Cosmos DB Gremlin to another Gremlin platform such as Google BigTableHas anyone tried, or have any idea if something like this is possible, thinking about potentially chWhat does Setting Write Buffer Watermark do?**int writeBufferHighWaterMark** If the number of bytes in the network send buffer exceeds this vHow can I filter by property typeSome time ago, we discovered that a certain timestamp property was being stored as a String instead Deleting X nodes when there is no incoming Y nodes to themHello, In my case, a `team` has many `Member` and each member works only for one company. a companyUser Defined Steps for orientDB Handlers (Server Plugins)OrientDB has Handlers (Server Plugins). Handlers allow writing custom functions. For example, there Modify traversal from outside the function that builds the traversal (Java)Hi peeps, more of an OOP oriented question this time around. I'll start off by explaining what I'm tHow can I write a project using an inject that doesn't exhaust itself?Take the following example query: g.inject("1", "2", "3").project("list").by(__.inject("b").fold()ReadOnlyStrategy for remote script execution to make a read only server instanceHi all, I am setting up a read only cluster of gremlin server, I have conifgured the initialization