Skip to content

Instantly share code, notes, and snippets.

@mebibou
Created August 18, 2013 07:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mebibou/6260379 to your computer and use it in GitHub Desktop.
Save mebibou/6260379 to your computer and use it in GitHub Desktop.
simple map
== The setup
This is a simple map.
//setup
//hide
[source,cypher]
----
CREATE (s1:Stop {name:"First Stop"})
CREATE (s2:Stop {name:"Second Stop"})
CREATE (s3:Stop {name:"Third Stop"})
CREATE (s4:Stop {name:"Fourth Stop"})
CREATE (s5:Stop {name:"Fifth Stop"})
CREATE (s6:Stop {name:"Sixth Stop"})
CREATE (s1)-[:STOPS_STOPS{lineId:1}]->(s2)
CREATE (s2)-[:STOPS_STOPS{lineId:1}]->(s3)
CREATE (s3)-[:STOPS_STOPS{lineId:1}]->(s4)
CREATE (s4)-[:STOPS_STOPS{lineId:1}]->(s5)
CREATE (s4)-[:STOPS_STOPS{lineId:1}]->(s6)
----
== Find all the stops for Line `1` to create a map
Here, all the stops that make up the line should be found in order to create a map
[source,cypher]
----
MATCH (stop1)-[r:STOPS_STOPS]->(stop2)
WHERE r.lineId?=1
RETURN stop1, r, stop2
----
//table
== console
//console
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment