<< April 2010 | Home | June 2010 >>

Creating a Report for a Neo4J Sample Database

Native Neo4J access out of the box.

Anders Nawroth has created a -> neat example for the Neo4J  database that models a shop with products and nested categories. Cool.

I have used this example to create a report for the database using RepostsAnywhere. Result: Yes you can. It works right out of the box. (No Mappings or Helper scripts or such like)

For me it was important to learn, whether reporting for No-SQL is possible, and how easy it was. I think it was easy, but for a designer used to SQL the navigational access may be unusual. The problems lie less in the report design or Neo4J, but rather in understanding the data model.

With ReportWeaver, you can connect to neo4J simply by adding the jar file of the sample application to your report. It can the pick up the classes in the schema and you can navigate the database using Neo4Js native relationships.

That is how it looks:

Sample Neo4J Report

And here is how it looks in the designer:

Sample report in the designer

As you can see, you can access your attributes as if they where members of a class, and you can even access fields, that are in the object used as keys.

This example is interesing for two reasons: It uses a recursive structure to model the categories and subcategories. And it returns the fields of the products as a map. It is particularly noteworthy, that the map uses a Java class type AttributeDefinition as key instead of a String. Both Neo4J and ReportsAnywhere deal gracefully with this situation.

Storing this model in a relational database and reporting on it using SQL would be much more complicated.

If you are interested in how it is done, please ask, I will then produce a step by step explanation.