Developer Guides Getting Started Getting Started What is a Graph Database? Intro to Graph DBs Video Series Concepts: RDBMS to Graph Concepts: NoSQL to Graph Getting Started Resources Neo4j Graph Platform Graph Platform Overview Neo4j Desktop Intro Neo4j Browser Intro… Read more →

Developer Guides

Want to Speak? Get $ back.

Third-party libraries

Neo4j Community Drivers

Members of the each programming language community have invested a lot of time and love to develop each one of the community drivers for Neo4j, so if you use any one of them, please provide feedback to the authors.

The community drivers have been graciously contributed by the Neo4j community. Many of them are fully featured and well-maintained, but some may not be. Neo4j does not take any responsibility for their usability.

Using Neo4j Server with JDBC

Being a Java developer you’re probably familiar with JDBC as a way to work with relational databases, either directly or via abstractions like Spring’s JDBCTemplate or MyBatis. Many tools for ETL, Report Generators, Business Intelligence, and data management also use JDBC drivers to interact with relational databases.

As Cypher, like SQL, is a textual parameterizable query language that can return tabular results, it was possible for us to support the JDBC APIs and make a Neo4j-JDBC driver available.

The driver supports the new binary “Bolt” protocol of Neo4j 3.x, the transactional http endpoint and Neo4j embedded connections.

// Connect
Connection con = DriverManager.getConnection("jdbc:neo4j:bolt://localhost");

// Querying
try (Statement stmt = con.createStatement()) {
    ResultSet rs = stmt.executeQuery("MATCH (n:User) RETURN n.name");
	while (rs.next()) {
		System.out.println(rs.getString("n.name"));
	}
}
con.close();

More details on how to use it can be found with our example project for Java-JDBC. There, we implement the backend as a minimal Java webapp that leverages Neo4j-JDBC to connect to Neo4j Server.

We tested the driver with many enterprise tools to ensure that it works in a variety of environments. Just grab the JAR of the latest release and add it to your tool of choice.

Authors

Developers from Larus BA Italy and Neo4j

Package

https://github.com/neo4j-contrib/neo4j-jdbc/releases/latest

Source

https://github.com/neo4j-contrib/neo4j-jdbc

Docs

https://github.com/neo4j-contrib/neo4j-jdbc/blob/master/README.adoc

Example

https://github.com/neo4j-examples/movies-java-jdbc

Blog Post

http://neo4j.com/blog/couchbase-jdbc-integrations-neo4j-3-0/

Neo4j Community Drivers

Members of the each programming language community have invested a lot of time and love to develop each one of the community drivers for Neo4j, so if you use any one of them, please provide feedback to the authors.

The community drivers have been graciously contributed by the Neo4j community. Many of them are fully featured and well-maintained, but some may not be. Neo4j does not take any responsibility for their usability.

JCypher

JCypher provides seamlessly integrated Java access to Neo4j at different levels of abstraction:

At the topmost level of abstraction, JCypher allows you to map complex business domains to graph databases. You can take an arbitrarily complex graph of domain objects or POJOs and store it in a straightforward way into Neo4j for later retrieval. You do not need to modify your domain object classes in any way, there is also no need for annotations. JCypher provides a default mapping out of the box.

At the same level of abstraction, Domain Queries provide the power and expressiveness of queries on a graph database, while being formulated on domain objects or on types of domain objects, respectively. The true power of Domain Queries comes from the fact, that the graph of domain objects is backed by a graph database.

At the next lower level of abstraction – access to graph databases – is provided based on a generic graph model. While simple, the model allows you to easily navigate and manipulate graphs.

At the bottom level of abstraction, a native Java DSL in the form of a fluent Java API allows you to intuitively and comfortably formulate queries against Neo4j.

Author

Wolfgang Schützelhofer

Package

http://maven.org

Source

http://github.com/Wolfgang-Schuetzelhofer/jcypher

Docs

http://jcypher.iot-solutions.net/

Article

https://neo4j.com/blog/jcypher-focus-on-your-domain-model-not-how-to-map-it-to-the-database/

Groovy & Grails: Neo4j Grails Plugin

grails

The goal of GORM for Neo4j is to provide a ‘as-complete-as-possible’ GORM implementation that maps domain classes and instances to the Neo4j nodespace. The following features are supported:

  • Marshalling from Neo4j Nodes to Groovy types and back again
  • Support for GORM dynamic finders, criteria and named queries
  • Session-managed transactions
  • Access to Neo4j’s traversal capabilities
  • Access the Neo4j graph database via the Bolt driver

Authors

Stefan Armbruster, Graeme Rocher

Package

http://www.grails.org/plugin/neo4j

Source

https://github.com/grails/grails-data-mapping/tree/master/grails-datastore-gorm-neo4j

Docs

http://grails.github.io/grails-data-mapping/latest/neo4j/

Scala: neotypes

scala

Scala lightweight, type-safe, asynchronous driver (not opinionated on side-effect implementation) for neo4j. The project aims to provide seamless integration with most popular scala infrastructures such as lightbend (Akka, Akka-http, Lagom, etc), typelevel (cats, http4s, etc), twitter (finch, etc)…​

Author

Dmitry Fedosov

Source

https://github.com/neotypes/neotypes

Docs

https://neotypes.github.io/neotypes/docs.html

Article

http://dimafeng.com/2018/12/27/neotypes-1/

Example

https://github.com/neotypes/examples

JPA: Hibernate OGM

Hibernate Object/Grid Mapper (OGM) with Neo4j Support.

Authors

Davide D’Alto, Gunnar Moelling, Emmanuel Bernard

Package

http://maven.org

Source

https://github.com/hibernate/hibernate-ogm/tree/master/neo4j

Docs

http://docs.jboss.org/hibernate/ogm/5.0/reference/en-US/html_single/#ogm-neo4j

Article

Blog, JPL Queries

Example

https://github.com/TimmyStorms/hibernate-ogm-neo4j-example