Neo4j 1.8.M03 has been released

Released today, Neo4j 1.8.M03 introduces the RELATE clause, a two-step dance of MATCH orCREATE. Also, new Transaction support in the shell let’s you call for a do-over in case you misstep.

RELATE, a Subgraph Match-Maker

A RELATE clause looks a lot like a MATCH clause — the ASCII-art of graph traversals — but behaves differently when there isn’t a satisfying subgraph. When there is no match, RELATE will create the needed Relationships and even intervening Nodes. RELATE ensures that the subgraph exists.
So, I just fetched myself a coffee. Let’s say I want to keep track of how often I visit 3 Bees Coffee. I could carve notches on my desk, but I’ve already ruined one Ikea desk that way. Being graph-minded, I immediately realize that I’ll be curious about deeper questions regarding all the places I visit. I will, of course, evolve a graph mini-app.
Neo4j 1.8.M01 introduced the CREATE clause, so I’ll create me and the coffee shop:

CREATE me = {name:"Andreas"}, `3bees` = {name"3 Bees Coffee"}

(Note the back ticks around 3bees because the term starts with a number)
To record that I have visited 3 Bees Coffee, I could add a relationship at the same time:

CREATE me = {name:"Andreas"}, `3bees` = {name"3 Bees Coffee"}, me-[:VISITS]->`3bees`

Of course, I will be re-visiting coffee shops more often than going to newly opened shops. I already know about me, and will usually know about the coffee shop, so what I really want to do is just create the Relationship.

START me=node(1), coffee=node(2) CREATE me-[:VISITS]-coffee

Easy as pie. Mmm pie. Create a record for me, create a record for a shop, and whenever I visit a shop, create a Relationship. Because I want to keep track of the frequency of my visits, I suddenly have a problem: I don’t want to create a Relationship every time, but get one if it exists and just update a property on it.
Cypher is declarative. There is no spoon, I mean ‘IF’. So we turn to our friendly match-making RELATEclause:

START me=node(1), coffee=node(2) RELATE me-[v:VISITS]-coffee return v

That’ll match the VISITS if it exists, or create one if it doesn’t. To update the visits, I can convert theRETURN into a WITH to tack on a SET clause like so:

START me=node(1), coffee=node(2) RELATE me-[v:VISITS]-coffee WITH SET v.visits=(v.visits +1) RETURN v

OK, one last detail to adjust: the classic initial condition problem. If RELATE happened to create a new Relationship, it won’t yet have a visits Property. We’ll use COALESCE to ignore v.visits if it is null, then add 1:

START me=node(1), coffee=node(3) RELATE me-[v:VISITS]-coffee WITH SET v.visits=(coalesce(v.visits?,0)+1) return v

Ah, now I have even more motivation to take coffee breaks. The RELATE clause is powerful fun. Get yourself a cup of coffee, then sit down to peruse the Neo4j Manual section on Cypher RELATE to learn more. And, check on my coffee consumption in the Neo4j Live console, where you can play around withRELATE.

Transactional Shell

Prior to this release, every query issued in Neo4j shell (whether command-line or in Webadmin) created a transaction when needed. Now, you have control over transactions with some new shell commands: begin transaction, commit, and rollback. These let you practice your new Cypher dance moves without worrying about falling on your face and taking your database down with you. As usual, look to the Neo4j Manual for the details.

Relate Yourself

Neo4j 1.8.M03 is available for immediate download in the usual places. Get it now:

  • Download from
  • Bump the versions in your maven pom.xml
  • Provision on heroku with: heroku addons:add neo4j –neo4j-version 1.8.M03

Want to practice Cypher with fellow Graphistas? Join us at a meetup somewhere in the world, or propose a new location and we’ll look into visiting your area to buy you a cup of coffee.

Neo4j 1.8.M02 has been released

Neo4j 1.8.M02 – The Strong, Silent Type

