[ 
https://issues.apache.org/jira/browse/TINKERPOP-2419?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stephen Mallette updated TINKERPOP-2419:
----------------------------------------
    Issue Type: Improvement  (was: Bug)

> Gremlin.Net does not fully implement GraphSON serialization
> -----------------------------------------------------------
>
>                 Key: TINKERPOP-2419
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2419
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: dotnet
>    Affects Versions: 3.4.8
>            Reporter: Shaun
>            Priority: Major
>
> 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)

Reply via email to