In our graph we have some nodes of persons which are connected with SAME_AS-edges, because they all mean the same person.
One of the nodes, with the name-property starting with a major character and a number is the main node, to which all others should be merges to.
Any help would be great.
答案 0 :(得分:0)
就像杰罗姆所说的那样,你应该使用APOC
来执行apoc.refactor.mergeNodes
程序。
但如果出现以下情况,您可能会遇到错误:
所以要解决这个问题,你可以这样做:
MATCH (n1:Person {name:$name1}),
(n2:Person {name:$name2}),
(n3:Person {name:$name3}),
(n4:Person {name:$name4})
WITH head( collect( [n1, n2, n3, n4] ) ) AS nodes
CALL apoc.refactor.mergeNodes(nodes) YIELD node
RETURN node