You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Stephen Mallette (Jira)" <ji...@apache.org> on 2020/09/09 20:14:00 UTC

[jira] [Comment Edited] (TINKERPOP-2419) Gremlin.Net does not fully implement GraphSON serialization

    [ https://issues.apache.org/jira/browse/TINKERPOP-2419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17193160#comment-17193160 ] 

Stephen Mallette edited comment on TINKERPOP-2419 at 9/9/20, 8:13 PM:
----------------------------------------------------------------------

.NET is a Gremlin Language Variant and is meant to be a lightweight Gremlin implementation for remote interaction with a graph system. As such, it enables you to send Gremlin to a server and you get back results in some form, typically converting to more generic data structures like list and dictionary types. As it was never meant to have a fully fledged Gremlin processing engine within it, some functionality available in Java ends up not being available to .NET (as well as other languages off the JVM like python and javascript). 

While I suppose that was convenient in the early days, I've more recently wondered if it was time to advance the non-JVM language variants a bit further along to better allow for support of things like {{subgraph()}} step which would mean having some core graph structures. I tend to feel that this issue you mention is generally captured by TINKERPOP-2063 (so i might merge this issue into that one and close this) as we need to address that one to even begin to do {{io()}} based operations. You might also find [this dev list post|https://lists.apache.org/thread.html/e959e85d4f8b3d46d281f2742a6e574c7d27c54bfc52f802f7c04af3%40%3Cdev.tinkerpop.apache.org%3E] as interesting reading on the wider topic of graph structures in GLVs.


was (Author: spmallette):
.NET is a Gremlin Language Variant and is meant to be a lightweight Gremlin implementation for remote interaction with a graph system. As such, it enables you to send Gremlin to a server and you get back results in some form, typically converting to more generic data structures like list and dictionary types. As it was never meant to have a fully fledged Gremlin processing engine within it, some functionality available in Java ends up not being available to .NET (as well as other languages off the JVM like python and javascript). 

While I suppose that was convenient in the early days, I've more recently wondered if it was time to advance the non-JVM language variants a bit further along to better allow for support of things like {{subgraph()} step which would mean having some core graph structures. I tend to feel that this issue you mention is generally captured by TINKERPOP-2063 (so i might merge this issue into that one and close this) as we need to address that one to even begin to do {{io()}} based operations. You might also find [this dev list post|https://lists.apache.org/thread.html/e959e85d4f8b3d46d281f2742a6e574c7d27c54bfc52f802f7c04af3%40%3Cdev.tinkerpop.apache.org%3E] as interesting reading on the wider topic of graph structures in GLVs.

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