Expand description
In-process graph backing store for the loopback daemon /query route.
The live daemon graph is a fixed-capacity, zero-heap store backed by a
caller-invisible [NQuin; MAX_GRAPH_QUINS] buffer. Cold-path ontology and
file ingestion may still allocate while parsing, but the resident graph used
by /query no longer relies on Vec or HashSet.
Structs§
- Daemon
Graph Store - Init
Graph Options - Controls which resident graph layers are seeded at daemon boot.
- Update
Outcome - Outcome of applying a SPARQL Update to the daemon graph.
Constants§
- MAX_
GRAPH_ QUINS - Bench datasets (Schema.org ~18K quins) must fit for browser/native parity.
Functions§
- apply_
sparql_ update - Apply a parsed SPARQL Update to the resident daemon graph.
- apply_
sparql_ update_ durable - Apply a SPARQL Update durably and signed: each net change is stamped and signed to the WAL (the append-only audit trail) with the caller’s real ed25519 key, then the full graph state is snapshotted for restart durability. This is the production write path; the key must come from the identity / key-vault layer — never a placeholder.
- bump_
graph_ revision - Increment revision and notify SSE subscribers (Release ordering).
- condition_
label_ for_ subject_ hash - Known condition subject hashes for Anatomy graph -> label mapping.
- extend_
with_ ontology_ quins - Extend the live graph with ontology quins from
qualia-core-db::ontology_loader. - extend_
with_ ontology_ quins_ slice - Zero-heap resident update path for ontology insertion.
- graph_
lexicon_ lookup - Resolve a term hash to its literal text via the resident graph’s lexicon.
Used by the query path as the ingested-data resolver for
TextResolver. - graph_
quin_ count - Number of Quins currently available to
/query. - graph_
read_ guard - Read guard over the live graph (lock is process-static via
OnceLock). - graph_
revision - Monotonic Lamport-style revision counter for daemon graph mutations.
- init_
daemon_ graph - Initialise or refresh the daemon graph from storage path.
- init_
daemon_ graph_ with_ options - Initialise or refresh the daemon graph with explicit seeding policy.
- load_
graph_ snapshot - Load the durable snapshot into the graph, if present. Returns the quin count loaded (0 if there is no snapshot). This is the authoritative last full state (defaults + index + committed updates) when it exists.
- persist_
graph_ snapshot - Write the current full graph state to a flat-quin snapshot file. Called after a persisted SPARQL Update so the change survives a restart. Returns the quin count written.
- replace_
graph_ from_ flat_ bytes - Replace the in-memory graph with flat 48-byte NQuin bytes (browser bench_load).
- subscribe_
graph_ revisions - Subscribe to graph revision bumps (used by
GET /tensor/eventsSSE).