Is it possible to generate gremlin script from the bytecode?
I am working on a POC in which I need to query graph Azure CosmosDB database via Gremlin API.
Currently, Azure CosmosDB does not support bytecode. Azure development team has started working on this but no release timeline has been published so far.
I would like to prepare working code which would require minimum refactoring in future when bytecode support will be generally available.
Based on the Apache TinkerPop docs, there are two ways of submitting Gremlin queries: bytecode and script
# script
client = Client('ws://localhost:8182/gremlin', 'g')
list = client.submit("g.V().has('person','name',name).out('knows')",{'name': 'marko'}).all()
# bytecode
g = traversal().withRemote(DriverRemoteConnection('ws://localhost:8182/gremlin','g'))
list = g.V().has("person","name","marko").out("knows").toList()
The "bytecode way" seems to me much more efficient (syntax checking, IDE intellisens, etc.) moreover I am interested in creating the DSL (Domain Specific Language).
Would it be possible to use the fluent api and serialize it to string, in a way similar to this:
client = Client('ws://localhost:8182/gremlin', 'g')
g = traversal()
q = g.V().has("person","name","marko").out("knows").toString()
list = client.submit(q).all()
I am using python 3.5 and gremlinpython 3.4.0