Expand description
Storage contracts for Vertep actors.
Storage is two RDF-agnostic traits, so that no backend is asked for a guarantee it cannot give:
JournalStore: per actor address, a linearizable, all-or-nothing append of journal entries at an expected position (compare-and-set), reads from a position, and an optional fencing token checked on append.GraphStore: RDF quads in, SPARQL 1.1 out, with a declared RDF 1.2 capability. No compare-and-set and no transactions across requests are required.
Journal entries are RDF datasets with one named graph per entry (Entry). The crate also
ships the pieces every backend shares: the in-memory reference implementation
(MemoryStore), the projector that copies journals into an external graph store
(Projector), the RDF 1.1 reification fallback for annotations (reification), the
SPARQL text helpers (sparql) and, behind the testkit feature, the shared backend test
kit every backend must pass.
@tg: implements:: [[decisions#Two storage traits with tiramemsu as default]] {confidence: partial} @tg: implements:: [[decisions#Fencing epochs on journal appends]] {confidence: partial}
Re-exports§
pub use oxrdf;
Modules§
- reification
- Annotations on statements, written as RDF 1.2 reifiers or, on stores that only speak
RDF 1.1, as classic
rdf:Statementreification, and read back as the same annotation. - sparql
- SPARQL text for graph store writes, and conversion of evaluator results.
- vocab
- The
vt:terms the storage layer writes itself.
Structs§
- Append
Meta - Optional metadata of an append.
- Entry
- One journal entry: an RDF dataset with exactly one named graph, named by the entry’s IRI.
- Fencing
Token - A fencing token: a scope (for example a shard) and a monotonically increasing epoch.
- Graph
Capabilities - What a graph store declares about itself, read before writing anything that depends on it.
- Journal
Capabilities - What a journal store supports beyond compare-and-set, read before relying on it.
- Journal
Record - An entry read back from a journal, with its position.
- Memory
Store - The in-memory reference implementation of
JournalStoreandGraphStoreon one dataset, used by the test kit’s self-test and by tests of code above the storage layer. - Position
- A journal position: the number of an entry in one actor’s journal.
- Projection
Report - What one
Projector::project_actorrun did. - Projector
- Copies journal entries into a separate graph store in journal order, idempotently, and records per actor the last projected position in the target store.
- Solutions
- A table of SPARQL solutions: variable names in projection order and rows of optional terms
(
Noneis unbound). - State
Delta - The changes an append makes to the actor’s current-state graph (the named graph named by the actor address): statements of exited states to retract, and statements to assert.
Enums§
- Append
Error - Why a journal append wrote nothing.
- Query
Results - The result of a SPARQL query.
- RdfCapability
- Which RDF version a graph store speaks for statements about statements.
- Store
Error - An error of a read, a graph store operation or a backend outside the append protocol.
Traits§
- Graph
Store - A graph store: accepts RDF quads and answers SPARQL 1.1 queries, and declares whether it supports RDF 1.2 triple terms.
- Journal
Store - A journal store: per actor address, a linearizable, all-or-nothing append at an expected position, and reads from a position.
Functions§
- prepare_
append - The checks every backend runs before an append touches storage, and the stamped entries to
write at
expected + 1 ...