Re: Best practice setup for Go driver development & identifying the websocket serialization format


Robert Dale <rob...@...>
 

Have you seen this Go client?  https://github.com/qasaur/gremgo


On Friday, August 4, 2017 at 3:40:44 PM UTC-4, Ray Scott wrote:
I want to develop a driver in Go that connects to Gremlin Server using a websocket, runs a parameterized Groovy script and parses the response. At this stage all I need to do is perform basic queries and modify the graph. I've read through the documentation on driver development, and looked through some source code for existing drivers. 

Connecting and sending the data is the easy part. What I can not find anywhere, is an explanation of what I can expect to receive back in terms of the serialised format. I'm actually using JanusGraph straight out the box. I've looked at the yaml config and read some posts on the serializers listed therein. I've read a little about GraphSON and GraphML and Kryo and all I'm really looking for is a way to setup the server so that it returns a response thats some sort of official spec'd format that I can work with in Go. The only other thing I need to do, is be able to use the console as normal. 

As an example, if I send this query...

graph = JanusGraphFactory.open(cassandra)
g
= graph.traversal()
g
.V().has('name', 'hercules').next()


I receive this...

[[map[id:8376 label:demigod type:vertex properties:map[name:[map[id:2s7-6go-sl value:hercules]] age:[map[id:36f-6go-35x value:30]]]]]]


What format is that? How do other driver developers handle this? Do I need to change the settings of the serializers in the yaml config? Do I use a writer in the Groovy script to serialize the result into a format of my choice? I don't want to perform any unnecessary serialization. 

Thanks.

Join janusgraph-users@lists.lfaidata.foundation to automatically receive all group messages.