Skip to content

Instantly share code, notes, and snippets.

@jalakoo
Created January 11, 2022 23:47
Show Gist options
  • Save jalakoo/0295eb8e7c9efe1d7ade67a426d78631 to your computer and use it in GitHub Desktop.
Save jalakoo/0295eb8e7c9efe1d7ade67a426d78631 to your computer and use it in GitHub Desktop.
discoveraurafree - week 2 - load data
LOAD CSV WITH HEADERS FROM "https://raw.githubusercontent.com/ThaWeatherman/scrapers/b8757711296703356891f8f4e7757de6698a6b5b/boardgamegeek/games.csv" AS ROW
WITH ROW WHERE tointeger(row.playingtime) > 9
AND tointeger(row.playingtime) <61
CREATE (g:Game {name:row.name, weight:tofloat(row.average_weight),
rating:tofloat(row.average_rating),
playingTime:tointeger(row.playingtime), id:row.id})
MERGE (pmin:PlayerCount {value:tointeger(row.minplayers)})
MERGE (pmax:PlayerCount {value:tointeger(row.maxplayers)})
WITH g, pmin, pmax
CREATE (g)-[:HAS_MIN_PLAYERS]->(pmin)
CREATE (g)-[:HAS_MAX_PLAYERS]->(pmax)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment