I am using FalkorDb 4.0.5 which is a fork of the now discontinued Redis Graph.
My simplified test case:
GRAPH.QUERY g
// Create 4 nodes:
"CREATE (w:Work{name:'Work'}), (a:City{name:'A'}), (b:City{name:'B'}), (c:City{name:'C'}),
// Create "Road" edges, each with an `x` property:
(w)-[r0:Road{x:0}]->(a), (a)-[r1:Road{x:1}]->(b), (b)-[r2:Road{x:2}]->(c),
// Add "Accom" edges, also with an `x` property:
(a)-[a1:Accom{x:10}]->(h1:Hotel{name:'Hilton'}),
(a)-[a2:Accom{x:11}]->(h2:Hotel{name:'Marriot'}),
(c)-[a3:Accom{x:12}]->(h3:Hotel{name:'Marriot'})
RETURN w,a,b,c,r0,r1,r2,a1,h1,a2,h2,a3,h3"
This results in a graph that looks like this with the x values on each edge shown:

So, the x in the path looks like:
(Work)-[x:0]-(A)-[x:1]-(B)-[x:2]-(C)
I am trying to work out how to write a query so I get 2 paths (because City A has 2 Accom edges: Hilton and Marriot) that looks like the following schematic.
for Hilton: (Work)-[x:10]-(A)-[x:1]-(B)-[x:2 ]-(C)
for Marriot: (Work)-[x:11]-(A)-[x:1]-(B)-[x:12]-(C)
{repeat for other Hotels found attached to A ...}
i.e: Make a path from Work to C for each Hotel found attached to A (Hilton and Marriot in this case, but could be many others). Each path needs to be updated to reflect the x found on the Accom edge where that same Hotel is attached to the Town.
This is the query for the path for just the Road edges:
GRAPH.QUERY g "MATCH path=(p)-[r:Road*]->(c) RETURN path"
which yields the (Work)-[x:0]-(A)-[x:1]-(B)-[x:2]-(C).
But what query to get the two paths listed above?
Edit: Maybe I just need to do the following to get all the data then work it out in my application (Java / Quarkus)
GRAPH.QUERY g "MATCH path=(p)-[r]->(c) RETURN path"
Yields:
1) 1) "[(0), [0], (1)]"
2) 1) "[(1), [1], (2)]"
3) 1) "[(1), [3], (4)]"
4) 1) "[(1), [4], (5)]"
5) 1) "[(2), [2], (3)]"
6) 1) "[(3), [5], (6)]"
Thanks!
What about:
Although it might be a bit too specific, as it requires the Hotel node to be directly connected to the first City reachable from Work.