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 |
|
Source |
|
Docs |
https://github.com/neo4j-contrib/neo4j-jdbc/blob/master/README.adoc |
Example |
|
Blog Post |
http://neo4j.com/blog/couchbase-jdbc-integrations-neo4j-3-0/ |
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 |
|
Package |
|
Source |
|
Docs |
|
Article |
https://neo4j.com/blog/jcypher-focus-on-your-domain-model-not-how-to-map-it-to-the-database/ |
Groovy & Grails: Neo4j Grails Plugin
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 |
|
Source |
https://github.com/grails/grails-data-mapping/tree/master/grails-datastore-gorm-neo4j |
Docs |
Scala: neotypes
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 |
|
Source |
|
Docs |
|
Article |
|
Example |
JPA: Hibernate OGM
Hibernate Object/Grid Mapper (OGM) with Neo4j Support.
Authors |
Davide D’Alto, Gunnar Moelling, Emmanuel Bernard |
Package |
|
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 |
|
Example |
Was this page helpful?