2017-11-15 5 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 

불행하게도 쿼리가 완료되지 않을 효과적으로 서비스 거부-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 

: 그것을 달성하기 위해, 나는 두 개의 쿼리를 실행 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 홉 관계의 방향과 한계를 추가했습니다. 이렇게하면 복제본 내보내기가 제거되고 내보내기 속도가 빨라집니다.

관련 문제