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 2017/01/10 16:07:32 UTC
[1/2] tinkerpop git commit: Added a recipe appendix entry
Repository: tinkerpop
Updated Branches:
refs/heads/more-recipes d7ecfc05f -> 6971e644f
Added a recipe appendix entry
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/0938ebdc
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/0938ebdc
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/0938ebdc
Branch: refs/heads/more-recipes
Commit: 0938ebdce4b6d8512674503680c660eea9870e9e
Parents: d7ecfc0
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Jan 10 10:45:56 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jan 10 10:45:56 2017 -0500
----------------------------------------------------------------------
docs/src/recipes/appendix.asciidoc | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0938ebdc/docs/src/recipes/appendix.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/recipes/appendix.asciidoc b/docs/src/recipes/appendix.asciidoc
index 63ec447..15d7340 100644
--- a/docs/src/recipes/appendix.asciidoc
+++ b/docs/src/recipes/appendix.asciidoc
@@ -109,4 +109,19 @@ g.V().as("a").
unfold().
filter(select(values).is(gt(1))).
select(keys)
-----
\ No newline at end of file
+----
+
+[[appendix-e]]
+_In the "crew" graph, find vertices that match on a complete set of multi-properties._
+
+[gremlin-groovy,theCrew]
+----
+places = ["centreville","dulles"];[] // will not match as "purcellville" is missing
+g.V().not(has("location", without(places))).
+ where(values("location").is(within(places)).count().is(places.size())).
+ valueMap()
+places = ["centreville","dulles","purcellville"];[]
+g.V().not(has("location", without(places))).
+ where(values("location").is(within(places)).count().is(places.size())).
+ valueMap()
+----
[2/2] tinkerpop git commit: Added recipe to appendix for some basic
math ops
Posted by sp...@apache.org.
Added recipe to appendix for some basic math ops
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/6971e644
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/6971e644
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/6971e644
Branch: refs/heads/more-recipes
Commit: 6971e644ffc0306a968c43f055a7849761108f60
Parents: 0938ebd
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Jan 10 11:06:48 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jan 10 11:06:48 2017 -0500
----------------------------------------------------------------------
docs/src/recipes/appendix.asciidoc | 12 ++++++++++++
1 file changed, 12 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6971e644/docs/src/recipes/appendix.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/recipes/appendix.asciidoc b/docs/src/recipes/appendix.asciidoc
index 15d7340..369d049 100644
--- a/docs/src/recipes/appendix.asciidoc
+++ b/docs/src/recipes/appendix.asciidoc
@@ -125,3 +125,15 @@ g.V().not(has("location", without(places))).
where(values("location").is(within(places)).count().is(places.size())).
valueMap()
----
+
+[[appendix-f]]
+_Methods for performing some basic mathematical operations in the "modern" graph._
+
+[gremlin-groovy,modern]
+----
+g.V().values("age").sum() // sum all ages
+g.V().values("age").fold(1, mult) // multiply all ages
+g.V().values("age").map(union(identity(), constant(-1)).sum()) // subtract 1
+g.V().values("age").map(union(identity(), identity()).sum()) // multiply by 2 (simple)
+g.V().values("age").map(union(identity(), constant(2)).fold(1, mult)) // multiply by 2 (generally useful for multiplications by n):
+----
\ No newline at end of file