[
https://issues.apache.org/jira/browse/TINKERPOP3-699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14557482#comment-14557482
]
Matt Frantz commented on TINKERPOP3-699:
----------------------------------------
[~spmallette] OK, I see them now. I had not realized how significant the
changes to GraphSON had been. On further review of the communication record, I
see the following _ex post facto_ announcement in the dev list on "IO
Modifications" from May 1:
bq. In addition to API changes there were some adjustments to format. For
GraphSON this meant a bit of a change in format that was more efficient and a
bit less verbose when using writeGraph, writeVertex or writeVertices.
There is also this in the change log:
bq. GraphSON format for output from `GraphWriter.writeVertex`,
`GraphWriter.writeVertices`, and `GraphWriter.writeGraph` have all changed now
that they use `StarGraph` serialization.
We'll huddle to review how we use GraphSON, and to see if there is anything
that we can contribute in this area. Our use case involves small test data
sets, and we like JSON because diffs are reasonably easy to interpret during a
code review. That said, a sequence of JSON blobs has many of the same
desirable properties, so maybe we need to see how to make the existing output
fit our needs.
> GraphSON writeGraph not producing valid json object
> ---------------------------------------------------
>
> Key: TINKERPOP3-699
> URL: https://issues.apache.org/jira/browse/TINKERPOP3-699
> Project: TinkerPop 3
> Issue Type: Improvement
> Components: documentation
> Reporter: Jim Lloyd
> Assignee: stephen mallette
> Fix For: 3.0.0.GA
>
>
> The following code in the M9-rc3 console produces an incorrect t.json file:
> gremlin> graph = TinkerFactory.createModern()
> ==>tinkergraph[vertices:6 edges:6]
> gremlin> g = graph.traversal()
> ==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
> gremlin> f = new FileOutputStream("t.json")
> ==>java.io.FileOutputStream@7927bd9f
> gremlin> mapper =
> graph.io(IoCore.graphson()).mapper().embedTypes(true).create()
> ==>org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONMapper@63f34b70
> gremlin>
> graph.io(IoCore.graphson()).writer().mapper(mapper).create().writeGraph(f,
> graph)
> ==>null
> gremlin> f.close()
> ==>null
> The file is a stream of independent vertices rather than a single json object
> following the GraphSON schema. I.e. the output looks like the this:
> {"id":1,"label":"person", ... }
> {"id":2,"label":"person", ... }
> {"id":3,"label":"software", ... }
> Where ... represents omitted fields.
> A separate issue but related issue is that the documentation examples use
> "CoreIo" but the actual name of that class is "IoCore", as shown in the
> console session above.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)