Skip to content

Instantly share code, notes, and snippets.

@vladbatushkov
Created May 5, 2019 07:50
Show Gist options
  • Save vladbatushkov/2c60659516f06500d4b98c583b8dce22 to your computer and use it in GitHub Desktop.
Save vladbatushkov/2c60659516f06500d4b98c583b8dce22 to your computer and use it in GitHub Desktop.
Species to planet as a homewolrd relationship.
WITH "https://vbatushkov.bitbucket.io/swapi.json" AS url
CALL apoc.load.json(url) YIELD value
UNWIND value.species as species
MATCH (spec:Species { url: species.url })
MATCH (p:Planet { url: species.homeworld })
MERGE (spec)-[:HOMEWORLD]->(p)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment