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 2016/08/04 22:40:40 UTC
[11/24] tinkerpop git commit: Merge remote-tracking branch
'origin/tp31'
Merge remote-tracking branch 'origin/tp31'
Conflicts:
docs/src/reference/the-traversal.asciidoc
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/85776169
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/85776169
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/85776169
Branch: refs/heads/TINKERPOP-1278
Commit: 857761693341f51a4c2777c02ebf8f2fc2b83cac
Parents: 0f5f2d8 8ed3c95
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Aug 1 13:35:23 2016 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Aug 1 13:35:23 2016 -0400
----------------------------------------------------------------------
docs/src/dev/developer/contributing.asciidoc | 6 +++---
docs/src/dev/provider/index.asciidoc | 4 ++--
docs/src/reference/gremlin-applications.asciidoc | 4 ++--
docs/src/reference/implementations-neo4j.asciidoc | 12 ++++++------
docs/src/reference/preface.asciidoc | 2 +-
docs/src/reference/the-graphcomputer.asciidoc | 2 +-
docs/src/reference/the-traversal.asciidoc | 12 +++++++++---
docs/src/upgrade/release-3.1.x-incubating.asciidoc | 4 ++--
8 files changed, 26 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/85776169/docs/src/dev/provider/index.asciidoc
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/85776169/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/85776169/docs/src/reference/the-graphcomputer.asciidoc
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/85776169/docs/src/reference/the-traversal.asciidoc
----------------------------------------------------------------------
diff --cc docs/src/reference/the-traversal.asciidoc
index d98a573,f300e98..6b4696c
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@@ -1127,31 -1127,12 +1127,37 @@@ g.V().repeat(both()).times(3).values('a
IMPORTANT: `min(local)` determines the min of the current, local object (not the objects in the traversal stream).
This works for `Collection` and `Number`-type objects. For any other object, a min of `Double.NaN` is returned.
+ [[option-step]]
+ Option Step
+ ~~~~~~~~~~~~~
+
+ An option to a <<branch-step,`branch()`>> or <<choose-step,`choose()`>>
+
+[[optional-step]]
+Optional Step
+~~~~~~~~~~~~~
+
+The `optional()`-step (*map*) returns the result of the specified traversal if it yields a result else it returns the calling
+element, i.e. the `identity()`.
+
+[gremlin-groovy,modern]
+----
+g.V(2).optional(out('knows')) <1>
+g.V(2).optional(__.in('knows')) <2>
+----
+
+<1> vadas does not have an `out` "know" edge so vadas is returned.
+<2> vadas does have an `in` "knows" edge so marko is returned.
+
+`optional` is particularly useful for lifting entire graphs when used in conjunction with `path` or `tree`.
+
+[gremlin-groovy,modern]
+----
+g.V().hasLabel('person').optional(out("knows").optional(out("created"))).path() <1>
+----
+
+<1> Returns the paths of everybody followed by who they know followed by what they created.
+
[[or-step]]
Or Step
~~~~~~~
@@@ -2308,7 -2117,7 +2314,7 @@@ Gremlin attempts to provide the user a
leverage a lambda in practice. It is advised that users only leverage a lambda if and only if there is no
corresponding lambda-less step that encompasses the desired functionality. The reason being, lambdas can not be
optimized by Gremlin's compiler strategies as they can not be programmatically inspected (see
- <<traversalstrategy,traversal strategies>>). It is also not currently possible to send a lambda for remote execution to Gremlin-Server or a driver that supports remote execution.
-<<traversalstrategy,traversal strategies>>).
++<<traversalstrategy,traversal strategies>>). It is also not currently possible to send a lambda for remote execution to Gremlin-Server or a driver that supports remote execution.
In many situations where a lambda could be used, either a corresponding step exists or a traversal can be provided in
its place. A `TraversalLambda` behaves like a typical lambda, but it can be optimized and it yields less objects than