Embedded bi-temporal graph database for Java/Kotlin — Datalog queries, time travel, fat JAR with embedded natives
Minigraf for Java and Kotlin on the desktop JVM. Fat JAR with embedded native libraries for Linux x86_64/aarch64, macOS universal2, and Windows x86_64. No Rust toolchain required.
dependencies {
implementation("io.github.project-minigraf:minigraf-jvm:2.0.11")
}<dependency>
<groupId>io.github.project-minigraf</groupId>
<artifactId>minigraf-jvm</artifactId>
<version>2.0.11</version>
</dependency>import uniffi.minigraf_ffi.MiniGrafDb
import org.json.JSONObject
// File-backed database
val db = MiniGrafDb.open("/path/to/myapp.graph")
// In-memory database (ephemeral / testing)
val mem = MiniGrafDb.openInMemory()
// Transact facts
db.execute("""(transact [[:alice :person/name "Alice"] [:alice :person/age 30]])""")
// Query with Datalog
val json = JSONObject(db.execute(
"(query [:find ?name ?age :where [?e :person/name ?name] [?e :person/age ?age]])"
))
// json.getJSONArray("results").getJSONArray(0).getString(0) == "Alice"
// Time travel — state as of transaction 1
val snap = db.execute("(query [:find ?age :as-of 1 :where [:alice :person/age ?age]])")
// Flush dirty pages to disk
db.checkpoint()MIT OR Apache-2.0