Created
January 11, 2022 23:47
-
-
Save jalakoo/0295eb8e7c9efe1d7ade67a426d78631 to your computer and use it in GitHub Desktop.
discoveraurafree - week 2 - load data
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
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