The Neo4j 2.3.0 Milestone 3 Release Is Now Available


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) 
RETURN c.name

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.)

Delete


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 a.name = "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.


Cheers,
Andreas

Download: https://neo4j.com/download-center/#milestone
Documentation: https://neo4j.com/docs/milestone/
Cypher Reference Card: https://neo4j.com/docs/milestone/cypher-refcard
Please send feedback to: feedback@neotechnology.com
GitHub: https://github.com/neo4j/neo4j/issues


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.