Neo4j: Exploring new data sets with help from Neo4j browser

One of the things that I’ve found difficult when looking at a new Neo4j database is working out the structure of the data it contains.

I’m used to relational databases where you can easily get a list of the table and the foreign keys that allow you to join them to each other.


This has traditionally been difficult when using Neo4j but with the release of the Neo4j browser we can now easily get this type of overview by clicking on the Neo4j icon at the top left of the browser.

We’ll see something similar to the image on the left which shows the structure of my football graph and we can now discover parts of the graph by clicking on the various labels, properties or relationships.

For example, if we click on the Month label the following query will be executed:


That query actually returns all the months in the database since there are only 12 in total, but for other queries we’d get back a subset of the nodes/relationships with that structure.

To explore the structure around the months we might explore which relationships it has by running a query like this:


From running this query we learn that there is a in_month relationship connecting matches to the month that they were played in.

Another useful exploration mechanism is the allShortestPaths function which will show us the path between two nodes if one exists. For example the following query would show us the path between Wayne Rooney and March:


The text is a bit small but the relationship between Rooney and a match is named played_in so if we want to find which matches Rooney played in in March we could easily write that query.

Another neat feature of the browser is that we can save our queries as we go by clicking on the save button and optionally naming the query in a comment:


We can then access those queries and re-run them if we want via the star tab on the left hand side:


You can get a hold of the browser by downloading milestone 2.0.0-M06 about half way down the download page or if you want to hack on the browser it’s on github.

Related Whitepaper:

Functional Programming in Java: Harnessing the Power of Java 8 Lambda Expressions

Get ready to program in a whole new way!

Functional Programming in Java will help you quickly get on top of the new, essential Java 8 language features and the functional style that will change and improve your code. This short, targeted book will help you make the paradigm shift from the old imperative way to a less error-prone, more elegant, and concise coding style that’s also a breeze to parallelize. You’ll explore the syntax and semantics of lambda expressions, method and constructor references, and functional interfaces. You’ll design and write applications better using the new standards in Java 8 and the JDK.

Get it Now!  

Leave a Reply

× 9 = eighty one

Java Code Geeks and all content copyright © 2010-2014, Exelixis Media Ltd | Terms of Use | Privacy Policy
All trademarks and registered trademarks appearing on Java Code Geeks are the property of their respective owners.
Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries.
Java Code Geeks is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.

Sign up for our Newsletter

20,709 insiders are already enjoying weekly updates and complimentary whitepapers! Join them now to gain exclusive access to the latest news in the Java world, as well as insights about Android, Scala, Groovy and other related technologies.

As an extra bonus, by joining you will get our brand new e-books, published by Java Code Geeks and their JCG partners for your reading pleasure! Enter your info and stay on top of things,

  • Fresh trends
  • Cases and examples
  • Research and insights
  • Two complimentary e-books