pub struct Entry { /* private fields */ }Expand description
One journal entry: an RDF dataset with exactly one named graph, named by the entry’s IRI.
The entry IRI is chosen by the caller (the runtime derives it from the actor address and the
position, see runtime-ontology#Stable Runtime IRIs) and is unique in the store. On append a
store adds three stamps to the graph (Entry::stamp): rdf:type vt:JournalEntry,
vt:actor and vt:position, so every entry read back is self-describing in vt: terms.
Implementations§
Source§impl Entry
impl Entry
Sourcepub fn new(name: NamedNode, triples: impl IntoIterator<Item = Triple>) -> Self
pub fn new(name: NamedNode, triples: impl IntoIterator<Item = Triple>) -> Self
An entry named name holding triples.
Sourcepub fn from_dataset(dataset: &Dataset) -> Result<Self, StoreError>
pub fn from_dataset(dataset: &Dataset) -> Result<Self, StoreError>
The entry encoded by a dataset, which must hold exactly one named graph, named by an IRI, and nothing in the default graph.
§Errors
StoreError::Invalid for any other dataset shape.
Sourcepub fn quads(&self) -> Vec<Quad>
pub fn quads(&self) -> Vec<Quad>
The quads of the entry: every statement in the graph named by the entry IRI.
Sourcepub fn to_dataset(&self) -> Dataset
pub fn to_dataset(&self) -> Dataset
The entry as an RDF dataset with one named graph.
Sourcepub fn position(&self) -> Option<Position>
pub fn position(&self) -> Option<Position>
The position stamped on the entry (<entry> vt:position n), if any.
Sourcepub fn stamp(
&self,
actor: &NamedNode,
position: Position,
) -> Result<Entry, StoreError>
pub fn stamp( &self, actor: &NamedNode, position: Position, ) -> Result<Entry, StoreError>
The entry with the store’s stamps added: rdf:type vt:JournalEntry, vt:actor <actor>
and vt:position n.
§Errors
StoreError::Invalid when the entry already states another actor or position.
Sourcepub fn is_isomorphic(&self, other: &Entry) -> bool
pub fn is_isomorphic(&self, other: &Entry) -> bool
True when both entries have the same IRI and isomorphic graphs (equal up to blank node labels, which a store may rename).
Sourcepub fn has_blank_nodes(&self) -> bool
pub fn has_blank_nodes(&self) -> bool
True when the graph contains a blank node anywhere.