我有一个看起来像这样的csv:
empname Department Company
AbdulMarianneB Marketing MARG
AdamsCarrollL Sales MARG
我想使用此代码导入neo4j
LOAD CSV with headers from "file:///C:/Users/Sarah/Desktop/nodes/EmployeeListcsv1.csv" as row
merge (e :empname {name: row.empname})
merge(d :Department {name: row.Department})
merge(c :Company {name: row.Company})
merge (e)-[: works_in]->(c)
merge(d)-[:is_in]->(c);
上面的这个块给出了错误:
无法使用名称
的null属性值合并节点
答案 0 :(得分:0)
CSV文件的格式不符合required specifications:
,
; FIELDTERMINATOR
更改字段终止符字符; 因此,您必须修改源文件。或者,例如,明确指定列separator:
LOAD CSV with headers from
"file:///C:/Users/Sarah/Desktop/nodes/EmployeeListcsv1.csv" as row
FIELDTERMINATOR " "
merge (e :empname {name: row.empname})
merge(d :Department {name: row.Department})
merge(c :Company {name: row.Company})
merge (e)-[: works_in]->(c)
merge(d)-[:is_in]->(c);