Gremlin.Net System.InvalidOperationException:'用于"janusgraph:RelationIdentifier"的反序列化器;找不到"例外 [英] Gremlin.Net System.InvalidOperationException: 'Deserializer for "janusgraph:RelationIdentifier" not found' exception

查看:94
本文介绍了Gremlin.Net System.InvalidOperationException:'用于"janusgraph:RelationIdentifier"的反序列化器;找不到"例外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是janusgraph和tinkerpop的新手.我正在使用Gremlin.Net 3.2.7连接到janusgraph,所有返回顶点的请求对我来说都可以正常工作,但是当我运行任何返回边缘的操作时,例如"gV(61464).outE('father'). toList()" 库中的异常:

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:'反序列化器 找不到"janusgraph:RelationIdentifier".

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

服务器未引发任何异常,序列化配置是默认配置:

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

序列化器:

 - { 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] }}

,但是在gremlin-client控制台中可以正常工作.你有什么建议吗?

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

推荐答案

看起来JanusGraph以自己的格式将边序列化为

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.

TinkerPop文档包含一个有关如何为Gremlin编写反序列化器的示例.net . (请注意,您只需实现一个IGraphSONDeserializer,而不必实现IGraphSONSerializer,因为它仅用于编写.)

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.)

或者,如果您想更改Gremlin遍历,则可以例如返回边缘属性:

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:看来您正在以Gremlin-Groovy字符串的形式将Gremlin遍历发送到JanusGraph服务器.您也可以改为使用Gremlin.Net在C#中直接编写克里姆林遍历.这不仅使遍历的编写更加容易,而且在服务器端的执行效率也更高.

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.

这篇关于Gremlin.Net System.InvalidOperationException:'用于"janusgraph:RelationIdentifier"的反序列化器;找不到"例外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