You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by dk...@apache.org on 2018/07/30 16:49:30 UTC

tinkerpop git commit: split ShortestPath example code block in the docs

Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1990 cbd157630 -> c029157a9


split ShortestPath example code block in the docs


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

Branch: refs/heads/TINKERPOP-1990
Commit: c029157a95261741244ce8d41f8f4ee913be4cf2
Parents: cbd1576
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Mon Jul 30 09:49:26 2018 -0700
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Mon Jul 30 09:49:26 2018 -0700

----------------------------------------------------------------------
 docs/src/reference/the-traversal.asciidoc | 33 +++++++++++++++-----------
 1 file changed, 19 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c029157a/docs/src/reference/the-traversal.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc
index 8b5f202..6817f52 100644
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@ -2507,29 +2507,24 @@ using the `with()`-modulator with the options given below.
 
 [gremlin-groovy,modern]
 ----
-a = g.withComputer()
-a.V().shortestPath() <1>
-a.V().has('person','name','marko').shortestPath() <2>
-a.V().shortestPath().with(ShortestPath.target, __.has('name','peter')) <3>
-a.V().shortestPath().
+g = g.withComputer()
+g.V().shortestPath() <1>
+g.V().has('person','name','marko').shortestPath() <2>
+g.V().shortestPath().with(ShortestPath.target, __.has('name','peter')) <3>
+g.V().shortestPath().
         with(ShortestPath.edges, Direction.IN).
         with(ShortestPath.target, __.has('name','josh')) <4>
-a.V().has('person','name','marko').
+g.V().has('person','name','marko').
       shortestPath().
         with(ShortestPath.target, __.has('name','josh')) <5>
-a.V().has('person','name','marko').
+g.V().has('person','name','marko').
       shortestPath().
         with(ShortestPath.target, __.has('name','josh')).
         with(ShortestPath.distance, 'weight') <6>
-a.V().has('person','name','marko').
+g.V().has('person','name','marko').
       shortestPath().
         with(ShortestPath.target, __.has('name','josh')).
         with(ShortestPath.includeEdges, true) <7>
-g.inject(a.V().shortestPath().
-           with(ShortestPath.distance, 'weight').
-           with(ShortestPath.includeEdges, true).
-           with(ShortestPath.maxDistance, 1).toList().toArray()).
-  map(unfold().values('name','weight').fold()) <8>
 ----
 
 <1> Find all shortest paths.
@@ -2539,7 +2534,17 @@ g.inject(a.V().shortestPath().
 <5> Find all shortest paths from `marko` to `josh`.
 <6> Find all shortest paths from `marko` to `josh` using a custom distance property.
 <7> Find all shortest paths from `marko` to `josh` and include edges in the result.
-<8> Find all shortest paths using a custom distance property and limit the distance to 1. Inject the result into a OLTP GraphTraversal in order to be able to select properties from all elements in all paths.
+
+[gremlin-groovy,modern]
+----
+g.inject(g.withComputer().V().shortestPath().
+           with(ShortestPath.distance, 'weight').
+           with(ShortestPath.includeEdges, true).
+           with(ShortestPath.maxDistance, 1).toList().toArray()).
+  map(unfold().values('name','weight').fold()) <1>
+----
+
+<1> Find all shortest paths using a custom distance property and limit the distance to 1. Inject the result into a OLTP `GraphTraversal` in order to be able to select properties from all elements in all paths.
 
 *Additional References*