I have a CSV file with data like:
ID,Name,Role,Project 1,James,Owner,TST 2,Ed,Assistant,TST 3,Jack,Manager,TST
and you want to create people whose relationship with the project is indicated in it. I tried to do it as follows:
load csv from 'file:/../x.csv' as line match (p:Project {code: line[3]}) create (n:Individual {name: line[1]})-[r:line[2]]->(p);
but these are barfs with:
Invalid input '[': expected character identifier, space, '|', length specification, property map or ']' (line 1, column 159 (offset: 158))
since it cannot look like a dereferenced line in creating relationships. if I hard code that it works:
load csv from 'file:/../x.csv' as line match (p:Project {code: line[3]}) create (n:Individual {name: line[1]})-[r:WORKSFOR]->(p);
so how can i make a link?
source share