Our longer arcs of development are chunked up into short-term stories, which arrive with notable features at differing points. Uniquely, at this 1.8.M02 merge point, the changes are all of the strong, silent type: under-the-hood improvements, stage-setting additions, or simple issue-correcting.

This is a solid, trustworthy release for anyone staying up-to-date with the leading edge of development. Go get download Neo4j 1.8.M02 to keep up. If you’re on Heroku, you can simply specify the version when provisioning a new database:
# heroku addons:add neo4j --neo4j-version 1.8.M02
More information available here

Neo4j 1.8.M01 has been released

Neo4j 1.8 has been released with an eye for expansive views, painting a picture with data and hanging it on the web. In this first milestone release, artful work on the Cypher query language is complemented with live views in the Neo4j documentation.


Lead Cypherologist Andrés Taylor has been cranking out work like Pablo Picasso with an empty museum. He shared some of his thoughts about the new Cypher grammar available in 1.8.M01:

ABK: It seems you can’t get Cypher out of your head fast enough.
AT: Yeah, it’s really like that. My family is tired of listening to me talk over the dinner table about implementation details about Cypher, I just can’t let it go.

ABK: Some of Cypher is SQL inspired, showing your SQL roots, but the new grammar is not like SQL.
AT: At first, I didn’t want any mutation stuff in it whatsoever, it was going to be a read only language. Then, I didn’t know what I wanted, but I did know what I didn’t want. Like with SQL, with all the problems you can have with inserting data.

ABK: What kind of problems?
AT: I think that SQL is a wonderful language when you’re talking about SELECT statements, but when you’re doing data manipulation, it quickly breaks down into an imperative thing. For example a normal problem is the “insert or update”, which doesn’t have any clean solution. Another is working over collections of stuff.

ABK: Ah, so that’s why FOREACH is included now.
AT: Yup.
ABK: And so what was your solution?
AT: Being declarative. By giving our users the tools to express what they want in a declarative way so they don’t have to invent patterns to work around the language. And, it is much, much easier to understand what’s happening, for a reader of a query.

AT: Looking at a problem, a bug yesterday, I needed a graph to work on so I wrote:

CREATE a,b, a-[:x]->b, a-[:y]->b;

Try It
Just two nodes, with two relationships between them, and that was awesome. Actually, the first version of this would have looked to much worse. There has been fine-tuning. There was a meetup, when Aseemcame with a lot of suggestions and the community had a lot of discussion about it. This is the result.
Continuing with the example, you can give them values, with a JSON look-alike thingy:

CREATE a={name:"Andres", age:37}, b, a-[:x { foo:"bar" } ]->b, a-[:y]->b

Try It
Then update a property like this:

START n=node(0) SET"Michael";

Try It
Simple deletes are now possible like this:

START n=node(0) DELETE n;

Try It

ABK: What about more complex statements, like operations on a subgraph?
AT: Instead of sub-queries, you can chain parts of statements using WITH, which essentially combines aRETURN and a START. Like this:

START lucy=node(1) MATCH lucy-->movie
    WITH lucy, collect(movie.title) AS movies
    SET lucy.movies = movies

Try It
To work on that collections of things, there is FOREACH:

START lucy=node(1) MATCH lucy-->movie WITH lucy, collect(movie) AS movies
    FOREACH (movie in movies : SET )

Try It

The one rule that we have, is that in one part of the query you can only read from the graph or write to the graph. In the short forms above, there are two logical parts, a write then a read, with an implied separation. To be explicit, and create longer queries from parts, you use WITH.

ABK: Neat. Well, thanks for all the hard work Andrés. Can’t wait to try it out.
AT: There is more to come, but this feels good.  Enjoy.

Hogwarts Manual of Graphs

Having unleashed the live Graph Console, the obvious next step was to animate the Cypher examples in theNeo4j Manual. Now the same graph code that generates the documentation also creates interactive consoles to allow experimentation. As a living, constantly evolving document, the Neo4j Manual learns new ways to help you learn.

The Console itself is evolving into a nice REPL, currently supporting Cypher and Geoff for initial graph creation, and Cypher for queries. A nice touch is that the visualization now highlights created nodes and relationships. When done, the graph and an initial query can be shared with a click of the share-button.
These shared graph-gists are really handy for tweeting questions, reporting issues on github and discussing graph modeling in the Neo4j Google Group.


Other changes of note included in this release are:
  • an OSGi section has been added to the manual
  • streaming results from the REST API
  • the usual relentless performance improvements and bug fixes

Neo4j 1.7 GA have been released

Neo4j 1.7 GA have been released , codenamed “Bastuträsk Bänk” is nowgenerally available.

The many improvements ushered in through milestones have been properly QA’d and documented, making 1.7 the preferred stable version for all production deployments.

More details and official announcement available here

1.7 (2012-04-18) Changes:
o Moved BatchInserter to a different package.
o Fixed ‘Record Not In Use’ issue with creating and setting Node properties with the BatchInserter.
  o Added the possibility to use multiple relationship types on patterns
  o Fixed bug when aggregation is used in ORDER BY and not listed in the RETURN clause
  o Added scored index results to REST API
  o Improvements to installation docs for the server
  o Added auto index management API to REST, fixing #399
  o Fixed unicode issues in batch operations API in windows and OS X
  o Server now disallows creating indexes with empty names. Closes #311
  o Attempting to delete a non-existing index now returns 404, closes #349
  o Modified UDC to run one thread per DB, and to shut down background thread on unload. Closes #279
  o UDC now sends the machines MAC adress to Neo Technology, to separate between instances behind firewalls
  o UDC now sends database registration ID to Neo Technology, if one is available
  o UDC now sends “tags” to Neo Technology, these contain information about the type of deployment, such as language, web-container, app-container, spring, ejb

Neo4J 1.7 M03 have been released

Neo4J 1.7.M03 have been released and can be downloaded here


Atomic Array -[:renamed_to]-> Garbage Collection Resistant

I think we can all agree, “there are only two hard problems in Computer Science: cache invalidation, naming things, and off-by-one errors.” (Cheers Tim Bray). Naturally, we started by creating a new cache, which focused on occupying a fixed size in memory with improved performance. Check.

Then, there’s the name. We liked the sound of Atomic Array Cache, because it sounds like something you could wield against hordes of invading aliens. But, in reality it was specifically identifying the implementation details of the cache. The actual behavior of the cache, the reason why you’d choose it over the other caches, is that by occupying a fixed amount of space in memory, it is effective at avoiding those horrid Garbage Collection pauses. Appropriately, we’ve renamed it to the Garbage Collection Resistant (GCR) cache, to reflect its purpose.

And off by one? Well, that is the tricky thing about the GCR cache: getting it configured correctly to actually have a good, responsive application takes some hard thinking. For now, we’re only including it with the enterprise edition of Neo4j, generally used when you’re going into large scale deployment and are tweaking every knob in your system.



Neo4j 1.7 milestone 1 has been released

Neo4j 1.7 milestone 1 update has been release, it bring the following new features:

  • improved Cypher
  • SSL support
  • improved Neo4j documentation
  • high availability improvements (nb: there are recommended maintenance releases for Neo4j 1.5 and 1.6)
  • upgraded Blueprints and Gremlin support

You can download Neo4j 1.7 here

Neo4j 1.6 GA released

Neo4j 1.6 GA has been released

It brings great new features;


What features have been included in this release?

  • Cloud – Public beta on Heroku of the Neo4j Add-on
  • Cypher – Supports older Cypher versions, better pattern matching, better performance, improved api
  • Web admin – Full Neo4j Shell commands, including versioned Cypher syntax.
  • Kernel – Improvements, for instance the ability to ensure that key-value pairs for entities are unique.
  • Lucene upgrade – Now version 3.5.

