cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Create relationship from a relationship CSV

Hi, I am new to Neo4j and I couldn't find the answer directly by looking for it in this forum.

I want to create relationships from a csv on already existing nodes.

These are the CSV's I have with the following data:
object.csv
unid,name

object-link.csv
unid,parentid,childid

The parentid/childid's from the object-link.csv are matching the unids from object.csv. How can I connect the parents to the childs from the object-link.csv?

Thanks!

1 REPLY 1

ameyasoft
Graph Maven

Assuming you created a Person node with unid, name as properties from object.csv

From object-link.csv

MATCH (p:Person) WHERE p.unid = line.parentid
MATCH (p1:Person) WHERE p1.unid = line.childid

WITH p, p1, line

MERGE (p)-[:PARENT_OF]->(p1)