Neo4j如何从带有属性的CSV加载关系

时间:2018-12-16 12:04:53

标签: neo4j cypher graph-databases load-csv

我一直试图加载2个csv文件来创建实体和关系。

这是针对实体的:

USING PERIODIC COMMIT 1000
LOAD CSV WITH HEADERS FROM "file:///jobs.csv" AS row
MERGE (j:JOB {order_id: row.child_order_id})
SET j.job_name = row.child_job_name,
            j.job_owner = row.child_job_owner,
            j.group_name = row.child_group_name,
            j.order_time = row.child_order_time,
            j.start_time = row.child_start_time,
            j.end_time = row.child_end_time,
            j.elasped_min = row.elasped_min;

这是一种关系:

USING PERIODIC COMMIT 1000
LOAD CSV WITH HEADERS FROM "file:///child_father.csv" AS row
MATCH (c:JOB {order_id: row.child_order_id})
MATCH (f:JOB {order_id: row.father_order_id})
MERGE (c)-[d:DEPENDS_ON]->(f)
ON CREATE SET d.elapsed_min = row.elasped_min;

我想加载关系并使它们具有属性elapsed_min,但最终却没有它。

0 个答案:

没有答案