Skip to content

Instantly share code, notes, and snippets.

@vladbatushkov
Created May 5, 2019 07:42
Show Gist options
  • Save vladbatushkov/c91d957f6a08c2f6599267a4f3f8dfb3 to your computer and use it in GitHub Desktop.
Save vladbatushkov/c91d957f6a08c2f6599267a4f3f8dfb3 to your computer and use it in GitHub Desktop.
Main nodes of the saga, includes filmes, characters and planets.
WITH "https://vbatushkov.bitbucket.io/swapi.json" AS url
CALL apoc.load.json(url) YIELD value
UNWIND value.films AS film
UNWIND value.people AS character
UNWIND value.planets AS planet
MERGE (:Film { name: film.title, url: film.url })
MERGE (:Character { name: character.name, url: character.url })
MERGE (:Planet { name: planet.name, url: planet.url })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment