0
votes

We have a big website with persons and how they are related.

Now we try to import them into neo4j and within the import process we get duplicate nodes of one Person and they are connected with SAME_AS-edges.

enter image description here

Person-Nodes can have one or more SAME_AS-edges but only the node starting with a major character is the main node and all other nodes should be merged to that main node.

enter image description here

Unfortunatelly the SAME_AS-edges do not always point to the main person-node (as you can see in the first picture).

Any help would be great.

1
First option is to make better MATCH in order to avoid creating a new node. For that, see if a custom procedure for matching or creating a person would do the job Second option is to refactor periodically (see with apoc) by merging infos from nodes tied by a SAME_AS relation and recreate all relations from from a node on the second. I think Apoc can do that too github.com/neo4j-contrib/neo4j-apoc-procedures - Jerome_B

1 Answers

0
votes

Have a look at apoc.refactor.mergeNodes([node1,node2]) as it merge nodes onto first in list