0

I have a code like the one below. Since I switched TinkerGraph to JanusGraph it got an error:

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

var result =
    _g.V().BothE("name").OtherV().Path().By(__.ValueMap<object, object>(true)).ToList();
Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Lúa Eri
  • 1
  • 1

1 Answers1

1

This is a common serializer error and likely related to an error on your client side. The RelationIdentifier is a JanusGraph specific class (i.e. an Edge identifier) and therefore the TinkerPop drivers don't know how to process it. Either avoid JanusGraph specific classes by not returing the Edge T.id in valueMap() or consider using janusgraph-dotnet.

stephen mallette
  • 45,298
  • 5
  • 67
  • 135
  • I used, but still failed, and installed JanusGraph.net: var employee = _g.V (idEmployee) .HasLabel (Employee.Label) .InE (Employee.LabelEdgeRole) .OtherV () .Path () .By (__. ValueMap (true)); var result = await employee.Promise (t => t.ToList ()); – Lúa Eri Feb 24 '21 at 08:16
  • But it is erro: Gremlin.Net System.InvalidOperationException: 'Deserializer for “janusgraph:RelationIdentifier” not found' exception – Lúa Eri Feb 24 '21 at 08:21
  • remove the `true` from `valueMap()` so that the `RelationId` is not returned. even if you need that id, it would be good to just see that you've isolated the serialization error to that, though your error in the comment above seems to be clear that it is. if you don't need the id/label then i sense you have your solution. Note that janusgraph-dotnet does have the `RelationIdentifier` deserializer in their code so its curious that you're not finding this workign: https://github.com/JanusGraph/janusgraph-dotnet/blob/master/src/JanusGraph.Net/IO/GraphSON/RelationIdentifierDeserializer.cs – stephen mallette Feb 24 '21 at 11:19
  • I am a student intern, I am investigating the gremlin. I don't understand it very well. Glad if you write a query snippet with my above query along with: https://github.com/JanusGraph/janusgraph-dotnet/blob/master/src/JanusGraph.Net/IO/GraphSON/RelationIdentifierDeserializer.cs .... so it won't fail – Lúa Eri Feb 24 '21 at 14:51
  • I need the edge id and label – Lúa Eri Feb 24 '21 at 14:52
  • How did you create the client? Did you use the `JanusGraphClientBuilder` as described in [the README.md of JanusGraph.Net](https://github.com/JanusGraph/janusgraph-dotnet#usage)? If you did, then the needed serializers are already registered by default and it should just work. – Florian Hockmann Feb 25 '21 at 08:08