1
Fork 0
mirror of https://github.com/Steffo99/unimore-bda-4.git synced 2024-11-22 08:04:19 +00:00
bda-4-steffo/scripts/import-cratesio/2-keywords.cypher
2023-03-05 21:49:24 +01:00

13 lines
438 B
Text

CREATE RANGE INDEX index_keyword_id IF NOT EXISTS
FOR (keyword:Keyword)
ON (keyword.id);
CREATE TEXT INDEX index_keyword_name IF NOT EXISTS
FOR (keyword:Keyword)
ON (keyword.name);
LOAD CSV WITH HEADERS FROM "file:///keywords.csv" AS line FIELDTERMINATOR ","
MERGE (keyword:Keyword { id: toInteger(line.id) })
SET
keyword.created_at = apoc.date.parse(line.created_at, "ms", "yyyy-MM-dd HH:mm:ss"),
keyword.name = line.keyword;