oxgraph-db
Standalone OxGraph-native database engine above the topology substrate.
The embedded database of the oxgraph crate family.
What it is
oxgraph-db is the product layer above the topology substrate. It owns what
the foundation crates refuse to: durable database identity, a catalog of
labels, relation types, roles, and property keys, cataloged physical
projections (graph and hypergraph), typed properties, indexes, native OxQL
execution, and embedded transaction semantics.
Storage is a per-generation base snapshot plus a delta log. Writes go
through a transaction closure and commit to the log; opening a database
replays the valid log prefix over the memory-mapped base, truncating a torn
tail back to its last good byte. Compaction freezes the current state into
the next base generation. Reads run against a consistent pin and include
OxQL queries, graph/hypergraph walks, and PageRank over the cataloged
projections (PageRankConfig is re-exported so db-only consumers can
configure it without depending on oxgraph-algo).
Where it sits
oxgraph-topology / -graph / -hyper capability traits
oxgraph-csr / -hyper-bcsr / -csc borrowed layouts
oxgraph-snapshot / -property / -mmap base-file machinery
oxgraph-algo BFS / PageRank
└── oxgraph-db ← this crate (embedded engine)
└── oxgraphd HTTP server / CLI facade (unpublished)
Example
Adapted from the engine's end-to-end tests
(tests/e2e.rs):
use ;
let mut db = create?;
let = db.write?;
let prepared = db.prepare?;
let rows = db.reader.run?;
Documentation
See docs.rs/oxgraph-db for the full API and
the oxgraph family README for
how the layers fit together. Also available through the umbrella crate:
cargo add oxgraph --features db.
Status
Pre-1.0. The on-disk format is coupled to the crate version that wrote it; treat persisted databases as not yet portable across versions.
License
MIT. See LICENSE.