Skip to content
liberation-dataPublic

About

Graph database client for Kotlin & Java — composable object views, type-safe Cypher DSL, zero impedance mismatch

Topics

Resources

Contributing

Stars

13 stars

Watchers

1 watching

Forks

Latest commit

 

History

481 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Drivine: graph database client for TypeScript, Python and the JVM

Drivine4j

CI License

Docs: drivine.org, for Kotlin & Java, TypeScript, and Python.

Watch: Drivine, graph RAG on any database (4:26)
▶ Watch Drivine in four and a half minutes: graph RAG on any database (4:26, with captions)

A graph database client library for Java and Kotlin supporting Neo4j, FalkorDB, Amazon Neptune, Memgraph, Oracle (SQL/PGQ), Postgres (plain SQL, with pgvector for vector search) and SQLite (a file, no server) with two approaches to graph mapping:

  1. PersistenceManager - Low-level API with manual Cypher queries (classic Drivine approach). Cypher runs on every engine, compiled to SQL on Oracle, Postgres and SQLite.
  2. Object manager (StatelessGraphObjectManager) - High-level API with annotated models and type-safe DSL.

On Node.js or Python? Drivine (npm install @liberation-data/drivine) and drivine-python (pip install drivine) are drivine4j's TypeScript and Python twins, with the same object manager, query DSL, schema management and engines.

Installation

Java 21+. The object manager needs Kotlin 2.2.0+. For a Spring Boot application, add the starter:

dependencies {
    implementation("org.drivine:drivine4j-spring-boot-starter:0.4.1")
}

Spring without Boot takes drivine4j-spring; the core library, drivine4j, runs with another framework or none. The type-safe query DSL needs the code generator: see Installation.

Quick Start

Name a datasource, and the starter provides the PersistenceManagerFactory, GraphObjectManagerFactory, SchemaManager and Drivine's transaction manager. Here manager is the PersistenceManager from factory.get("neo"):

database:
  datasources:
    neo:
      type: NEO4J
      host: localhost
      port: 7687
      user-name: neo4j
      password: password
      database-name: neo4j
@Transactional
fun findByCity(city: String): List<Person> = manager.query(
    QuerySpecification
        .withStatement("MATCH (p:Person {city: \$city}) RETURN properties(p)")
        .bind(mapOf("city" to city))
        .transform(Person::class.java)
)

The Quick Start has the rest, and the object manager maps annotated models with no Cypher at all.

Documentation

License

Apache License 2.0

About

Graph database client for Kotlin & Java — composable object views, type-safe Cypher DSL, zero impedance mismatch

Topics

Resources

Contributing

Stars

13 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages