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/05/15 19:44:30 UTC

[2/2] incubator-tinkerpop git commit: add cap step documentation

add cap step documentation


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

Branch: refs/heads/master
Commit: dc92345a62a78d694472b5e3c64f2cb44d17a0ca
Parents: fb0b401
Author: David Robinson <dr...@gmail.com>
Authored: Fri May 15 11:46:24 2015 -0400
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Fri May 15 11:44:16 2015 -0600

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


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/dc92345a/docs/src/the-traversal.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/the-traversal.asciidoc b/docs/src/the-traversal.asciidoc
index 56b1c7e..94d211e 100644
--- a/docs/src/the-traversal.asciidoc
+++ b/docs/src/the-traversal.asciidoc
@@ -280,6 +280,21 @@ g.V().group().by(bothE().count()).by('name').by(count(local))  <3>
 <2> `by('name')` will process the grouped elements by their name (*element property projection*).
 <3> `by(count(local))` will count the number of elements in each group (*traversal*).
 
+[cap-step]]
+Cap Step
+~~~~~~~~
+
+The `cap()`-step (*barrier*) iterates the traversal up to itself and emits the sideEffect referenced by the provided key. If multiple keys are provided, then a `Map<String,Object>` of sideEffects is emitted.
+
+[gremlin-groovy,modern]
+----
+g.V().groupCount('a').by(label).cap('a')      <1>
+g.V().groupCount('a').by(label).groupCount('b').by(outE().count()).cap('a','b')   <2>
+----
+
+<1> Group and count verticies by their label.  Emit the side effect labeled 'a', which is the group count by label.
+<2> Same as statement 1, but also emit the side effect labeled 'b' which groups vertices by the number of out edges.
+
 [[coalesce-step]]
 Coalesce Step
 ~~~~~~~~~~~~~