Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
05-03-2020 07:36 PM
Hello,
Any idea why my variable pID become empty after when calling UNWIND rbs AS rb in this query:
Match p=(Do:Departure)<-[:
BOARD_AT
]-(O:Origin)-[OD]->(D:Destination)-[:BOARD_AT
]->(DD:Departure), (Dp:Departure)
Where Dp<>Do and Dp<>DD
WITH 60 as K, OD.duration_min+120 as time,O,D,Dp
WITH time-K as LB,O,D,Dp
Call apoc.algo.dijkstra(O,Dp,'2016-01<|ALIGHT_AT|CONNECT_TO<', 'duration_min') yield path as pIO, weight as wIO
WHERE none (n IN nodes(pIO) WHERE n.code=D.code)
With distinct Dp,collect(wIO) as WIO, collect(pIO) as PIO, LB,D
Call apoc.algo.dijkstra(D,Dp,'2016-01<|ALIGHT_AT|CONNECT_TO<', 'duration_min') yield path as pID, weight as wID
Unwind WIO as wIO
Unwind PIO as pIO
With wID-wIO as dif1,LB,pIO,pID,Dp
Where dif1>=LB
Set Dp:Supported
With relationships(pIO) AS rpo,Dp, length(pIO) as l,pID
with tail(rpo) as relsIO,pID
with size(relsIO) as lo, relsIO,pID
with range(0,lo) as i, relsIO,lo,pID
unwind i as ii
with relsIO[ii..ii+1] as rs,ii,relsIO[ii-1..ii] as rbs,lo,relsIO,tail(relsIO) as bgrs,pID
unwind rs as r
unwind rbs as rb
unwind bgrs as bgr
with startNode(bgr) as sb, endNode(bgr) as eb,ii, r,startNode(r) as s, endNode(r) as e, type(r) as t,startNode(rb) as ss, endNode(rb) as ee,pID
Thank you
Solved! Go to Solution.
05-10-2020 12:36 AM
As you said, I think because of null value. I fixed it the problem by grouping paths using collect
Thank you
05-07-2020 07:40 AM
As in it has a null value when it isn't null without the unwind?
Could you try and create a smaller query and sample dataset that reproduces this issue? I can't see that there's anything wrong just from looking at the query.
05-10-2020 12:36 AM
As you said, I think because of null value. I fixed it the problem by grouping paths using collect
Thank you
All the sessions of the conference are now available online