Skip to main content

Crate vertep_store

Crate vertep_store 

Source
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:Statement reification, 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§

AppendMeta
Optional metadata of an append.
Entry
One journal entry: an RDF dataset with exactly one named graph, named by the entry’s IRI.
FencingToken
A fencing token: a scope (for example a shard) and a monotonically increasing epoch.
GraphCapabilities
What a graph store declares about itself, read before writing anything that depends on it.
JournalCapabilities
What a journal store supports beyond compare-and-set, read before relying on it.
JournalRecord
An entry read back from a journal, with its position.
MemoryStore
The in-memory reference implementation of JournalStore and GraphStore on 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.
ProjectionReport
What one Projector::project_actor run 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 (None is unbound).
StateDelta
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§

AppendError
Why a journal append wrote nothing.
QueryResults
The result of a SPARQL query.
RdfCapability
Which RDF version a graph store speaks for statements about statements.
StoreError
An error of a read, a graph store operation or a backend outside the append protocol.

Traits§

GraphStore
A graph store: accepts RDF quads and answers SPARQL 1.1 queries, and declares whether it supports RDF 1.2 triple terms.
JournalStore
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 ...