You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by ok...@apache.org on 2015/10/30 00:29:40 UTC

[19/50] incubator-tinkerpop git commit: added a docs section for GraphStep

added a docs section for GraphStep


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

Branch: refs/heads/TINKERPOP3-925
Commit: df443cc5f71904c167ce86149d4275fc8ea6aa67
Parents: a976ca6
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Wed Oct 28 12:39:23 2015 +0100
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Wed Oct 28 12:39:23 2015 +0100

----------------------------------------------------------------------
 docs/src/the-traversal.asciidoc | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/df443cc5/docs/src/the-traversal.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/the-traversal.asciidoc b/docs/src/the-traversal.asciidoc
index 554a241..9850b8a 100644
--- a/docs/src/the-traversal.asciidoc
+++ b/docs/src/the-traversal.asciidoc
@@ -545,6 +545,31 @@ g.V().values('age').sum() <6>
 <5> The same as before, but using a built-in bi-function.
 <6> The same as before, but using the <<sum-step,`sum()`-step>>.
 
+[[graph-step]]
+Graph Step
+~~~~~~~~~~
+
+The `V()`-step is usually used to start a `GraphTraversal`, but can also be used mid-traversal.
+
+[gremlin-groovy,modern]
+----
+g.V().has('name', within('marko', 'vadas', 'josh')).as('person').
+  V().has('name', within('lop', 'ripple')).addE('uses').from('person')
+----
+
+NOTE: Whether a mid-traversal `V()` uses an index or not, depends on a) whether suitable index exists and b) if the particular graph system provider implemented this functionality.
+
+[gremlin-groovy,modern]
+----
+g.V().has('name', within('marko', 'vadas', 'josh')).as('person').
+  V().has('name', within('lop', 'ripple')).addE('uses').from('person').toString() <1>
+g.V().has('name', within('marko', 'vadas', 'josh')).as('person').
+  V().has('name', within('lop', 'ripple')).addE('uses').from('person').iterate().toString() <2>
+----
+
+<1> Normally the `V()`-step will iterate over all vertices. However, graph strategies can fold `HasContainer`'s into a `GraphStep` to allow index lookups.
+<2> Whether the graph system provider supports mid-traversal `V()` index lookups or not can easily be determined by inspecting the `toString()` output of the iterated traversal. If `has` conditions were folded into the `V()`-step, an index - if one exists - will be used.
+
 [[group-step]]
 Group Step
 ~~~~~~~~~~