Spring Data Graph 1.1.0 with Neo4j support released

After the first public release of Spring Data Graph in April 2011 we mainly focused on user feedback. With the improved documentation around the tooling and an upgraded AspectJ version, we addressed many of the AspectJ issues that were reported by users. With the latest STS and Eclipse and hopefully with Idea11 it is possible to develop Spring Data Graph applications without the red wiggles. To further ease the development we also provided sample build scripts for ant/ivy and a plugin for gradle. Of course, we kept pace with development of Neo4j, currently using the latest stable release of Neo4j (1.4.1). During the last months of Neo4j development, the improved querying (Cypher, Gremlin) support was one of the important aspects, so we strove to support it on all levels. Now, it is possible to execute Cypher queries from Spring Data Graph Repositories, from the Neo4j-Template but also as part of dynamic field annotations and via the introduced entity methods. The same goes for Gremlin scripts. What’s possible with this new expressive power? Let’s take a look. For example, in a repository:
public interface PersonRepository extends GraphRepository<person>, NamedIndexRepository<person> {

@Query("start team=(%team) match (team)-[:persons]->(member) return member")
Iterable<person> findAllTeamMembers(@Param("team") Group team);

@Query(value = "g.v(team).out('persons')", type = QueryType.Gremlin)
Iterable<person> findAllTeamMembersGremlin(@Param("team") Group team);
The Neo4j Template API got a complete overhaul which resulted in much fewer, more focused methods. The advanced query result handling capabilities (type conversion, mapping, single results, handler, etc.) are now implemented using a more fluent API. This new API is available for all types of queries, whether index lookups, graph traversals, Cypher queries or Gremlin scripts.

	template.query("start n=(0) match n-->m return m", null).to(Node.class);

template.execute("g.v(0).out", null).to(Node.class);

template.lookup("relationship", "name", "rel1").to(String.class, new PropertyContainerNameConverter()).single();

template.traverse(referenceNode, traversalDescription).handle(new Handler<path>() {
public void handle(Path value) {
final String name = (String) value.endNode().getProperty("name", "");

The REST API wrapper also got an internal refreshment and added support for querying Cypher and Gremlin remotely. This makes both capabilities also available for running the object graph mapping and the Neo4j Template against a remote Neo4j-REST-Server. Many thanks to the community for the valuable feedback, the code contributions and discussions. The collaboration between the SpringSource and Neo-Technology teams was enjoyable, as always. Please check out the current release from Maven Central or from SpringSource.org. If you would like to discuss the Spring Data Graph project, make sure to visit the Spring Forums. We host the project publicly on github for you to fork, comment and contribute.

We want to give you a few glimpses of the future roadmap.
We are going to host a webinar on Sept. 8th to give a quick intro to Spring Data Graph. Spring Data Graph will be rebranded to “Spring Data Neo4j” as it is about: “Support for the Neo4j Graph Database in a SpringFramework environment.” This already cast its first signs in the changed package structures. We will focus on an additional mapping-based implementation that also works without AspectJ. Another major focus will be the remote REST-API which becomes more and more important with the availability of hosted Neo4j services at PaaS providers. The Spring Data Graph Guide Book will be published as an InfoQ Mini Book and available as printed version at the Spring One conference in October. Neo Technology will be present at Spring One to talk about NOSQL, Graph Databases and Spring Data Neo4j. We also hope to contribute some unexpected events and technologies to the conference. Stay tuned.

Want to learn more about graph databases? Click below to get your free copy of O’Reilly’s Graph Databases ebook and discover how to use graph technologies for your application today.

Download My Ebook



Anonymous says:

Exciting stuff. Reading the documentation, the version of spring-data-neo4j that is used is given as 1.1.0 – which results in maven build errors – surely this is supposed to be 1.1.0.RELEASE? (Example 5.1, Example 19.1, Examples 19.4, Example 25.4). Keep up the good work!

Why renaming and adding &quot;Neo4J&quot; specifically? With Gremlin, you can support ANY database supported by Blueprints, the backend &quot;JDBC&quot; for graph databases… Did not get that…<br /><br />Marcello

Leave a Reply

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


Upcoming Event


Neo4j GraphTour Register Now

From the CEO

Emil's Blog

Have a Graph Question?

Contact Us

Share your Graph Story?

Email us: content@neotechnology.com

Popular Graph Topics