How to visualise Neo4j graph database created from

2020-04-10 22:07发布

问题:

I created an application which embedded Neo4j. In that application I created and stored some nodes with some relationships. My application has saved this database to a file. I would like to visualise that data. I know I can see graphs if I fire up the Neo4j server but I do not know how to import my neo4j.db file into the Neo4j server so that I can visualise it. Any suggestions would be greatly appreciated.

回答1:

Depending on your use case you might have different solutions:

  • Use a web-based visualization
  • Use a desktop application to visualize your data

Use web-based visualization

In this case you have to take care of the web-app to visualize the data. You have basically two solutions out there: Javascript or Java applets.

For the Javascript side you have many choices: D3js, VivaGraph, SigmaJS, KeyLines.
The first three are open source and free while the last one has a commercial licence and non-free.
There're already a million questions about these libraries on SO, so I'll link you to some of those to understand the various differences.

Desktop Application

The main solutions in this case I would recommend you, depending on the kind of data are: either Gephi or Cytoscape.
In both cases I believe you have to write your own adapter to communicate with your application.

Architecture Reference

The architecture in both cases will be the following:

  • The controller renders a webpage with the JS visualisation framework you want to use
  • The controller offers a couple of JSON endpoints the client can use to query the data from the Neo4J embedded
  • Each query fetch the data, put in a model and render the JSON to send to the client


回答2:

If you're NOT using neo4j 2.0+ then really good way to visualize your graph is by using neoclipse. https://github.com/neo4j-contrib/neoclipse/downloads it's really handy and it has cypher support too.

Or

another quick hack is to copy your db folder (which you created by using embedded database) into $NEO4j_HOME/data/

and

change $NEO4j_HOME/conf/neo4j-server-properties file to point to

and

start your server (bin/.neo4j start). You'll be able to visualize your database at localhost:7474 I hope it helps!



标签: neo4j