wine icon indicating copy to clipboard operation
wine copied to clipboard

Creating relationships with Neo4j 5.0

Open adisD opened this issue 3 years ago • 0 comments

Hello, did anyone tried to migrate to neo4j 5 a script that establish relationships? It does exceed my cipher for neo4j skills. I am fully aware of how commit got obsolete and replaced it with a statement call {...} in transactions, but chained CASE statements got stopped me.

:auto //add this line if you're using Neo4j Browser USING PERIODIC COMMIT 1000 LOAD CSV WITH HEADERS FROM 'https://raw.githubusercontent.com/lju-lazarevic/wine/master/data/winemag-data-130k-v3.csv' AS row FOREACH (i IN CASE WHEN row.designation IS NOT NULL THEN [row.designation] ELSE ["No Designation"] END | MERGE (d:Designation {name:i})) FOREACH (i IN CASE WHEN row.taster_name IS NOT NULL THEN [row.taster_name] ELSE ["No Taster"] END | MERGE (t:Taster {name:i})) FOREACH (i IN CASE WHEN row.variety IS NOT NULL THEN [row.variety] ELSE ["No Variety"] END | MERGE (v:Variety {name:i})) CREATE (w:Wine {id:row.id, title:row.title})

adisD avatar Nov 06 '22 21:11 adisD