You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the second issue obtained from this wider problem: #5314 (you can find the first one here: #5330 )
Some specific conditions of the while statement in the traverse operator won't work when the chosen strategy is breadth_first. The only way to make them work is to add the limit keyword, but in this case the strategy breadth_first statement will be ignored (as pointed out here: #5330 )
The broken query is (together with some variations):
select $current.traversedVertex(-1), $path from
(
traverse * from #13:0
while
traversedVertex(-1)=traversedVertex(0)
or traversedVertex(-1).@class <> traversedVertex(0).@class
strategy breadth_first
)
limit -1
On the public dbs openBeer and Whisky this query will just run for hours (one night at least), while on smaller dbs it will return only the starting node. The script attached is a simple example (in the same form of the ones at #5314 ) that gives these results:
breadth_first without limit keyword
select $current.traversedVertex(-1), $path from
(
traverse * from #13:0
while
traversedVertex(-1)=traversedVertex(0)
or traversedVertex(-1).@class <> traversedVertex(0).@class
strategy breadth_first
)
limit -1
depth_first (limit keyword has no effects apart from the documented ones)
select $current.traversedVertex(-1), $path from
(
traverse * from #13:0
while
traversedVertex(-1)=traversedVertex(0)
or traversedVertex(-1).@class <> traversedVertex(0).@class
strategy depth_first
)
limit -1
This is the second issue obtained from this wider problem: #5314 (you can find the first one here: #5330 )
Some specific conditions of the
while
statement in thetraverse
operator won't work when the chosen strategy isbreadth_first
. The only way to make them work is to add thelimit
keyword, but in this case thestrategy breadth_first
statement will be ignored (as pointed out here: #5330 )The broken query is (together with some variations):
On the public dbs openBeer and Whisky this query will just run for hours (one night at least), while on smaller dbs it will return only the starting node. The script attached is a simple example (in the same form of the ones at #5314 ) that gives these results:
Results:
Results (note the depth_first order):
Results (Wrongly equal to query number 2):
TraversedVertex_BreadthFirst_check3.txt
The text was updated successfully, but these errors were encountered: