About Michael Hunger

Posts by Michael Hunger:


Neo4j Server Extension for Single Page Experiments

on Apr 24, 2015 in neo4j, server

Sometimes you have a nice dataset in Neo4j and you’d want to provide a self-contained way of quickly exposing it to the outside world without a multi-tier setup.

So for experiments and proofs of concepts it would be helpful to be able to extend Neo4j Browser to accomodate new types of frames and commands.
Unfortunately we’re not there yet, there is still some work to be done until this will be possible.

Until then …. why not use what we already have.

I was discussing some helpful database and server extensions which would benefit from a tiny built-in UI with different people.
Then I had the idea to just use the JAX-RS mechanisms that Neo4j Server supports to not only serve JSON/text or XML but also deliver
HTML, JS, CSS and image files to the browser.
Those files would not live on the file-system but be packaged directly into the jar of the extension, e.g. residing in a resources/webapp folder.

How it works

This was actually much easier than expected.
This is a normal JAX-RS resource class that can then be mounted on an endpoint using the neo4j-server.properties configuration.

The HTTP-GET endpoint handles certain patterns declared by a regular expression.
There is one function that tries to find that file within the webapp folder within the JAR classpath, returning null if not found or the InputStream otherwise.
And one function for determining the content-type to be returned.

You can easily use this approach for your own Neo4j extension just by copying that StaticWebResource into your project and providing the html,js and css files in the webapp directory.

The Demo: Popoto.js

As my demo I used a setup that exposes popoto.js automatcially on top of the data you have in your graph.

The StaticWebResource provides the web-files of the visualization from the resources/webapp directory.
And PopotoResource adds a second endpoint to provide a config/config.js file which uses label, property and index information
to provide the necessary config for popoto’s visualization.

Note that you have to disable auth for this demo as I haven’t added means for it to configure a username/password.

You can use the demo by cloning and building (mvn clean install) this repository.
Copy the resulting jar in the server’s plugin directory.
Edit conf/neo4j-server.properties to register the package name with an endpoint.

cp target/neo4j-web-extension-2.2-SNAPSHOT.jar /path/to/neo/plugins/
echo 'org.neo4j.server.thirdparty_jaxrs_classes=extension.web=/popoto' >>  /path/to/neo/conf/neo4j-server.properties
/path/to/neo/bin/neo4j restart
open http://localhost:7474/popoto

popoto in neo demo

You can also download the JAR from here.

Enjoy exploring!


How To: Neo4j Data Import – Minimal Example

on Apr 18, 2015 in import, neo4j

We want to import data into Neo4j, there are too many resources with a lot of information which makes it confusing.
Here is the minimal thing you need to know.

Imagine the data coming from the export of a relational or legacy system, just plain CSV files without headers (this time).





Graph Model

Our graph Model would be very [...]


On Neo4j Indexes, Match & Merge

on Apr 11, 2015 in cypher, neo4j

We at Neo4j do our fair share to cause confusion of our users. I’m talking about indexes my friends.
My trusted colleagues Nigel Small – Index Confusion and Stefan Armbruster – Indexing an Overview already did a great job explaining the indexing situation in Neo4j,
I want to add a few more aspects here.

Since the release of [...]


Natural Language Analytics made simple and visual with Neo4j

on Jan 8, 2015 in cypher, fun

I was really impressed by this blog post on Summarizing Opinions with a Graph from Max and always waited for Part 2 to show up :)

The blog post explains an really interesting approach by Kavita Ganesan which uses a graph representation of sentences of review content to extract the most significant statements about a product.

Each [...]


Spring Data Neo4j 3.3.0 – Improving Remoting Performance

on Dec 9, 2014 in neo4j, spring-data-neo4j

With the first milestone of the Spring Data “Fowler” release train, Spring Data Neo4j 3.3.0.M1 was released. Besides a lot of smaller fixes, it contains one big improvement. I finally found some time to work on the remoting performance of the library, i.e. when used in conjunction with Neo4j Server. This blog post explains the [...]


The Story of GraphGen

on Nov 1, 2014 in community, development, neo4j

This is the story behind the really useful and ingenious Neo4j example graph data generator developed by Christophe Willemsen.

I don’t just want to show you the tool but also tell the story how it came to be.

First of all: The Neo4j Community is awesome.
There are so many enthusiastic and creative people, that it is often [...]



on Oct 18, 2014 in cypher, import, neo4j

pre { word-wrap: normal; white-space:pre; overflow-x:scroll; }

I have to admit that using our LOAD CSV facility is trickier than you and I would expect.
Several people ran into issues that they could not solve on their own.

My first blog post on LOAD CSV is still valid in it own right, and contains important aspects that I [...]


Flexible Neo4j Batch Import with Groovy

on Oct 9, 2014 in import, neo4j

You might have data as CSV files to create nodes and relationships from in your Neo4j Graph Database.
It might be a lot of data, like many tens of million lines.
Too much for LOAD CSV to handle transactionally.

Usually you can just fire up my batch-importer and prepare node and relationship files that adhere to its input [...]


LOAD CSV into Neo4j quickly and successfully

on Jun 25, 2014 in cypher, import


You can also read an interactive and live version of this blog post as a Neo4j GraphGist.

Since version 2.1 Neo4j provides out-of-the box support for CSV ingestion. The LOAD CSV command that was added to the Cypher Query language is a versatile and powerful ETL tool.
It allows you to ingest CSV data from any URL [...]


Rendering a Neo4j Database in UbiGraph

on Jun 23, 2014 in cypher, server

I never heard of UbiGraph before, but this tweet by @a61dr41n made me curious.

#ubigraph is an excellent #visualisation package for #neo4j and other #GraphDB can't believe I haven't heard of it sooner…
— a61dr41n (@a61dr41n) June 20, 2014

So I checked it out. UbiGraph is a graph rendering server that is controlled remotely and also interactively with [...]

Copyright © 2007-2015 Better Software Development All rights reserved.
Multi v1.4.5 a child of the Desk Mess Mirrored v1.4.6 theme from BuyNowShop.com.