1
Fork 0
mirror of https://github.com/Steffo99/unimore-bda-4.git synced 2024-11-26 09:54:22 +00:00
bda-4-steffo/scripts/import-cratesio/7-crate_owners.cypher

11 lines
448 B
Text
Raw Normal View History

2022-11-25 08:31:19 +00:00
MATCH (:User)-[owns:OWNS]->(:Crate)
DELETE owns;
LOAD CSV WITH HEADERS FROM "file:///crate_owners.csv" AS line FIELDTERMINATOR ","
MATCH (crate:Crate { id: toInteger(line.crate_id) })
MATCH (owner:User { id: toInteger(line.owner_id) })
CREATE (owner)-[ownership:OWNS {
created_at: apoc.date.parse(line.created_at, "ms", "yyyy-MM-dd HH:mm:ss"),
created_by: toInteger(line.created_by),
owner_kind: toInteger(line.owner_kind)
}]->(crate);