You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2017/10/13 20:25:00 UTC

tinkerpop git commit: TINKERPOP-1790 Made some updates to GraphSON docs CTR

Repository: tinkerpop
Updated Branches:
  refs/heads/master 2743f4d47 -> 7407700c6


TINKERPOP-1790 Made some updates to GraphSON docs CTR


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/7407700c
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/7407700c
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/7407700c

Branch: refs/heads/master
Commit: 7407700c6704efc3648e58079215b49a676da269
Parents: 2743f4d
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Oct 13 16:24:32 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Oct 13 16:24:32 2017 -0400

----------------------------------------------------------------------
 docs/src/dev/io/graphson.asciidoc | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7407700c/docs/src/dev/io/graphson.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/dev/io/graphson.asciidoc b/docs/src/dev/io/graphson.asciidoc
index 7e03cc5..397ddb4 100644
--- a/docs/src/dev/io/graphson.asciidoc
+++ b/docs/src/dev/io/graphson.asciidoc
@@ -391,7 +391,7 @@ writer.writeObject(os, graph);
 Generalized object serialization will be discussed later in this section, so for now the focus will be on the "graph"
 format. Unlike GraphML, GraphSON does not use an edge list format. It uses an adjacency list. In the adjacency list,
 each vertex is essentially a line in the file and the vertex line contains a list of all the edges associated with
-that vertex. The GraphSON 2.0 representation looks like this for the Modern toy graph:
+that vertex. The GraphSON 3.0 representation looks like this for the Modern toy graph:
 
 [source,json]
 ----
@@ -403,9 +403,9 @@ that vertex. The GraphSON 2.0 representation looks like this for the Modern toy
 {"id":{"@type":"g:Int32","@value":6},"label":"person","outE":{"created":[{"id":{"@type":"g:Int32","@value":12},"inV":{"@type":"g:Int32","@value":3},"properties":{"weight":{"@type":"g:Double","@value":0.2}}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":10},"value":"peter"}],"age":[{"id":{"@type":"g:Int64","@value":11},"value":{"@type":"g:Int32","@value":35}}]}}
 ----
 
-At a glance, one can see that this is not a valid JSON document. While that may seem incorrect, there is a reason. The
-"graph" format is designed by default to be splittable, such that distributed systems like Spark can easily divide the
-a GraphSON file for processing. If this data were represented as an "array of vertices" with square brackets at the
+At a glance, one can see that this is not a valid JSON document. While that form may seem incorrect, there is a reason.
+The "graph" format is designed by default to be splittable, such that distributed systems like Spark can easily divide
+the a GraphSON file for processing. If this data were represented as an "array of vertices" with square brackets at the
 beginning and end of the file, the format would be less conducive to fit that purpose. It is possible to change this
 behavior by building the `GraphSONWriter` with the `wrapAdjacencyList` setting set to `true`, in which case the output
 will be a valid JSON document that looks like this:
@@ -3777,8 +3777,16 @@ The following example is a `ZoneOffset` of three hours, six minutes, and nine se
 [[graphson-3d0]]
 == Version 3.0
 
-Version 3.0 of GraphSON was first introduced on TinkerPop 3.3.0. It is quite similar to GraphSON 2.0 in many ways in
-terms of features, but it does not have an "untyped" version as previous version of GraphSON had.
+Version 3.0 of GraphSON was first introduced on TinkerPop 3.3.0 and is the default format when not specified as of this
+version. It is quite similar to GraphSON 2.0 and in most cases will appear compatible to the eye, however there are
+some critical differences:
+
+* GraphSON 3.0 does not have an option to be typeless. Types are always embedded.
+* GraphSON 2.0 relied on JSON data types for collections like `Map` and `List`. In GraphSON 3.0, there is explicit
+typed support for `Map`, `List` and `Set` as Gremlin relies on those types in quite specific ways that are not
+directly compatible with the JSON definitions of those collections. In the case of `List` and `Set`, it was important
+to distinguish between the two and for `Map` it was necessary to have the ability to return `Map` instances that did
+not have `String` keys (e.g. `g.V().out().groupCount()`).
 
 === Core