8

Background

I've been using neo4j to query a fairly large (but ultimately uncomplicated) dataset. I'm writing cypher directly into the web interface and keeping a track of my queries in a text file (old-skool).

Problem

I love the results I'm getting back, so I'd like to take this another step and build a more rigorous interface around it so that I can give it to non-technical people to explore the data within some pre-programmed parameters.

I've read the node4j API reference and I'm certain I could build an interface from scratch with a combination of D3 for layout and a back-end middleware app using (for example) seraph in node.js or the neo4j rubygem.

However, the standard neo4j web interface is so good that I wonder if I could leverage it a bit further and embed the query results (including force-directed graphs) in my app, rather than start from scratch?

Possible approach

Is there any precedence for this approach? I guess the journey would be something like:

  • Construct a query in my 3rd party app
  • Query neo4j server
  • Receive iframe (or other?) response
  • Embed response in 3rd party page

Any advice on this would be ace.

Lars Kotthoff
  • 107,425
  • 16
  • 204
  • 204

2 Answers2

7

Check out http://neo4j.com/developer/guide-data-visualization

It explains how to do it yourself but also links to other tools and frameworks that you can use for that.

You can also check out http://jexp.github.io/cy2neo for one example I created a while ago.

Usually most javascript graph visualization frameworks are easy to use.

Michael Hunger
  • 41,339
  • 3
  • 57
  • 80
3

You should take a look at Neo4j GraphGists, which was created for the same purpose.

[EDITED]

If you want to access your own database with GraphGists, that seems to be possible. Caveat: I have not tried this myself.

  • GraphGist is available as open source, and you can run it locally on your own computer/server.
  • Looking in the GraphGist installation script, you can see that it clones another neo4j open source project, called rabbithole.
  • Rabbithole's Readme states that you can configure it to "expose" a local DB:

    Potential arguments for local execution:

    java org.neo4j.community.console.Console port /path/to/db [expose]
    

    ("expose" will write and read-through to the graph-db otherwise it will copy the graph content into an in-memory db)

  • Near the bottom of rabbithole's pom file, you can configure rabbithole:

                <mainClass>org.neo4j.community.console.Console</mainClass>
                <!--arguments>
                  <argument>argument1</argument>
                </arguments-->
    
    • Theoretically, if you replace argument1 with port /path/to/db expose (and uncomment the arguments tag), you will be using your own local DB.
cybersam
  • 63,203
  • 6
  • 53
  • 76
  • Unless I'm mistaken, it looks like GraphGists are designed for small datasets that are created on the fly in the browser? My use-case is different – I'd like to query a much larger database sitting on a private server. – Peter MacRobert Oct 07 '15 at 15:53
  • I've updated my answer to provide some clues as to how to use your own DB with your own locally hosted GraphGist installation. – cybersam Oct 07 '15 at 19:08
  • rabbithole doesn't take arguments, https://github.com/neo4j-contrib/rabbithole/issues/78 (contains patch that needs to be applied) – jalmasi Apr 26 '21 at 16:27