I found out a while ago that returning edges from Janus is a problem with
gremlin.net as you get this exception:
"Deserializer for \"janusgraph:RelationIdentifier\" not found"
As I don't have the time or knowledge for writing custom serialisers or similar, I have been using a semi-satisfactory work-around of
g.V(edge.FromVertexId).AddE(edge.Label).To(g.V(edge.ToVertexId)).Values<string>().Next();
This adds the edge just fine, although I have nothing returned to prove it (can't work out how to return the id)
However, I have been asked to convert all my code to use Promises (as defined in ITraversal). This has worked just fine with Vertex-based traversals, but I'm back to square one with Edges in that no matter what I try I get that damn exception again.
Here's a little of my (admittedly flakey) code:
var graphTrav = g.V(edge.FromVertexId).AddE(edge.Label).To(g.V(edge.ToVertexId));
// attempt 1
var result = await graphTrav.Promise<ITraversal>(traverse);
Func<ITraversal<Vertex, Edge>, ITraversal> traverse =
(trav) =>
{
return trav.Iterate();
};
I cannot use values() on an itraversal object so trying iterate() to try and avoid a return object(?). Still get the exception
// attempt 2
var result = await graphTrav.Promise<string>(traverse);
Func<ITraversal<Vertex, Edge>, string> traverse =
(trav) =>
{
GraphTraversal<Vertex, Edge> gt = (GraphTraversal<Vertex, Edge>)trav;
return gt.Values<string>().Next();
};
here I've tried creating a GraphTraversal out of the Itraversal object. Janus stores the edge, but gives the exception even though it is meant to return a string like my work-around
I guess this may be more of a C# query than a gremlin(.net) one, but I would appreciate any help please.