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 2017/03/24 14:41:45 UTC

[01/19] tinkerpop git commit: added support for Path.getSubPath(). Added FromToModulating for from() and to()-based step modulations. Added support for path().from().to(). Added respective test cases. Going to add simplePath().from().to().by() and cyclic

Repository: tinkerpop
Updated Branches:
  refs/heads/master 78851d7e6 -> bbe337765


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9265ddf6/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/FromToModulating.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/FromToModulating.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/FromToModulating.java
new file mode 100644
index 0000000..59a51bd
--- /dev/null
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/FromToModulating.java
@@ -0,0 +1,49 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.tinkerpop.gremlin.process.traversal.step;
+
+import org.apache.tinkerpop.gremlin.process.traversal.Path;
+import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.MutablePath;
+
+import java.util.Set;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public interface FromToModulating {
+
+    public default void addFrom(final Traversal.Admin<?, ?> fromTraversal) {
+        throw new UnsupportedOperationException("The from()-modulating step does not support traversal-based modulation: " + this);
+    }
+
+    public default void addTo(final Traversal.Admin<?, ?> toTraversal) {
+        throw new UnsupportedOperationException("The to()-modulating step does not support traversal-based modulation: " + this);
+    }
+
+    public default void addFrom(final String fromLabel) {
+        addFrom(__.select(fromLabel).asAdmin());
+    }
+
+    public default void addTo(final String toLabel) {
+        addTo(__.select(toLabel).asAdmin());
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9265ddf6/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeStep.java
index 3f6086a..4308291 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeStep.java
@@ -21,6 +21,7 @@ package org.apache.tinkerpop.gremlin.process.traversal.step.map;
 import org.apache.tinkerpop.gremlin.process.traversal.Parameterizing;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
+import org.apache.tinkerpop.gremlin.process.traversal.step.FromToModulating;
 import org.apache.tinkerpop.gremlin.process.traversal.step.Mutating;
 import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.Parameters;
@@ -34,9 +35,7 @@ import org.apache.tinkerpop.gremlin.structure.T;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedFactory;
-import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
 
-import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
@@ -44,7 +43,7 @@ import java.util.Set;
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
-public final class AddEdgeStep<S> extends MapStep<S, Edge> implements Mutating<Event.EdgeAddedEvent>, TraversalParent, Parameterizing {
+public final class AddEdgeStep<S> extends MapStep<S, Edge> implements Mutating<Event.EdgeAddedEvent>, TraversalParent, Parameterizing, FromToModulating {
 
     private static final String FROM = Graph.Hidden.hide("from");
     private static final String TO = Graph.Hidden.hide("to");
@@ -73,12 +72,14 @@ public final class AddEdgeStep<S> extends MapStep<S, Edge> implements Mutating<E
         this.parameters.integrateTraversals(this);
     }
 
-    public void addTo(final Object toObject) {
+    @Override
+    public void addTo(final Traversal.Admin<?,?> toObject) {
         this.parameters.set(TO, toObject);
         this.parameters.integrateTraversals(this);
     }
 
-    public void addFrom(final Object fromObject) {
+    @Override
+    public void addFrom(final Traversal.Admin<?,?> fromObject) {
         this.parameters.set(FROM, fromObject);
         this.parameters.integrateTraversals(this);
     }
@@ -90,10 +91,10 @@ public final class AddEdgeStep<S> extends MapStep<S, Edge> implements Mutating<E
         final String edgeLabel = this.parameters.get(traverser, T.label, () -> Edge.DEFAULT_LABEL).get(0);
 
         final Edge edge = fromVertex.addEdge(edgeLabel, toVertex, this.parameters.getKeyValues(traverser, TO, FROM, T.label));
-            if (callbackRegistry != null) {
-                final Event.EdgeAddedEvent vae = new Event.EdgeAddedEvent(DetachedFactory.detach(edge, true));
-                callbackRegistry.getCallbacks().forEach(c -> c.accept(vae));
-            }
+        if (callbackRegistry != null) {
+            final Event.EdgeAddedEvent vae = new Event.EdgeAddedEvent(DetachedFactory.detach(edge, true));
+            callbackRegistry.getCallbacks().forEach(c -> c.accept(vae));
+        }
         return edge;
     }
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9265ddf6/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PathStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PathStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PathStep.java
index 705cf0c..06ff947 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PathStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PathStep.java
@@ -22,6 +22,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.Path;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
 import org.apache.tinkerpop.gremlin.process.traversal.step.ByModulating;
+import org.apache.tinkerpop.gremlin.process.traversal.step.FromToModulating;
 import org.apache.tinkerpop.gremlin.process.traversal.step.PathProcessor;
 import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.MutablePath;
@@ -36,10 +37,12 @@ import java.util.Set;
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
-public final class PathStep<S> extends MapStep<S, Path> implements TraversalParent, PathProcessor, ByModulating {
+public final class PathStep<S> extends MapStep<S, Path> implements TraversalParent, PathProcessor, ByModulating, FromToModulating {
 
     private TraversalRing<Object, Object> traversalRing;
     private Set<String> keepLabels;
+    private String fromLabel;
+    private String toLabel;
 
     public PathStep(final Traversal.Admin traversal) {
         super(traversal);
@@ -48,17 +51,18 @@ public final class PathStep<S> extends MapStep<S, Path> implements TraversalPare
 
     @Override
     protected Path map(final Traverser.Admin<S> traverser) {
-        final Path path;
+        final Path path = traverser.path().getSubPath(this.fromLabel, this.toLabel);
+        this.traversalRing.reset();
         if (this.traversalRing.isEmpty())
-            path = traverser.path();
+            return path;
         else {
-            path = MutablePath.make();
-            traverser.path().forEach((object, labels) -> path.extend(TraversalUtil.applyNullable(object, this.traversalRing.next()), labels));
+            final Path byPath = MutablePath.make();
+            path.forEach((object, labels) -> byPath.extend(TraversalUtil.applyNullable(object, this.traversalRing.next()), labels));
+            return byPath;
         }
-        this.traversalRing.reset();
-        return path;
     }
 
+
     @Override
     public PathStep<S> clone() {
         final PathStep<S> clone = (PathStep<S>) super.clone();
@@ -117,4 +121,15 @@ public final class PathStep<S> extends MapStep<S, Path> implements TraversalPare
     public Set<String> getKeepLabels() {
         return this.keepLabels;
     }
+
+
+    @Override
+    public void addFrom(final String fromLabel) {
+        this.fromLabel = fromLabel;
+    }
+
+    @Override
+    public void addTo(final String toLabel) {
+        this.toLabel = toLabel;
+    }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9265ddf6/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/PathTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/PathTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/PathTest.java
index 5087667..1d21074 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/PathTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/PathTest.java
@@ -33,7 +33,11 @@ import java.util.List;
 import java.util.function.Supplier;
 import java.util.stream.Collectors;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
@@ -375,4 +379,63 @@ public class PathTest {
             }
         }
     }
+
+    @Test
+    public void shouldHaveSubPathSupport() {
+        PATH_SUPPLIERS.forEach(supplier -> {
+            Path path = supplier.get();
+            path = path.extend("marko", Collections.singleton("a"));
+            path = path.extend("stephen", Collections.singleton("b"));
+            path = path.extend("matthias", new HashSet<>(Arrays.asList("c", "x")));
+            path = path.extend("bob", Collections.singleton("d"));
+            assertEquals(4, path.size());
+            assertEquals(4, path.objects().size());
+            assertEquals(4, path.labels().size());
+            ///
+            Path subPath = path.getSubPath("b", "c");
+            assertEquals(2, subPath.size());
+            assertEquals(2, subPath.objects().size());
+            assertEquals(2, subPath.labels().size());
+            assertEquals("stephen", subPath.objects().get(0));
+            assertEquals("matthias", subPath.objects().get(1));
+            assertTrue(subPath.labels().get(0).contains("b"));
+            assertEquals(1, subPath.labels().get(0).size());
+            assertTrue(subPath.labels().get(1).contains("c"));
+            assertTrue(subPath.labels().get(1).contains("x"));
+            assertEquals(2, subPath.labels().get(1).size());
+            ///
+            subPath = path.getSubPath("b", "b");
+            assertEquals(1, subPath.size());
+            assertEquals(1, subPath.objects().size());
+            assertEquals(1, subPath.labels().size());
+            assertEquals("stephen", subPath.objects().get(0));
+            ///
+            subPath = path.getSubPath("b", "b");
+            assertEquals(1, subPath.size());
+            assertEquals(1, subPath.objects().size());
+            assertEquals(1, subPath.labels().size());
+            assertEquals("stephen", subPath.objects().get(0));
+            ///
+            try {
+                subPath = path.getSubPath("d", "a");
+                fail("Path labels must be ordered along path");
+            } catch (final IllegalArgumentException e) {
+                assertTrue(true);
+            }
+            ///
+            try {
+                subPath = path.getSubPath("a", "e");
+                fail("End path label was not found");
+            } catch (final IllegalArgumentException e) {
+                assertEquals(Path.Exceptions.couldNotLocalPathToLabel("e").getMessage(), e.getMessage());
+            }
+            ///
+            try {
+                subPath = path.getSubPath("e", "b");
+                fail("Start path label was not found");
+            } catch (final IllegalArgumentException e) {
+                assertEquals(Path.Exceptions.couldNotLocalPathFromLabel("e").getMessage(), e.getMessage());
+            }
+        });
+    }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9265ddf6/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPathTest.groovy
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPathTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPathTest.groovy
index 15c499a..c3abf60 100644
--- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPathTest.groovy
+++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPathTest.groovy
@@ -59,5 +59,10 @@ public abstract class GroovyPathTest {
         public Traversal<Vertex, Path> get_g_VX1X_outEXcreatedX_inV_inE_outV_path(final Object v1Id) {
             new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).outE('created').inV.inE.outV.path()", "v1Id", v1Id)
         }
+
+        @Override
+        public Traversal<Vertex, Path> get_g_V_asXaX_out_asXbX_out_asXcX_path_fromXbX_toXcX_byXnameX() {
+            new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').out().as('b').out.as('c').path.from('b').to('c').by('name')")
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9265ddf6/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PathTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PathTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PathTest.java
index 9e18894..3014998 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PathTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PathTest.java
@@ -23,11 +23,14 @@ import org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest;
 import org.apache.tinkerpop.gremlin.process.GremlinProcessRunner;
 import org.apache.tinkerpop.gremlin.process.traversal.Path;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.MutablePath;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+import java.util.Arrays;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
@@ -57,6 +60,8 @@ public abstract class PathTest extends AbstractGremlinProcessTest {
 
     public abstract Traversal<Vertex, Path> get_g_VX1X_outEXcreatedX_inV_inE_outV_path(final Object v1Id);
 
+    public abstract Traversal<Vertex, Path> get_g_V_asXaX_out_asXbX_out_asXcX_path_fromXbX_toXcX_byXnameX();
+
     @Test
     @LoadGraphWith(MODERN)
     public void g_VX1X_name_path() {
@@ -157,6 +162,16 @@ public abstract class PathTest extends AbstractGremlinProcessTest {
         assertFalse(traversal.hasNext());
     }
 
+    @Test
+    @LoadGraphWith(MODERN)
+    public void g_V_asXaX_out_asXbX_out_asXcX_path_fromXbX_toXcX_byXnameX() {
+        final Traversal<Vertex, Path> traveral = get_g_V_asXaX_out_asXbX_out_asXcX_path_fromXbX_toXcX_byXnameX();
+        printTraversalForm(traveral);
+        checkResults(Arrays.asList(
+                MutablePath.make().extend("josh", Collections.singleton("b")).extend("lop", Collections.singleton("c")),
+                MutablePath.make().extend("josh", Collections.singleton("b")).extend("ripple", Collections.singleton("c"))), traveral);
+    }
+
     public static class Traversals extends PathTest {
         @Override
         public Traversal<Vertex, Path> get_g_VX1X_name_path(final Object v1Id) {
@@ -187,5 +202,10 @@ public abstract class PathTest extends AbstractGremlinProcessTest {
         public Traversal<Vertex, Path> get_g_VX1X_outEXcreatedX_inV_inE_outV_path(final Object v1Id) {
             return g.V(v1Id).outE("created").inV().inE().outV().path();
         }
+
+        @Override
+        public Traversal<Vertex, Path> get_g_V_asXaX_out_asXbX_out_asXcX_path_fromXbX_toXcX_byXnameX() {
+            return g.V().as("a").out().as("b").out().as("c").path().from("b").to("c").by("name");
+        }
     }
 }
\ No newline at end of file


[17/19] tinkerpop git commit: Added a traversal example for SimplePath step using `from()` / `to()` modulators to build two acyclic paths that cross each other and thus are not acyclic as a whole. @okram

Posted by ok...@apache.org.
Added a traversal example for SimplePath step using `from()` / `to()` modulators to build two acyclic paths that cross each other and thus are not acyclic as a whole. @okram


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

Branch: refs/heads/master
Commit: 38dc621a3d50c6977d7766b36839a6fd2cb55922
Parents: b9111c9
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Fri Mar 24 13:05:32 2017 +0100
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Fri Mar 24 13:05:32 2017 +0100

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


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/38dc621a/docs/src/reference/the-traversal.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc
index 31c0621..636cd33 100644
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@ -2052,6 +2052,29 @@ g.V().out().as('a').out().as('b').out().as('c').
     by('name')
 ----
 
+By using the `from()` and `to()` modulators traversers can ensure that only certain sections of the path are are acyclic.
+
+[gremlin-grovvy]
+----
+g.addV().property(id, "A").as("a").
+  addV().property(id, "B").as("b").
+  addV().property(id, "C").as("c").
+  addV().property(id, "D").as("d").
+  addE("link").from("a").to("b").
+  addE("link").from("b").to("c").
+  addE("link").from("c").to("d").iterate()
+g.V("A").repeat(both().simplePath()).times(3).path()  <1>
+g.V("D").repeat(both().simplePath()).times(3).path()  <2>
+g.V("A").as("a").
+  repeat(both().simplePath().from("a")).times(3).as("b").
+  repeat(both().simplePath().from("b")).times(3).path()  <3>
+----
+
+<1> Traverse all acyclic 3-hop paths starting from vertex `A`
+<2> Traverse all acyclic 3-hop paths starting from vertex `D`
+<3> Traverse all acyclic 3-hop paths starting from vertex `A` and from there again all 3-hop paths. The second path may
+cross the vertices from the first path.
+
 [[store-step]]
 Store Step
 ~~~~~~~~~~


[03/19] tinkerpop git commit: added support for Path.getSubPath(). Added FromToModulating for from() and to()-based step modulations. Added support for path().from().to(). Added respective test cases. Going to add simplePath().from().to().by() and cyclic

Posted by ok...@apache.org.
added support for Path.getSubPath(). Added FromToModulating for from() and to()-based step modulations. Added support for path().from().to(). Added respective test cases. Going to add simplePath().from().to().by() and cyclicPath().from().to().by() to this ticket as well and then PR this mo fo ya know.


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

Branch: refs/heads/master
Commit: 9265ddf6d1e5bded0ef6b3a0229ea1ce405e5259
Parents: 60a3fb3
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Mar 16 08:40:39 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Mar 16 08:40:39 2017 -0600

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |   3 +
 .../gremlin/process/traversal/Path.java         |  35 ++
 .../traversal/dsl/graph/GraphTraversal.java     | 398 +++++++++----------
 .../traversal/step/FromToModulating.java        |  49 +++
 .../process/traversal/step/map/AddEdgeStep.java |  19 +-
 .../process/traversal/step/map/PathStep.java    |  29 +-
 .../gremlin/process/traversal/PathTest.java     |  65 ++-
 .../traversal/step/map/GroovyPathTest.groovy    |   5 +
 .../process/traversal/step/map/PathTest.java    |  20 +
 9 files changed, 407 insertions(+), 216 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9265ddf6/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 6861d57..1eaf3ad 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,9 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 TinkerPop 3.2.5 (Release Date: NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+* Added `path().from().to()` to `GraphTraversal` so sub-paths can be isolated from the current path.
+* Added `FromToModulating` interface for use with `to()`- and `from()`-based step modulators.
+* Added `Path.getSubPath()` which supports isolating a sub-path from `Path` via to/from-labels.
 * Fixed an `NullPointerException` in `GraphMLReader` that occurred when an `<edge>` didn't have an ID field and the base graph supported ID assignment.
 * Split `ComputerVerificationStrategy` into two strategies: `ComputerVerificationStrategy` and `ComputerFinalizationStrategy`.
 * Removed `HasTest.g_V_hasId_compilationEquality` from process test suite as it makes too many assumptions about provider compilation.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9265ddf6/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java
index b2916d9..df46800 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java
@@ -18,6 +18,7 @@
  */
 package org.apache.tinkerpop.gremlin.process.traversal;
 
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.MutablePath;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.javatuples.Pair;
 
@@ -238,10 +239,44 @@ public interface Path extends Cloneable, Iterable<Object> {
                 isPresent();
     }
 
+    public default Path getSubPath(final String fromLabel, final String toLabel) {
+        if (null == fromLabel && null == toLabel)
+            return this;
+        else {
+            Path subPath = MutablePath.make();
+            boolean record = false;
+            int size = this.size();
+            for (int i = 0; i < size; i++) {
+                final Set<String> labels = this.labels().get(i);
+                if (labels.contains(fromLabel) || null == fromLabel)
+                    record = true;
+                if (record)
+                    subPath = subPath.extend(this.get(i), labels);
+                if (labels.contains(toLabel)) {
+                    if (!record)
+                        throw Path.Exceptions.couldNotLocalPathFromLabel(fromLabel);
+                    return subPath;
+                }
+            }
+            if (null == toLabel)
+                return subPath;
+            else
+                throw Path.Exceptions.couldNotLocalPathToLabel(toLabel);
+        }
+    }
+
     public static class Exceptions {
 
         public static IllegalArgumentException stepWithProvidedLabelDoesNotExist(final String label) {
             return new IllegalArgumentException("The step with label " + label + " does not exist");
         }
+
+        public static IllegalArgumentException couldNotLocalPathFromLabel(final String fromLabel) {
+            return new IllegalArgumentException("Could not local path from-label: " + fromLabel);
+        }
+
+        public static IllegalArgumentException couldNotLocalPathToLabel(final String toLabel) {
+            return new IllegalArgumentException("Could not local path to-label: " + toLabel);
+        }
     }
 }


[04/19] tinkerpop git commit: Cleaned up and added JavaDoc for now sub-path work.

Posted by ok...@apache.org.
Cleaned up and added JavaDoc for now sub-path work.


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

Branch: refs/heads/master
Commit: 0fe3b1d8f4b49db80a59e9d29d8082735edfcef4
Parents: 9265ddf
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Mar 16 08:44:43 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Mar 16 08:44:43 2017 -0600

----------------------------------------------------------------------
 .../tinkerpop/gremlin/process/traversal/Path.java       | 12 ++++++++++--
 .../process/traversal/dsl/graph/GraphTraversal.java     |  6 +-----
 .../process/traversal/step/FromToModulating.java        |  7 +++----
 3 files changed, 14 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0fe3b1d8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java
index df46800..cefe7d9 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java
@@ -239,6 +239,14 @@ public interface Path extends Cloneable, Iterable<Object> {
                 isPresent();
     }
 
+    /**
+     * Isolate a sub-path from the path object. The isolation is based solely on the path labels.
+     * The to-label is inclusive. Thus, from "b" to "c" would isolate the example path as follows {@code a,[b,c],d}.
+     *
+     * @param fromLabel The label to start recording the sub-path from.
+     * @param toLabel   The label to end recording the sub-path to.
+     * @return the isolated sub-path.
+     */
     public default Path getSubPath(final String fromLabel, final String toLabel) {
         if (null == fromLabel && null == toLabel)
             return this;
@@ -272,11 +280,11 @@ public interface Path extends Cloneable, Iterable<Object> {
         }
 
         public static IllegalArgumentException couldNotLocalPathFromLabel(final String fromLabel) {
-            return new IllegalArgumentException("Could not local path from-label: " + fromLabel);
+            return new IllegalArgumentException("Could not locate path from-label: " + fromLabel);
         }
 
         public static IllegalArgumentException couldNotLocalPathToLabel(final String toLabel) {
-            return new IllegalArgumentException("Could not local path to-label: " + toLabel);
+            return new IllegalArgumentException("Could not locate path to-label: " + toLabel);
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0fe3b1d8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
index 0248612..4344aaf 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
@@ -36,8 +36,8 @@ import org.apache.tinkerpop.gremlin.process.traversal.lambda.LoopTraversal;
 import org.apache.tinkerpop.gremlin.process.traversal.lambda.PredicateTraverser;
 import org.apache.tinkerpop.gremlin.process.traversal.lambda.TrueTraversal;
 import org.apache.tinkerpop.gremlin.process.traversal.step.ByModulating;
-import org.apache.tinkerpop.gremlin.process.traversal.step.Mutating;
 import org.apache.tinkerpop.gremlin.process.traversal.step.FromToModulating;
+import org.apache.tinkerpop.gremlin.process.traversal.step.Mutating;
 import org.apache.tinkerpop.gremlin.process.traversal.step.TimesModulating;
 import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalOptionParent;
 import org.apache.tinkerpop.gremlin.process.traversal.step.branch.BranchStep;
@@ -1034,7 +1034,6 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param toStepLabel the step label of the incoming vertex
      * @return the traversal with the modified {@link AddEdgeStep}
-     * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#addedge-step" target="_blank">Reference Documentation - AddEdge Step</a>
      * @since 3.1.0-incubating
      */
     public default GraphTraversal<S, E> to(final String toStepLabel) {
@@ -1049,7 +1048,6 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param fromStepLabel the step label of the outgoing vertex
      * @return the traversal with the modified {@link AddEdgeStep}
-     * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#addedge-step" target="_blank">Reference Documentation - AddEdge Step</a>
      * @since 3.1.0-incubating
      */
     public default GraphTraversal<S, E> from(final String fromStepLabel) {
@@ -1064,7 +1062,6 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param toVertex the traversal for selecting the incoming vertex
      * @return the traversal with the modified {@link AddEdgeStep}
-     * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#addedge-step" target="_blank">Reference Documentation - AddEdge Step</a>
      * @since 3.1.0-incubating
      */
     public default GraphTraversal<S, E> to(final Traversal<E, Vertex> toVertex) {
@@ -1079,7 +1076,6 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param fromVertex the traversal for selecting the outgoing vertex
      * @return the traversal with the modified {@link AddEdgeStep}
-     * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#addedge-step" target="_blank">Reference Documentation - AddEdge Step</a>
      * @since 3.1.0-incubating
      */
     public default GraphTraversal<S, E> from(final Traversal<E, Vertex> fromVertex) {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0fe3b1d8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/FromToModulating.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/FromToModulating.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/FromToModulating.java
index 59a51bd..166ebf7 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/FromToModulating.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/FromToModulating.java
@@ -19,14 +19,13 @@
 
 package org.apache.tinkerpop.gremlin.process.traversal.step;
 
-import org.apache.tinkerpop.gremlin.process.traversal.Path;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
-import org.apache.tinkerpop.gremlin.process.traversal.step.util.MutablePath;
-
-import java.util.Set;
 
 /**
+ * FromToModulating are for {@link org.apache.tinkerpop.gremlin.process.traversal.Step}s that support from()- and to()-modulation.
+ * This step is similar to {@link ByModulating}.
+ *
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
 public interface FromToModulating {


[09/19] tinkerpop git commit: updated CHANGELOG.

Posted by ok...@apache.org.
updated CHANGELOG.


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

Branch: refs/heads/master
Commit: 9155c464b78abfe0772d1c8e12ba4196d829e28b
Parents: 35ecf8c
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Mar 16 10:05:17 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Mar 16 10:05:17 2017 -0600

----------------------------------------------------------------------
 CHANGELOG.asciidoc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9155c464/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 1eaf3ad..4aaa25b 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,7 +26,9 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 TinkerPop 3.2.5 (Release Date: NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-* Added `path().from().to()` to `GraphTraversal` so sub-paths can be isolated from the current path.
+* Added `cyclicPath().from().to().by()` support to `GraphTraversal`.
+* Added `simplePath().from().to().by()` support to `GraphTraversal`.
+* Added `path().from().to()` support to `GraphTraversal` so sub-paths can be isolated from the current path.
 * Added `FromToModulating` interface for use with `to()`- and `from()`-based step modulators.
 * Added `Path.getSubPath()` which supports isolating a sub-path from `Path` via to/from-labels.
 * Fixed an `NullPointerException` in `GraphMLReader` that occurred when an `<edge>` didn't have an ID field and the base graph supported ID assignment.


[02/19] tinkerpop git commit: added support for Path.getSubPath(). Added FromToModulating for from() and to()-based step modulations. Added support for path().from().to(). Added respective test cases. Going to add simplePath().from().to().by() and cyclic

Posted by ok...@apache.org.
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9265ddf6/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
index 8070538..0248612 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
@@ -37,6 +37,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.lambda.PredicateTraverser;
 import org.apache.tinkerpop.gremlin.process.traversal.lambda.TrueTraversal;
 import org.apache.tinkerpop.gremlin.process.traversal.step.ByModulating;
 import org.apache.tinkerpop.gremlin.process.traversal.step.Mutating;
+import org.apache.tinkerpop.gremlin.process.traversal.step.FromToModulating;
 import org.apache.tinkerpop.gremlin.process.traversal.step.TimesModulating;
 import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalOptionParent;
 import org.apache.tinkerpop.gremlin.process.traversal.step.branch.BranchStep;
@@ -192,8 +193,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param function the lambda expression that does the functional mapping
      * @return the traversal with an appended {@link LambdaMapStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#general-steps" target="_blank">Reference Documentation - General Steps</a>
+     * @since 3.0.0-incubating
      */
     public default <E2> GraphTraversal<S, E2> map(final Function<Traverser<E>, E2> function) {
         this.asAdmin().getBytecode().addStep(Symbols.map, function);
@@ -205,8 +206,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param mapTraversal the traversal expression that does the functional mapping
      * @return the traversal with an appended {@link LambdaMapStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#general-steps" target="_blank">Reference Documentation - General Steps</a>
+     * @since 3.0.0-incubating
      */
     public default <E2> GraphTraversal<S, E2> map(final Traversal<?, E2> mapTraversal) {
         this.asAdmin().getBytecode().addStep(Symbols.map, mapTraversal);
@@ -220,8 +221,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * @param function the lambda expression that does the functional mapping
      * @param <E2>     the type of the returned iterator objects
      * @return the traversal with an appended {@link LambdaFlatMapStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#general-steps" target="_blank">Reference Documentation - General Steps</a>
+     * @since 3.0.0-incubating
      */
     public default <E2> GraphTraversal<S, E2> flatMap(final Function<Traverser<E>, Iterator<E2>> function) {
         this.asAdmin().getBytecode().addStep(Symbols.flatMap, function);
@@ -235,8 +236,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * @param flatMapTraversal the traversal generating objects of type <code>E2</code>
      * @param <E2>             the end type of the internal traversal
      * @return the traversal with an appended {@link TraversalFlatMapStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#general-steps" target="_blank">Reference Documentation - General Steps</a>
+     * @since 3.0.0-incubating
      */
     public default <E2> GraphTraversal<S, E2> flatMap(final Traversal<?, E2> flatMapTraversal) {
         this.asAdmin().getBytecode().addStep(Symbols.flatMap, flatMapTraversal);
@@ -247,8 +248,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * Map the {@link Element} to its {@link Element#id}.
      *
      * @return the traversal with an appended {@link IdStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#id-step" target="_blank">Reference Documentation - Id Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, Object> id() {
         this.asAdmin().getBytecode().addStep(Symbols.id);
@@ -259,8 +260,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * Map the {@link Element} to its {@link Element#label}.
      *
      * @return the traversal with an appended {@link LabelStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#label-step" target="_blank">Reference Documentation - Label Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, String> label() {
         this.asAdmin().getBytecode().addStep(Symbols.label);
@@ -282,8 +283,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * Map any object to a fixed <code>E</code> value.
      *
      * @return the traversal with an appended {@link ConstantStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#constant-step" target="_blank">Reference Documentation - Constant Step</a>
+     * @since 3.0.0-incubating
      */
     public default <E2> GraphTraversal<S, E2> constant(final E2 e) {
         this.asAdmin().getBytecode().addStep(Symbols.constant, e);
@@ -295,8 +296,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param vertexIdsOrElements vertices to inject into the traversal
      * @return the traversal with an appended {@link GraphStep}
-     * @since 3.1.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#graph-step" target="_blank">Reference Documentation - Graph Step</a>
+     * @since 3.1.0-incubating
      */
     public default GraphTraversal<S, Vertex> V(final Object... vertexIdsOrElements) {
         this.asAdmin().getBytecode().addStep(Symbols.V, vertexIdsOrElements);
@@ -309,8 +310,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * @param direction  the direction to traverse from the current vertex
      * @param edgeLabels the edge labels to traverse
      * @return the traversal with an appended {@link VertexStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#vertex-steps" target="_blank">Reference Documentation - Vertex Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, Vertex> to(final Direction direction, final String... edgeLabels) {
         this.asAdmin().getBytecode().addStep(Symbols.to, direction, edgeLabels);
@@ -322,8 +323,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param edgeLabels the edge labels to traverse
      * @return the traversal with an appended {@link VertexStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#vertex-steps" target="_blank">Reference Documentation - Vertex Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, Vertex> out(final String... edgeLabels) {
         this.asAdmin().getBytecode().addStep(Symbols.out, edgeLabels);
@@ -335,8 +336,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param edgeLabels the edge labels to traverse
      * @return the traversal with an appended {@link VertexStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#vertex-steps" target="_blank">Reference Documentation - Vertex Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, Vertex> in(final String... edgeLabels) {
         this.asAdmin().getBytecode().addStep(Symbols.in, edgeLabels);
@@ -348,8 +349,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param edgeLabels the edge labels to traverse
      * @return the traversal with an appended {@link VertexStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#vertex-steps" target="_blank">Reference Documentation - Vertex Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, Vertex> both(final String... edgeLabels) {
         this.asAdmin().getBytecode().addStep(Symbols.both, edgeLabels);
@@ -362,8 +363,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * @param direction  the direction to traverse from the current vertex
      * @param edgeLabels the edge labels to traverse
      * @return the traversal with an appended {@link VertexStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#vertex-steps" target="_blank">Reference Documentation - Vertex Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, Edge> toE(final Direction direction, final String... edgeLabels) {
         this.asAdmin().getBytecode().addStep(Symbols.toE, direction, edgeLabels);
@@ -375,8 +376,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param edgeLabels the edge labels to traverse
      * @return the traversal with an appended {@link VertexStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#vertex-steps" target="_blank">Reference Documentation - Vertex Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, Edge> outE(final String... edgeLabels) {
         this.asAdmin().getBytecode().addStep(Symbols.outE, edgeLabels);
@@ -388,8 +389,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param edgeLabels the edge labels to traverse
      * @return the traversal with an appended {@link VertexStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#vertex-steps" target="_blank">Reference Documentation - Vertex Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, Edge> inE(final String... edgeLabels) {
         this.asAdmin().getBytecode().addStep(Symbols.inE, edgeLabels);
@@ -401,8 +402,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param edgeLabels the edge labels to traverse
      * @return the traversal with an appended {@link VertexStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#vertex-steps" target="_blank">Reference Documentation - Vertex Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, Edge> bothE(final String... edgeLabels) {
         this.asAdmin().getBytecode().addStep(Symbols.bothE, edgeLabels);
@@ -414,8 +415,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param direction the direction to traverser from the current edge
      * @return the traversal with an appended {@link EdgeVertexStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#vertex-steps" target="_blank">Reference Documentation - Vertex Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, Vertex> toV(final Direction direction) {
         this.asAdmin().getBytecode().addStep(Symbols.toV, direction);
@@ -426,8 +427,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * Map the {@link Edge} to its incoming/head incident {@link Vertex}.
      *
      * @return the traversal with an appended {@link EdgeVertexStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#vertex-steps" target="_blank">Reference Documentation - Vertex Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, Vertex> inV() {
         this.asAdmin().getBytecode().addStep(Symbols.inV);
@@ -438,8 +439,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * Map the {@link Edge} to its outgoing/tail incident {@link Vertex}.
      *
      * @return the traversal with an appended {@link EdgeVertexStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#vertex-steps" target="_blank">Reference Documentation - Vertex Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, Vertex> outV() {
         this.asAdmin().getBytecode().addStep(Symbols.outV);
@@ -450,8 +451,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * Map the {@link Edge} to its incident vertices.
      *
      * @return the traversal with an appended {@link EdgeVertexStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#vertex-steps" target="_blank">Reference Documentation - Vertex Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, Vertex> bothV() {
         this.asAdmin().getBytecode().addStep(Symbols.bothV);
@@ -462,8 +463,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * Map the {@link Edge} to the incident vertex that was not just traversed from in the path history.
      *
      * @return the traversal with an appended {@link EdgeOtherVertexStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#vertex-steps" target="_blank">Reference Documentation - Vertex Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, Vertex> otherV() {
         this.asAdmin().getBytecode().addStep(Symbols.otherV);
@@ -474,8 +475,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * Order all the objects in the traversal up to this point and then emit them one-by-one in their ordered sequence.
      *
      * @return the traversal with an appended {@link OrderGlobalStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#order-step" target="_blank">Reference Documentation - Order Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> order() {
         this.asAdmin().getBytecode().addStep(Symbols.order);
@@ -487,8 +488,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param scope whether the ordering is the current local object or the entire global stream.
      * @return the traversal with an appended {@link OrderGlobalStep} or {@link OrderLocalStep} depending on the {@code scope}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#order-step" target="_blank">Reference Documentation - Order Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> order(final Scope scope) {
         this.asAdmin().getBytecode().addStep(Symbols.order, scope);
@@ -502,8 +503,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * @param propertyKeys the properties to retrieve
      * @param <E2>         the value type of the returned properties
      * @return the traversal with an appended {@link PropertiesStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#properties-step" target="_blank">Reference Documentation - Properties Step</a>
+     * @since 3.0.0-incubating
      */
     public default <E2> GraphTraversal<S, ? extends Property<E2>> properties(final String... propertyKeys) {
         this.asAdmin().getBytecode().addStep(Symbols.properties, propertyKeys);
@@ -517,8 +518,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * @param propertyKeys the properties to retrieve their value from
      * @param <E2>         the value type of the properties
      * @return the traversal with an appended {@link PropertiesStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#values-step" target="_blank">Reference Documentation - Values Step</a>
+     * @since 3.0.0-incubating
      */
     public default <E2> GraphTraversal<S, E2> values(final String... propertyKeys) {
         this.asAdmin().getBytecode().addStep(Symbols.values, propertyKeys);
@@ -532,8 +533,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * @param propertyKeys the properties to retrieve
      * @param <E2>         the value type of the returned properties
      * @return the traversal with an appended {@link PropertyMapStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#propertymap-step" target="_blank">Reference Documentation - PropertyMap Step</a>
+     * @since 3.0.0-incubating
      */
     public default <E2> GraphTraversal<S, Map<String, E2>> propertyMap(final String... propertyKeys) {
         this.asAdmin().getBytecode().addStep(Symbols.propertyMap, propertyKeys);
@@ -547,8 +548,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * @param propertyKeys the properties to retrieve
      * @param <E2>         the value type of the returned properties
      * @return the traversal with an appended {@link PropertyMapStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#valuemap-step" target="_blank">Reference Documentation - ValueMap Step</a>
+     * @since 3.0.0-incubating
      */
     public default <E2> GraphTraversal<S, Map<String, E2>> valueMap(final String... propertyKeys) {
         this.asAdmin().getBytecode().addStep(Symbols.valueMap, propertyKeys);
@@ -563,8 +564,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * @param propertyKeys  the properties to retrieve
      * @param <E2>          the value type of the returned properties
      * @return the traversal with an appended {@link PropertyMapStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#valuemap-step" target="_blank">Reference Documentation - ValueMap Step</a>
+     * @since 3.0.0-incubating
      */
     public default <E2> GraphTraversal<S, Map<String, E2>> valueMap(final boolean includeTokens, final String... propertyKeys) {
         this.asAdmin().getBytecode().addStep(Symbols.valueMap, includeTokens, propertyKeys);
@@ -593,8 +594,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * Map the {@link Property} to its {@link Property#key}.
      *
      * @return the traversal with an appended {@link PropertyKeyStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#key-step" target="_blank">Reference Documentation - Key Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, String> key() {
         this.asAdmin().getBytecode().addStep(Symbols.key);
@@ -605,8 +606,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * Map the {@link Property} to its {@link Property#value}.
      *
      * @return the traversal with an appended {@link PropertyValueStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#value-step" target="_blank">Reference Documentation - Value Step</a>
+     * @since 3.0.0-incubating
      */
     public default <E2> GraphTraversal<S, E2> value() {
         this.asAdmin().getBytecode().addStep(Symbols.value);
@@ -617,8 +618,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * Map the {@link Traverser} to its {@link Path} history via {@link Traverser#path}.
      *
      * @return the traversal with an appended {@link PathStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#path-step" target="_blank">Reference Documentation - Path Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, Path> path() {
         this.asAdmin().getBytecode().addStep(Symbols.path);
@@ -631,8 +632,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * @param matchTraversals the traversal that maintain variables which must hold for the life of the traverser
      * @param <E2>            the type of the obejcts bound in the variables
      * @return the traversal with an appended {@link MatchStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#match-step" target="_blank">Reference Documentation - Match Step</a>
+     * @since 3.0.0-incubating
      */
     public default <E2> GraphTraversal<S, Map<String, E2>> match(final Traversal<?, ?>... matchTraversals) {
         this.asAdmin().getBytecode().addStep(Symbols.match, matchTraversals);
@@ -644,8 +645,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param <E2> the sack value type
      * @return the traversal with an appended {@link SackStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#sack-step" target="_blank">Reference Documentation - Sack Step</a>
+     * @since 3.0.0-incubating
      */
     public default <E2> GraphTraversal<S, E2> sack() {
         this.asAdmin().getBytecode().addStep(Symbols.sack);
@@ -657,8 +658,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * traverser.
      *
      * @return the traversal with an appended {@link LoopsStep}
-     * @since 3.1.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#loops-step" target="_blank">Reference Documentation - Loops Step</a>
+     * @since 3.1.0-incubating
      */
     public default GraphTraversal<S, Integer> loops() {
         this.asAdmin().getBytecode().addStep(Symbols.loops);
@@ -669,8 +670,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * Projects the current object in the stream into a {@code Map} that is keyed by the provided labels.
      *
      * @return the traversal with an appended {@link ProjectStep}
-     * @since 3.2.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#project-step" target="_blank">Reference Documentation - Project Step</a>
+     * @since 3.2.0-incubating
      */
     public default <E2> GraphTraversal<S, Map<String, E2>> project(final String projectKey, final String... otherProjectKeys) {
         final String[] projectKeys = new String[otherProjectKeys.length + 1];
@@ -689,8 +690,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * @param otherSelectKeys the third+ keys to project
      * @param <E2>            the type of the objects projected
      * @return the traversal with an appended {@link SelectStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#select-step" target="_blank">Reference Documentation - Select Step</a>
+     * @since 3.0.0-incubating
      */
     public default <E2> GraphTraversal<S, Map<String, E2>> select(final Pop pop, final String selectKey1, final String selectKey2, String... otherSelectKeys) {
         final String[] selectKeys = new String[otherSelectKeys.length + 2];
@@ -709,8 +710,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * @param otherSelectKeys the third+ keys to project
      * @param <E2>            the type of the objects projected
      * @return the traversal with an appended {@link SelectStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#select-step" target="_blank">Reference Documentation - Select Step</a>
+     * @since 3.0.0-incubating
      */
     public default <E2> GraphTraversal<S, Map<String, E2>> select(final String selectKey1, final String selectKey2, String... otherSelectKeys) {
         final String[] selectKeys = new String[otherSelectKeys.length + 2];
@@ -727,8 +728,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param selectKey the key to project
      * @return the traversal with an appended {@link SelectStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#select-step" target="_blank">Reference Documentation - Select Step</a>
+     * @since 3.0.0-incubating
      */
     public default <E2> GraphTraversal<S, E2> select(final Pop pop, final String selectKey) {
         this.asAdmin().getBytecode().addStep(Symbols.select, pop, selectKey);
@@ -742,8 +743,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param selectKey the key to project
      * @return the traversal with an appended {@link SelectStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#select-step" target="_blank">Reference Documentation - Select Step</a>
+     * @since 3.0.0-incubating
      */
     public default <E2> GraphTraversal<S, E2> select(final String selectKey) {
         this.asAdmin().getBytecode().addStep(Symbols.select, selectKey);
@@ -755,8 +756,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param column the column to extract
      * @return the traversal with an appended {@link TraversalMapStep}
-     * @since 3.1.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#select-step" target="_blank">Reference Documentation - Select Step</a>
+     * @since 3.1.0-incubating
      */
     public default <E2> GraphTraversal<S, Collection<E2>> select(final Column column) {
         this.asAdmin().getBytecode().addStep(Symbols.select, column);
@@ -768,8 +769,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * is not one of those types.
      *
      * @return the traversal with an appended {@link UnfoldStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#unfold-step" target="_blank">Reference Documentation - Unfold Step</a>
+     * @since 3.0.0-incubating
      */
     public default <E2> GraphTraversal<S, E2> unfold() {
         this.asAdmin().getBytecode().addStep(Symbols.unfold);
@@ -780,8 +781,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * Rolls up objects in the stream into an aggregate list.
      *
      * @return the traversal with an appended {@link FoldStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#fold-step" target="_blank">Reference Documentation - Fold Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, List<E>> fold() {
         this.asAdmin().getBytecode().addStep(Symbols.fold);
@@ -791,12 +792,12 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
     /**
      * Rolls up objects in the stream into an aggregate value as defined by a {@code seed} and {@code BiFunction}.
      *
-     * @param seed the value to provide as the first argument to the {@code foldFunction}
+     * @param seed         the value to provide as the first argument to the {@code foldFunction}
      * @param foldFunction the function to fold by where the first argument is the {@code seed} or the value returned from subsequent calss and
      *                     the second argument is the value from the stream
      * @return the traversal with an appended {@link FoldStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#fold-step" target="_blank">Reference Documentation - Fold Step</a>
+     * @since 3.0.0-incubating
      */
     public default <E2> GraphTraversal<S, E2> fold(final E2 seed, final BiFunction<E2, E, E2> foldFunction) {
         this.asAdmin().getBytecode().addStep(Symbols.fold, seed, foldFunction);
@@ -808,8 +809,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * of traversers up to this point).
      *
      * @return the traversal with an appended {@link CountGlobalStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#count-step" target="_blank">Reference Documentation - Count Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, Long> count() {
         this.asAdmin().getBytecode().addStep(Symbols.count);
@@ -821,8 +822,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * {@link Scope} (i.e. count the number of traversers up to this point).
      *
      * @return the traversal with an appended {@link CountGlobalStep} or {@link CountLocalStep} depending on the {@link Scope}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#count-step" target="_blank">Reference Documentation - Count Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, Long> count(final Scope scope) {
         this.asAdmin().getBytecode().addStep(Symbols.count, scope);
@@ -834,8 +835,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * {@link Traverser#bulk} (i.e. sum the traverser values up to this point).
      *
      * @return the traversal with an appended {@link SumGlobalStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#sum-step" target="_blank">Reference Documentation - Sum Step</a>
+     * @since 3.0.0-incubating
      */
     public default <E2 extends Number> GraphTraversal<S, E2> sum() {
         this.asAdmin().getBytecode().addStep(Symbols.sum);
@@ -847,8 +848,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * {@link Traverser#bulk} given the specified {@link Scope} (i.e. sum the traverser values up to this point).
      *
      * @return the traversal with an appended {@link SumGlobalStep} or {@link SumLocalStep} depending on the {@link Scope}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#sum-step" target="_blank">Reference Documentation - Sum Step</a>
+     * @since 3.0.0-incubating
      */
     public default <E2 extends Number> GraphTraversal<S, E2> sum(final Scope scope) {
         this.asAdmin().getBytecode().addStep(Symbols.sum, scope);
@@ -859,8 +860,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * Determines the largest value in the stream.
      *
      * @return the traversal with an appended {@link MaxGlobalStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#max-step" target="_blank">Reference Documentation - Max Step</a>
+     * @since 3.0.0-incubating
      */
     public default <E2 extends Number> GraphTraversal<S, E2> max() {
         this.asAdmin().getBytecode().addStep(Symbols.max);
@@ -871,8 +872,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * Determines the largest value in the stream given the {@link Scope}.
      *
      * @return the traversal with an appended {@link MaxGlobalStep} or {@link MaxLocalStep} depending on the {@link Scope}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#max-step" target="_blank">Reference Documentation - Max Step</a>
+     * @since 3.0.0-incubating
      */
     public default <E2 extends Number> GraphTraversal<S, E2> max(final Scope scope) {
         this.asAdmin().getBytecode().addStep(Symbols.max, scope);
@@ -883,8 +884,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * Determines the smallest value in the stream.
      *
      * @return the traversal with an appended {@link MinGlobalStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#min-step" target="_blank">Reference Documentation - Min Step</a>
+     * @since 3.0.0-incubating
      */
     public default <E2 extends Number> GraphTraversal<S, E2> min() {
         this.asAdmin().getBytecode().addStep(Symbols.min);
@@ -895,8 +896,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * Determines the smallest value in the stream given the {@link Scope}.
      *
      * @return the traversal with an appended {@link MinGlobalStep} or {@link MinLocalStep} depending on the {@link Scope}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#min-step" target="_blank">Reference Documentation - Min Step</a>
+     * @since 3.0.0-incubating
      */
     public default <E2 extends Number> GraphTraversal<S, E2> min(final Scope scope) {
         this.asAdmin().getBytecode().addStep(Symbols.min, scope);
@@ -907,8 +908,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * Determines the mean value in the stream.
      *
      * @return the traversal with an appended {@link MeanGlobalStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#mean-step" target="_blank">Reference Documentation - Mean Step</a>
+     * @since 3.0.0-incubating
      */
     public default <E2 extends Number> GraphTraversal<S, E2> mean() {
         this.asAdmin().getBytecode().addStep(Symbols.mean);
@@ -919,8 +920,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * Determines the mean value in the stream given the {@link Scope}.
      *
      * @return the traversal with an appended {@link MeanGlobalStep} or {@link MeanLocalStep} depending on the {@link Scope}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#mean-step" target="_blank">Reference Documentation - Mean Step</a>
+     * @since 3.0.0-incubating
      */
     public default <E2 extends Number> GraphTraversal<S, E2> mean(final Scope scope) {
         this.asAdmin().getBytecode().addStep(Symbols.mean, scope);
@@ -932,8 +933,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * {@link #by()} modulators which help specify how the grouping should occur.
      *
      * @return the traversal with an appended {@link GroupStep}.
-     * @since 3.1.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#group-step" target="_blank">Reference Documentation - Group Step</a>
+     * @since 3.1.0-incubating
      */
     public default <K, V> GraphTraversal<S, Map<K, V>> group() {
         this.asAdmin().getBytecode().addStep(Symbols.group);
@@ -941,8 +942,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
     }
 
     /**
-     * @deprecated As of release 3.1.0, replaced by {@link #group()}
      * @since 3.0.0-incubating
+     * @deprecated As of release 3.1.0, replaced by {@link #group()}
      */
     @Deprecated
     public default <K, V> GraphTraversal<S, Map<K, V>> groupV3d0() {
@@ -955,8 +956,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * object is the key and the value is the count.
      *
      * @return the traversal with an appended {@link GroupCountStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#groupcount-step" target="_blank">Reference Documentation - GroupCount Step</a>
+     * @since 3.0.0-incubating
      */
     public default <K> GraphTraversal<S, Map<K, Long>> groupCount() {
         this.asAdmin().getBytecode().addStep(Symbols.groupCount);
@@ -967,8 +968,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * Aggregates the emanating paths into a {@link Tree} data structure.
      *
      * @return the traversal with an appended {@link TreeStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#tree-step" target="_blank">Reference Documentation - Tree Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, Tree> tree() {
         this.asAdmin().getBytecode().addStep(Symbols.tree);
@@ -980,8 +981,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param vertexLabel the label of the {@link Vertex} to add
      * @return the traversal with the {@link AddVertexStep} added
-     * @since 3.1.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#addvertex-step" target="_blank">Reference Documentation - AddVertex Step</a>
+     * @since 3.1.0-incubating
      */
     public default GraphTraversal<S, Vertex> addV(final String vertexLabel) {
         this.asAdmin().getBytecode().addStep(Symbols.addV, vertexLabel);
@@ -992,8 +993,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * Adds a {@link Vertex} with a default vertex label.
      *
      * @return the traversal with the {@link AddVertexStep} added
-     * @since 3.1.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#addvertex-step" target="_blank">Reference Documentation - AddVertex Step</a>
+     * @since 3.1.0-incubating
      */
     public default GraphTraversal<S, Vertex> addV() {
         this.asAdmin().getBytecode().addStep(Symbols.addV);
@@ -1019,8 +1020,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param edgeLabel the label of the newly added edge
      * @return the traversal with the {@link AddEdgeStep} added
-     * @since 3.1.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#addedge-step" target="_blank">Reference Documentation - AddEdge Step</a>
+     * @since 3.1.0-incubating
      */
     public default GraphTraversal<S, Edge> addE(final String edgeLabel) {
         this.asAdmin().getBytecode().addStep(Symbols.addE, edgeLabel);
@@ -1033,12 +1034,12 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param toStepLabel the step label of the incoming vertex
      * @return the traversal with the modified {@link AddEdgeStep}
-     * @since 3.1.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#addedge-step" target="_blank">Reference Documentation - AddEdge Step</a>
+     * @since 3.1.0-incubating
      */
     public default GraphTraversal<S, E> to(final String toStepLabel) {
         this.asAdmin().getBytecode().addStep(Symbols.to, toStepLabel);
-        ((AddEdgeStep) this.asAdmin().getEndStep()).addTo(__.select(toStepLabel));
+        ((FromToModulating) this.asAdmin().getEndStep()).addTo(toStepLabel);
         return this;
     }
 
@@ -1048,12 +1049,12 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param fromStepLabel the step label of the outgoing vertex
      * @return the traversal with the modified {@link AddEdgeStep}
-     * @since 3.1.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#addedge-step" target="_blank">Reference Documentation - AddEdge Step</a>
+     * @since 3.1.0-incubating
      */
     public default GraphTraversal<S, E> from(final String fromStepLabel) {
         this.asAdmin().getBytecode().addStep(Symbols.from, fromStepLabel);
-        ((AddEdgeStep) this.asAdmin().getEndStep()).addFrom(__.select(fromStepLabel));
+        ((FromToModulating) this.asAdmin().getEndStep()).addFrom(fromStepLabel);
         return this;
     }
 
@@ -1063,12 +1064,12 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param toVertex the traversal for selecting the incoming vertex
      * @return the traversal with the modified {@link AddEdgeStep}
-     * @since 3.1.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#addedge-step" target="_blank">Reference Documentation - AddEdge Step</a>
+     * @since 3.1.0-incubating
      */
     public default GraphTraversal<S, E> to(final Traversal<E, Vertex> toVertex) {
         this.asAdmin().getBytecode().addStep(Symbols.to, toVertex);
-        ((AddEdgeStep) this.asAdmin().getEndStep()).addTo(toVertex);
+        ((FromToModulating) this.asAdmin().getEndStep()).addTo(toVertex.asAdmin());
         return this;
     }
 
@@ -1078,12 +1079,12 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param fromVertex the traversal for selecting the outgoing vertex
      * @return the traversal with the modified {@link AddEdgeStep}
-     * @since 3.1.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#addedge-step" target="_blank">Reference Documentation - AddEdge Step</a>
+     * @since 3.1.0-incubating
      */
     public default GraphTraversal<S, E> from(final Traversal<E, Vertex> fromVertex) {
         this.asAdmin().getBytecode().addStep(Symbols.from, fromVertex);
-        ((AddEdgeStep) this.asAdmin().getEndStep()).addFrom(fromVertex);
+        ((FromToModulating) this.asAdmin().getEndStep()).addFrom(fromVertex.asAdmin());
         return this;
     }
 
@@ -1148,8 +1149,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param predicate the filter function to apply
      * @return the traversal with the {@link LambdaFilterStep} added
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#general-steps" target="_blank">Reference Documentation - General Steps</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> filter(final Predicate<Traverser<E>> predicate) {
         this.asAdmin().getBytecode().addStep(Symbols.filter, predicate);
@@ -1162,8 +1163,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param filterTraversal the filter traversal to apply
      * @return the traversal with the {@link TraversalFilterStep} added
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#general-steps" target="_blank">Reference Documentation - General Steps</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> filter(final Traversal<?, ?> filterTraversal) {
         this.asAdmin().getBytecode().addStep(Symbols.filter, filterTraversal);
@@ -1175,8 +1176,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param orTraversals filter traversals where at least one must be satisfied
      * @return the traversal with an appended {@link OrStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#or-step" target="_blank">Reference Documentation - Or Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> or(final Traversal<?, ?>... orTraversals) {
         this.asAdmin().getBytecode().addStep(Symbols.or, orTraversals);
@@ -1188,8 +1189,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param andTraversals filter traversals that must be satisfied
      * @return the traversal with an appended {@link AndStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#and-step" target="_blank">Reference Documentation - And Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> and(final Traversal<?, ?>... andTraversals) {
         this.asAdmin().getBytecode().addStep(Symbols.and, andTraversals);
@@ -1201,9 +1202,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param injections the objects to add to the stream
      * @return the traversal with an appended {@link InjectStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#inject-step" target="_blank">Reference Documentation - Inject Step</a>
-     *
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> inject(final E... injections) {
         this.asAdmin().getBytecode().addStep(Symbols.inject, injections);
@@ -1216,8 +1216,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * @param scope       whether the deduplication is on the stream (global) or the current object (local).
      * @param dedupLabels if labels are provided, then the scope labels determine de-duplication. No labels implies current object.
      * @return the traversal with an appended {@link DedupGlobalStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#dedup-step" target="_blank">Reference Documentation - Dedup Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> dedup(final Scope scope, final String... dedupLabels) {
         this.asAdmin().getBytecode().addStep(Symbols.dedup, scope, dedupLabels);
@@ -1229,8 +1229,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param dedupLabels if labels are provided, then the scoped object's labels determine de-duplication. No labels implies current object.
      * @return the traversal with an appended {@link DedupGlobalStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#dedup-step" target="_blank">Reference Documentation - Dedup Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> dedup(final String... dedupLabels) {
         this.asAdmin().getBytecode().addStep(Symbols.dedup, dedupLabels);
@@ -1240,13 +1240,13 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
     /**
      * Filters the current object based on the object itself or the path history.
      *
-     * @param startKey the key containing the object to filter
+     * @param startKey  the key containing the object to filter
      * @param predicate the filter to apply
      * @return the traversal with an appended {@link WherePredicateStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#where-step" target="_blank">Reference Documentation - Where Step</a>
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#using-where-with-match" target="_blank">Reference Documentation - Where with Match</a>
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#using-where-with-select" target="_blank">Reference Documentation - Where with Select</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> where(final String startKey, final P<String> predicate) {
         this.asAdmin().getBytecode().addStep(Symbols.where, startKey, predicate);
@@ -1258,10 +1258,10 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param predicate the filter to apply
      * @return the traversal with an appended {@link WherePredicateStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#where-step" target="_blank">Reference Documentation - Where Step</a>
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#using-where-with-match" target="_blank">Reference Documentation - Where with Match</a>
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#using-where-with-select" target="_blank">Reference Documentation - Where with Select</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> where(final P<String> predicate) {
         this.asAdmin().getBytecode().addStep(Symbols.where, predicate);
@@ -1273,10 +1273,10 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param whereTraversal the filter to apply
      * @return the traversal with an appended {@link WherePredicateStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#where-step" target="_blank">Reference Documentation - Where Step</a>
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#using-where-with-match" target="_blank">Reference Documentation - Where with Match</a>
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#using-where-with-select" target="_blank">Reference Documentation - Where with Select</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> where(final Traversal<?, ?> whereTraversal) {
         this.asAdmin().getBytecode().addStep(Symbols.where, whereTraversal);
@@ -1289,10 +1289,10 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * Filters vertices, edges and vertex properties based on their properties.
      *
      * @param propertyKey the key of the property to filter on
-     * @param predicate the filter to apply to the key's value
+     * @param predicate   the filter to apply to the key's value
      * @return the traversal with an appended {@link HasStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> has(final String propertyKey, final P<?> predicate) {
         this.asAdmin().getBytecode().addStep(Symbols.has, propertyKey, predicate);
@@ -1302,11 +1302,11 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
     /**
      * Filters vertices, edges and vertex properties based on their properties.
      *
-     * @param accessor the {@link T} accessor of the property to filter on
+     * @param accessor  the {@link T} accessor of the property to filter on
      * @param predicate the filter to apply to the key's value
      * @return the traversal with an appended {@link HasStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> has(final T accessor, final P<?> predicate) {
         this.asAdmin().getBytecode().addStep(Symbols.has, accessor, predicate);
@@ -1317,10 +1317,10 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * Filters vertices, edges and vertex properties based on their properties.
      *
      * @param propertyKey the key of the property to filter on
-     * @param value the value to compare the property value to for equality
+     * @param value       the value to compare the property value to for equality
      * @return the traversal with an appended {@link HasStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> has(final String propertyKey, final Object value) {
         if (value instanceof P)
@@ -1337,10 +1337,10 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * Filters vertices, edges and vertex properties based on their properties.
      *
      * @param accessor the {@link T} accessor of the property to filter on
-     * @param value the value to compare the accessor value to for equality
+     * @param value    the value to compare the accessor value to for equality
      * @return the traversal with an appended {@link HasStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> has(final T accessor, final Object value) {
         if (value instanceof P)
@@ -1356,12 +1356,12 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
     /**
      * Filters vertices, edges and vertex properties based on their properties.
      *
-     * @param label the label of the {@link Element}
+     * @param label       the label of the {@link Element}
      * @param propertyKey the key of the property to filter on
-     * @param predicate the filter to apply to the key's value
+     * @param predicate   the filter to apply to the key's value
      * @return the traversal with an appended {@link HasStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> has(final String label, final String propertyKey, final P<?> predicate) {
         this.asAdmin().getBytecode().addStep(Symbols.has, label, propertyKey, predicate);
@@ -1372,12 +1372,12 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
     /**
      * Filters vertices, edges and vertex properties based on their properties.
      *
-     * @param label the label of the {@link Element}
+     * @param label       the label of the {@link Element}
      * @param propertyKey the key of the property to filter on
-     * @param value the value to compare the accessor value to for equality
+     * @param value       the value to compare the accessor value to for equality
      * @return the traversal with an appended {@link HasStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> has(final String label, final String propertyKey, final Object value) {
         this.asAdmin().getBytecode().addStep(Symbols.has, label, propertyKey, value);
@@ -1388,11 +1388,11 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
     /**
      * Filters vertices, edges and vertex properties based on their properties.
      *
-     * @param accessor the {@link T} accessor of the property to filter on
+     * @param accessor          the {@link T} accessor of the property to filter on
      * @param propertyTraversal the traversal to filter the accessor value by
      * @return the traversal with an appended {@link HasStep}
-     * @since 3.1.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a>
+     * @since 3.1.0-incubating
      */
     public default GraphTraversal<S, E> has(final T accessor, final Traversal<?, ?> propertyTraversal) {
         this.asAdmin().getBytecode().addStep(Symbols.has, accessor, propertyTraversal);
@@ -1404,11 +1404,11 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
     /**
      * Filters vertices, edges and vertex properties based on their properties.
      *
-     * @param propertyKey the key of the property to filter on
+     * @param propertyKey       the key of the property to filter on
      * @param propertyTraversal the traversal to filter the property value by
      * @return the traversal with an appended {@link HasStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> has(final String propertyKey, final Traversal<?, ?> propertyTraversal) {
         this.asAdmin().getBytecode().addStep(Symbols.has, propertyKey, propertyTraversal);
@@ -1422,8 +1422,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param propertyKey the key of the property to filter on for existence
      * @return the traversal with an appended {@link HasStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> has(final String propertyKey) {
         this.asAdmin().getBytecode().addStep(Symbols.has, propertyKey);
@@ -1435,8 +1435,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param propertyKey the key of the property to filter on for existence
      * @return the traversal with an appended {@link HasStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> hasNot(final String propertyKey) {
         this.asAdmin().getBytecode().addStep(Symbols.hasNot, propertyKey);
@@ -1446,11 +1446,11 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
     /**
      * Filters vertices, edges and vertex properties based on their label.
      *
-     * @param label the label of the {@link Element}
+     * @param label       the label of the {@link Element}
      * @param otherLabels additional labels of the {@link Element}
      * @return the traversal with an appended {@link HasStep}
-     * @since 3.2.2
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a>
+     * @since 3.2.2
      */
     public default GraphTraversal<S, E> hasLabel(final String label, final String... otherLabels) {
         final String[] labels = new String[otherLabels.length + 1];
@@ -1465,8 +1465,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param predicate the filter to apply to the label of the {@link Element}
      * @return the traversal with an appended {@link HasStep}
-     * @since 3.2.4
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a>
+     * @since 3.2.4
      */
     public default GraphTraversal<S, E> hasLabel(final P<String> predicate) {
         this.asAdmin().getBytecode().addStep(Symbols.hasLabel, predicate);
@@ -1476,11 +1476,11 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
     /**
      * Filters vertices, edges and vertex properties based on their identifier.
      *
-     * @param id the identifier of the {@link Element}
+     * @param id       the identifier of the {@link Element}
      * @param otherIds additional identifiers of the {@link Element}
      * @return the traversal with an appended {@link HasStep}
-     * @since 3.2.2
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a>
+     * @since 3.2.2
      */
     public default GraphTraversal<S, E> hasId(final Object id, final Object... otherIds) {
         if (id instanceof P)
@@ -1511,8 +1511,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param predicate the filter to apply to the identifier of the {@link Element}
      * @return the traversal with an appended {@link HasStep}
-     * @since 3.2.4
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a>
+     * @since 3.2.4
      */
     public default GraphTraversal<S, E> hasId(final P<Object> predicate) {
         this.asAdmin().getBytecode().addStep(Symbols.hasId, predicate);
@@ -1522,11 +1522,11 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
     /**
      * Filters vertices, edges and vertex properties based on their key.
      *
-     * @param label the key of the {@link Element}
+     * @param label       the key of the {@link Element}
      * @param otherLabels additional key of the {@link Element}
      * @return the traversal with an appended {@link HasStep}
-     * @since 3.2.2
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a>
+     * @since 3.2.2
      */
     public default GraphTraversal<S, E> hasKey(final String label, final String... otherLabels) {
         final String[] labels = new String[otherLabels.length + 1];
@@ -1541,8 +1541,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param predicate the filter to apply to the key of the {@link Element}
      * @return the traversal with an appended {@link HasStep}
-     * @since 3.2.4
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a>
+     * @since 3.2.4
      */
     public default GraphTraversal<S, E> hasKey(final P<String> predicate) {
         this.asAdmin().getBytecode().addStep(Symbols.hasKey, predicate);
@@ -1552,7 +1552,7 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
     /**
      * Filters vertices, edges and vertex properties based on their value.
      *
-     * @param value the value of the {@link Element}
+     * @param value       the value of the {@link Element}
      * @param otherValues additional values of the {@link Element}
      * @return the traversal with an appended {@link HasStep}
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a>
@@ -1586,8 +1586,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param predicate the filter to apply to the value of the {@link Element}
      * @return the traversal with an appended {@link HasStep}
-     * @since 3.2.4
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a>
+     * @since 3.2.4
      */
     public default GraphTraversal<S, E> hasValue(final P<Object> predicate) {
         this.asAdmin().getBytecode().addStep(Symbols.hasValue, predicate);
@@ -1599,8 +1599,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param predicate the filter to apply
      * @return the traversal with an appended {@link IsStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#is-step" target="_blank">Reference Documentation - Is Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> is(final P<E> predicate) {
         this.asAdmin().getBytecode().addStep(Symbols.is, predicate);
@@ -1612,8 +1612,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param value the value that the object must equal.
      * @return the traversal with an appended {@link IsStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#is-step" target="_blank">Reference Documentation - Is Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> is(final Object value) {
         this.asAdmin().getBytecode().addStep(Symbols.is, value);
@@ -1625,8 +1625,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param notTraversal the traversal to filter by.
      * @return the traversal with an appended {@link NotStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#not-step" target="_blank">Reference Documentation - Not Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> not(final Traversal<?, ?> notTraversal) {
         this.asAdmin().getBytecode().addStep(Symbols.not, notTraversal);
@@ -1638,8 +1638,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param probability the probability that the object will pass through
      * @return the traversal with an appended {@link CoinStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#coin-step" target="_blank">Reference Documentation - Coin Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> coin(final double probability) {
         this.asAdmin().getBytecode().addStep(Symbols.coin, probability);
@@ -1650,11 +1650,11 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * Filter the objects in the traversal by the number of them to pass through the stream. Those before the value
      * of {@code low} do not pass through and those that exceed the value of {@code high} will end the iteration.
      *
-     * @param low the number at which to start allowing objects through the stream
+     * @param low  the number at which to start allowing objects through the stream
      * @param high the number at which to end the stream
      * @return the traversal with an appended {@link RangeGlobalStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#range-step" target="_blank">Reference Documentation - Range Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> range(final long low, final long high) {
         this.asAdmin().getBytecode().addStep(Symbols.range, low, high);
@@ -1667,11 +1667,11 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * {@code high} will end the iteration.
      *
      * @param scope the scope of how to apply the {@code range}
-     * @param low the number at which to start allowing objects through the stream
-     * @param high the number at which to end the stream
+     * @param low   the number at which to start allowing objects through the stream
+     * @param high  the number at which to end the stream
      * @return the traversal with an appended {@link RangeGlobalStep} or {@link RangeLocalStep} depending on {@code scope}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#range-step" target="_blank">Reference Documentation - Range Step</a>
+     * @since 3.0.0-incubating
      */
     public default <E2> GraphTraversal<S, E2> range(final Scope scope, final long low, final long high) {
         this.asAdmin().getBytecode().addStep(Symbols.range, scope, low, high);
@@ -1686,8 +1686,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param limit the number at which to end the stream
      * @return the traversal with an appended {@link RangeGlobalStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#limit-step" target="_blank">Reference Documentation - Limit Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> limit(final long limit) {
         this.asAdmin().getBytecode().addStep(Symbols.limit, limit);
@@ -1701,8 +1701,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * @param scope the scope of how to apply the {@code limit}
      * @param limit the number at which to end the stream
      * @return the traversal with an appended {@link RangeGlobalStep} or {@link RangeLocalStep} depending on {@code scope}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#limit-step" target="_blank">Reference Documentation - Limit Step</a>
+     * @since 3.0.0-incubating
      */
     public default <E2> GraphTraversal<S, E2> limit(final Scope scope, final long limit) {
         this.asAdmin().getBytecode().addStep(Symbols.limit, scope, limit);
@@ -1716,8 +1716,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * object will be returned.
      *
      * @return the traversal with an appended {@link TailGlobalStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#tail-step" target="_blank">Reference Documentation - Tail Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> tail() {
         this.asAdmin().getBytecode().addStep(Symbols.tail);
@@ -1730,8 +1730,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param limit the number at which to end the stream
      * @return the traversal with an appended {@link TailGlobalStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#tail-step" target="_blank">Reference Documentation - Tail Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> tail(final long limit) {
         this.asAdmin().getBytecode().addStep(Symbols.tail, limit);
@@ -1744,8 +1744,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param scope the scope of how to apply the {@code tail}
      * @return the traversal with an appended {@link TailGlobalStep} or {@link TailLocalStep} depending on {@code scope}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#tail-step" target="_blank">Reference Documentation - Tail Step</a>
+     * @since 3.0.0-incubating
      */
     public default <E2> GraphTraversal<S, E2> tail(final Scope scope) {
         this.asAdmin().getBytecode().addStep(Symbols.tail, scope);
@@ -1761,8 +1761,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * @param scope the scope of how to apply the {@code tail}
      * @param limit the number at which to end the stream
      * @return the traversal with an appended {@link TailGlobalStep} or {@link TailLocalStep} depending on {@code scope}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#tail-step" target="_blank">Reference Documentation - Tail Step</a>
+     * @since 3.0.0-incubating
      */
     public default <E2> GraphTraversal<S, E2> tail(final Scope scope, final long limit) {
         this.asAdmin().getBytecode().addStep(Symbols.tail, scope, limit);
@@ -1776,8 +1776,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param timeLimit the count down time
      * @return the traversal with an appended {@link TimeLimitStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#timelimit-step" target="_blank">Reference Documentation - TimeLimit Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> timeLimit(final long timeLimit) {
         this.asAdmin().getBytecode().addStep(Symbols.timeLimit, timeLimit);
@@ -1788,8 +1788,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * Filter the <code>E</code> object if its {@link Traverser#path} is not {@link Path#isSimple}.
      *
      * @return the traversal with an appended {@link SimplePathStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#simplepath-step" target="_blank">Reference Documentation - SimplePath Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> simplePath() {
         this.asAdmin().getBytecode().addStep(Symbols.simplePath);
@@ -1800,8 +1800,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * Filter the <code>E</code> object if its {@link Traverser#path} is {@link Path#isSimple}.
      *
      * @return the traversal with an appended {@link CyclicPathStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#cyclicpath-step" target="_blank">Reference Documentation - CyclicPath Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> cyclicPath() {
         this.asAdmin().getBytecode().addStep(Symbols.cyclicPath);
@@ -1813,8 +1813,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param amountToSample the number of objects to allow
      * @return the traversal with an appended {@link SampleGlobalStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#sample-step" target="_blank">Reference Documentation - Sample Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> sample(final int amountToSample) {
         this.asAdmin().getBytecode().addStep(Symbols.sample, amountToSample);
@@ -1824,11 +1824,11 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
     /**
      * Allow some specified number of objects to pass through the stream.
      *
-     * @param scope the scope of how to apply the {@code sample}
+     * @param scope          the scope of how to apply the {@code sample}
      * @param amountToSample the number of objects to allow
      * @return the traversal with an appended {@link SampleGlobalStep} or {@link SampleLocalStep} depending on the {@code scope}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#sample-step" target="_blank">Reference Documentation - Sample Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> sample(final Scope scope, final int amountToSample) {
         this.asAdmin().getBytecode().addStep(Symbols.sample, scope, amountToSample);
@@ -1843,8 +1843,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * to actually take place. In most cases, iteration is best accomplished with {@code g.V().drop().iterate()}.
      *
      * @return the traversal with the {@link DropStep} added
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#drop-step" target="_blank">Reference Documentation - Drop Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> drop() {
         this.asAdmin().getBytecode().addStep(Symbols.drop);
@@ -1858,8 +1858,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param consumer the operation to perform at this step in relation to the {@link Traverser}
      * @return the traversal with an appended {@link LambdaSideEffectStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#general-steps" target="_blank">Reference Documentation - General Steps</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> sideEffect(final Consumer<Traverser<E>> consumer) {
         this.asAdmin().getBytecode().addStep(Symbols.sideEffect, consumer);
@@ -1871,8 +1871,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param sideEffectTraversal the operation to perform at this step in relation to the {@link Traverser}
      * @return the traversal with an appended {@link TraversalSideEffectStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#general-steps" target="_blank">Reference Documentation - General Steps</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> sideEffect(final Traversal<?, ?> sideEffectTraversal) {
         this.asAdmin().getBytecode().addStep(Symbols.sideEffect, sideEffectTraversal);
@@ -1883,11 +1883,11 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * Iterates the traversal up to the itself and emits the side-effect referenced by the key. If multiple keys are
      * supplied then the side-effects are emitted as a {@code Map}.
      *
-     * @param sideEffectKey the side-effect to emit
+     * @param sideEffectKey  the side-effect to emit
      * @param sideEffectKeys other side-effects to emit
      * @return the traversal with an appended {@link SideEffectCapStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#cap-step" target="_blank">Reference Documentation - Cap Step</a>
+     * @since 3.0.0-incubating
      */
     public default <E2> GraphTraversal<S, E2> cap(final String sideEffectKey, final String... sideEffectKeys) {
         this.asAdmin().getBytecode().addStep(Symbols.cap, sideEffectKey, sideEffectKeys);
@@ -1900,8 +1900,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param sideEffectKey the name of the side-effect key that will hold the subgraph
      * @return the traversal with an appended {@link SubgraphStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#subgraph-step" target="_blank">Reference Documentation - Subgraph Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, Edge> subgraph(final String sideEffectKey) {
         this.asAdmin().getBytecode().addStep(Symbols.subgraph, sideEffectKey);
@@ -1913,8 +1913,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param sideEffectKey the name of the side-effect key that will hold the aggregated objects
      * @return the traversal with an appended {@link AggregateStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#aggregate-step" target="_blank">Reference Documentation - Aggregate Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> aggregate(final String sideEffectKey) {
         this.asAdmin().getBytecode().addStep(Symbols.aggregate, sideEffectKey);
@@ -1927,8 +1927,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param sideEffectKey the name of the side-effect key that will hold the aggregated grouping
      * @return the traversal with an appended {@link GroupStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#group-step" target="_blank">Reference Documentation - Group Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> group(final String sideEffectKey) {
         this.asAdmin().getBytecode().addStep(Symbols.group, sideEffectKey);
@@ -1950,8 +1950,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param sideEffectKey the name of the side-effect key that will hold the aggregated grouping
      * @return the traversal with an appended {@link GroupCountStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#groupcount-step" target="_blank">Reference Documentation - GroupCount Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> groupCount(final String sideEffectKey) {
         this.asAdmin().getBytecode().addStep(Symbols.groupCount, sideEffectKey);
@@ -1963,8 +1963,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param sideEffectKey the name of the side-effect key that will hold the tree
      * @return the traversal with an appended {@link TreeStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#tree-step" target="_blank">Reference Documentation - Tree Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> tree(final String sideEffectKey) {
         this.asAdmin().getBytecode().addStep(Symbols.tree, sideEffectKey);
@@ -1976,8 +1976,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param sackOperator the operator to apply to the sack value
      * @return the traversal with an appended {@link SackStep}.
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#sack-step" target="_blank">Reference Documentation - Sack Step</a>
+     * @since 3.0.0-incubating
      */
     public default <V, U> GraphTraversal<S, E> sack(final BiFunction<V, U, V> sackOperator) {
         this.asAdmin().getBytecode().addStep(Symbols.sack, sackOperator);
@@ -1998,8 +1998,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param sideEffectKey the name of the side-effect key that will hold the aggregate
      * @return the traversal with an appended {@link StoreStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#store-step" target="_blank">Reference Documentation - Store Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> store(final String sideEffectKey) {
         this.asAdmin().getBytecode().addStep(Symbols.store, sideEffectKey);
@@ -2012,8 +2012,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param sideEffectKey the name of the side-effect key within which to hold the profile object
      * @return the traversal with an appended {@link ProfileSideEffectStep}
-     * @since 3.2.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#profile-step" target="_blank">Reference Documentation - Profile Step</a>
+     * @since 3.2.0-incubating
      */
     public default GraphTraversal<S, E> profile(final String sideEffectKey) {
         this.asAdmin().getBytecode().addStep(Traversal.Symbols.profile, sideEffectKey);
@@ -2025,8 +2025,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * counts, etc.
      *
      * @return the traversal with an appended {@link ProfileSideEffectStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#profile-step" target="_blank">Reference Documentation - Profile Step</a>
+     * @since 3.0.0-incubating
      */
     @Override
     public default GraphTraversal<S, TraversalMetrics> profile() {
@@ -2050,8 +2050,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * @param value       the value for the property
      * @param keyValues   any meta properties to be assigned to this property
      * @return the traversal with the last step modified to add a property
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#addproperty-step" target="_blank">AddProperty Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> property(final VertexProperty.Cardinality cardinality, final Object key, final Object value, final Object... keyValues) {
         if (null == cardinality)
@@ -2084,8 +2084,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * @param value     the value for the property
      * @param keyValues any meta properties to be assigned to this property
      * @return the traversal with the last step modified to add a property
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#addproperty-step" target="_blank">AddProperty Step</a>
+     * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> property(final Object key, final Object value, final Object... keyValues) {
         return key instanceof VertexProperty.Cardinality ?
@@ -2103,8 +2103,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param branchTraversal the traversal to branch the {@link Traverser} to
      * @return the {@link Traversal} with the {@link BranchStep} added
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#general-steps" target="_blank">Reference Documentation - General Steps</a>
+     * @since 3.0.0-incubating
      */
     public default <M, E2> GraphTraversal<S, E2> branch(final Traversal<?, M> branchTraversal) {
         this.asAdmin().getBytecode().addStep(Symbols.branch, branchTraversal);
@@ -2118,8 +2118,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param function the traversal to branch the {@link Traverser} to
      * @return the {@link Traversal} with the {@link BranchStep} added
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#general-steps" target="_blank">Reference Documentation - General Steps</a>
+     * @since 3.0.0-incubating
      */
     public default <M, E2> GraphTraversal<S, E2> branch(final Function<Traverser<E>, M> function) {
         this.asAdmin().getBytecode().addStep(Symbols.branch, function);
@@ -2135,8 +2135,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param choiceTraversal the traversal used to determine the value for the branch
      * @return the traversal with the appended {@link ChooseStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#choose-step" target="_blank">Reference Documentation - Choose Step</a>
+     * @since 3.0.0-incubating
      */
     public default <M, E2> GraphTraversal<S, E2> choose(final Traversal<?, M> choiceTraversal) {
         this.asAdmin().getBytecode().addStep(Symbols.choose, choiceTraversal);
@@ -2148,11 +2148,11 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * like semantics within a traversal.
      *
      * @param traversalPredicate the traversal used to determine the "if" portion of the if-then-else
-     * @param trueChoice the traversal to execute in the event the {@code traversalPredicate} returns true
-     * @param falseChoice the traversal to execute in the event the {@code traversalPredicate} returns false
+     * @param trueChoice         the traversal to execute in the event the {@code traversalPredicate} returns true
+     * @param falseChoice        the traversal to execute in the event the {@code traversalPredicate} returns false
      * @return the traversal with the appended {@link ChooseStep}
-     * @since 3.0.0-incubating
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#choose-step" target="_blank">Reference Documentation - Choose Step</a>
+     * @since 3.0.0-incubating
      */
     public default <E2> GraphTraversal<S, E2> choose(final Traversal<?, ?> traversalPredicate,
                                                      final Traversal<?, E2> trueChoice, final Traversal<?, E2> falseChoice) {
@@ -2165,10 +2165,10 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * like semantics within a traversal.
      *
      * @param traversalPredicate the traversal used to determine the "if" portion of the if-then-else
-     * @param trueChoice the traversal to execute in the event the {@code traversalPredicate} returns true
+     * @param trueChoice         the traversal to execute in the event the {@code traversalPredicate} returns true
      * @return the traversal with the appended {@link ChooseStep}
-     * @since 3.2.4
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#choose-step" target="_blank">Reference Documentation - Choose Step</a>
+     * @since 3.2.4
      */
     public default <E2> GraphTraversal<S, E2> choose(final Traversal<?, ?> traversalPredicate,
                                                      final Traversal<?, E2> trueChoice) {
@@ -2183,8 +2183,8 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param choiceFunction the function used to determine the value for the branch
      * @return the traversal with the appended {@link ChooseStep}
-     * @since 3.0.0-incubating
      * @see <a href="htt

<TRUNCATED>

[18/19] tinkerpop git commit: Merge branch 'TINKERPOP-1387' into tp32

Posted by ok...@apache.org.
Merge branch 'TINKERPOP-1387' into tp32


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

Branch: refs/heads/master
Commit: 2fedaace4f40e98a0175048f468e4f826b2550cf
Parents: a314c9c 38dc621
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Fri Mar 24 08:36:43 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Fri Mar 24 08:36:43 2017 -0600

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |   5 +
 docs/src/reference/the-traversal.asciidoc       |  58 +++
 .../upgrade/release-3.2.x-incubating.asciidoc   |  16 +
 .../gremlin/process/traversal/Path.java         |  57 +++
 .../traversal/dsl/graph/GraphTraversal.java     | 423 +++++++++----------
 .../traversal/step/FromToModulating.java        |  48 +++
 .../traversal/step/filter/CyclicPathStep.java   |  46 --
 .../traversal/step/filter/PathFilterStep.java   | 139 ++++++
 .../traversal/step/filter/SimplePathStep.java   |  47 ---
 .../process/traversal/step/map/AddEdgeStep.java |  19 +-
 .../process/traversal/step/map/PathStep.java    |  29 +-
 .../optimization/FilterRankingStrategy.java     |  38 +-
 .../IncidentToAdjacentStrategy.java             |   7 +-
 .../gremlin/process/traversal/PathTest.java     | 128 +++++-
 .../step/filter/CyclicPathStepTest.java         |  37 --
 .../step/filter/PathFilterStepTest.java         |  53 +++
 .../step/filter/SimplePathStepTest.java         |  37 --
 .../step/filter/GroovyCyclicPathTest.groovy     |   6 +
 .../step/filter/GroovySimplePathTest.groovy     |   5 +
 .../traversal/step/map/GroovyPathTest.groovy    |   5 +
 .../process/traversal/step/ComplexTest.java     |  49 ++-
 .../traversal/step/filter/CyclicPathTest.java   |  16 +-
 .../traversal/step/filter/SimplePathTest.java   |  29 +-
 .../process/traversal/step/map/PathTest.java    |  20 +
 24 files changed, 874 insertions(+), 443 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2fedaace/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --cc CHANGELOG.asciidoc
index 367e3cc,ab73263..ed26f7a
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@@ -26,16 -26,11 +26,21 @@@ image::https://raw.githubusercontent.co
  TinkerPop 3.2.5 (Release Date: NOT OFFICIALLY RELEASED YET)
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  
 +* De-registered metrics on Gremlin Server shutdown.
 +* Added "help" command option on `:remote config` for plugins that support that feature in the Gremlin Console.
 +* Allowed for multiple scripts and related arguments to be passed to `gremlin.sh` via `-i` and `-e`.
 +* Added various metrics to the `GremlinGroovyScriptEngine` around script compilation and exposed them in Gremlin Server.
 +* Moved the `caffeine` dependency down to `gremlin-groovy` and out of `gremlin-server`.
 +* Improved script compilation in `GremlinGroovyScriptEngine to use better caching, log long compile times and prevent failed compilations from recompiling on future requests.
 +* Script compilation is synchronised.
 +* Script compilation times are placed in to logs.
 +* Failed scripts will not be recompiled.
 +* Scripts that take over 5 seconds to compile are logged as a warning.
+ * Added `cyclicPath().from().to().by()` support to `GraphTraversal`.
+ * Added `simplePath().from().to().by()` support to `GraphTraversal`.
+ * Added `path().from().to()` support to `GraphTraversal` so sub-paths can be isolated from the current path.
+ * Added `FromToModulating` interface for use with `to()`- and `from()`-based step modulators.
+ * Added `Path.subPath()` which supports isolating a sub-path from `Path` via to/from-labels.
  * Fixed an `NullPointerException` in `GraphMLReader` that occurred when an `<edge>` didn't have an ID field and the base graph supported ID assignment.
  * Split `ComputerVerificationStrategy` into two strategies: `ComputerVerificationStrategy` and `ComputerFinalizationStrategy`.
  * Removed `HasTest.g_V_hasId_compilationEquality` from process test suite as it makes too many assumptions about provider compilation.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2fedaace/docs/src/reference/the-traversal.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2fedaace/docs/src/upgrade/release-3.2.x-incubating.asciidoc
----------------------------------------------------------------------
diff --cc docs/src/upgrade/release-3.2.x-incubating.asciidoc
index 79b1ac3,7fe1d84..fbe31bd
--- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc
+++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
@@@ -32,31 -32,13 +32,40 @@@ Please see the link:https://github.com/
  Upgrading for Users
  ~~~~~~~~~~~~~~~~~~~
  
 +GremlinScriptEngine Metrics
 +^^^^^^^^^^^^^^^^^^^^^^^^^^^
 +
 +The `GremlinScriptEngine` has a number of new metrics about its cache size and script compilation times which should
 +be helpful in understanding usage problems. As `GremlinScriptEngine` instances are used in Gremlin Server these metrics
 +are naturally exposed as part of the standard link:http://tinkerpop.apache.org/docs/current/reference/#_metrics[metrics]
 +set. Note that metrics are captured for both sessionless requests as well as for each individual session that is opened.
 +
 +See: https://issues.apache.org/jira/browse/TINKERPOP-1644[TINKERPOP-1644]
 +
 +Gremlin Console Scripting
 +^^^^^^^^^^^^^^^^^^^^^^^^^
 +
 +The `gremlin.sh` command has two flags, `-i` and `-e`, which are used to pass a script and arguments into the Gremlin
 +Console for execution. Those flags now allow for passing multiple scripts and related arguments to be supplied which
 +can yield greater flexibilty in automation tasks.
 +
 +[source,bash]
 +----
 +$ bin/gremlin.sh -i y.groovy 1 2 3 -i x.groovy
 +$ bin/gremlin.sh -e y.groovy 1 2 3 -e x.groovy
 +----
 +
 +See: link:https://issues.apache.org/jira/browse/TINKERPOP-1653[TINKERPOP-1653]
 +
+ simplePath(), cyclicPath(), and path() support by()-, from()-, to()-modulation
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 
+ It is now possible to extract analyze sub-paths using `from()` and `to()` modulations with respective, path-based steps.
+ Likewise, `simplePath()` and `cyclicPath()` now support, along with `from()` and `to()`, `by()`-modulation so the cyclicity
+ is determined by projections of the path data. This extension is fully backwards compatible.
+ 
++See: link:https://issues.apache.org/jira/browse/TINKERPOP-1387[TINKERPOP-1387]
++
  Gremlin-Python Driver
  ^^^^^^^^^^^^^^^^^^^^^
  Gremlin-Python now offers a more complete driver implementation that uses connection pooling and


[12/19] tinkerpop git commit: added @spmallette updates.

Posted by ok...@apache.org.
added @spmallette updates.


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

Branch: refs/heads/master
Commit: 28a05d74d1bee82264d302bf77198ed10165605f
Parents: a9c2f65
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Mar 16 10:53:49 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Mar 16 10:53:49 2017 -0600

----------------------------------------------------------------------
 docs/src/upgrade/release-3.2.x-incubating.asciidoc            | 7 +++++++
 .../org/apache/tinkerpop/gremlin/process/traversal/Path.java  | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/28a05d74/docs/src/upgrade/release-3.2.x-incubating.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.2.x-incubating.asciidoc b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
index a770ed8..7fe1d84 100644
--- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc
+++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
@@ -32,6 +32,13 @@ Please see the link:https://github.com/apache/tinkerpop/blob/3.2.5/CHANGELOG.asc
 Upgrading for Users
 ~~~~~~~~~~~~~~~~~~~
 
+simplePath(), cyclicPath(), and path() support by()-, from()-, to()-modulation
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+It is now possible to extract analyze sub-paths using `from()` and `to()` modulations with respective, path-based steps.
+Likewise, `simplePath()` and `cyclicPath()` now support, along with `from()` and `to()`, `by()`-modulation so the cyclicity
+is determined by projections of the path data. This extension is fully backwards compatible.
+
 Gremlin-Python Driver
 ^^^^^^^^^^^^^^^^^^^^^
 Gremlin-Python now offers a more complete driver implementation that uses connection pooling and

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/28a05d74/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java
index 3ad2613..91e0c05 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java
@@ -252,7 +252,7 @@ public interface Path extends Cloneable, Iterable<Object> {
             return this;
         else {
             Path subPath = MutablePath.make();
-            int size = this.size();
+            final int size = this.size();
             boolean record = false;
             for (int i = 0; i < size; i++) {
                 final Set<String> labels = this.labels().get(i);


[13/19] tinkerpop git commit: added to() and from() to the-traversal step documentation and then reference it with @see in GraphTraversal JavaDoc.

Posted by ok...@apache.org.
added to() and from() to the-traversal step documentation and then reference it with @see in GraphTraversal JavaDoc.


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

Branch: refs/heads/master
Commit: 9ffd250ba6f20c38bda402f561d514607b07632e
Parents: 28a05d7
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Mar 16 12:19:08 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Mar 16 12:19:08 2017 -0600

----------------------------------------------------------------------
 docs/src/reference/the-traversal.asciidoc         | 17 +++++++++++++++++
 .../traversal/dsl/graph/GraphTraversal.java       | 18 ++++++++++--------
 2 files changed, 27 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9ffd250b/docs/src/reference/the-traversal.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc
index c333373..31c0621 100644
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@ -716,6 +716,14 @@ g.V().has('name', within('marko', 'vadas', 'josh')).as('person').
 <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.
 
+[[from-step]]
+From Step
+~~~~~~~~~
+
+The `from()`-step is not an actual step, but instead is a "step-modulator" similar to <<as-step,`as()`>> and
+<<by-step,`by()`>>. If a step is able to accept traversals or strings then `from()` is the
+means by which they are added. The general pattern is `step().from()`. See <<to-step,`to()`>>-step.
+
 [[group-step]]
 Group Step
 ~~~~~~~~~~
@@ -2194,6 +2202,15 @@ note that the internal clock of `timeLimit()`-step starts when the first travers
 reached, any `next()` evaluation of the step will yield a `NoSuchElementException` and any `hasNext()` evaluation will
 yield `false`.
 
+[[to-step]]
+To Step
+~~~~~~~
+
+The `to()`-step is not an actual step, but instead is a "step-modulator" similar to <<as-step,`as()`>> and
+<<by-step,`by()`>>. If a step is able to accept traversals or strings then `to()` is the
+means by which they are added. The general pattern is `step().to()`. See <<from-step,`from()`>>-step.
+
+
 [[tree-step]]
 Tree Step
 ~~~~~~~~~

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9ffd250b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
index 0b95479..bde1dea 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
@@ -1028,11 +1028,11 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
     }
 
     /**
-     * When used as a modifier to {@link #addE(String)} this method specifies the step label to use for selecting the
-     * incoming vertex of the newly added {@link Edge}.
+     * Provide {@code to()}-modulation to respective steps.
      *
-     * @param toStepLabel the step label of the incoming vertex
-     * @return the traversal with the modified {@link AddEdgeStep}
+     * @param toStepLabel the step label to modulate to.
+     * @return the traversal with the modified {@link FromToModulating} step.
+     * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#to-step" target="_blank">Reference Documentation - To Step</a>
      * @since 3.1.0-incubating
      */
     public default GraphTraversal<S, E> to(final String toStepLabel) {
@@ -1042,11 +1042,11 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
     }
 
     /**
-     * When used as a modifier to {@link #addE(String)} this method specifies the step label to use for selecting the
-     * outgoing vertex of the newly added {@link Edge}.
+     * Provide {@code from()}-modulation to respective steps.
      *
-     * @param fromStepLabel the step label of the outgoing vertex
-     * @return the traversal with the modified {@link AddEdgeStep}
+     * @param fromStepLabel the step label to modulate to.
+     * @return the traversal with the modified {@link FromToModulating} step.
+     * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#from-step" target="_blank">Reference Documentation - From Step</a>
      * @since 3.1.0-incubating
      */
     public default GraphTraversal<S, E> from(final String fromStepLabel) {
@@ -1061,6 +1061,7 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param toVertex the traversal for selecting the incoming vertex
      * @return the traversal with the modified {@link AddEdgeStep}
+     * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#addedge-step" target="_blank">Reference Documentation - From Step</a>
      * @since 3.1.0-incubating
      */
     public default GraphTraversal<S, E> to(final Traversal<E, Vertex> toVertex) {
@@ -1075,6 +1076,7 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      *
      * @param fromVertex the traversal for selecting the outgoing vertex
      * @return the traversal with the modified {@link AddEdgeStep}
+     * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#addedge-step" target="_blank">Reference Documentation - From Step</a>
      * @since 3.1.0-incubating
      */
     public default GraphTraversal<S, E> from(final Traversal<E, Vertex> fromVertex) {


[10/19] tinkerpop git commit: renamed Path.getSubPath() to Path.subPath() as its in the fluent style of operations on Path.

Posted by ok...@apache.org.
renamed Path.getSubPath() to Path.subPath() as its in the fluent style of operations on Path.


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

Branch: refs/heads/master
Commit: 718a29bb6ff5a2f5294cd3629b616fb615bc3e15
Parents: 9155c46
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Mar 16 10:07:30 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Mar 16 10:07:30 2017 -0600

----------------------------------------------------------------------
 .../tinkerpop/gremlin/process/traversal/Path.java   |  2 +-
 .../traversal/step/filter/PathFilterStep.java       |  2 +-
 .../process/traversal/step/map/PathStep.java        |  2 +-
 .../gremlin/process/traversal/PathTest.java         | 16 ++++++++--------
 4 files changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/718a29bb/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java
index d231a52..3ad2613 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java
@@ -247,7 +247,7 @@ public interface Path extends Cloneable, Iterable<Object> {
      * @param toLabel   The label to end recording the sub-path to.
      * @return the isolated sub-path.
      */
-    public default Path getSubPath(final String fromLabel, final String toLabel) {
+    public default Path subPath(final String fromLabel, final String toLabel) {
         if (null == fromLabel && null == toLabel)
             return this;
         else {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/718a29bb/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/PathFilterStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/PathFilterStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/PathFilterStep.java
index b9583fa..4fe5953 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/PathFilterStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/PathFilterStep.java
@@ -55,7 +55,7 @@ public final class PathFilterStep<S> extends FilterStep<S> implements FromToModu
 
     @Override
     protected boolean filter(final Traverser.Admin<S> traverser) {
-        final Path path = traverser.path().getSubPath(this.fromLabel, this.toLabel);
+        final Path path = traverser.path().subPath(this.fromLabel, this.toLabel);
         if (this.traversalRing.isEmpty())
             return path.isSimple() == this.isSimple;
         else {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/718a29bb/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PathStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PathStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PathStep.java
index 6b030f9..2c96261 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PathStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PathStep.java
@@ -51,7 +51,7 @@ public final class PathStep<S> extends MapStep<S, Path> implements TraversalPare
 
     @Override
     protected Path map(final Traverser.Admin<S> traverser) {
-        final Path path = traverser.path().getSubPath(this.fromLabel, this.toLabel);
+        final Path path = traverser.path().subPath(this.fromLabel, this.toLabel);
         if (this.traversalRing.isEmpty())
             return path;
         else {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/718a29bb/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/PathTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/PathTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/PathTest.java
index 1f7ec85..590ce69 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/PathTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/PathTest.java
@@ -392,7 +392,7 @@ public class PathTest {
             assertEquals(4, path.objects().size());
             assertEquals(4, path.labels().size());
             ///
-            Path subPath = path.getSubPath("b", "c");
+            Path subPath = path.subPath("b", "c");
             assertEquals(2, subPath.size());
             assertEquals(2, subPath.objects().size());
             assertEquals(2, subPath.labels().size());
@@ -404,19 +404,19 @@ public class PathTest {
             assertTrue(subPath.labels().get(1).contains("x"));
             assertEquals(2, subPath.labels().get(1).size());
             ///
-            subPath = path.getSubPath("b", "b");
+            subPath = path.subPath("b", "b");
             assertEquals(1, subPath.size());
             assertEquals(1, subPath.objects().size());
             assertEquals(1, subPath.labels().size());
             assertEquals("stephen", subPath.objects().get(0));
             ///
-            subPath = path.getSubPath("b", "b");
+            subPath = path.subPath("b", "b");
             assertEquals(1, subPath.size());
             assertEquals(1, subPath.objects().size());
             assertEquals(1, subPath.labels().size());
             assertEquals("stephen", subPath.objects().get(0));
             ///
-            subPath = path.getSubPath("c", "d");
+            subPath = path.subPath("c", "d");
             assertEquals(2, subPath.size());
             assertEquals(2, subPath.objects().size());
             assertEquals(2, subPath.labels().size());
@@ -428,27 +428,27 @@ public class PathTest {
             assertTrue(subPath.labels().get(1).contains("d"));
             assertEquals(1, subPath.labels().get(1).size());
             ///
-            subPath = path.getSubPath("a","d");
+            subPath = path.subPath("a","d");
             assertEquals(4, subPath.size());
             assertEquals(4, subPath.objects().size());
             assertEquals(4, subPath.labels().size());
             ///
             try {
-                subPath = path.getSubPath("d", "a");
+                subPath = path.subPath("d", "a");
                 fail("Path labels must be ordered along path");
             } catch (final IllegalArgumentException e) {
                 assertTrue(true);
             }
             ///
             try {
-                subPath = path.getSubPath("a", "e");
+                subPath = path.subPath("a", "e");
                 fail("End path label was not found");
             } catch (final IllegalArgumentException e) {
                 assertEquals(Path.Exceptions.couldNotLocalPathToLabel("e").getMessage(), e.getMessage());
             }
             ///
             try {
-                subPath = path.getSubPath("e", "b");
+                subPath = path.subPath("e", "b");
                 fail("Start path label was not found");
             } catch (final IllegalArgumentException e) {
                 assertEquals(Path.Exceptions.couldNotLocalPathFromLabel("e").getMessage(), e.getMessage());


[08/19] tinkerpop git commit: added test support for simplePath() and cyclicPath() by()/to()/from(). Really cool. Works great and makes sense. Updated this-traversal.asciidoc with examples.

Posted by ok...@apache.org.
added test support for simplePath() and cyclicPath() by()/to()/from(). Really cool. Works great and makes sense. Updated this-traversal.asciidoc with examples.


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

Branch: refs/heads/master
Commit: 35ecf8c0f56139953187769ee719c95b66cfa477
Parents: 8ec49c4
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Mar 16 10:03:28 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Mar 16 10:03:28 2017 -0600

----------------------------------------------------------------------
 docs/src/reference/the-traversal.asciidoc       | 10 ++++++
 .../gremlin/process/traversal/Path.java         |  7 ++--
 .../traversal/step/filter/PathFilterStep.java   |  3 +-
 .../process/traversal/step/map/PathStep.java    |  2 +-
 .../optimization/FilterRankingStrategy.java     | 37 ++++----------------
 .../gremlin/process/traversal/PathTest.java     | 17 +++++++++
 .../step/filter/GroovySimplePathTest.groovy     |  5 +++
 .../traversal/step/filter/SimplePathTest.java   | 29 +++++++++++++--
 8 files changed, 71 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/35ecf8c0/docs/src/reference/the-traversal.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc
index 75d740f..c333373 100644
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@ -2032,6 +2032,16 @@ objects in it, the traverser is filtered. If cyclic behavior is desired, see <<c
 g.V(1).both().both()
 g.V(1).both().both().simplePath()
 g.V(1).both().both().simplePath().path()
+g.V().out().as('a').out().as('b').out().as('c').
+  simplePath().by(label).
+  path()
+g.V().out().as('a').out().as('b').out().as('c').
+  simplePath().
+    by(label).
+    from('b').
+    to('c').
+  path().
+    by('name')
 ----
 
 [[store-step]]

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/35ecf8c0/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java
index cefe7d9..d231a52 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java
@@ -252,18 +252,19 @@ public interface Path extends Cloneable, Iterable<Object> {
             return this;
         else {
             Path subPath = MutablePath.make();
-            boolean record = false;
             int size = this.size();
+            boolean record = false;
             for (int i = 0; i < size; i++) {
                 final Set<String> labels = this.labels().get(i);
-                if (labels.contains(fromLabel) || null == fromLabel)
+                if (!record && (labels.contains(fromLabel) || null == fromLabel))
                     record = true;
                 if (record)
                     subPath = subPath.extend(this.get(i), labels);
                 if (labels.contains(toLabel)) {
                     if (!record)
                         throw Path.Exceptions.couldNotLocalPathFromLabel(fromLabel);
-                    return subPath;
+                    else
+                        return subPath;
                 }
             }
             if (null == toLabel)

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/35ecf8c0/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/PathFilterStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/PathFilterStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/PathFilterStep.java
index e8e0607..b9583fa 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/PathFilterStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/PathFilterStep.java
@@ -56,14 +56,13 @@ public final class PathFilterStep<S> extends FilterStep<S> implements FromToModu
     @Override
     protected boolean filter(final Traverser.Admin<S> traverser) {
         final Path path = traverser.path().getSubPath(this.fromLabel, this.toLabel);
-        this.traversalRing.reset();
         if (this.traversalRing.isEmpty())
             return path.isSimple() == this.isSimple;
         else {
+            this.traversalRing.reset();
             final Path byPath = MutablePath.make();
             path.forEach((object, labels) -> byPath.extend(TraversalUtil.applyNullable(object, this.traversalRing.next()), labels));
             return byPath.isSimple() == this.isSimple;
-
         }
     }
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/35ecf8c0/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PathStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PathStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PathStep.java
index 06ff947..6b030f9 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PathStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PathStep.java
@@ -52,10 +52,10 @@ public final class PathStep<S> extends MapStep<S, Path> implements TraversalPare
     @Override
     protected Path map(final Traverser.Admin<S> traverser) {
         final Path path = traverser.path().getSubPath(this.fromLabel, this.toLabel);
-        this.traversalRing.reset();
         if (this.traversalRing.isEmpty())
             return path;
         else {
+            this.traversalRing.reset();
             final Path byPath = MutablePath.make();
             path.forEach((object, labels) -> byPath.extend(TraversalUtil.applyNullable(object, this.traversalRing.next()), labels));
             return byPath;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/35ecf8c0/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
index 6ca676a..bec2502 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
@@ -32,7 +32,6 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.filter.HasStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.IsStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.NotStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.OrStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.filter.PathFilterStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilterStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.WherePredicateStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.WhereTraversalStep;
@@ -48,26 +47,6 @@ import java.util.Set;
  * FilterRankingStrategy reorders filter- and order-steps according to their rank. It will also do its best to push
  * step labels as far "right" as possible in order to keep traversers as small and bulkable as possible prior to the
  * absolute need for path-labeling.
- * <p/>
- * <table>
- * <thead>
- * <tr><th>Step</th><th>Rank</th></tr>
- * </thead>
- * <tbody>
- * <tr><td>is(predicate)</td><td>1</td></tr>
- * <tr><td>has(predicate)</td><td>2</td></tr>
- * <tr><td>where(predicate)</td><td>3</td></tr>
- * <tr><td>simplePath()</td><td>4</td></tr>
- * <tr><td>cyclicPath()</td><td>4</td></tr>
- * <tr><td>filter(traversal)</td><td>5</td></tr>
- * <tr><td>not(traversal)</td>td>5</td></tr>
- * <tr><td>where(traversal)</td><td>6</td></tr>
- * <tr><td>or(...)</td><td>7</td></tr>
- * <tr><td>and(...)</td><td>8</td></tr>
- * <tr><td>dedup()</td><td>9</td></tr>
- * <tr><td>order()</td><td>10</td></tr>
- * </tbody>
- * </table>
  *
  * @author Daniel Kuppitz (http://gremlin.guru)
  * @author Marko A. Rodriguez (http://markorodriguez.com)
@@ -128,22 +107,20 @@ public final class FilterRankingStrategy extends AbstractTraversalStrategy<Trave
             rank = 2;
         else if (step instanceof WherePredicateStep && ((WherePredicateStep) step).getLocalChildren().isEmpty())
             rank = 3;
-        else if (step instanceof PathFilterStep)
-            rank = 4;
         else if (step instanceof TraversalFilterStep || step instanceof NotStep)
-            rank = 5;
+            rank = 4;
         else if (step instanceof WhereTraversalStep)
-            rank = 6;
+            rank = 5;
         else if (step instanceof OrStep)
-            rank = 7;
+            rank = 6;
         else if (step instanceof AndStep)
-            rank = 8;
+            rank = 7;
         else if (step instanceof WherePredicateStep) // has by()-modulation
-            rank = 9;
+            rank = 8;
         else if (step instanceof DedupGlobalStep)
-            rank = 10;
+            rank = 9;
         else if (step instanceof OrderGlobalStep)
-            rank = 11;
+            rank = 10;
         else
             return 0;
         ////////////

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/35ecf8c0/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/PathTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/PathTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/PathTest.java
index 1d21074..1f7ec85 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/PathTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/PathTest.java
@@ -416,6 +416,23 @@ public class PathTest {
             assertEquals(1, subPath.labels().size());
             assertEquals("stephen", subPath.objects().get(0));
             ///
+            subPath = path.getSubPath("c", "d");
+            assertEquals(2, subPath.size());
+            assertEquals(2, subPath.objects().size());
+            assertEquals(2, subPath.labels().size());
+            assertEquals("matthias", subPath.objects().get(0));
+            assertEquals("bob", subPath.objects().get(1));
+            assertTrue(subPath.labels().get(0).contains("c"));
+            assertTrue(subPath.labels().get(0).contains("x"));
+            assertEquals(2, subPath.labels().get(0).size());
+            assertTrue(subPath.labels().get(1).contains("d"));
+            assertEquals(1, subPath.labels().get(1).size());
+            ///
+            subPath = path.getSubPath("a","d");
+            assertEquals(4, subPath.size());
+            assertEquals(4, subPath.objects().size());
+            assertEquals(4, subPath.labels().size());
+            ///
             try {
                 subPath = path.getSubPath("d", "a");
                 fail("Path labels must be ordered along path");

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/35ecf8c0/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovySimplePathTest.groovy
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovySimplePathTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovySimplePathTest.groovy
index e1206df..e0d813f 100644
--- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovySimplePathTest.groovy
+++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovySimplePathTest.groovy
@@ -39,5 +39,10 @@ public abstract class GroovySimplePathTest {
         public Traversal<Vertex, Path> get_g_V_repeatXboth_simplePathX_timesX3X_path() {
             new ScriptTraversal<>(g, "gremlin-groovy", "g.V.repeat(__.both.simplePath).times(3).path()");
         }
+
+        @Override
+        public Traversal<Vertex, Path> get_g_V_asXaX_out_asXbX_out_asXcX_simplePath_byXlabelX_fromXbX_toXcX_path_byXnameX() {
+            new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').out.as('b').out.as('c').simplePath.by(label).from('b').to('c').path.by('name')")
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/35ecf8c0/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/SimplePathTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/SimplePathTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/SimplePathTest.java
index 7e2d8d3..f51478e 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/SimplePathTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/SimplePathTest.java
@@ -23,14 +23,20 @@ import org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest;
 import org.apache.tinkerpop.gremlin.process.GremlinProcessRunner;
 import org.apache.tinkerpop.gremlin.process.traversal.Path;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.MutablePath;
+import org.apache.tinkerpop.gremlin.structure.T;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+import java.util.Arrays;
+import java.util.Collections;
+
 import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData.MODERN;
-import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.*;
-import static org.junit.Assert.*;
+import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.both;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
@@ -42,6 +48,8 @@ public abstract class SimplePathTest extends AbstractGremlinProcessTest {
 
     public abstract Traversal<Vertex, Path> get_g_V_repeatXboth_simplePathX_timesX3X_path();
 
+    public abstract Traversal<Vertex, Path> get_g_V_asXaX_out_asXbX_out_asXcX_simplePath_byXlabelX_fromXbX_toXcX_path_byXnameX();
+
     @Test
     @LoadGraphWith(MODERN)
     public void g_VX1X_outXcreatedX_inXcreatedX_simplePath() {
@@ -71,6 +79,16 @@ public abstract class SimplePathTest extends AbstractGremlinProcessTest {
         assertFalse(traversal.hasNext());
     }
 
+    @Test
+    @LoadGraphWith(MODERN)
+    public void g_V_asXaX_out_asXbX_out_asXcX_simplePath_byXlabelX_fromXbX_toXcX_path_byXnameX() {
+        final Traversal<Vertex, Path> traversal = get_g_V_asXaX_out_asXbX_out_asXcX_simplePath_byXlabelX_fromXbX_toXcX_path_byXnameX();
+        printTraversalForm(traversal);
+        checkResults(Arrays.asList(
+                MutablePath.make().extend("marko", Collections.singleton("a")).extend("josh", Collections.singleton("b")).extend("ripple", Collections.singleton("c")),
+                MutablePath.make().extend("marko", Collections.singleton("a")).extend("josh", Collections.singleton("b")).extend("lop", Collections.singleton("c"))), traversal);
+    }
+
     public static class Traversals extends SimplePathTest {
         @Override
         public Traversal<Vertex, Vertex> get_g_VX1X_outXcreatedX_inXcreatedX_simplePath(final Object v1Id) {
@@ -82,5 +100,10 @@ public abstract class SimplePathTest extends AbstractGremlinProcessTest {
         public Traversal<Vertex, Path> get_g_V_repeatXboth_simplePathX_timesX3X_path() {
             return g.V().repeat(both().simplePath()).times(3).path();
         }
+
+        @Override
+        public Traversal<Vertex, Path> get_g_V_asXaX_out_asXbX_out_asXcX_simplePath_byXlabelX_fromXbX_toXcX_path_byXnameX() {
+            return g.V().as("a").out().as("b").out().as("c").simplePath().by(T.label).from("b").to("c").path().by("name");
+        }
     }
 }


[14/19] tinkerpop git commit: updated Path.subGraph() so the semantics are Pop.last like select, match, where, etc. Smart @dkuppitz.

Posted by ok...@apache.org.
updated Path.subGraph() so the semantics are Pop.last like select, match, where, etc. Smart @dkuppitz.


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

Branch: refs/heads/master
Commit: 9160573a7aeda2480903b1e3b31f3eaea5944038
Parents: 9ffd250
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Mar 23 09:49:45 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Mar 23 09:49:45 2017 -0600

----------------------------------------------------------------------
 .../gremlin/process/traversal/Path.java         | 49 +++++++++++++-------
 .../gremlin/process/traversal/PathTest.java     | 18 +++++--
 2 files changed, 46 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9160573a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java
index 91e0c05..1119775 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java
@@ -242,6 +242,8 @@ public interface Path extends Cloneable, Iterable<Object> {
     /**
      * Isolate a sub-path from the path object. The isolation is based solely on the path labels.
      * The to-label is inclusive. Thus, from "b" to "c" would isolate the example path as follows {@code a,[b,c],d}.
+     * Note that if there are multiple path segments with the same label, then its the last occurrence that is isolated.
+     * For instance, from "b" to "c" would be {@code a,b,[b,c,d,c]}.
      *
      * @param fromLabel The label to start recording the sub-path from.
      * @param toLabel   The label to end recording the sub-path to.
@@ -253,24 +255,31 @@ public interface Path extends Cloneable, Iterable<Object> {
         else {
             Path subPath = MutablePath.make();
             final int size = this.size();
-            boolean record = false;
-            for (int i = 0; i < size; i++) {
+            int fromIndex = -1;
+            int toIndex = -1;
+            for (int i = size - 1; i >= 0; i--) {
                 final Set<String> labels = this.labels().get(i);
-                if (!record && (labels.contains(fromLabel) || null == fromLabel))
-                    record = true;
-                if (record)
-                    subPath = subPath.extend(this.get(i), labels);
-                if (labels.contains(toLabel)) {
-                    if (!record)
-                        throw Path.Exceptions.couldNotLocalPathFromLabel(fromLabel);
-                    else
-                        return subPath;
-                }
+                if (-1 == fromIndex && labels.contains(fromLabel))
+                    fromIndex = i;
+                if (-1 == toIndex && labels.contains(toLabel))
+                    toIndex = i;
+            }
+            if (null != fromLabel && -1 == fromIndex)
+                throw Path.Exceptions.couldNotLocatePathFromLabel(fromLabel);
+            if (null != toLabel && -1 == toIndex)
+                throw Path.Exceptions.couldNotLocatePathToLabel(toLabel);
+
+            if (fromIndex == -1)
+                fromIndex = 0;
+            if (toIndex == -1)
+                toIndex = size-1;
+            if (fromIndex > toIndex)
+                throw Path.Exceptions.couldNotIsolatedSubPath(fromLabel, toLabel);
+            for (int i = fromIndex; i <= toIndex; i++) {
+                final Set<String> labels = this.labels().get(i);
+                subPath.extend(this.get(i), labels);
             }
-            if (null == toLabel)
-                return subPath;
-            else
-                throw Path.Exceptions.couldNotLocalPathToLabel(toLabel);
+            return subPath;
         }
     }
 
@@ -280,12 +289,16 @@ public interface Path extends Cloneable, Iterable<Object> {
             return new IllegalArgumentException("The step with label " + label + " does not exist");
         }
 
-        public static IllegalArgumentException couldNotLocalPathFromLabel(final String fromLabel) {
+        public static IllegalArgumentException couldNotLocatePathFromLabel(final String fromLabel) {
             return new IllegalArgumentException("Could not locate path from-label: " + fromLabel);
         }
 
-        public static IllegalArgumentException couldNotLocalPathToLabel(final String toLabel) {
+        public static IllegalArgumentException couldNotLocatePathToLabel(final String toLabel) {
             return new IllegalArgumentException("Could not locate path to-label: " + toLabel);
         }
+
+        public static IllegalArgumentException couldNotIsolatedSubPath(final String fromLabel, final String toLabel) {
+            return new IllegalArgumentException("Could not isolate path because from comes after to: " + fromLabel + "->" + toLabel);
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9160573a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/PathTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/PathTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/PathTest.java
index 590ce69..ce21732 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/PathTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/PathTest.java
@@ -428,6 +428,18 @@ public class PathTest {
             assertTrue(subPath.labels().get(1).contains("d"));
             assertEquals(1, subPath.labels().get(1).size());
             ///
+            subPath = path.subPath("c",null);
+            assertEquals(2, subPath.size());
+            assertEquals(2, subPath.objects().size());
+            assertEquals(2, subPath.labels().size());
+            assertEquals("matthias", subPath.objects().get(0));
+            assertEquals("bob", subPath.objects().get(1));
+            assertTrue(subPath.labels().get(0).contains("c"));
+            assertTrue(subPath.labels().get(0).contains("x"));
+            assertEquals(2, subPath.labels().get(0).size());
+            assertTrue(subPath.labels().get(1).contains("d"));
+            assertEquals(1, subPath.labels().get(1).size());
+            ///
             subPath = path.subPath("a","d");
             assertEquals(4, subPath.size());
             assertEquals(4, subPath.objects().size());
@@ -437,21 +449,21 @@ public class PathTest {
                 subPath = path.subPath("d", "a");
                 fail("Path labels must be ordered along path");
             } catch (final IllegalArgumentException e) {
-                assertTrue(true);
+                assertEquals(Path.Exceptions.couldNotIsolatedSubPath("d","a").getMessage(), e.getMessage());
             }
             ///
             try {
                 subPath = path.subPath("a", "e");
                 fail("End path label was not found");
             } catch (final IllegalArgumentException e) {
-                assertEquals(Path.Exceptions.couldNotLocalPathToLabel("e").getMessage(), e.getMessage());
+                assertEquals(Path.Exceptions.couldNotLocatePathToLabel("e").getMessage(), e.getMessage());
             }
             ///
             try {
                 subPath = path.subPath("e", "b");
                 fail("Start path label was not found");
             } catch (final IllegalArgumentException e) {
-                assertEquals(Path.Exceptions.couldNotLocalPathFromLabel("e").getMessage(), e.getMessage());
+                assertEquals(Path.Exceptions.couldNotLocatePathFromLabel("e").getMessage(), e.getMessage());
             }
         });
     }


[19/19] tinkerpop git commit: Merge branch 'tp32'

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


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

Branch: refs/heads/master
Commit: bbe337765d899bd3815d3f92585e5ba54ebb49cd
Parents: 78851d7 2fedaac
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Fri Mar 24 08:41:34 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Fri Mar 24 08:41:34 2017 -0600

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |   5 +
 docs/src/reference/the-traversal.asciidoc       |  58 +++
 .../upgrade/release-3.2.x-incubating.asciidoc   |  16 +
 .../gremlin/process/traversal/Path.java         |  57 +++
 .../traversal/dsl/graph/GraphTraversal.java     | 423 +++++++++----------
 .../traversal/step/FromToModulating.java        |  48 +++
 .../traversal/step/filter/CyclicPathStep.java   |  46 --
 .../traversal/step/filter/PathFilterStep.java   | 139 ++++++
 .../traversal/step/filter/SimplePathStep.java   |  47 ---
 .../process/traversal/step/map/AddEdgeStep.java |  19 +-
 .../process/traversal/step/map/PathStep.java    |  29 +-
 .../optimization/FilterRankingStrategy.java     |  38 +-
 .../IncidentToAdjacentStrategy.java             |   7 +-
 .../gremlin/process/traversal/PathTest.java     | 128 +++++-
 .../step/filter/CyclicPathStepTest.java         |  37 --
 .../step/filter/PathFilterStepTest.java         |  53 +++
 .../step/filter/SimplePathStepTest.java         |  37 --
 .../process/traversal/step/ComplexTest.java     |  49 ++-
 .../traversal/step/filter/CyclicPathTest.java   |  16 +-
 .../traversal/step/filter/SimplePathTest.java   |  29 +-
 .../process/traversal/step/map/PathTest.java    |  20 +
 21 files changed, 858 insertions(+), 443 deletions(-)
----------------------------------------------------------------------


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

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bbe33776/docs/src/reference/the-traversal.asciidoc
----------------------------------------------------------------------
diff --cc docs/src/reference/the-traversal.asciidoc
index eea606e,b0db605..d381d4e
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@@ -2033,37 -2051,41 +2049,70 @@@ objects in it, the traverser is filtere
  g.V(1).both().both()
  g.V(1).both().both().simplePath()
  g.V(1).both().both().simplePath().path()
- ----
+ g.V().out().as('a').out().as('b').out().as('c').
+   simplePath().by(label).
+   path()
+ g.V().out().as('a').out().as('b').out().as('c').
+   simplePath().
+     by(label).
+     from('b').
+     to('c').
+   path().
+     by('name')
+ ----
+ 
+ By using the `from()` and `to()` modulators traversers can ensure that only certain sections of the path are are acyclic.
+ 
+ [gremlin-grovvy]
+ ----
 -g.addV().property(id, "A").as("a").
 -  addV().property(id, "B").as("b").
 -  addV().property(id, "C").as("c").
 -  addV().property(id, "D").as("d").
 -  addE("link").from("a").to("b").
 -  addE("link").from("b").to("c").
 -  addE("link").from("c").to("d").iterate()
 -g.V("A").repeat(both().simplePath()).times(3).path()  <1>
 -g.V("D").repeat(both().simplePath()).times(3).path()  <2>
 -g.V("A").as("a").
 -  repeat(both().simplePath().from("a")).times(3).as("b").
 -  repeat(both().simplePath().from("b")).times(3).path()  <3>
++g.addV().property(id, 'A').as('a').
++  addV().property(id, 'B').as('b').
++  addV().property(id, 'C').as('c').
++  addV().property(id, 'D').as('d').
++  addE('link').from('a').to('b').
++  addE('link').from('b').to('c').
++  addE('link').from('c').to('d').iterate()
++g.V('A').repeat(both().simplePath()).times(3).path()  <1>
++g.V('D').repeat(both().simplePath()).times(3).path()  <2>
++g.V('A').as('a').
++  repeat(both().simplePath().from('a')).times(3).as('b').
++  repeat(both().simplePath().from('b')).times(3).path()  <3>
+ ----
+ 
+ <1> Traverse all acyclic 3-hop paths starting from vertex `A`
+ <2> Traverse all acyclic 3-hop paths starting from vertex `D`
+ <3> Traverse all acyclic 3-hop paths starting from vertex `A` and from there again all 3-hop paths. The second path may
+ cross the vertices from the first path.
  
 +[[skip-step]]
 +Skip Step
 +~~~~~~~~~
 +
 +The `skip()`-step is analogous to <<range-step,`range()`-step>> save that the higher end range is set to -1.
 +
 +[gremlin-groovy,modern]
 +----
 +g.V().values('age').order()
 +g.V().values('age').order().skip(2)
 +g.V().values('age').order().range(2, -1)
 +----
 +
 +The `skip()`-step can also be applied with `Scope.local`, in which case it operates on the incoming collection.
 +
 +[gremlin-groovy,modern]
 +----
 +g.V().hasLabel('person').filter(outE('created')).as('p'). <1>
 +  map(out('created').values('name').fold()).
 +  project('person','primary','other').
 +    by(select('p').by('name')).
 +    by(limit(local, 1)). <2>
 +    by(skip(local, 1)) <3>
 +----
 +
 +<1> For each person who created something...
 +<2> ...select the first project (random order) as `primary` and...
 +<3> ...select all other projects as `other`.
 +
  [[store-step]]
  Store Step
  ~~~~~~~~~~

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bbe33776/docs/src/upgrade/release-3.2.x-incubating.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bbe33776/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bbe33776/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
----------------------------------------------------------------------
diff --cc gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
index 66362eb,bde1dea..6ca6a3e
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
@@@ -564,10 -563,10 +564,10 @@@ public interface GraphTraversal<S, E> e
       * @param propertyKeys  the properties to retrieve
       * @param <E2>          the value type of the returned properties
       * @return the traversal with an appended {@link PropertyMapStep}.
-      * @since 3.0.0-incubating
       * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#valuemap-step" target="_blank">Reference Documentation - ValueMap Step</a>
+      * @since 3.0.0-incubating
       */
 -    public default <E2> GraphTraversal<S, Map<String, E2>> valueMap(final boolean includeTokens, final String... propertyKeys) {
 +    public default <E2> GraphTraversal<S, Map<Object, E2>> valueMap(final boolean includeTokens, final String... propertyKeys) {
          this.asAdmin().getBytecode().addStep(Symbols.valueMap, includeTokens, propertyKeys);
          return this.asAdmin().addStep(new PropertyMapStep<>(this.asAdmin(), includeTokens, PropertyType.VALUE, propertyKeys));
      }
@@@ -2429,12 -2373,11 +2426,12 @@@
       * Calculates a PageRank over the graph using a 0.85 for the {@code alpha} value.
       *
       * @return the traversal with the appended {@link PageRankVertexProgramStep}
-      * @since 3.2.0-incubating
       * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#pagerank-step" target="_blank">Reference Documentation - PageRank Step</a>
+      * @since 3.2.0-incubating
       */
      public default GraphTraversal<S, E> pageRank() {
 -        return this.pageRank(0.85d);
 +        this.asAdmin().getBytecode().addStep(Symbols.pageRank);
 +        return this.asAdmin().addStep((Step<E, E>) new PageRankVertexProgramStep(this.asAdmin(), 0.85d));
      }
  
      /**
@@@ -2500,12 -2443,11 +2497,12 @@@
       * {@code Integer.MAX_VALUE}.
       *
       * @return the traversal with an appended {@link NoOpBarrierStep}
-      * @since 3.0.0-incubating
       * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#barrier-step" target="_blank">Reference Documentation - Barrier Step</a>
+      * @since 3.0.0-incubating
       */
      public default GraphTraversal<S, E> barrier() {
 -        return this.barrier(Integer.MAX_VALUE);
 +        this.asAdmin().getBytecode().addStep(Symbols.barrier);
 +        return this.asAdmin().addStep(new NoOpBarrierStep<>(this.asAdmin(), Integer.MAX_VALUE));
      }
  
      /**
@@@ -2699,15 -2641,15 +2696,15 @@@
      /**
       * This step modifies {@link #choose(Function)} to specifies the available choices that might be executed.
       *
-      * @param pickToken the token that would trigger this option
+      * @param pickToken       the token that would trigger this option
       * @param traversalOption the option as a traversal
       * @return the traversal with the modulated step
-      * @since 3.0.0-incubating
       * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#choose-step" target="_blank">Reference Documentation - Choose Step</a>
+      * @since 3.0.0-incubating
       */
 -    public default <M, E2> GraphTraversal<S, E> option(final M pickToken, final Traversal<E, E2> traversalOption) {
 +    public default <M, E2> GraphTraversal<S, E> option(final M pickToken, final Traversal<?, E2> traversalOption) {
          this.asAdmin().getBytecode().addStep(Symbols.option, pickToken, traversalOption);
 -        ((TraversalOptionParent<M, E, E2>) this.asAdmin().getEndStep()).addGlobalChildOption(pickToken, traversalOption.asAdmin());
 +        ((TraversalOptionParent<M, E, E2>) this.asAdmin().getEndStep()).addGlobalChildOption(pickToken, (Traversal.Admin<E, E2>) traversalOption.asAdmin());
          return this;
      }
  
@@@ -2716,13 -2658,12 +2713,13 @@@
       *
       * @param traversalOption the option as a traversal
       * @return the traversal with the modulated step
-      * @since 3.0.0-incubating
       * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#choose-step" target="_blank">Reference Documentation - Choose Step</a>
+      * @since 3.0.0-incubating
       */
 -    public default <E2> GraphTraversal<S, E> option(final Traversal<E, E2> traversalOption) {
 +    public default <E2> GraphTraversal<S, E> option(final Traversal<?, E2> traversalOption) {
          this.asAdmin().getBytecode().addStep(Symbols.option, traversalOption);
 -        return this.option(TraversalOptionParent.Pick.any, traversalOption.asAdmin());
 +        ((TraversalOptionParent<Object, E, E2>) this.asAdmin().getEndStep()).addGlobalChildOption(TraversalOptionParent.Pick.any, (Traversal.Admin<E, E2>) traversalOption.asAdmin());
 +        return this;
      }
  
      ////

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bbe33776/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/ComplexTest.java
----------------------------------------------------------------------
diff --cc gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/ComplexTest.java
index 7085d4f,d53f9d5..5c6a1e5
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/ComplexTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/ComplexTest.java
@@@ -285,9 -306,22 +307,22 @@@ public abstract class ComplexTest exten
                              barrier().
                              group("x").
                              by(select("src", "tgt")).
 -                            by(select("p").fold()).select("tgt").barrier()).
 +                            by(select(all, "p").fold()).select("tgt").barrier()).
                      cap("x").select(values).unfold().unfold().map(unfold().id().fold());
          }
+ 
+         @Override
+         public Traversal<Vertex, Map<String, List<String>>> getPlaylistPaths() {
+             return g.V().has("name", "Bob_Dylan").in("sungBy").as("a").
+                     repeat(out().order().by(Order.shuffle).simplePath().from("a")).
+                     until(out("writtenBy").has("name", "Johnny_Cash")).limit(1).as("b").
+                     repeat(out().order().by(Order.shuffle).as("c").simplePath().from("b").to("c")).
+                     until(out("sungBy").has("name", "Grateful_Dead")).limit(1).
+                     path().from("a").unfold().
+                     <List<String>>project("song", "artists").
+                     by("name").
+                     by(__.coalesce(out("sungBy", "writtenBy").dedup().values("name"), constant("Unknown")).fold());
+         }
      }
  }
  


[05/19] tinkerpop git commit: removed CyclicPathStep and SimplePathStep for a more abstract, generalized step called PathFilterStep which handles cyclic/simple filtering as well as to() and from() modulation. Updated UPGRADE docs. Will add by()-modulatio

Posted by ok...@apache.org.
removed CyclicPathStep and SimplePathStep for a more abstract, generalized step called PathFilterStep which handles cyclic/simple filtering as well as to() and from() modulation. Updated UPGRADE docs. Will add by()-modulation to PathFilterStep next.


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

Branch: refs/heads/master
Commit: 65b3ad06b15b75ae944c11bfbdc592994fa706b2
Parents: 0fe3b1d
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Mar 16 09:14:40 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Mar 16 09:14:40 2017 -0600

----------------------------------------------------------------------
 .../upgrade/release-3.2.x-incubating.asciidoc   |  7 ++
 .../traversal/dsl/graph/GraphTraversal.java     | 11 ++-
 .../traversal/step/filter/CyclicPathStep.java   | 46 ------------
 .../traversal/step/filter/PathFilterStep.java   | 75 ++++++++++++++++++++
 .../traversal/step/filter/SimplePathStep.java   | 47 ------------
 .../optimization/FilterRankingStrategy.java     |  5 +-
 .../IncidentToAdjacentStrategy.java             |  7 +-
 .../step/filter/PathFilterStepTest.java         | 47 ++++++++++++
 8 files changed, 139 insertions(+), 106 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/65b3ad06/docs/src/upgrade/release-3.2.x-incubating.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.2.x-incubating.asciidoc b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
index 78c276b..a770ed8 100644
--- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc
+++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
@@ -63,6 +63,13 @@ See: link:https://issues.apache.org/jira/browse/TINKERPOP-1599[TINKERPOP-1599]
 Upgrading for Providers
 ~~~~~~~~~~~~~~~~~~~~~~~
 
+SimplePathStep and CyclicPathStep now PathFilterStep
+++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+The Gremlin traversal machine use to support two step instructions: `SimplePathStep` and `CyclicPathStep`. These have
+been replaced by a high-level instruction called `PathFilterStep` which is boolean configured for simple or cyclic paths.
+Furthermore, `PathFilterStep` also support `from()`-, `to()`-, and `by()`-modulation.
+
 LazyBarrierStrategy No Longer End Appends Barriers
 ++++++++++++++++++++++++++++++++++++++++++++++++++
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/65b3ad06/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
index 4344aaf..0b95479 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
@@ -48,7 +48,6 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.branch.UnionStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.AndStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.CoinStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.ConnectiveStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.filter.CyclicPathStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.DedupGlobalStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.DropStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.HasStep;
@@ -56,9 +55,9 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.filter.IsStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.LambdaFilterStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.NotStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.OrStep;
+import org.apache.tinkerpop.gremlin.process.traversal.step.filter.PathFilterStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.RangeGlobalStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.SampleGlobalStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.filter.SimplePathStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TailGlobalStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TimeLimitStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilterStep;
@@ -1783,25 +1782,25 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
     /**
      * Filter the <code>E</code> object if its {@link Traverser#path} is not {@link Path#isSimple}.
      *
-     * @return the traversal with an appended {@link SimplePathStep}.
+     * @return the traversal with an appended {@link PathFilterStep}.
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#simplepath-step" target="_blank">Reference Documentation - SimplePath Step</a>
      * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> simplePath() {
         this.asAdmin().getBytecode().addStep(Symbols.simplePath);
-        return this.asAdmin().addStep(new SimplePathStep<>(this.asAdmin()));
+        return this.asAdmin().addStep(new PathFilterStep<E>(this.asAdmin(), true));
     }
 
     /**
      * Filter the <code>E</code> object if its {@link Traverser#path} is {@link Path#isSimple}.
      *
-     * @return the traversal with an appended {@link CyclicPathStep}.
+     * @return the traversal with an appended {@link PathFilterStep}.
      * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#cyclicpath-step" target="_blank">Reference Documentation - CyclicPath Step</a>
      * @since 3.0.0-incubating
      */
     public default GraphTraversal<S, E> cyclicPath() {
         this.asAdmin().getBytecode().addStep(Symbols.cyclicPath);
-        return this.asAdmin().addStep(new CyclicPathStep<>(this.asAdmin()));
+        return this.asAdmin().addStep(new PathFilterStep<E>(this.asAdmin(), false));
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/65b3ad06/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathStep.java
deleted file mode 100644
index e9c5dcf..0000000
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathStep.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.process.traversal.step.filter;
-
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
-
-import java.util.Collections;
-import java.util.Set;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class CyclicPathStep<S> extends FilterStep<S> {
-
-    public CyclicPathStep(final Traversal.Admin traversal) {
-        super(traversal);
-    }
-
-    @Override
-    protected boolean filter(final Traverser.Admin<S> traverser) {
-        return !traverser.path().isSimple();
-    }
-
-    @Override
-    public Set<TraverserRequirement> getRequirements() {
-        return Collections.singleton(TraverserRequirement.PATH);
-    }
-}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/65b3ad06/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/PathFilterStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/PathFilterStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/PathFilterStep.java
new file mode 100644
index 0000000..bbc8168
--- /dev/null
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/PathFilterStep.java
@@ -0,0 +1,75 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.tinkerpop.gremlin.process.traversal.step.filter;
+
+import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
+import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
+import org.apache.tinkerpop.gremlin.process.traversal.step.FromToModulating;
+import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
+import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
+
+import java.util.Collections;
+import java.util.Set;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public final class PathFilterStep<S> extends FilterStep<S> implements FromToModulating {
+
+    protected String fromLabel;
+    protected String toLabel;
+    private boolean isSimple;
+
+    public PathFilterStep(final Traversal.Admin traversal, final boolean isSimple) {
+        super(traversal);
+        this.isSimple = isSimple;
+    }
+
+    @Override
+    protected boolean filter(final Traverser.Admin<S> traverser) {
+        return traverser.path().getSubPath(this.fromLabel, this.toLabel).isSimple() == this.isSimple;
+    }
+
+    @Override
+    public Set<TraverserRequirement> getRequirements() {
+        return Collections.singleton(TraverserRequirement.PATH);
+    }
+
+    public void addFrom(final String fromLabel) {
+        this.fromLabel = fromLabel;
+    }
+
+    public void addTo(final String toLabel) {
+        this.toLabel = toLabel;
+    }
+
+    @Override
+    public String toString() {
+        return StringFactory.stepString(this, this.isSimple ? "simple" : "cyclic", this.fromLabel, this.toLabel);
+    }
+
+    @Override
+    public int hashCode() {
+        return super.hashCode() ^
+                Boolean.hashCode(this.isSimple) ^
+                (null == this.fromLabel ? "null".hashCode() : this.fromLabel.hashCode()) ^
+                (null == this.toLabel ? "null".hashCode() : this.toLabel.hashCode());
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/65b3ad06/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/SimplePathStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/SimplePathStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/SimplePathStep.java
deleted file mode 100644
index 5789803..0000000
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/SimplePathStep.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.process.traversal.step.filter;
-
-
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
-
-import java.util.Collections;
-import java.util.Set;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class SimplePathStep<S> extends FilterStep<S> {
-
-    public SimplePathStep(final Traversal.Admin traversal) {
-        super(traversal);
-    }
-
-    @Override
-    protected boolean filter(final Traverser.Admin<S> traverser) {
-        return traverser.path().isSimple();
-    }
-
-    @Override
-    public Set<TraverserRequirement> getRequirements() {
-        return Collections.singleton(TraverserRequirement.PATH);
-    }
-}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/65b3ad06/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
index 3649615..6ca676a 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
@@ -26,14 +26,13 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.Scoping;
 import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.AndStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.ClassFilterStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.filter.CyclicPathStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.DedupGlobalStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.FilterStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.HasStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.IsStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.NotStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.OrStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.filter.SimplePathStep;
+import org.apache.tinkerpop.gremlin.process.traversal.step.filter.PathFilterStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilterStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.WherePredicateStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.WhereTraversalStep;
@@ -129,7 +128,7 @@ public final class FilterRankingStrategy extends AbstractTraversalStrategy<Trave
             rank = 2;
         else if (step instanceof WherePredicateStep && ((WherePredicateStep) step).getLocalChildren().isEmpty())
             rank = 3;
-        else if (step instanceof SimplePathStep || step instanceof CyclicPathStep)
+        else if (step instanceof PathFilterStep)
             rank = 4;
         else if (step instanceof TraversalFilterStep || step instanceof NotStep)
             rank = 5;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/65b3ad06/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/IncidentToAdjacentStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/IncidentToAdjacentStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/IncidentToAdjacentStrategy.java
index 4270ac3..1c96cf8 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/IncidentToAdjacentStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/IncidentToAdjacentStrategy.java
@@ -23,8 +23,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.Step;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.step.LambdaHolder;
-import org.apache.tinkerpop.gremlin.process.traversal.step.filter.CyclicPathStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.filter.SimplePathStep;
+import org.apache.tinkerpop.gremlin.process.traversal.step.filter.PathFilterStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.EdgeOtherVertexStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.EdgeVertexStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.PathStep;
@@ -72,8 +71,8 @@ public final class IncidentToAdjacentStrategy extends AbstractTraversalStrategy<
 
     private static final IncidentToAdjacentStrategy INSTANCE = new IncidentToAdjacentStrategy();
     private static final String MARKER = Graph.Hidden.hide("gremlin.incidentToAdjacent");
-    private static final Set<Class> INVALIDATING_STEP_CLASSES = new HashSet<>(Arrays.asList(CyclicPathStep.class,
-            PathStep.class, SimplePathStep.class, TreeStep.class, TreeSideEffectStep.class, LambdaHolder.class));
+    private static final Set<Class> INVALIDATING_STEP_CLASSES = new HashSet<>(Arrays.asList(
+            PathStep.class, PathFilterStep.class, TreeStep.class, TreeSideEffectStep.class, LambdaHolder.class));
 
     private IncidentToAdjacentStrategy() {
     }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/65b3ad06/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/PathFilterStepTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/PathFilterStepTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/PathFilterStepTest.java
new file mode 100644
index 0000000..ff994e8
--- /dev/null
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/PathFilterStepTest.java
@@ -0,0 +1,47 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.tinkerpop.gremlin.process.traversal.step.filter;
+
+import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
+import org.apache.tinkerpop.gremlin.process.traversal.step.StepTest;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public class PathFilterStepTest extends StepTest {
+
+    @Override
+    protected List<Traversal> getTraversals() {
+        return Arrays.asList(
+                __.simplePath(),
+                __.simplePath().from("a").to("b"),
+                __.simplePath().from("a"),
+                __.simplePath().to("b"),
+                __.cyclicPath().from("a"),
+                __.cyclicPath().to("b"),
+                __.cyclicPath().from("a").to("b"),
+                __.cyclicPath()
+        );
+    }
+}


[15/19] tinkerpop git commit: added a test to PathTest which tests Pop semantics. Right now, we will only support Pop.last -- but we are staged for support Pop.first in the future... if we want.

Posted by ok...@apache.org.
added a test to PathTest which tests Pop semantics. Right now, we will only support Pop.last -- but we are staged for support Pop.first in the future... if we want.


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

Branch: refs/heads/master
Commit: 07c92d92a444f865a954bcf0ac2e660cc3ca3bb9
Parents: 9160573
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Mar 23 09:53:59 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Mar 23 09:53:59 2017 -0600

----------------------------------------------------------------------
 .../gremlin/process/traversal/PathTest.java     | 40 ++++++++++++++++++--
 1 file changed, 37 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/07c92d92/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/PathTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/PathTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/PathTest.java
index ce21732..e9630f0 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/PathTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/PathTest.java
@@ -428,7 +428,7 @@ public class PathTest {
             assertTrue(subPath.labels().get(1).contains("d"));
             assertEquals(1, subPath.labels().get(1).size());
             ///
-            subPath = path.subPath("c",null);
+            subPath = path.subPath("c", null);
             assertEquals(2, subPath.size());
             assertEquals(2, subPath.objects().size());
             assertEquals(2, subPath.labels().size());
@@ -440,7 +440,12 @@ public class PathTest {
             assertTrue(subPath.labels().get(1).contains("d"));
             assertEquals(1, subPath.labels().get(1).size());
             ///
-            subPath = path.subPath("a","d");
+            subPath = path.subPath("a", "d");
+            assertEquals(4, subPath.size());
+            assertEquals(4, subPath.objects().size());
+            assertEquals(4, subPath.labels().size());
+            ///
+            subPath = path.subPath(null, "d");
             assertEquals(4, subPath.size());
             assertEquals(4, subPath.objects().size());
             assertEquals(4, subPath.labels().size());
@@ -449,7 +454,7 @@ public class PathTest {
                 subPath = path.subPath("d", "a");
                 fail("Path labels must be ordered along path");
             } catch (final IllegalArgumentException e) {
-                assertEquals(Path.Exceptions.couldNotIsolatedSubPath("d","a").getMessage(), e.getMessage());
+                assertEquals(Path.Exceptions.couldNotIsolatedSubPath("d", "a").getMessage(), e.getMessage());
             }
             ///
             try {
@@ -467,4 +472,33 @@ public class PathTest {
             }
         });
     }
+
+    @Test
+    public void shouldHaveSubPathPopSupport() {
+        PATH_SUPPLIERS.forEach(supplier -> {
+            Path path = supplier.get();
+            path = path.extend("marko", Collections.singleton("a"));
+            path = path.extend("stephen", Collections.singleton("a"));
+            path = path.extend("matthias", new HashSet<>(Arrays.asList("c", "x")));
+            path = path.extend("bob", Collections.singleton("c"));
+            assertEquals(4, path.size());
+            assertEquals(4, path.objects().size());
+            assertEquals(4, path.labels().size());
+            ///
+            Path subPath = path.subPath("a", "c");
+            assertEquals(3, subPath.size());
+            assertEquals(3, subPath.objects().size());
+            assertEquals(3, subPath.labels().size());
+            assertEquals("stephen", subPath.objects().get(0));
+            assertEquals("matthias", subPath.objects().get(1));
+            assertEquals("bob", subPath.objects().get(2));
+            assertTrue(subPath.labels().get(0).contains("a"));
+            assertEquals(1, subPath.labels().get(0).size());
+            assertTrue(subPath.labels().get(1).contains("c"));
+            assertTrue(subPath.labels().get(1).contains("x"));
+            assertEquals(2, subPath.labels().get(1).size());
+            assertTrue(subPath.labels().get(2).contains("c"));
+            assertEquals(1, subPath.labels().get(2).size());
+        });
+    }
 }


[07/19] tinkerpop git commit: PathFilterStep now support by() modulation. Removed unneeded CyclicPathStepTest and SimplePathStepTest.

Posted by ok...@apache.org.
PathFilterStep now support by() modulation. Removed unneeded CyclicPathStepTest and SimplePathStepTest.


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

Branch: refs/heads/master
Commit: 8ec49c433ae472116853df12247fa903e41f958d
Parents: 936344f
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Mar 16 09:34:25 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Mar 16 09:34:25 2017 -0600

----------------------------------------------------------------------
 .../traversal/step/filter/PathFilterStep.java   | 71 +++++++++++++++++++-
 .../step/filter/CyclicPathStepTest.java         | 37 ----------
 .../step/filter/PathFilterStepTest.java         |  8 ++-
 .../step/filter/SimplePathStepTest.java         | 37 ----------
 4 files changed, 75 insertions(+), 78 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8ec49c43/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/PathFilterStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/PathFilterStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/PathFilterStep.java
index bbc8168..e8e0607 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/PathFilterStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/PathFilterStep.java
@@ -19,32 +19,52 @@
 
 package org.apache.tinkerpop.gremlin.process.traversal.step.filter;
 
+import org.apache.tinkerpop.gremlin.process.traversal.Path;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
+import org.apache.tinkerpop.gremlin.process.traversal.step.ByModulating;
 import org.apache.tinkerpop.gremlin.process.traversal.step.FromToModulating;
+import org.apache.tinkerpop.gremlin.process.traversal.step.PathProcessor;
+import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.MutablePath;
 import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
+import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalRing;
+import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalUtil;
 import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
 
 import java.util.Collections;
+import java.util.List;
 import java.util.Set;
 
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
-public final class PathFilterStep<S> extends FilterStep<S> implements FromToModulating {
+public final class PathFilterStep<S> extends FilterStep<S> implements FromToModulating, ByModulating, TraversalParent, PathProcessor {
 
     protected String fromLabel;
     protected String toLabel;
     private boolean isSimple;
+    private TraversalRing<Object, Object> traversalRing;
+    private Set<String> keepLabels;
 
     public PathFilterStep(final Traversal.Admin traversal, final boolean isSimple) {
         super(traversal);
+        this.traversalRing = new TraversalRing<>();
         this.isSimple = isSimple;
     }
 
     @Override
     protected boolean filter(final Traverser.Admin<S> traverser) {
-        return traverser.path().getSubPath(this.fromLabel, this.toLabel).isSimple() == this.isSimple;
+        final Path path = traverser.path().getSubPath(this.fromLabel, this.toLabel);
+        this.traversalRing.reset();
+        if (this.traversalRing.isEmpty())
+            return path.isSimple() == this.isSimple;
+        else {
+            final Path byPath = MutablePath.make();
+            path.forEach((object, labels) -> byPath.extend(TraversalUtil.applyNullable(object, this.traversalRing.next()), labels));
+            return byPath.isSimple() == this.isSimple;
+
+        }
     }
 
     @Override
@@ -62,14 +82,59 @@ public final class PathFilterStep<S> extends FilterStep<S> implements FromToModu
 
     @Override
     public String toString() {
-        return StringFactory.stepString(this, this.isSimple ? "simple" : "cyclic", this.fromLabel, this.toLabel);
+        return StringFactory.stepString(this, this.isSimple ? "simple" : "cyclic", this.fromLabel, this.toLabel, this.traversalRing);
+    }
+
+    @Override
+    public PathFilterStep<S> clone() {
+        final PathFilterStep<S> clone = (PathFilterStep<S>) super.clone();
+        clone.traversalRing = this.traversalRing.clone();
+        return clone;
+    }
+
+    @Override
+    public void setTraversal(final Traversal.Admin<?, ?> parentTraversal) {
+        super.setTraversal(parentTraversal);
+        this.traversalRing.getTraversals().forEach(this::integrateChild);
+    }
+
+    @Override
+    public List<Traversal.Admin<Object, Object>> getLocalChildren() {
+        return this.traversalRing.getTraversals();
+    }
+
+    @Override
+    public void modulateBy(final Traversal.Admin<?, ?> pathTraversal) {
+        this.traversalRing.addTraversal(this.integrateChild(pathTraversal));
+    }
+
+    @Override
+    public void reset() {
+        super.reset();
+        this.traversalRing.reset();
     }
 
     @Override
     public int hashCode() {
         return super.hashCode() ^
+                this.traversalRing.hashCode() ^
                 Boolean.hashCode(this.isSimple) ^
                 (null == this.fromLabel ? "null".hashCode() : this.fromLabel.hashCode()) ^
                 (null == this.toLabel ? "null".hashCode() : this.toLabel.hashCode());
     }
+
+    @Override
+    public void setKeepLabels(final Set<String> labels) {
+        this.keepLabels = labels;
+    }
+
+    @Override
+    protected Traverser.Admin<S> processNextStart() {
+        return PathProcessor.processTraverserPathLabels(super.processNextStart(), this.keepLabels);
+    }
+
+    @Override
+    public Set<String> getKeepLabels() {
+        return this.keepLabels;
+    }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8ec49c43/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathStepTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathStepTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathStepTest.java
deleted file mode 100644
index c187d3f..0000000
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathStepTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.process.traversal.step.filter;
-
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
-import org.apache.tinkerpop.gremlin.process.traversal.step.StepTest;
-
-import java.util.Collections;
-import java.util.List;
-
-/**
- * @author Daniel Kuppitz (http://gremlin.guru)
- */
-public class CyclicPathStepTest extends StepTest {
-
-    @Override
-    protected List<Traversal> getTraversals() {
-        return Collections.singletonList(__.cyclicPath());
-    }
-}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8ec49c43/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/PathFilterStepTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/PathFilterStepTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/PathFilterStepTest.java
index ff994e8..531cfed 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/PathFilterStepTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/PathFilterStepTest.java
@@ -38,10 +38,16 @@ public class PathFilterStepTest extends StepTest {
                 __.simplePath().from("a").to("b"),
                 __.simplePath().from("a"),
                 __.simplePath().to("b"),
+                __.simplePath().from("a").by("name").by("age"),
+                __.simplePath().from("a").to("b").by("name").by("age"),
+                __.simplePath().by("name").by("age"),
                 __.cyclicPath().from("a"),
                 __.cyclicPath().to("b"),
                 __.cyclicPath().from("a").to("b"),
-                __.cyclicPath()
+                __.cyclicPath(),
+                __.cyclicPath().from("a").by("name").by("age"),
+                __.cyclicPath().from("a").to("b").by("name").by("age"),
+                __.cyclicPath().by("name").by("age")
         );
     }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8ec49c43/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/SimplePathStepTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/SimplePathStepTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/SimplePathStepTest.java
deleted file mode 100644
index 170ad47..0000000
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/SimplePathStepTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.process.traversal.step.filter;
-
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
-import org.apache.tinkerpop.gremlin.process.traversal.step.StepTest;
-
-import java.util.Collections;
-import java.util.List;
-
-/**
- * @author Daniel Kuppitz (http://gremlin.guru)
- */
-public class SimplePathStepTest extends StepTest {
-
-    @Override
-    protected List<Traversal> getTraversals() {
-        return Collections.singletonList(__.simplePath());
-    }
-}


[16/19] tinkerpop git commit: added a ComplexTest for simplePath().from().to() that was provided by @dkuppitz. Works for both OLTP and OLAP. Sweet.

Posted by ok...@apache.org.
added a ComplexTest for simplePath().from().to() that was provided by @dkuppitz. Works for both OLTP and OLAP. Sweet.


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

Branch: refs/heads/master
Commit: b9111c90350548d675a8db3b95fe08c77f72a5d3
Parents: 07c92d9
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Mar 23 12:09:27 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Mar 23 12:09:27 2017 -0600

----------------------------------------------------------------------
 .../process/traversal/step/ComplexTest.java     | 49 +++++++++++++++++---
 1 file changed, 42 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b9111c90/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/ComplexTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/ComplexTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/ComplexTest.java
index 98d19b5..d53f9d5 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/ComplexTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/ComplexTest.java
@@ -27,6 +27,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.Order;
 import org.apache.tinkerpop.gremlin.process.traversal.P;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.BulkSet;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.PathRetractionStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ComputerVerificationStrategy;
@@ -74,6 +75,16 @@ import static org.junit.Assert.assertTrue;
 @RunWith(GremlinProcessRunner.class)
 public abstract class ComplexTest extends AbstractGremlinProcessTest {
 
+    public abstract Traversal<Vertex, String> getClassicRecommendation();
+
+    public abstract Traversal<Vertex, Map<String, Map<String, Map<String, Object>>>> getCoworkerSummary();
+
+    public abstract Traversal<Vertex, Map<String, Map<String, Map<String, Object>>>> getCoworkerSummaryOLTP();
+
+    public abstract Traversal<Vertex, List<Object>> getAllShortestPaths();
+
+    public abstract Traversal<Vertex, Map<String, List<String>>> getPlaylistPaths();
+
     /**
      * Checks the result of both coworkerSummary tests, which is expected to look as follows:
      * <p>
@@ -112,13 +123,6 @@ public abstract class ComplexTest extends AbstractGremlinProcessTest {
         }
     }
 
-    public abstract Traversal<Vertex, String> getClassicRecommendation();
-
-    public abstract Traversal<Vertex, Map<String, Map<String, Map<String, Object>>>> getCoworkerSummary();
-
-    public abstract Traversal<Vertex, Map<String, Map<String, Map<String, Object>>>> getCoworkerSummaryOLTP();
-
-    public abstract Traversal<Vertex, List<Object>> getAllShortestPaths();
 
     @Test
     @LoadGraphWith(LoadGraphWith.GraphData.GRATEFUL)
@@ -220,6 +224,24 @@ public abstract class ComplexTest extends AbstractGremlinProcessTest {
         checkResults(allShortestPaths, traversal);
     }
 
+    @Test
+    @LoadGraphWith(LoadGraphWith.GraphData.GRATEFUL)
+    public void playlistPaths() {
+        final Traversal<Vertex, Map<String, List<String>>> traversal = getPlaylistPaths();
+        printTraversalForm(traversal);
+        assertTrue(traversal.hasNext());
+        Map<String, List<String>> map = traversal.next();
+        assertTrue(map.get("artists").contains("Bob_Dylan"));
+        boolean hasJohnnyCash = false;
+        while (traversal.hasNext()) {
+            map = traversal.next();
+            if (map.get("artists").contains("Johnny_Cash"))
+                hasJohnnyCash = true;
+        }
+        assertTrue(hasJohnnyCash);
+        assertTrue(map.get("artists").contains("Grateful_Dead"));
+    }
+
     public static class Traversals extends ComplexTest {
 
         @Override
@@ -287,6 +309,19 @@ public abstract class ComplexTest extends AbstractGremlinProcessTest {
                             by(select("p").fold()).select("tgt").barrier()).
                     cap("x").select(values).unfold().unfold().map(unfold().id().fold());
         }
+
+        @Override
+        public Traversal<Vertex, Map<String, List<String>>> getPlaylistPaths() {
+            return g.V().has("name", "Bob_Dylan").in("sungBy").as("a").
+                    repeat(out().order().by(Order.shuffle).simplePath().from("a")).
+                    until(out("writtenBy").has("name", "Johnny_Cash")).limit(1).as("b").
+                    repeat(out().order().by(Order.shuffle).as("c").simplePath().from("b").to("c")).
+                    until(out("sungBy").has("name", "Grateful_Dead")).limit(1).
+                    path().from("a").unfold().
+                    <List<String>>project("song", "artists").
+                    by("name").
+                    by(__.coalesce(out("sungBy", "writtenBy").dedup().values("name"), constant("Unknown")).fold());
+        }
     }
 }
 


[11/19] tinkerpop git commit: renamed Path.getSubPath() to Path.subPath() as its in the fluent style of operations on Path.

Posted by ok...@apache.org.
renamed Path.getSubPath() to Path.subPath() as its in the fluent style of operations on Path.


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

Branch: refs/heads/master
Commit: a9c2f65e0557dfd5f486b2ba683c571bb60f5fe6
Parents: 718a29b
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Mar 16 10:07:50 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Mar 16 10:07:50 2017 -0600

----------------------------------------------------------------------
 CHANGELOG.asciidoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a9c2f65e/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 4aaa25b..ab73263 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -30,7 +30,7 @@ TinkerPop 3.2.5 (Release Date: NOT OFFICIALLY RELEASED YET)
 * Added `simplePath().from().to().by()` support to `GraphTraversal`.
 * Added `path().from().to()` support to `GraphTraversal` so sub-paths can be isolated from the current path.
 * Added `FromToModulating` interface for use with `to()`- and `from()`-based step modulators.
-* Added `Path.getSubPath()` which supports isolating a sub-path from `Path` via to/from-labels.
+* Added `Path.subPath()` which supports isolating a sub-path from `Path` via to/from-labels.
 * Fixed an `NullPointerException` in `GraphMLReader` that occurred when an `<edge>` didn't have an ID field and the base graph supported ID assignment.
 * Split `ComputerVerificationStrategy` into two strategies: `ComputerVerificationStrategy` and `ComputerFinalizationStrategy`.
 * Removed `HasTest.g_V_hasId_compilationEquality` from process test suite as it makes too many assumptions about provider compilation.


[06/19] tinkerpop git commit: added to()/from() test support for cyclicPath() and added to()/from() example to the-traversal.asciidoc.

Posted by ok...@apache.org.
added to()/from() test support for cyclicPath() and added to()/from() example to 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/936344f3
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/936344f3
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/936344f3

Branch: refs/heads/master
Commit: 936344f33f62fd3b3d7adee6bf0bf8fb11b8e5e5
Parents: 65b3ad0
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Mar 16 09:26:45 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Mar 16 09:26:45 2017 -0600

----------------------------------------------------------------------
 docs/src/reference/the-traversal.asciidoc           |  8 ++++++++
 .../step/filter/GroovyCyclicPathTest.groovy         |  6 ++++++
 .../traversal/step/filter/CyclicPathTest.java       | 16 +++++++++++++++-
 3 files changed, 29 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/936344f3/docs/src/reference/the-traversal.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc
index eb93950..75d740f 100644
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@ -584,6 +584,14 @@ traversal computation. If non-cyclic behavior is desired, see <<simplepath-step,
 g.V(1).both().both()
 g.V(1).both().both().cyclicPath()
 g.V(1).both().both().cyclicPath().path()
+g.V(1).as('a').out('created').as('b').
+  in('created').as('c').
+  cyclicPath().
+  path()
+g.V(1).as('a').out('created').as('b').
+  in('created').as('c').
+  cyclicPath().from('a').to('b').
+  path()
 ----
 
 [[dedup-step]]

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/936344f3/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyCyclicPathTest.groovy
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyCyclicPathTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyCyclicPathTest.groovy
index 7479e21..d18e677 100644
--- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyCyclicPathTest.groovy
+++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyCyclicPathTest.groovy
@@ -39,5 +39,11 @@ public abstract class GroovyCyclicPathTest {
         Traversal<Vertex, Path> get_g_VX1X_outXcreatedX_inXcreatedX_cyclicPath_path(final Object v1Id) {
             new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).out('created').in('created').cyclicPath().path()", "v1Id", v1Id);
         }
+
+        @Override
+        public Traversal<Vertex, Path> get_g_VX1X_asXaX_outXcreatedX_asXbX_inXcreatedX_asXcX_cyclicPath_fromXaX_toXbX_path(
+                final Object v1Id) {
+            new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).as('a').out('created').as('b').in('created').as('c').cyclicPath.from('a').to('b').path", "v1Id", v1Id)
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/936344f3/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathTest.java
index 33a3a6e..6d9fef5 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathTest.java
@@ -23,7 +23,6 @@ import org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest;
 import org.apache.tinkerpop.gremlin.process.GremlinProcessRunner;
 import org.apache.tinkerpop.gremlin.process.traversal.Path;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -42,6 +41,8 @@ public abstract class CyclicPathTest extends AbstractGremlinProcessTest {
 
     public abstract Traversal<Vertex, Path> get_g_VX1X_outXcreatedX_inXcreatedX_cyclicPath_path(final Object v1);
 
+    public abstract Traversal<Vertex, Path> get_g_VX1X_asXaX_outXcreatedX_asXbX_inXcreatedX_asXcX_cyclicPath_fromXaX_toXbX_path(final Object v1Id);
+
     @Test
     @LoadGraphWith(MODERN)
     public void g_VX1X_outXcreatedX_inXcreatedX_cyclicPath() {
@@ -72,6 +73,14 @@ public abstract class CyclicPathTest extends AbstractGremlinProcessTest {
         assertFalse(traversal.hasNext());
     }
 
+    @Test
+    @LoadGraphWith(MODERN)
+    public void g_VX1X_asXaX_outXcreatedX_asXbX_inXcreatedX_asXcX_cyclicPath_fromXaX_toXbX_path() {
+        final Traversal<Vertex, Path> traversal = get_g_VX1X_asXaX_outXcreatedX_asXbX_inXcreatedX_asXcX_cyclicPath_fromXaX_toXbX_path(convertToVertexId("marko"));
+        printTraversalForm(traversal);
+        assertFalse(traversal.hasNext());
+    }
+
     public static class Traversals extends CyclicPathTest {
         @Override
         public Traversal<Vertex, Vertex> get_g_VX1X_outXcreatedX_inXcreatedX_cyclicPath(final Object v1Id) {
@@ -82,5 +91,10 @@ public abstract class CyclicPathTest extends AbstractGremlinProcessTest {
         public Traversal<Vertex, Path> get_g_VX1X_outXcreatedX_inXcreatedX_cyclicPath_path(final Object v1Id) {
             return g.V(v1Id).out("created").in("created").cyclicPath().path();
         }
+
+        @Override
+        public Traversal<Vertex, Path> get_g_VX1X_asXaX_outXcreatedX_asXbX_inXcreatedX_asXcX_cyclicPath_fromXaX_toXbX_path(final Object v1Id) {
+            return g.V(v1Id).as("a").out("created").as("b").in("created").as("c").cyclicPath().from("a").to("b").path();
+        }
     }
 }