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 2018/06/01 14:21:17 UTC
[20/25] tinkerpop git commit: Merge branch 'tp32' into tp33
Merge branch 'tp32' into tp33
Conflicts:
docs/src/reference/the-graph.asciidoc
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/ae8fee7f
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/ae8fee7f
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/ae8fee7f
Branch: refs/heads/TINKERPOP-1975
Commit: ae8fee7fd453f6dedebb04524a784bef95c8423b
Parents: 6c98a30 4d0d481
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Jun 1 06:15:46 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Jun 1 06:15:46 2018 -0400
----------------------------------------------------------------------
docs/src/reference/the-graph.asciidoc | 42 +++++++++++++-------------
docs/src/reference/the-traversal.asciidoc | 28 ++++++++---------
2 files changed, 35 insertions(+), 35 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ae8fee7f/docs/src/reference/the-graph.asciidoc
----------------------------------------------------------------------
diff --cc docs/src/reference/the-graph.asciidoc
index cc500af,099cd3b..baa9f25
--- a/docs/src/reference/the-graph.asciidoc
+++ b/docs/src/reference/the-graph.asciidoc
@@@ -469,28 -469,26 +469,28 @@@ called `tinkerpop-modern.json` and the
[source,java]
----
- final Graph graph = TinkerFactory.createModern();
+ Graph graph = TinkerFactory.createModern();
-graph.io(IoCore.graphson()).writeGraph("tinkerpop-modern.json");
+graph.io(graphson()).writeGraph("tinkerpop-modern.json");
- final Graph newGraph = TinkerGraph.open();
+ Graph newGraph = TinkerGraph.open();
-newGraph.io(IoCore.graphson()).readGraph("tinkerpop-modern.json");
+newGraph.io(graphson()).readGraph("tinkerpop-modern.json");
----
+NOTE: Using `graphson()`, which is a static helper method of `IoCore`, will default to the most current version of GraphSON which is 3.0.
+
If a custom configuration is required, then have the `Graph` generate a `GraphReader` or `GraphWriter` "builder" instance:
[source,java]
----
- final Graph graph = TinkerFactory.createModern();
- try (final OutputStream os = new FileOutputStream("tinkerpop-modern.json")) {
- final GraphSONMapper mapper = graph.io(IoCore.graphson()).mapper().normalize(true).create()
+ Graph graph = TinkerFactory.createModern();
+ try (OutputStream os = new FileOutputStream("tinkerpop-modern.json")) {
+ GraphSONMapper mapper = graph.io(IoCore.graphson()).mapper().normalize(true).create()
- graph.io(IoCore.graphson()).writer().mapper(mapper).create().writeGraph(os, graph)
+ graph.io(graphson()).writer().mapper(mapper).create().writeGraph(os, graph)
}
- final Graph newGraph = TinkerGraph.open();
- try (final InputStream stream = new FileInputStream("tinkerpop-modern.json")) {
+ Graph newGraph = TinkerGraph.open();
+ try (InputStream stream = new FileInputStream("tinkerpop-modern.json")) {
- newGraph.io(IoCore.graphson()).reader().create().readGraph(stream, newGraph);
+ newGraph.io(graphson()).reader().create().readGraph(stream, newGraph);
}
----
@@@ -710,27 -814,25 +710,27 @@@ Kryo supports all of the `GraphReader`
[source,java]
----
- final Graph graph = TinkerFactory.createModern();
+ Graph graph = TinkerFactory.createModern();
-graph.io(IoCore.gryo()).writeGraph("tinkerpop-modern.kryo");
+graph.io(gryo()).writeGraph("tinkerpop-modern.kryo");
- final Graph newGraph = TinkerGraph.open();
+ Graph newGraph = TinkerGraph.open();
-newGraph.io(IoCore.gryo()).readGraph("tinkerpop-modern.kryo");
+newGraph.io(gryo()).readGraph("tinkerpop-modern.kryo");
----
+NOTE: Using `gryo()`, which is a static helper method of `IoCore`, will default to the most current version of Gryo which is 3.0.
+
If a custom configuration is required, then have the `Graph` generate a `GraphReader` or `GraphWriter` "builder" instance:
[source,java]
----
- final Graph graph = TinkerFactory.createModern();
- try (final OutputStream os = new FileOutputStream("tinkerpop-modern.kryo")) {
+ Graph graph = TinkerFactory.createModern();
+ try (OutputStream os = new FileOutputStream("tinkerpop-modern.kryo")) {
- graph.io(IoCore.gryo()).writer().create().writeGraph(os, graph);
+ graph.io(GryoIo.build(GryoVersion.V1_0)).writer().create().writeGraph(os, graph);
}
- final Graph newGraph = TinkerGraph.open();
- try (final InputStream stream = new FileInputStream("tinkerpop-modern.kryo")) {
+ Graph newGraph = TinkerGraph.open();
+ try (InputStream stream = new FileInputStream("tinkerpop-modern.kryo")) {
- newGraph.io(IoCore.gryo()).reader().create().readGraph(stream, newGraph);
+ newGraph.io(GryoIo.build(GryoVersion.V1_0)).reader().create().readGraph(stream, newGraph);
}
----
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ae8fee7f/docs/src/reference/the-traversal.asciidoc
----------------------------------------------------------------------