我有一个csv关系文件。我必须将此关系加载到neo4j,但是我不能。我已经创建了News节点,并且该节点具有唯一的ID。
csv文件具有iStart, iRel, iEnd
列。谢谢
示例.csv
文件如下:
iStart iRel iEnd
------------------------
114471 IS 2225
这是我的代码:
LOAD CSV WITH HEADERS FROM "file:///try.csv" as input
MATCH (from:News {id: input.iStart}), (to:News {id: input.iEnd})
CREATE (from)-[:RELATION { type: input.iRel }]->(to);
答案 0 :(得分:0)
尝试这个:
LOAD CSV WITH HEADERS FROM 'file:///try.csv' as input
CREATE (fromnews:FromNews{id: input.iStart}),(tonews:ToNews{id: input.iEnd})
WITH fromnews,tonews
CREATE (fromnews)-[:RELATION{type: input.iRel}]->(tonews );