You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Shaun (Jira)" <ji...@apache.org> on 2020/09/09 16:26:00 UTC
[jira] [Created] (TINKERPOP-2419) Gremlin.Net does not fully
implement GraphSON serialization
Shaun created TINKERPOP-2419:
--------------------------------
Summary: Gremlin.Net does not fully implement GraphSON serialization
Key: TINKERPOP-2419
URL: https://issues.apache.org/jira/browse/TINKERPOP-2419
Project: TinkerPop
Issue Type: Bug
Components: dotnet
Affects Versions: 3.4.8
Reporter: Shaun
Quite a bit of Gremlin.Net.Structure.* seems to not be implemented:
* Gremlin.Net.Structure.Graph doesn't actually provide any collections for Edge, Vertices, or VertexProperties
* Gremlin.Net.Structure.IO.GraphSON.GraphSONWriter (and derived GraphSON2Writer/GraphSON3Writer) is missing writeGraph
* Gremlin.Net.Structure.IO.GraphSON.GraphSONReader (and derived GraphSON2Reader/GraphSON3Reader) is missing readGraph
The combination of the above means the Gremlin.Net library can't be used to serialize GraphSON (of any version).
I can get partial GraphSON (missing all VertexProperties) with:
{code:c#}
List<Vertex> Vertices = new List<Vertex>();
List<VertexProperty> VertexProperties = new List<VertexProperty>();
List<Edge> Edges = new List<Edge>();
/* build up collections */
var sb = new StringBuilder();
var gsWriter = new GraphSON3Writer();
// NOTE: There is supposed to be a .writeGraph method on GraphSON3Writer, but there isn't 😣
sb.AppendLine("{");
sb.AppendLine(" \"mode\":\"EXTENDED\",");
sb.AppendLine(" \"vertices\": [");
// Unique vertices by name
foreach (var v in state.Vertices)
{
sb.AppendLine(gsWriter.WriteObject(v));
}
sb.AppendLine(" ],");
sb.AppendLine(" \"edges\": [");
// Unique edges by name
foreach (var e in state.Edges)
{
sb.AppendLine(gsWriter.WriteObject(e));
}
sb.AppendLine(" ]");
sb.AppendLine("}");
var brokenGraphSON = sb.ToString();
{code}
Am I missing something obvious here?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)