문제

I have a Neo4j graph that I want to visualize using Gephi. I am able to import the whole graph using the Neo4j plugin, but I only want a visual for the nodes returned by a query:

START n=node(*)  
MATCH com<-[:ON_COMMITTEE]-n-[:HAS_OFFICE_IN]->x<-[:LOCATED_IN]-y<-[:AFFILIATED_WITH]-z<-[:WRITTEN_BY]-m  
WHERE com.name="Committee on Finance" or com.name="Financial Services"  
RETURN collect(com.name), com.house, n.name, x.name, y, y.name, collect(distinct z.name), m.title, m.published, m.times_cited

I have looked into getting the graph into Gremlin, but keep getting groovysh_parse: 46: unexpected token: = @ line 46, column 6. when I try and open my graph using this command:$_g := neo4j:open('../gephiData/neo4j-community-1.9/data/graph.db')

I also tried the traversal import, but it would never display anything when I tried it.

I am in no way tied to Gremlin, but can't seem to find anyway to get only the results that I want into Gephi.

도움이 되었습니까?

해결책

I can't say I fully follow, but if you are executing this from the Gremlin REPL:

_g := neo4j:open('../gephiData/neo4j-community-1.9/data/graph.db')

you are likely getting that error because it isn't valid Gremlin. The appropriate way to open a Graph is:

g = new Neo4jGraph('../gephiData/neo4j-community-1.9/data/graph.db')

As mentioned in the comments to this question here, make sure that Neo4j is not running in some other process when you try to do this.

From there you could go about subgraphing to a TinkerGraph and saving that graph as GraphML. You can see a bit more on the approach to subgraphing with Gremlin here:

http://gremlindocs.com/#recipes/subgraphing

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top