1

I want to visualize my Neo4j dataset with Gephi. After installing apoc and get it working, I called call apoc.export.graphml.all("/tmp/test2.graphml",{}) and I get the right file. Now I import/open this .graphml-file in Gephi 0.9.1 but in the import-window I can´t see any properties. Also in the graph itself there´re no properties on the nodes / relations. Does anyknow know, what I´m doing wrong or have I forgot to set the right configuration-parameters?

Thanks in advance


UDPATE


this is my procedure call:

call apoc.export.graphml.all("/tmp/test2.graphml",{}) yield nodes, relationships, properties, time

this is the snapchot from the Neo4j browser

Result Neo4j browser

I´ve loaded this file from my server and openend it in Gephi, resulted in this:

Gephi view nodes Gephi view edges

Like you see, my properties are still not there...

Andy
  • 129
  • 1
  • 3
  • 15

1 Answers1

0

Apoc has a custom procedure, that exports data to Gephi in one single step. You will need to download a graph streaming plugin for Gephi,so you will be able to easily export data from Neo4j to Gephi using apoc.gephi procedures. Example:

MATCH path = (:Person)-[:KNOWS]->(:Person)
CALL apoc.gephi.add(null,'workspace1',path,'weight') yield nodes
RETURN distinct("success")

Check out the docs and this tutorial for more info.

Tomaž Bratanič
  • 6,319
  • 2
  • 18
  • 31
  • I´ve already had a look at this Plugin, but it doesn´t work with my Neo4j-Version (3.1.0)! I´ve just updated my original post with the code and the snapshots... – Andy May 01 '17 at 12:42
  • Graph streaming plugin is for Gephi, not Neo4j. If you do not have the latest APOC, you can use `CALL apoc.gephi.add(null,'workspace1',path) yield nodes`, which works for me, but you are always exporting an unweighted network. If you want to also export weights to Gephi I suggest you upgrade to Neo4j 3.1.3 and latest APOC to date, which is https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/tag/3.1.3.6 right now. – Tomaž Bratanič May 01 '17 at 12:58
  • I´ve tried your suggestion and updated Neo4j (to version 3.1.3) and apoc. now, when i call the abovementioned procedure I´ll get this error: `Failed to invoke procedure 'apoc.gephi.add': Caused by: org.neo4j.graphdb.NotFoundException: NODE[380] has no property with propertyKey="name".` My nodes got the properties "firstname" and "lastname".. is this the problem? How do i declare, that the firstname (or lastname) should be exported to GephI? – Andy May 02 '17 at 12:09
  • In current version i think it is still hardcoded. Check https://github.com/neo4j-contrib/neo4j-apoc-procedures/blob/3.1/src/main/java/apoc/gephi/Gephi.java .... easiest solution is to set the name property as first name + last name – Tomaž Bratanič May 02 '17 at 12:23
  • ok, i added this property but now I get another error... :( is it generally possible to stream from a remote server to gephi? – Andy May 02 '17 at 12:51
  • Is you use graph streaming plugin for Gephi you can... and you have to start master server as shown in tutorial – Tomaž Bratanič May 02 '17 at 13:30
  • ok.. I´ve done this like described in the tutorial and I get this error `Failed to invoke procedure `apoc.gephi.add`: Caused by: java.lang.RuntimeException: Can't read url invalid URL as json: no protocol: 78.47.***.***/arbeitsbereich1/operation=updateGraph` I´m so sorry for this, but I don´t find any description/working example for a stream to a remote server... – Andy May 02 '17 at 15:30
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/143209/discussion-between-andy-and-tomaz-bratanic). – Andy May 02 '17 at 15:38