Also, there have been many improvements behind-the-scenes:
Infrastructure – Our library repositories have moved to Amazon, providing significantly faster download times.
Quality – High availability features better logging and operational support.
Process – Better handling of breaking changes in our api and how we handle deprecated features.

If you want more info on all of this – sure you do – please keep reading. Here is a run down of the major new features in Neo4j 1.6.

Heroku Public Beta

The public beta of the Neo4j Add-on for Heroku is available. We’re taking a careful approach with our cloud services, evaluating the best supporting infrastructure and user experience in preparation for a general release in the coming months. Already, we’ve been pleased with the positive response.

Documentation on how to get started with the Heroku Neo4j Add-on can be found at the Heroku DevCenter. We’ll be posting additional guides for getting started on Heroku with Neo4j.

For pioneering adopters, we welcome you to join our Neo4j Heroku Challenge. You can win fabulous prizes while proudly blazing a path into the cloud for our community.

Latest on Cypher

Most the work in Cypher for this release has been internal changes that are not immediately visible to an end user. The type system has been rebuilt and revamped, and a second, simpler, pattern matcher has been added. The first change makes the Cypher code base faster to work with, and the second makes your queries faster.

End user facing changes include: possibility to get all shortest paths, the COALESCE function, column aliasing, and the possibility for variable length relationships to introduce an iterable of the relationships.

More, array properties have been supported in Neo4j for a long time, but until now it wasn’t possible to query on them. This release makes it possible to filter on array properties in Cypher. We have also improved aggregation performance.

Finally, there are two breaking changes – the syntax for the ALL/NONE/ANY/SINGLE predicates has changed, and the ExecutionResult is now a read-once, forward only iterable.

New to Cypher? Then you should watch this updated “Introduction to Cypher” screencast by Alistair Jones:

New on the web admin
I’m quite happy to announce that the web admin interface has initial support for Cypher calls directly in the data browser. It’s so sweet to be able to query your way around the node space! And, the Cypher console is now supports full Neo4j Shell commands.
Moreover, Gremlin has been updated to version 1.4, with major improvements and bug fixes.

Kernel changes

This release includes a popular feature request: the ability to ensure that key-value pairs for entities are unique!

If you look up entities (nodes or relationships) using an external key, you’ll want exactly one entity to correspond to each value of the key.  For example, if you have nodes representing people, and you look these up using Social Security Number (SSN), you’ll want exactly one node for each SSN.  This is easily achieved if you load all your data sequentially, because you can add a new node each time you meet a value of the key (a new SSN).  However, up to now, it has been awkward to maintain this uniqueness when multiple processes are adding data simultaneously (via web requests for example).

Since this is a common use-case, we’ve improved the API to make it easy to enforce entity uniqueness for a given key-value pair.  At the index level, we’ve added a new method putIfAbsent which ensures that only one entity will indexed for the key-value pair, even if lots of threads are using the same key-value pair at the same time.  Alternatively, if you’d prefer to work with nodes or relationships rather than with the underlying indexes, there’s a higher level API provided by UniqueFactory. This makes it easy to retrieve an entity using get-or-create semantics, i.e. it returns a matching entity if one exists, otherwise it creates one. Again, this mechanism is thread-safe, so it doesn’t matter how many threads call getOrCreatesimultaneously, only one entity will be created for each key-value pair. This functionality is also exposed through the REST API, via a ?unique query parameter.

Lucene upgrade

Neo4j uses Apache Lucene as the default implementation for its indexing features – this allows you to find “entry points” into the graph before starting graph-based queries.  Lucene is an actively developed project in its own right, and is constantly being enhanced and improved.  In this Neo4j release, we’re taking the opportunity to upgrade to a newer stable release of Apache Lucene, so that all users get the benefits of recent enhancements in Lucene.  We’ve moved to Lucene 3.5; for details on all the changes, have a look at their changelog.

Breaking changes and deprecating

We’re introducing a new way to handle breaking changes. They will be flagged in the change logs as “BREAKING CHANGE.”

