1
Fork 0
mirror of https://github.com/Steffo99/unimore-bda-4.git synced 2024-11-22 16:14:17 +00:00
bda-4-steffo/scripts/import-cratesio/2-keywords.cypher

14 lines
438 B
Text
Raw Normal View History

2022-11-25 08:31:19 +00:00
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;