[
https://issues.apache.org/jira/browse/TINKERPOP-2851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17678854#comment-17678854
]
Stephen Mallette commented on TINKERPOP-2851:
---------------------------------------------
Your example output and mine don't align. I don't know why that is, but here is
what I get with your sample data and ids from your queries:
{code}
gremlin> g.V(36).repeat(out().simplePath()).until(hasId(259)).path().count()
==>6
gremlin> g.V(259).repeat(out().simplePath()).until(hasId(21)).path().count()
==>10
gremlin>
g.V(36).repeat(out().simplePath()).until(hasId(259)).repeat(out().simplePath()).until(hasId(21)).path().count()
==>0
{code}
I think things are working as expected. You are using {{simplePath()}} in the
second {{repeat()}} and that is going to start with vertex 259 at that point.
For my example above, I get 0 results because it is traversing over vertices it
has already seen on its way to 21. You can see that here when i get rid of the
second {{simplePath()}}:
{code}
gremlin>
g.V(36).repeat(out().simplePath()).until(hasId(259)).repeat(out()).until(hasId(21)).path()
==>[v[36],v[77],v[233],v[168],v[259],v[233],v[21]]
==>[v[36],v[77],v[233],v[168],v[259],v[225],v[123],v[233],v[21]]
==>[v[36],v[77],v[233],v[168],v[259],v[132],v[123],v[233],v[21]]
==>[v[36],v[77],v[233],v[168],v[259],v[225],v[123],v[77],v[233],v[21]]
==>[v[36],v[77],v[233],v[168],v[259],v[225],v[220],v[123],v[233],v[21]]
==>[v[36],v[77],v[233],v[168],v[259],v[132],v[123],v[77],v[233],v[21]]
==>[v[36],v[77],v[233],v[168],v[259],v[233],v[132],v[123],v[233],v[21]]
==>[v[36],v[77],v[233],v[168],v[259],v[233],v[168],v[259],v[233],v[21]]
==>[v[36],v[77],v[233],v[168],v[259],v[225],v[123],v[77],v[77],v[233],v[21]]
==>[v[36],v[77],v[233],v[168],v[259],v[225],v[123],v[36],v[77],v[233],v[21]]
==>[v[36],v[77],v[233],v[168],v[259],v[225],v[123],v[132],v[123],v[233],v[21]]
==>[v[36],v[77],v[233],v[168],v[259],v[225],v[220],v[168],v[259],v[233],v[21]]
...
{code}
So, all of them filter out. {{simplePath()}} is not applied locally to the
{{repeat()}} but to the traversal path as a whole and that is expected behavior.
> TinkerPop could not deal with correct path traversal results
> ------------------------------------------------------------
>
> Key: TINKERPOP-2851
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2851
> Project: TinkerPop
> Issue Type: Bug
> Components: process
> Affects Versions: 3.4.10, 3.6.1
> Environment: Version: 3.4.10
> Storage Backend: in-memory
> Reporter: Zeyang Zhuang
> Priority: Major
>
> - Expected Behavior:
> We construct the following scenario: x equals count nodes(A->B) path numbers,
> y equals count nodes(B->C) path numbers, z equals count(A->B->C) path
> numbers. Then z should equal to x*y.
> We generate graph schema and data based on random strings and values. We
> build the graph with 100 vertexes, 200 edges, 20 vertex labels, and 20 edge
> labels.
> `g.V().id()` is used to get the node ids of the graph, then can use for loop
> to traverse all the nodes. Here is one of our examples executed.
> 1) `g.V(46).repeat(out().simplePath()).until(hasId(0)).path().size()` return 9
> 2) `g.V(0).repeat(out().simplePath()).until(hasId(276)).path().size()` return
> 8
> 3)
> `g.V(46).repeat(out().simplePath()).until(hasId(0)).repeat(out().simplePath()).until(hasId(276)).path().size()`,
> should return 9*8.
> - Current Behavior:
> The query 3 return 7 != 9*8.
> - Steps to Reproduce:
> Although the randomness of the graph data generation process, we still find
> the problem after many attempts. Reproduce: Generate a large enough graph ->
> Get all node ids -> Count the number of paths for any two ids -> Multiply and
> compare following our strategy.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)