I am running a query to traverse all the "in" edges following a specific label, and I will be doing a similar query later for the "out" edges later. I want to get this as a tree as there may be a vertex with multiple edges to traverse and need to reflect that in my client, so I can't just use a ToList()
here.
I'm currently using Gremlin-Go SDK, but when calling the Tree()
step I get a deserialization error. Here's a snippet from my client code:
res, err := g.V(id).
Emit().
Repeat(__.In(label)).
Tree().
Next() // Other terminal steps produce same issue
This produces the deserialization error on the data type 0x2b
, which is a GraphBinary core data type "Tree"
2023/02/28 12:23:05 Error occurred during operation gremlinServerWSProtocol.readLoop(): 'E0408: unknown data type to deserialize 0x2b'
2023/02/28 12:23:05 Read loop error 'E0408: unknown data type to deserialize 0x2b', closing read loop.
2023/02/28 12:23:05 Connection error callback invoked, closing protocol.
The Gremlin-Go reference docs don't seem to mention anything on specific serialization support. According to the gremlin-go
README, it supports all core GraphBinary data types. I have tested my query in Gremlin Console to verify the query and server:
g.V(<ID>).emit().repeat(__.in(<LABEL>)).tree().next()
.
For some added context, I am developing this against gremlin-server:3.5.3
locally for experimentation with the intention of finalizing queries with support for AWS Neptune. I'm aware these aren't fully interchangeable and will follow the Neptune-Gremlin reference. The latest version of Neptune specifies the latest supported version of Gremlin is 3.5.3.
In general, only the Java (and other JVM based clients) are able to de-serialize structures like a SubGraph or a Tree. This is because those are the only Gremlin clients that have native implementations of those data structures currently available (for example the JVM clients have TinkerGraph available).
This is an item that the TinkerPop community is very aware of and it is on the list of things that it makes sense to improve.
A possible workaround (not a great one) is to use the HTTP endpoint (sending queries as text) and processing the GraphSON returned if getting this type of data structure back is essential.