Go SDK - gremlingo.dataType=0 when decoding a janusgraph response

48 views
Skip to first unread message

remi.p...@gmail.com

unread,
Sep 19, 2022, 4:11:37 AM9/19/22
to Gremlin-users
Hey,
I'm trying to decode a simple query from janusgraph using the go sdk v3.6.1. It's failing around the janusgraph.RelationIdentifier.

The query:
`addV('"vertex-label-1').as('v1').addV('"vertex-label-2').as('v2').addE('edge-label').to(select('v1')).from(select('v2')).valueMap(true)`

The data:
`\x81\x00\xd87UrސNɲ\xa8X\x95\x84 \xeb\xd0\x00\x00\x00\xc8\x00\x00\x00\x00\x00\x00\x00\x00\x01\x03\x00\x00\x00\x00\x04host\x03\x00\x00\x00\x00\x11/172.25.0.1:60468\x00\x00\x00\x00\t\x00\x00\x00\x00\x02\n\x00\x00\x00\x00\x01 \x00\x03\x00\x00\x00\x00\x02id\x00\x00\x00\x00\x1djanusgraph.RelationIdentifier\x00\x00\x10\x01\x00\x00\x00\x00\x00\x00\x00\x10h\x00\x00\x00\x00\x00\x00\f\x15\x00\x00\x00\x00\x00\x00\x06\r\x00\x00\x00\x00\x00\x00\x10\x00\n\x00\x00\x00\x00\x01 \x00\x03\x00\x00\x00\x00\x05label\x03\x00\x00\x00\x00\nedge-label`

The output from delve at the error capture: https://imgur.com/a/DBu4Akw

Per the debug, the issue is happening at index 92 
88: i
89: d
90: \x00
91: \x00
92: \x00
93: \x00
94: \x1d
95: j
... anusgraph.RelationIdentifier

I'm not sure if this is a janusgraph issue or a library issue, the response decodes fine when using graphson with the (un-maintained) grammes library (https://github.com/northwesternmutual/grammes). Vertices decode fine too, it seems it fails every time there is an edge.

Any ideas or pointers?

Thanks!
Remi

Yang Xia

unread,
Sep 21, 2022, 1:44:53 AM9/21/22
to Gremlin-users
Hi Remi,

Thank you for raising the issue! This error is due to the RelationIdentifier being a custom edge object specific to JanusGraph that isn't serializable by TinkerPop, and so the Gremlin Go driver doesn't support it by default. We could potentially enable the mechanism to add custom serializers for compatibility in the future (I've created a JIRA ticket to track this https://issues.apache.org/jira/browse/TINKERPOP-2802, feel free to contribute!), but we don't have any immediate solution in the mean while. 

JanusGraph does supply libraries to help support this serialization, such as for .NET (https://github.com/JanusGraph/janusgraph-dotnet), but a Go library isn't yet available. Perhaps you could check with the JanusGraph community for more information on this as well? 

Cheers,

Yang

Florian Hockmann

unread,
Sep 21, 2022, 2:35:56 AM9/21/22
to Gremlin-users
JanusGraph does supply libraries to help support this serialization, such as for .NET (https://github.com/JanusGraph/janusgraph-dotnet), but a Go library isn't yet available. Perhaps you could check with the JanusGraph community for more information on this as well?

I think JanusGraph would need TINKERPOP-2802 to support this. So, I think there isn't much that can be done right now from JanusGraph's side.

If you don't need the edge ID (which is represented as a RelationIdentifier in JanusGraph), then you can simply omit the true parameter to valueMap(). That should allow you to retrieve the properties of the newly created edge or if you don't need to get anything back, then you could also use the none() step. It's just unfortunately not possible to return the edge ID.

remi.p...@gmail.com

unread,
Sep 22, 2022, 2:16:33 AM9/22/22
to Gremlin-users
Thanks for the quick response.
We would unfortunately need the edge ID and from what I understand of Janus we can't disable this behavior on their side.

I'm not very familiar with graphbinary, but happy to help if you can give a pointer on where to look.

Reply all
Reply to author
Forward
0 new messages