Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 696
janus graph Avatar asked Mar 10 '26 20:03

janus graph


1 Answers

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.

like image 104
Florian Hockmann Avatar answered Mar 12 '26 11:03

Florian Hockmann



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!