Neo4j load CSV to create dynamic relationship types

后端 未结 1 1473
野趣味
野趣味 2020-12-18 15:11

I can load CSV into Neo4j for a specific label (say PERSON) and the nodes are created under the label PERSON.

I also have another CSV to i

相关标签:
1条回答
  • 2020-12-18 15:48

    You can install the APOC library and then use apoc.merge.relationship

    apoc.merge.relationship(startNode, relType, {key:value, ...}, {key:value, ...}, endNode) - merge relationship with dynamic type

    load csv with headers from "file:///d:/Resources/Neo4j/person-rel.csv" as p
    match (a:PERSON) where a.name=p.name1
    match (b:PERSON) where b.name=p.name2
    call apoc.merge.relationship(a,p.REL,{},{},b) yield rel
    return count(*);
    
    0 讨论(0)
提交回复
热议问题