Discover the New Features in the Latest Milestone Release of Neo4j 2.3 in the Beta ProgramGreat news for all those Neo4j alpha-developers out there: The third (and final) milestone release of Neo4j 2.3 is now ready for download! Get your copy of Neo4j 2.3.0-M03 here.

Quick clarification: Milestone releases like this one are for development and experimentation only, and not all features are in their finalized form. Click here for the most fully stable version of Neo4j (2.2.5).

So, what cool new features made it into this milestone release of Neo4j? Let’s dive in.

Better Recommendations with Triadic Selection

(What is a triadic selection, you ask?)

The foundation of all recommendations is a simple pattern of looking at triangles in a graph, then suggesting new ones to complete. It looks something like this:

An Example of a Basic Triadic Selection on a Graph

From node A, follow relationships outward to find B and C. Because B and C are also connected, we have a triangle that suggests strong relationships, even without looking at any properties. Thus, the natural recommendation.

To demonstrate, let’s use the Movie Graph example included with Neo4j to create a professional actor’s network, connecting Persons who have worked on a Movie together:

MATCH (a:Person)--(:Movie)--(other:Person) 
MERGE (a)-[:KNOWS]-(other)

Now, we could recommend new people for Tom Hanks to work with, by looking for the people he knows, then the other people they know that Tom doesn’t know:

EXPLAIN MATCH (a:Person {name:"Tom Hanks"})-[:KNOWS]->(b:Person)-[:KNOWS]->(c:Person) 
WHERE NOT (a)-[:KNOWS]->(c) 

We’ve used EXPLAIN to display the execution plan, where you’ll notice the new TriadicSelection operator, which optimizes the solution to this query.

Property Must Exist

In large organizations, it’s common to have multiple applications accessing the same database. That’s when constraints are helpful to supplement application-level conventions.

Sticking with the Movie Graph, we could insist that the title property exists on all Movies:

CREATE CONSTRAINT ON (m:Movie) ASSERT exists(m.title)

(This Property Must Exist constraint is exclusive to Neo4j Enterprise Edition.)


Removing a node along with any existing relationships is such a common operation that we’ve added a special variation on DELETE which concisely expresses just that.

For instance, we could remove a mistakenly added Person from the Movie Graph:

MATCH (a:Person) WHERE = "Emil Eifrem" DETACH DELETE a

Windows Power!

Windows users can now use a full complement of Powershell scripts for managing Neo4j, making it convenient to orchestrate the management of Neo4j.

Query Warnings in the Neo4j Browser

To help you write the best queries possible, Cypher now reports warnings about queries which might be less-than-awesome. In the Neo4j Browser, you may notice a little yellow warning sign pop up when something about your query could be improved.

Click on the warning, and you’ll get a nice explanation about the concern, such as this explanation about calculating a Cartesian product:

An Example of a Cartesian Product Warning in the Neo4j Browser

More Features

The Milestone 3 release also includes a number of other new features, such as:
    • Range queries can now be solved using index seeks
    • Function exists() may use index scan
    • LIMIT influences planning costs
    • Inequality predicates can now be chained on the form 0 < n.prop < 10

Feedback Requested

With this milestone, Neo4j 2.3 is nearly feature complete, so please give it a try and let us know what you think about the features.


Cypher Reference Card:
Please send feedback to:

Dig deeper into the world of graph databases: Click below to get your free copy of O’Reilly’s Graph Databases ebook and discover how to use graph solutions for your mission-critical problems today.

Get My Free Copy



About the Author

Andreas Kollegger , Senior Product Designer

Andreas Kollegger Image

Andreas Kollegger is a technological humanist. Starting at NASA, Andreas designed systems from scratch to support science missions. Then in Zambia, he built medical informatics systems that complement technology with social good. Now with Neo4j, he is democratizing graph databases which elevate understanding by emphasizing relationships.

Andreas joined Neo4j as an early member of core engineering. He has now taken on the role of Senior Product Designer, crafting a developer experience that balances simplicity with power.

1 Comment

Very good jobs guys. We stress tested TriadicSelection and the results are really good, blog post coming.

One thing, for non misleading people, the example does not exclude the fact that (a) can equals (c), so maybe add AND (a) (c) in the Cypher query.



Leave a Reply

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


Upcoming Event


Have a Graph Question?

Stack Overflow
Community Forums
Contact Us

Share your Graph Story?

Email us: