使用调用后无法保留关系方向 apoc.refactor.cloneNodesWithRelationships

Relationship Direction can't be retained after using call apoc.refactor.cloneNodesWithRelationships

我正在使用 neo4j 社区版 3.0.6 和 apoc 3.0.8.6。 我在尝试复制已经具有多重关系的节点时遇到了这个问题。 然后当我使用 call apoc.refactor.cloneNodesWithRelationships([node1,node2,… ]) 时,节点及其关系被复制。 但是关系方向是错误的。 附上下面的图片。如图所示,A-B 之间的关系方向是错误的。似乎在那里建立的所有关系都被视为外向关系。 这是 apoc 3.0.8.6 上的错误还是有关于此问题的任何解决方案?

谢谢

我看到你创建了 APOC issue #936 for this, which appears to be a duplicate of issue #229

我已将 a comment 添加到问题 #229 中,其中包含我对 APOC 错误的分析。

有关此问题的更新。抱歉,但刚刚发现这是我的查询错误。 我确实使用了这样的查询。

MATCH (p:A)-[r1:A_has_B]->(l:B) 
WHERE p.id IN {0} WITH COLLECT(l) as oldBList 
CALL apoc.refactor.cloneNodesWithRelationships(oldBList) YIELD output 
CALL apoc.create.uuid() YIELD uuid SET output.id = uuid 
WITH COLLECT(output.id) as copiedIds
MATCH (l2:B)-[r1]-() 
WHERE l2.id IN copiedIdsAND r1.id IS NOT NULL 
CALL apoc.create.uuid() YIELD uuid 
SET r1.id = uuid 
WITH copiedIds as copiedIds
UNWIND(copiedIds) as result
RETURN result

显然我有一个案例,其中与具有 r.id 的 B 没有任何关系,因此 copiedIds 以某种方式未返回到结果查询。让它看起来像是交易问题。

感谢大家的帮助