vertep_store/lib.rs
1//! Storage contracts for Vertep actors.
2//!
3//! Storage is two RDF-agnostic traits, so that no backend is asked for a guarantee it cannot
4//! give:
5//!
6//! - [`JournalStore`]: per actor address, a linearizable, all-or-nothing append of journal
7//! entries at an expected position (compare-and-set), reads from a position, and an optional
8//! fencing token checked on append.
9//! - [`GraphStore`]: RDF quads in, SPARQL 1.1 out, with a declared RDF 1.2 capability. No
10//! compare-and-set and no transactions across requests are required.
11//!
12//! Journal entries are RDF datasets with one named graph per entry ([`Entry`]). The crate also
13//! ships the pieces every backend shares: the in-memory reference implementation
14//! ([`MemoryStore`]), the projector that copies journals into an external graph store
15//! ([`Projector`]), the RDF 1.1 reification fallback for annotations ([`reification`]), the
16//! SPARQL text helpers ([`sparql`]) and, behind the `testkit` feature, the shared backend test
17//! kit every backend must pass.
18//!
19//! @tg: implements:: [[decisions#Two storage traits with tiramemsu as default]] {confidence: partial}
20//! @tg: implements:: [[decisions#Fencing epochs on journal appends]] {confidence: partial}
21
22mod error;
23mod graph;
24mod journal;
25mod memory;
26mod projector;
27pub mod reification;
28pub mod sparql;
29pub mod vocab;
30
31#[cfg(feature = "testkit")]
32pub mod testkit;
33
34pub use error::{AppendError, StoreError};
35pub use graph::{GraphCapabilities, GraphStore, QueryResults, RdfCapability, Solutions};
36pub use journal::{
37 AppendMeta, Entry, FencingToken, JournalCapabilities, JournalRecord, JournalStore, Position,
38 StateDelta, prepare_append,
39};
40pub use memory::MemoryStore;
41pub use projector::{ProjectionReport, Projector};
42
43/// The RDF model the contracts are written in (the `oxrdf` crate, with RDF 1.2 terms).
44pub use oxrdf;
45
46#[cfg(doctest)]
47#[doc = include_str!("../README.md")]
48struct ReadmeDoctests;