Skip to content

Instantly share code, notes, and snippets.

@vladbatushkov
Created May 5, 2019 07:43
Show Gist options
  • Save vladbatushkov/591517eedee6c0e2973d33c9c813c381 to your computer and use it in GitHub Desktop.
Save vladbatushkov/591517eedee6c0e2973d33c9c813c381 to your computer and use it in GitHub Desktop.
Create species, vehicles and starships.
WITH "https://vbatushkov.bitbucket.io/swapi.json" AS url
CALL apoc.load.json(url) YIELD value
UNWIND value.species AS spec
UNWIND value.vehicles AS vehicle
UNWIND value.starships AS starship
MERGE (:Species { name: spec.name, url: spec.url })
MERGE (:Vehicle { name: vehicle.name, url: vehicle.url })
MERGE (:Starship { name: starship.name, url: starship.url })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment