Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.2.1
    • Fix Version/s: 3.2.5
    • Component/s: process
    • Labels:
      None

      Description

      Just had this crazy idea of from and to modulators for path steps.

      g.V(1).as("a").
        repeat(both("knows").simplePath().from("a")).emit().out("created").as("p").in("created").
        repeat(both("knows").simplePath().from("p")).emit(hasId(6)).out("created").as("b").
        path().from("a").to("p").as("pathFromMarkoToProject").
        path().from("p").to("b").as("pathFromProjectToPeter").
        match(
          __.as("pathFromMarkoToProject").count(local).is(lte(3)),
          __.as("pathFromProjectToPeter").count(local).is(lte(3))
        ).select("p", "pathFromMarkoToProject", "pathFromProjectToPeter")
      

        Issue Links

          Activity

          Hide
          okram Marko A. Rodriguez added a comment -

          This is a cool idea. I don't really grok your example, but I believe the basics are:

          1. simplePath/cyclicPath will just check for duplications with the specific label range.
          2. path will return a "subpath" that is from the specified label range.

          Neat.

          Two semantic questions:

          g.V().as('a').out().as('b').out().as('a').path().from('a').to('b') // which "a"?
          g.V().as('a').out().as('a').out().as('a').path().from('a').to('a') // which "a"?
          
          Show
          okram Marko A. Rodriguez added a comment - This is a cool idea. I don't really grok your example, but I believe the basics are: 1. simplePath / cyclicPath will just check for duplications with the specific label range. 2. path will return a "subpath" that is from the specified label range. Neat. Two semantic questions: g.V().as('a').out().as('b').out().as('a').path().from('a').to('b') // which "a" ? g.V().as('a').out().as('a').out().as('a').path().from('a').to('a') // which "a" ?
          Hide
          dkuppitz Daniel Kuppitz added a comment -

          Hmm, select("a") selects all a's. Hence path().from("a") should also use all a's. Let me use an easier example:

          gremlin> g.V().as('a').out().as('a').out().as('b').path().from('a').to('b')
          ==> [[v[1],v[4],v[5]],[v[4],v[5]]]
          ==> [[v[1],v[4],v[3]],[v[4],v[3]]]
          

          .from("a").to("a") is crazy though.

          Show
          dkuppitz Daniel Kuppitz added a comment - Hmm, select("a") selects all a's. Hence path().from("a") should also use all a's. Let me use an easier example: gremlin> g.V().as('a').out().as('a').out().as('b').path().from('a').to('b') ==> [[v[1],v[4],v[5]],[v[4],v[5]]] ==> [[v[1],v[4],v[3]],[v[4],v[3]]] .from("a").to("a") is crazy though.
          Hide
          okram Marko A. Rodriguez added a comment -

          Hm, that is not really a "path"-then. Dunno, sorta crazy. ?? ...

          We could make a hard rule.

          from('a').to('b')
          

          The first path entry with "a" to the first path entry at or after "a" with "b". Thus,

          from('a').to('a')
          

          would simply be like select('a').

          I think that is easy to understand and a fair restriction. People will just have to be smart about their step labeling.

          Thoughts?

          Show
          okram Marko A. Rodriguez added a comment - Hm, that is not really a "path"-then. Dunno, sorta crazy. ?? ... We could make a hard rule. from('a').to('b') The first path entry with "a" to the first path entry at or after "a" with "b". Thus, from('a').to('a') would simply be like select('a') . I think that is easy to understand and a fair restriction. People will just have to be smart about their step labeling. Thoughts?
          Hide
          dkuppitz Daniel Kuppitz added a comment -

          +1

          Show
          dkuppitz Daniel Kuppitz added a comment - +1
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user okram opened a pull request:

          https://github.com/apache/tinkerpop/pull/574

          TINKERPOP-1387: from and to modulators for path steps

          https://issues.apache.org/jira/browse/TINKERPOP-1387

          `path()`, `simplePath()`, and `cyclicPath()` now all support `to()`, `from()`, and `by()`-modulation. Support for `to()`/`from()` modulation is made possible by a new interface `FromToModulating` which `AddEdgeStep` now implements. To isolate sub-paths, `Path.subPath(String,String)` was added to `Path` interface with a default implementation. Added respective tests and documentation updates.

          @dkuppitz – can you give this bad boy a whirl. Also, if you come up with a some cool doc examples during your play, can you add them please?

          VOTE +1.

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/apache/tinkerpop TINKERPOP-1387

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/tinkerpop/pull/574.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #574


          commit 9265ddf6d1e5bded0ef6b3a0229ea1ce405e5259
          Author: Marko A. Rodriguez <okrammarko@gmail.com>
          Date: 2017-03-16T14:40:39Z

          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.

          commit 0fe3b1d8f4b49db80a59e9d29d8082735edfcef4
          Author: Marko A. Rodriguez <okrammarko@gmail.com>
          Date: 2017-03-16T14:44:43Z

          Cleaned up and added JavaDoc for now sub-path work.

          commit 65b3ad06b15b75ae944c11bfbdc592994fa706b2
          Author: Marko A. Rodriguez <okrammarko@gmail.com>
          Date: 2017-03-16T15:14:40Z

          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.

          commit 936344f33f62fd3b3d7adee6bf0bf8fb11b8e5e5
          Author: Marko A. Rodriguez <okrammarko@gmail.com>
          Date: 2017-03-16T15:26:45Z

          added to()/from() test support for cyclicPath() and added to()/from() example to the-traversal.asciidoc.

          commit 8ec49c433ae472116853df12247fa903e41f958d
          Author: Marko A. Rodriguez <okrammarko@gmail.com>
          Date: 2017-03-16T15:34:25Z

          PathFilterStep now support by() modulation. Removed unneeded CyclicPathStepTest and SimplePathStepTest.

          commit 35ecf8c0f56139953187769ee719c95b66cfa477
          Author: Marko A. Rodriguez <okrammarko@gmail.com>
          Date: 2017-03-16T16:03:28Z

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

          commit 9155c464b78abfe0772d1c8e12ba4196d829e28b
          Author: Marko A. Rodriguez <okrammarko@gmail.com>
          Date: 2017-03-16T16:05:17Z

          updated CHANGELOG.

          commit 718a29bb6ff5a2f5294cd3629b616fb615bc3e15
          Author: Marko A. Rodriguez <okrammarko@gmail.com>
          Date: 2017-03-16T16:07:30Z

          renamed Path.getSubPath() to Path.subPath() as its in the fluent style of operations on Path.

          commit a9c2f65e0557dfd5f486b2ba683c571bb60f5fe6
          Author: Marko A. Rodriguez <okrammarko@gmail.com>
          Date: 2017-03-16T16:07:50Z

          renamed Path.getSubPath() to Path.subPath() as its in the fluent style of operations on Path.


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user okram opened a pull request: https://github.com/apache/tinkerpop/pull/574 TINKERPOP-1387 : from and to modulators for path steps https://issues.apache.org/jira/browse/TINKERPOP-1387 `path()`, `simplePath()`, and `cyclicPath()` now all support `to()` , `from()` , and `by()`-modulation. Support for `to()`/`from()` modulation is made possible by a new interface `FromToModulating` which `AddEdgeStep` now implements. To isolate sub-paths, `Path.subPath(String,String)` was added to `Path` interface with a default implementation. Added respective tests and documentation updates. @dkuppitz – can you give this bad boy a whirl. Also, if you come up with a some cool doc examples during your play, can you add them please? VOTE +1. You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/tinkerpop TINKERPOP-1387 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/574.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #574 commit 9265ddf6d1e5bded0ef6b3a0229ea1ce405e5259 Author: Marko A. Rodriguez <okrammarko@gmail.com> Date: 2017-03-16T14:40:39Z 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. commit 0fe3b1d8f4b49db80a59e9d29d8082735edfcef4 Author: Marko A. Rodriguez <okrammarko@gmail.com> Date: 2017-03-16T14:44:43Z Cleaned up and added JavaDoc for now sub-path work. commit 65b3ad06b15b75ae944c11bfbdc592994fa706b2 Author: Marko A. Rodriguez <okrammarko@gmail.com> Date: 2017-03-16T15:14:40Z 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. commit 936344f33f62fd3b3d7adee6bf0bf8fb11b8e5e5 Author: Marko A. Rodriguez <okrammarko@gmail.com> Date: 2017-03-16T15:26:45Z added to()/from() test support for cyclicPath() and added to()/from() example to the-traversal.asciidoc. commit 8ec49c433ae472116853df12247fa903e41f958d Author: Marko A. Rodriguez <okrammarko@gmail.com> Date: 2017-03-16T15:34:25Z PathFilterStep now support by() modulation. Removed unneeded CyclicPathStepTest and SimplePathStepTest. commit 35ecf8c0f56139953187769ee719c95b66cfa477 Author: Marko A. Rodriguez <okrammarko@gmail.com> Date: 2017-03-16T16:03:28Z added test support for simplePath() and cyclicPath() by()/to()/from(). Really cool. Works great and makes sense. Updated this-traversal.asciidoc with examples. commit 9155c464b78abfe0772d1c8e12ba4196d829e28b Author: Marko A. Rodriguez <okrammarko@gmail.com> Date: 2017-03-16T16:05:17Z updated CHANGELOG. commit 718a29bb6ff5a2f5294cd3629b616fb615bc3e15 Author: Marko A. Rodriguez <okrammarko@gmail.com> Date: 2017-03-16T16:07:30Z renamed Path.getSubPath() to Path.subPath() as its in the fluent style of operations on Path. commit a9c2f65e0557dfd5f486b2ba683c571bb60f5fe6 Author: Marko A. Rodriguez <okrammarko@gmail.com> Date: 2017-03-16T16:07:50Z renamed Path.getSubPath() to Path.subPath() as its in the fluent style of operations on Path.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user spmallette commented on a diff in the pull request:

          https://github.com/apache/tinkerpop/pull/574#discussion_r106463235

          — Diff: 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
          — End diff –

          You added something here for providers which is good. I think it would be good to add something to the users section as well to bring attention to the new available syntax that is available to them with a links to the respective reference docs where the new examples are.

          Show
          githubbot ASF GitHub Bot added a comment - Github user spmallette commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/574#discussion_r106463235 — Diff: 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 — End diff – You added something here for providers which is good. I think it would be good to add something to the users section as well to bring attention to the new available syntax that is available to them with a links to the respective reference docs where the new examples are.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user spmallette commented on a diff in the pull request:

          https://github.com/apache/tinkerpop/pull/574#discussion_r106464069

          — Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java —
          @@ -238,10 +239,53 @@ public default boolean popEquals(final Pop pop, final Object other)

          { 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 subPath(final String fromLabel, final String toLabel) {
          + if (null == fromLabel && null == toLabel)
          + return this;
          + else {
          + Path subPath = MutablePath.make();
          + int size = this.size();
          — End diff –

          Missed a `final` on `size` - that variable doesn't appear to be re-assigned elsewhere.

          Show
          githubbot ASF GitHub Bot added a comment - Github user spmallette commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/574#discussion_r106464069 — Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java — @@ -238,10 +239,53 @@ public default boolean popEquals(final Pop pop, final Object other) { 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 subPath(final String fromLabel, final String toLabel) { + if (null == fromLabel && null == toLabel) + return this; + else { + Path subPath = MutablePath.make(); + int size = this.size(); — End diff – Missed a `final` on `size` - that variable doesn't appear to be re-assigned elsewhere.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user spmallette commented on a diff in the pull request:

          https://github.com/apache/tinkerpop/pull/574#discussion_r106464852

          — Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java —
          @@ -992,8 +992,8 @@

          • 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

              • End diff –

          did your IDE do all this javadoc annotation switching? or was that intentional? not something to switch back or anything i guess, but it just made it hard to root out what's changed here of substance and what hasn't.

          Show
          githubbot ASF GitHub Bot added a comment - Github user spmallette commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/574#discussion_r106464852 — Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java — @@ -992,8 +992,8 @@ 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 End diff – did your IDE do all this javadoc annotation switching? or was that intentional? not something to switch back or anything i guess, but it just made it hard to root out what's changed here of substance and what hasn't.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user spmallette commented on a diff in the pull request:

          https://github.com/apache/tinkerpop/pull/574#discussion_r106465531

          — Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java —
          @@ -1034,11 +1034,10 @@

          • @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>
            */
            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);
              • End diff –

          Now that `from()` is more generic the javadoc needs to be updated to better reflect usage. Also, looks like you removed the `@see` annotation. I think that should be added back with additional ones linking to the appropriate steps that make use of this. I didn't look at the changes for `to()` in here but I assume this comment would apply to those as well.

          Show
          githubbot ASF GitHub Bot added a comment - Github user spmallette commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/574#discussion_r106465531 — Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java — @@ -1034,11 +1034,10 @@ @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> */ 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); End diff – Now that `from()` is more generic the javadoc needs to be updated to better reflect usage. Also, looks like you removed the `@see` annotation. I think that should be added back with additional ones linking to the appropriate steps that make use of this. I didn't look at the changes for `to()` in here but I assume this comment would apply to those as well.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user spmallette commented on a diff in the pull request:

          https://github.com/apache/tinkerpop/pull/574#discussion_r106466930

          — Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathStep.java —
          @@ -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> {
              • End diff –

          As this is going to `tp32`, wouldn't it be better to mark this as deprecated in favor of `PathFilterStep`? It's final, so no one could have extended from it, but perhaps they used it in some other way? I guess I'd be in favor of doing the same for `SimplePathStep`.

          Show
          githubbot ASF GitHub Bot added a comment - Github user spmallette commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/574#discussion_r106466930 — Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathStep.java — @@ -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> { End diff – As this is going to `tp32`, wouldn't it be better to mark this as deprecated in favor of `PathFilterStep`? It's final, so no one could have extended from it, but perhaps they used it in some other way? I guess I'd be in favor of doing the same for `SimplePathStep`.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user okram commented on a diff in the pull request:

          https://github.com/apache/tinkerpop/pull/574#discussion_r106472146

          — Diff: 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
          — End diff –

          Done.

          Show
          githubbot ASF GitHub Bot added a comment - Github user okram commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/574#discussion_r106472146 — Diff: 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 — End diff – Done.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user okram commented on a diff in the pull request:

          https://github.com/apache/tinkerpop/pull/574#discussion_r106472194

          — Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java —
          @@ -238,10 +239,53 @@ public default boolean popEquals(final Pop pop, final Object other)

          { 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 subPath(final String fromLabel, final String toLabel) {
          + if (null == fromLabel && null == toLabel)
          + return this;
          + else {
          + Path subPath = MutablePath.make();
          + int size = this.size();
          — End diff –

          Done.

          Show
          githubbot ASF GitHub Bot added a comment - Github user okram commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/574#discussion_r106472194 — Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Path.java — @@ -238,10 +239,53 @@ public default boolean popEquals(final Pop pop, final Object other) { 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 subPath(final String fromLabel, final String toLabel) { + if (null == fromLabel && null == toLabel) + return this; + else { + Path subPath = MutablePath.make(); + int size = this.size(); — End diff – Done.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user okram commented on a diff in the pull request:

          https://github.com/apache/tinkerpop/pull/574#discussion_r106472288

          — Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java —
          @@ -992,8 +992,8 @@

          • 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

              • End diff –

          I don't know who put all that there. ?

          Show
          githubbot ASF GitHub Bot added a comment - Github user okram commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/574#discussion_r106472288 — Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java — @@ -992,8 +992,8 @@ 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 End diff – I don't know who put all that there. ?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user okram commented on a diff in the pull request:

          https://github.com/apache/tinkerpop/pull/574#discussion_r106472426

          — Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java —
          @@ -1034,11 +1034,10 @@

          • @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>
            */
            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);
              • End diff –

          There is nothing to `@see` as it doesn't reference `AddEdgeStep` anymore.

          Show
          githubbot ASF GitHub Bot added a comment - Github user okram commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/574#discussion_r106472426 — Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java — @@ -1034,11 +1034,10 @@ @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> */ 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); End diff – There is nothing to `@see` as it doesn't reference `AddEdgeStep` anymore.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user okram commented on a diff in the pull request:

          https://github.com/apache/tinkerpop/pull/574#discussion_r106472723

          — Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathStep.java —
          @@ -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> {
              • End diff –

          This is why there are `UPGRADE` doc comments. It will only apply to vendors (and 99% chance not) and if it does, they simply need to change `CyclicPathStep` to `PathFilterStep` in their code.

          Show
          githubbot ASF GitHub Bot added a comment - Github user okram commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/574#discussion_r106472723 — Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathStep.java — @@ -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> { End diff – This is why there are `UPGRADE` doc comments. It will only apply to vendors (and 99% chance not) and if it does, they simply need to change `CyclicPathStep` to `PathFilterStep` in their code.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user spmallette commented on a diff in the pull request:

          https://github.com/apache/tinkerpop/pull/574#discussion_r106480814

          — Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java —
          @@ -992,8 +992,8 @@

          • 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

              • End diff –

          a few weeks ago i added all the annotations and references, but it looks like your IDE didn't like my formatting so it just shuffled stuff around.

          Show
          githubbot ASF GitHub Bot added a comment - Github user spmallette commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/574#discussion_r106480814 — Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java — @@ -992,8 +992,8 @@ 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 End diff – a few weeks ago i added all the annotations and references, but it looks like your IDE didn't like my formatting so it just shuffled stuff around.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user spmallette commented on a diff in the pull request:

          https://github.com/apache/tinkerpop/pull/574#discussion_r106481769

          — Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java —
          @@ -1034,11 +1034,10 @@

          • @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>
            */
            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);
              • End diff –

          but you still use `from()` and `to()` with `addE()` right? we just now use it with path related stuff as well, so it relates to all of those things correct? I guess I'm saying that the javadoc should reference to the all the steps that `from()` and `to()` modulate.

          Show
          githubbot ASF GitHub Bot added a comment - Github user spmallette commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/574#discussion_r106481769 — Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java — @@ -1034,11 +1034,10 @@ @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> */ 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); End diff – but you still use `from()` and `to()` with `addE()` right? we just now use it with path related stuff as well, so it relates to all of those things correct? I guess I'm saying that the javadoc should reference to the all the steps that `from()` and `to()` modulate.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user spmallette commented on a diff in the pull request:

          https://github.com/apache/tinkerpop/pull/574#discussion_r106483016

          — Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathStep.java —
          @@ -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> {
              • End diff –

          ok - agreed. then please send a DISCUSS post for lazy consensus to dev to call attention to the issue so that folks are aware that there is a small chance of breakage in 3.2.5 if you use those steps in their code for any reason. We just did something similar with that `GraphManager` PR recently - it has a low low chance of breaking folks code as well.

          Show
          githubbot ASF GitHub Bot added a comment - Github user spmallette commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/574#discussion_r106483016 — Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathStep.java — @@ -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> { End diff – ok - agreed. then please send a DISCUSS post for lazy consensus to dev to call attention to the issue so that folks are aware that there is a small chance of breakage in 3.2.5 if you use those steps in their code for any reason. We just did something similar with that `GraphManager` PR recently - it has a low low chance of breaking folks code as well.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user okram commented on a diff in the pull request:

          https://github.com/apache/tinkerpop/pull/574#discussion_r106494779

          — Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java —
          @@ -1034,11 +1034,10 @@

          • @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>
            */
            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);
              • End diff –

          Added to and from step "stubs" to the-traversal.asciidoc and then reference it from `GraphTraversal` JavaDoc.

          Show
          githubbot ASF GitHub Bot added a comment - Github user okram commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/574#discussion_r106494779 — Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java — @@ -1034,11 +1034,10 @@ @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> */ 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); End diff – Added to and from step "stubs" to the-traversal.asciidoc and then reference it from `GraphTraversal` JavaDoc.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user okram commented on a diff in the pull request:

          https://github.com/apache/tinkerpop/pull/574#discussion_r106495135

          — Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathStep.java —
          @@ -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> {
              • End diff –

          Done.

          Show
          githubbot ASF GitHub Bot added a comment - Github user okram commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/574#discussion_r106495135 — Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathStep.java — @@ -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> { End diff – Done.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user spmallette commented on a diff in the pull request:

          https://github.com/apache/tinkerpop/pull/574#discussion_r106496036

          — Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java —
          @@ -1034,11 +1034,10 @@

          • @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>
            */
            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);
              • End diff –

          Doing it that way works as well. That was probably smart now that those steps apply to more than just `addEdge()`.

          Show
          githubbot ASF GitHub Bot added a comment - Github user spmallette commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/574#discussion_r106496036 — Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java — @@ -1034,11 +1034,10 @@ @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> */ 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); End diff – Doing it that way works as well. That was probably smart now that those steps apply to more than just `addEdge()`.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user spmallette commented on the issue:

          https://github.com/apache/tinkerpop/pull/574

          Looks like all my comments are satisfied. Just judging from the changes I sense this will merge to master without much of a hitch, but I've been getting in the habit of getting the master branch straight locally before pushing tp32 - that way they can push at the same time.

          Didn't really play with it but this looks like a really neat change. All tests pass with `docker/build.sh -t -n -i`

          VOTE +1

          Show
          githubbot ASF GitHub Bot added a comment - Github user spmallette commented on the issue: https://github.com/apache/tinkerpop/pull/574 Looks like all my comments are satisfied. Just judging from the changes I sense this will merge to master without much of a hitch, but I've been getting in the habit of getting the master branch straight locally before pushing tp32 - that way they can push at the same time. Didn't really play with it but this looks like a really neat change. All tests pass with `docker/build.sh -t -n -i` VOTE +1
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user dkuppitz commented on the issue:

          https://github.com/apache/tinkerpop/pull/574

          ```
          g.V().as("a").emit().repeat(both().as("b").simplePath().from("a").to("b")).path()
          ```
          ...emits all paths, including cyclic paths. Without the consoles output limit it would run into an infinite loop.

          Show
          githubbot ASF GitHub Bot added a comment - Github user dkuppitz commented on the issue: https://github.com/apache/tinkerpop/pull/574 ``` g.V().as("a").emit().repeat(both().as("b").simplePath().from("a").to("b")).path() ``` ...emits all paths, including cyclic paths. Without the consoles output limit it would run into an infinite loop.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user okram commented on the issue:

          https://github.com/apache/tinkerpop/pull/574

          @dkuppitz – okay? ... so.....

          Show
          githubbot ASF GitHub Bot added a comment - Github user okram commented on the issue: https://github.com/apache/tinkerpop/pull/574 @dkuppitz – okay? ... so.....
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user okram commented on the issue:

          https://github.com/apache/tinkerpop/pull/574

          @dkuppitz — Do you feel like adding your "playlist" example with text to `the-traversal.asciidoc` in the `SimplePath Step` section?

          Show
          githubbot ASF GitHub Bot added a comment - Github user okram commented on the issue: https://github.com/apache/tinkerpop/pull/574 @dkuppitz — Do you feel like adding your "playlist" example with text to `the-traversal.asciidoc` in the `SimplePath Step` section?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user dkuppitz commented on the issue:

          https://github.com/apache/tinkerpop/pull/574

          I'm going to add a different example. Starting with an empty graph:

          ```
          g = TinkerGraph.open().traversal()
          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()
          g.V("D").repeat(both().simplePath()).times(3).path()
          g.V("A").as("a").
          repeat(both().simplePath().from("a")).times(3).as("b").
          repeat(both().simplePath().from("b")).times(3).
          path()
          ````

          Why not the playlist example? Because I haven't found a playlist that had in fact duplicates in the second path.

          Show
          githubbot ASF GitHub Bot added a comment - Github user dkuppitz commented on the issue: https://github.com/apache/tinkerpop/pull/574 I'm going to add a different example. Starting with an empty graph: ``` g = TinkerGraph.open().traversal() 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() g.V("D").repeat(both().simplePath()).times(3).path() g.V("A").as("a"). repeat(both().simplePath().from("a")).times(3).as("b"). repeat(both().simplePath().from("b")).times(3). path() ```` Why not the playlist example? Because I haven't found a playlist that had in fact duplicates in the second path.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user dkuppitz commented on the issue:

          https://github.com/apache/tinkerpop/pull/574

          It's all working as expected now.

          VOTE: +1

          Show
          githubbot ASF GitHub Bot added a comment - Github user dkuppitz commented on the issue: https://github.com/apache/tinkerpop/pull/574 It's all working as expected now. VOTE: +1
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/tinkerpop/pull/574

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/574
          Hide
          dkuppitz Daniel Kuppitz added a comment -

          I just realized that tree() was not covered by this PR. Shall I create a new ticket?

          Show
          dkuppitz Daniel Kuppitz added a comment - I just realized that tree() was not covered by this PR. Shall I create a new ticket?
          Hide
          okram Marko A. Rodriguez added a comment -

          If adding to/from to tree() makes sense, then please do create another ticket with an example of expected behavior. Off the top of my head, it doesn't seem useful for to/from on tree. ?

          Show
          okram Marko A. Rodriguez added a comment - If adding to / from to tree() makes sense, then please do create another ticket with an example of expected behavior. Off the top of my head, it doesn't seem useful for to/from on tree. ?

            People

            • Assignee:
              okram Marko A. Rodriguez
              Reporter:
              dkuppitz Daniel Kuppitz
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development