I have Graph database in Neo4j with Train stations as nodes, and train 
connecting these stations as directed relationship

for example Train station A is connected to Train station B via 
relationship train{train no : 123}, train relationship has a property 
called train no .

My question is getting a path from A to D with all intermediate stations 
connected with same train number.

A-->B-->C-->D

For this example I should get B, C as returned nodes

I tried

MATCH (from:TrainStation { stationCode:'A' }), 
(to:TrainStation {stationCode:'D'}) ,
path = (from)-[r:train*..]->(to)
RETURN path

This query gives me path related to all the trains, but I want to restrict 
it to specific train number 123

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to