Skip to content

Instantly share code, notes, and snippets.

@lassewesth
Created July 11, 2018 08:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lassewesth/2d6402a43ee1126b3452ba4d2a9aa4bd to your computer and use it in GitHub Desktop.
Save lassewesth/2d6402a43ee1126b3452ba4d2a9aa4bd to your computer and use it in GitHub Desktop.
A Cypher statement that imports E-road data from a CSV
USING PERIODIC COMMIT 1000
LOAD CSV WITH HEADERS FROM "https://gist.githubusercontent.com/lassewesth/634281cced11147432cf232a2c36e080/raw/1ed1f4fe4ca4c8092bbc8557addd1e5d87316833/eroads.csv" AS row
MERGE (origin:ReferencePlace {name: row.origin_reference_place, country_code: row.origin_country_code})
MERGE (destination:ReferencePlace {name: row.destination_reference_place, country_code: row.destination_country_code})
CREATE (origin)-[:EROAD {road_number: row.road_number, distance: row.distance, watercrossing: row.watercrossing}]->(destination)
WITH "Århus" AS homeTown
MATCH (aarhus:ReferencePlace {name: homeTown})
RETURN aarhus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment