无法合并节点

时间:2016-07-31 13:57:04

标签: neo4j

我有一个看起来像这样的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属性值合并节点

1 个答案:

答案 0 :(得分:0)

CSV文件的格式不符合required specifications

  • 默认字段终止符为,;
  • 可以使用LOAD CSV命令中提供的选项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);