Home » Java » Enterprise Java » Neo4j: Exploring new data sets with help from Neo4j browser

About Mark Needham

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.

2013-10-17_21-27-36

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:

2013-10-18_11-59-49

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:

2013-10-18_12-18-54

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:

2013-10-18_12-27-12

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:

2013-10-18_12-37-31

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

2013-10-18_12-34-06

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.
 

Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!

1. JPA Mini Book

2. JVM Troubleshooting Guide

3. JUnit Tutorial for Unit Testing

4. Java Annotations Tutorial

5. Java Interview Questions

6. Spring Interview Questions

7. Android UI Design

and many more ....

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*


6 + eight =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close