Where we do introduce a breaking change, we will continue to support the older functionality for 2 GA releases. This would typically be six months heads up and will allow you to adopt new GA releases quickly while giving plenty of time to develop against the new API. This policy applies to published and stable APIs, including Cypher.

In the same vein: We now have a deprecated feature. Cypher execution is now part of the core REST API, the cypher plugin is deprecated.

This policy does not cover third-party add-ons (like Gremlin from Tinkerpop) which have their own release strategy.

Looking Forward

Community member Pablo Pareja Tobes had organized a poll around feature requests, which really helps us prioritize our development focus. Thanks everyone making their voice heard!

Here are the results:

Filter relationships natively by their name (supernodes issue)
Sharding and horizontal scalability
Mandatory node types
Node insertion with checking of uniq external (get_or_create)
N-ary relationships

Let’s consider each of these features more closely.


The write-scaling complement to high-availability, sharding distributes a graph across multiple machines in a cluster. We (and many others) have researched the general graph sharding problem for years. This year, we’re embarking upon a pragmatic approach to sharding, providing the benefit without obsessing about academic perfection.


In Twitter-culture, you’d call these the “Ashton Kutcher” nodes, the nodes in a graph with an extreme number of connections. We’ve been working on a branch that has a promising approach for mitigating the performance challenge of traversing these supernodes.

Node types

In Neo4j, there is no schema, only structure. Relationships indicate the effective type of the connected Nodes, and Indexes imply membership in a set. Often, though, it would be helpful to know the designated type of a Node. So, we’re considering the appropriate way to introduce just enough schema. If you have any thoughts or desires to share, please chime in on the issue page.

Unique indexing

Indexes provide a quick look-up for sets of Nodes or Relationships. With unique indexes, Neo4j will guarantee that only one Node is mapped to a property key, providing support for domain-specific identifiers. This new feature is available now with 1.6GA.

N-ary relationships

Neo4j’s property graph model restricts a relationship to connecting two nodes. In some domains, it is useful to consider relationships having multiple end-points. For now, we think this is best solved with domain-specific solutions.

Fixes and details

Of course, this release includes a slew of bug fixes. For details about all the fixes and additions please read the various CHANGES.txt files included in the packaging.

Also, an impressive array of community-contributed development has been included in this release. Thank you all for the good ideas and pull requests – everyone is really appreciating it!

The Neo4j 1.6 is ready for download

Neo4j 1.6 GA has been released

Neo4j has been released; version 1.6 GA aka “Jörn Kniv” is now available.

The following new features have been included in this release:

  • Cloud – Public beta on Heroku of the Neo4j Add-on
  • Cypher – Supports older Cypher versions, better pattern matching, better performance, improved api
  • Web admin – Full Neo4j Shell commands, including versioned Cypher syntax.
  • Kernel – Improvements, for instance the ability to ensure that key-value pairs for entities are unique.
  • Lucene upgrade – Now version 3.5.


All details available on their official blog:


Riak Compared to Neo4j

Basho, the co,pamy behing Riak, has just published a nice paper comparing its solution to Neo4j, even if both solution are meant for storing fundamentally different types of data:

  • Riak is a document database and key/value store, designed to store semi-structured documents or objects of varying sizes.
  • Neo4j is a graph database, designed to store and traverse a network of related information. (e.g. Social Networks)

In most cases, the needs of your application will clearly dictate whether you should use a key/value store or a graph database. And in many cases, it may make sense to combine the two. An application like Facebook, for example, might store user profile information, wall posts, and images in a key/value or document database, and store the network of friends and associations in a graph database.

Read the entire article on Basho’s wiki:



Neoclipse is an independant project, forked from Neo4j, which aims to be a tool that supports the development of Neo4j applications.

Main features:

  • visualize the graph
  • increase/decrease the traversal depth
  • filter the view by relationship types
  • add/remove nodes/relationships
  • create relationship types
  • add/remove/change properties on nodes and relationships
  • highlight nodes/relationships in different ways
  • add icons to nodes