加载csv时出现Neo4j数据库错误

时间:2016-04-17 22:58:55

标签: neo4j spring-data-neo4j

运行时,

LOAD CSV WITH HEADERS FROM "file:///E:/data.csv" AS line
MERGE (n:MyNode {Name:line.Source})
MERGE (m:MyNode {Name:line.Target})
MERGE (n) -[:TO {dist:line.distance}]-> (m)

我收到了这条消息:

Cannot merge node using null property value for Name

标题是:

OFFICIAL_SYMBOL_A,OFFICIAL_SYMBOL_B,EXPERIMENTAL_SYSTEM
MAP2K4,FLNC,Two-hybrid
MYPN,ACTN2,Two-hybrid
ACVR1,FNTA,Two-hybrid
GATA2,PML,Two-hybrid
RPA2,STAT3,Two-hybrid

1 个答案:

答案 0 :(得分:0)

您获得的错误是CSV中没有line.property(因此" null"抱怨。)

您需要使用CSV标题中的字段名称才能生效。我猜测哪个标题字段对应哪一行。*参考 - 您需要根据自己的情况对其进行更改并相应地应用:

LOAD CSV WITH HEADERS FROM "file:///E:/data.csv" AS line
MERGE (n:MyNode {Name:line.OFFICIAL_SYMBOL_A})
MERGE (m:MyNode {Name:line.OFFICIAL_SYMBOL_B})
MERGE (n) -[:TO {dist:line.EXPERIMENTAL_SYSTEM}]-> (m)