Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-14-2021 08:16 PM
Hi All
I want create relationships between a (a1,a2,a3...) and b (b1,b2,b3...),
where relationships are c (c1,c2,c3...).
(like a1-[:c1]->b1, a2-[:c2]->b2, a3-[:c3]->b3...)
How can I do ?
LOAD CSV WITH HEADERS FROM "file:///abc.csv" AS line
MATCH ( a: ee { ee_id: line.from } )
MATCH ( b: ee { ee_id: line.to } )
MATCH ( c: r { r_id :line.id } )
MERGE (a)-[ :c]->(b)
03-15-2021 07:18 AM
Hi yasinlyu,
welcome in the Neo4j community!
Shall the relationships be of variable "type", i.e. label? What do you mean by "[:c]"? Do you want the relationship to just have the properties of c?
If you "simply" have trouble loading several edges with same type, have a look here: How to create a relation from two columns in one table? - Neo4j Graph Platform / Cypher - Neo4j Onli...
If you want variable label relationships, have a look here: apoc.refactor.setType - APOC Documentation (neo4j.com)
If you have further problems, do not hesitate to ask.
Hope this helps.
Regards,
Elena
All the sessions of the conference are now available online