Thanks a lot Tom. That is one of the possibilities I am considering.
The relationship structure I am looking at is more like, (amsterdam:City) - [:HAS_FLIGHT]-> (klm:Flight) - [:FLYING_TO] -> (delhi:City). I am however also trying to figure out if there is any other way specify the query without modifying the structure of the graph. Its just a matter of curiosity :) -- Thanks and Regards Mahesh Lal On 31 October 2014 22:49, Tom Zeppenfeldt <t.zeppenfe...@ophileon.com> wrote: > would modeling this way work ? > > (a:City)->[:FROM]-(f:Flight)-[:TO]->(b:City) > > and matching it against > > (a)-[:FROM|TO*2..12]->(b) > > > Having Flight nodes makes sense I guess, especially when you want to link > for instance crewmembers or passengers to the flight. > > HtH > > > > > Met vriendelijke groet / With kind regards > > > > Ir. T. Zeppenfeldt > van der Waalsstraat 30 > 6706 JR Wageningen > The Netherlands > > Mobile: +31 6 23 28 78 06 > Phone: +31 3 17 84 22 17 > E-mail: t.zeppenfe...@ophileon.com > <t.zeppenfe...@ophileon.com>Web: www.ophileon.com > Twitter: tomzeppenfeldt > Skype: tomzeppenfeldt > > 2014-10-31 18:00 GMT+01:00 Mahesh Lal <mahesh.2...@gmail.com>: > >> Hi, >> >> I have a problem in which I need to specify repeating path patterns in >> Cypher. >> >> The Problem: >> Find the route between two cities which aren't directly connected to each >> other. >> >> Original design: >> (a:City)-[:FLIGHT]->(b:City) >> >> To get the shortest route, I could simply run a query that specified >> (i:City{name:"Istanbul"})-[r:FLIGHT*1..6]->(l:City{name:"Ulan Bator"}) to >> say that the path length could be arbitrary, and then process the returned >> paths >> >> However, flight is a hyperedge, which means we need to model it >> differently. >> >> New Design: >> (a:City)<-[:LEAVES_FROM]-(:Flight)-[:GOES_TO]->(b:City) >> >> How do I define a path of arbitrary length in this? >> >> Does the design even make sense from a semantic perspective? >> >> Any help would be appreciated. >> >> >> -- Thanks and Regards >> Mahesh Lal >> >> -- >> 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 neo4j+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. >> > > -- > 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 neo4j+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- 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 neo4j+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.