我已经从CSV导入中创建了一组节点,并将其标记为' Argument'。
我有另一个CSV文件,其中包含我想要的Connector_ID,Start_Object_ID,End_Object_ID:
目前,我只能使用以下方式创建关系(有效语法但无效)
LOAD CSV WITH HEADERS FROM "file:///Users/argument_has_part_argument.txt" AS row
MATCH (argument1:Argument {object_ID: row.Start_Object_ID})
MATCH (argument2:Argument {object_ID: row.End_Object_ID})
MERGE (argument1)-[:has_part]->(argument2);
但还不能看到
任何指针?
答案 0 :(得分:1)
来自:http://neo4j.com/developer/guide-import-csv/#_csv_data_quality
Cypher支架
Cypher看到的是将要导入的内容,因此您可以利用它来获得优势。您可以使用LOAD CSV而无需创建图形结构,只需输出样本,计数或分布。因此,还可以检测不正确的标题列计数,分隔符,引号,转义或标题名称的拼写。
// assert correct line count
LOAD CSV FROM "file-url" AS line
RETURN count(*);
// check first few raw lines
LOAD CSV FROM "file-url" AS line WITH line
RETURN line
LIMIT 5;
// check first 5 line-sample with header-mapping
LOAD CSV WITH HEADERS FROM "file-url" AS line WITH line
RETURN line
LIMIT 5;
关于你的上一个问题:
LOAD CSV WITH HEADERS FROM "file:///Users/argument_has_part_argument.txt" AS row
MATCH (argument1:Argument {object_ID: row.Start_Object_ID})
MATCH (argument2:Argument {object_ID: row.End_Object_ID})
MERGE (argument1)-[r:has_part]->(argument2)
ON CREATE SET r.connector_ID = row.Connector_ID;