我打算将我的整个图(具有关系的节点和“独立”节点)导出到 Gephi 中。为了实现它,我当前执行了两个查询:
// export relationships
match path = (n)--()
with collect(path) as paths
call apoc.gephi.add(null, 'workspace1', paths, '', ['attr1', 'attr2']) yield nodes, relationships, time
return nodes, relationships, time
// export independent nodes
match path = (p)
where not (p)--()
with collect(path) as paths
call apoc.gephi.add(null, 'workspace1', paths, '', ['attr1', 'attr2']) yield nodes, relationships, time
return nodes, relationships, time
我试图用一个查询替换它们,例如:
match path = (n)-[*0..]-()
with collect(path) as paths
call apoc.gephi.add(null, 'workspace1', paths, '', ['attr1', 'attr2']) yield nodes, relationships, time
return nodes, relationships, time
不幸的是,查询永远不会完成并且有效地 DoS-es Neo4j(导致 Neo4j 端的 CPU 和 RAM 消耗高,并使其无响应)。我也试图限制与的关系深度,[*0..10]
但没有帮助。
使用单个查询导出数据的正确方法是什么?