2
votes

I am new in janusgraph and tinkerpop. I am using Gremlin.Net 3.2.7 to connect to janusgraph and all the request that return vertexes work fine for me but when I run any operation that return edges like "g.V(61464).outE('father').toList()" an exception in the library:

System.InvalidOperationException: 'Deserializer for "janusgraph:RelationIdentifier" not found'

the server didn't throw any exception, the serializes configuration are the default:

serializers:

 - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
 - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: {ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
 - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}
 - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistryV1d0] }}
 - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
 - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistryV1d0] }}

but its working fine in the gremlin-client console. do you have any suggestion plz?

1
We are currently working on a .NET library for JanusGraph that extends Gremlin.Net to support JanusGraph specific types. The initial version is in review right now and if you or anyone else from the community is interested in improving JanusGraph .NET support, then you can help give it a review: github.com/JanusGraph/janusgraph-dotnet/pull/1Florian Hockmann

1 Answers

3
votes

It looks like JanusGraph serializes edges in its own format as RelationIdentifiers which aren't part of TinkerPop. So Gremlin.Net has no deserializer for this type. This means that you either have to implement your own GraphSON deserializer for this type or you change your Gremlin query to not return edges directly.

The TinkerPop docs contain an example on how to write a deserializer for Gremlin.Net. (Note that you only have to implement an IGraphSONDeserializer, not IGraphSONSerializer as that's only used for writing.)

Or, if you instead want to change your Gremlin traversal, than you can for example just return the edge properties:

g.V(61464).OutE("father").ValueMap<object>().ToList();

BTW: It looks like you are sending your Gremlin traversals in the form of Gremlin-Groovy strings to the JanusGraph server. You can instead also write Gremlin traversals directly in C# with Gremlin.Net. This makes it not only easier to write the traversal, but the execution is also more efficient on the server-side.