2017-11-15 3 views
0

グラフ全体(関係と "独立"ノードの両方のノード)をGephiにエクスポートしようとしています。_all_ノードとすべての関係をNeo4jからGephiにエクスポートするには?

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(:私はのような単一のクエリでそれらを交換しようとしてい

// 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 

:それを達成するために、私は2つのクエリを実行currenly Neo4j側でCPUとRAMの消費量が多くなり、応答が遅くなります)。 私も[*0..10]でリレーションの深さを制限しようとしましたが、それは役に立ちませんでした。

単一のクエリでデータをエクスポートする正しい方法は何ですか?

+0

neo4jインスタンスをシャットダウンしてグラフフォルダにアクセスできる場合は、[neo4j-admin](https://neo4j.com/docs/operations-manual/current/tools/dump-load/)を使用して、 –

答えて

1

私はあなたのケースでは次のことをしようと...

match path = (n)-[*0..1]->() 
with collect(path) as paths 
call apoc.gephi.add(null, 'workspace1', paths, '', ['attr1', 'attr2']) yield nodes, relationships, time 
return nodes, relationships, time 

は、だから我々は唯一の1ホップに関係し、制限の方向を追加しました。このようにして、複製のエクスポートを取り除き、エクスポートを高速化します。

関連する問題