Last active
May 5, 2019 08:26
-
-
Save vladbatushkov/b95f9a46c72d433f1a6b5e7454bdb6be to your computer and use it in GitHub Desktop.
Connect vehicels nd starships with films they are appeared in.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH "https://vbatushkov.bitbucket.io/swapi.json" AS url | |
CALL apoc.load.json(url) YIELD value | |
UNWIND value.films as film | |
UNWIND film.starships as starship_url | |
MATCH (f:Film { url: film.url }) | |
MATCH (s:Starship { url: starship_url }) | |
MERGE (s)-[:APPEARED_IN]->(f); | |
WITH "https://vbatushkov.bitbucket.io/swapi.json" AS url | |
CALL apoc.load.json(url) YIELD value | |
UNWIND value.films as film | |
UNWIND film.vehicles as vehicle_url | |
MATCH (f:Film { url: film.url }) | |
MATCH (v:Vehicle { url: vehicle_url }) | |
MERGE (v)-[:APPEARED_IN]->(f) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment