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/08/24 21:32:12 UTC

[1/2] incubator-tinkerpop git commit: TINKERPOP3-792 #close. SelectOneStep and SelectStep are no longer treated as special by MatchStartStep. However, WhereTraversalStep and WherePredicateStep are.

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/master 04551b9ce -> c985fac6b


TINKERPOP3-792 #close. SelectOneStep and SelectStep are no longer treated as special by MatchStartStep. However, WhereTraversalStep and WherePredicateStep are.


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

Branch: refs/heads/master
Commit: f647865ed25a0bd57f4b2be4faab99f283136c08
Parents: b9293bb
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Aug 24 13:29:49 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Aug 24 13:29:49 2015 -0600

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 .../process/traversal/step/map/MatchStep.java   |  4 +--
 .../traversal/step/map/GroovyMatchTest.groovy   |  5 ++++
 .../process/traversal/step/map/MatchTest.java   | 31 +++++++++++++++++---
 4 files changed, 35 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f647865e/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index ec39683..57ac60b 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -25,6 +25,7 @@ image::http://www.tinkerpop.com/docs/current/images/gremlin-hindu.png[width=225]
 TinkerPop 3.0.1 (NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+* `WhereTraversalStep` and `WherePredicateStep` are now the only "special" `Scoping` steps after `MatchStartStep` in `match()`.
 * Clarified semantics of `Transaction.close()` in unit tests - now refers only to closing the current transaction in the current thread.
 * `Neo4jGraph` no longer uses `OptOut` on `TransactionTest.shouldRollbackOnCloseWhenConfigured` (formerly `shouldRollbackOnShutdownWhenConfigured`)
 * Gremlin Server initialization scripts can now return a `Map` of values that will become global bindings for the server.

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f647865e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java
index ae1a264..6373059 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java
@@ -421,8 +421,8 @@ public final class MatchStep<S, E> extends ComputerAwareStep<S, Map<String, E>>
                 this.scopeKeys = new HashSet<>();
                 if (null != this.selectKey)
                     this.scopeKeys.add(this.selectKey);
-                if (this.getNextStep() instanceof Scoping)
-                    this.scopeKeys.addAll(((Scoping) this.getNextStep()).getScopeKeys());
+                if (this.getNextStep() instanceof WhereTraversalStep || this.getNextStep() instanceof WherePredicateStep)
+                   this.scopeKeys.addAll(((Scoping) this.getNextStep()).getScopeKeys());
                 this.scopeKeys = Collections.unmodifiableSet(this.scopeKeys);
             }
             return this.scopeKeys;

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f647865e/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMatchTest.groovy
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMatchTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMatchTest.groovy
index d68a88e..c2f9d43 100644
--- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMatchTest.groovy
+++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMatchTest.groovy
@@ -48,6 +48,11 @@ public abstract class GroovyMatchTest {
     public abstract static class Traversals extends MatchTest {
 
         @Override
+        public Traversal<Vertex, Map<String, Object>> get_g_V_valueMap_matchXa_selectXnameX_bX() {
+            TraversalScriptHelper.compute("g.V.valueMap.match(__.as('a').select('name').as('b'))", g)
+        }
+
+        @Override
         public Traversal<Vertex, Map<String, Vertex>> get_g_V_matchXa_out_bX() {
             TraversalScriptHelper.compute("g.V.match(__.as('a').out.as('b'))", g)
         }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f647865e/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchTest.java
index 4f8d582..ff657ef 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchTest.java
@@ -53,6 +53,8 @@ import static org.junit.Assert.*;
 @RunWith(GremlinProcessRunner.class)
 public abstract class MatchTest extends AbstractGremlinProcessTest {
 
+    public abstract Traversal<Vertex, Map<String, Object>> get_g_V_valueMap_matchXa_selectXnameX_bX();
+
     // very basic query
     public abstract Traversal<Vertex, Map<String, Vertex>> get_g_V_matchXa_out_bX();
 
@@ -134,6 +136,22 @@ public abstract class MatchTest extends AbstractGremlinProcessTest {
 
     @Test
     @LoadGraphWith(MODERN)
+    public void g_V_valueMap_matchXa_selectXnameX_bX() {
+        final Traversal<Vertex, Map<String, Object>> traversal = get_g_V_valueMap_matchXa_selectXnameX_bX();
+        printTraversalForm(traversal);
+        int counter = 0;
+        while (traversal.hasNext()) {
+            counter++;
+            final Map<String, Object> map = traversal.next();
+            assertTrue(Map.class.isAssignableFrom(map.get("a").getClass()));
+            final String name = ((Map<String,List<String>>) map.get("a")).get("name").get(0);
+            assertEquals(name, ((List<String>) map.get("b")).get(0));
+        }
+        assertEquals(6, counter);
+    }
+
+    @Test
+    @LoadGraphWith(MODERN)
     public void g_V_matchXa_out_bX() throws Exception {
         final Traversal<Vertex, Map<String, Vertex>> traversal = get_g_V_matchXa_out_bX();
         printTraversalForm(traversal);
@@ -469,6 +487,11 @@ public abstract class MatchTest extends AbstractGremlinProcessTest {
 
     public abstract static class Traversals extends MatchTest {
         @Override
+        public Traversal<Vertex, Map<String, Object>> get_g_V_valueMap_matchXa_selectXnameX_bX() {
+            return g.V().valueMap().match(as("a").select("name").as("b"));
+        }
+
+        @Override
         public Traversal<Vertex, Map<String, Vertex>> get_g_V_matchXa_out_bX() {
             return g.V().match(as("a").out().as("b"));
         }
@@ -521,7 +544,7 @@ public abstract class MatchTest extends AbstractGremlinProcessTest {
             return g.V().match(
                     as("a").out("created").has("name", "lop").as("b"),
                     as("b").in("created").has("age", 29).as("c"))
-                    .where(__.<Vertex>as("c").repeat(out()).times(2)).select("a","b","c");
+                    .where(__.<Vertex>as("c").repeat(out()).times(2)).select("a", "b", "c");
         }
 
         @Override
@@ -551,7 +574,7 @@ public abstract class MatchTest extends AbstractGremlinProcessTest {
                     as("b").out("created").has("name", "lop"),
                     as("b").match(
                             as("b").out("created").as("d"),
-                            as("d").in("created").as("c")).select("c").as("c")).<Vertex>select("a","b","c");
+                            as("d").in("created").as("c")).select("c").as("c")).<Vertex>select("a", "b", "c");
         }
 
         @Override
@@ -606,7 +629,7 @@ public abstract class MatchTest extends AbstractGremlinProcessTest {
         public Traversal<Vertex, Map<String, String>> get_g_V_matchXa_created_b__c_created_bX_selectXa_b_cX_byXnameX() {
             return g.V().match(
                     as("a").out("created").as("b"),
-                    as("c").out("created").as("b")).<String>select("a","b","c").by("name");
+                    as("c").out("created").as("b")).<String>select("a", "b", "c").by("name");
         }
 
         @Override
@@ -627,7 +650,7 @@ public abstract class MatchTest extends AbstractGremlinProcessTest {
                     ),
                     as("b").in("created").as("c"),
                     as("b").in("created").count().is(P.gt(1)))
-                    .select("a","b","c").by(T.id);
+                    .select("a", "b", "c").by(T.id);
         }
 
         @Override


[2/2] incubator-tinkerpop git commit: Merge branch 'tp30'

Posted by ok...@apache.org.
Merge branch 'tp30'


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

Branch: refs/heads/master
Commit: c985fac6b6b7633cf49f54e143ff5d53fb31a8bb
Parents: 04551b9 f647865
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Aug 24 13:31:04 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Aug 24 13:31:04 2015 -0600

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 .../process/traversal/step/map/MatchStep.java   |  4 +--
 .../traversal/step/map/GroovyMatchTest.groovy   |  5 ++++
 .../process/traversal/step/map/MatchTest.java   | 31 +++++++++++++++++---
 4 files changed, 35 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c985fac6/CHANGELOG.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c985fac6/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java
----------------------------------------------------------------------