pub struct Graph {
pub triples: HashSet<String>,
pub prefixes: BTreeMap<String, String>,
/* private fields */
}Expand description
A minimal in-memory RDF graph used for patch application and diff generation.
Triples are stored as (subject, predicate, object) tuples of PatchTerm.
Prefix mappings are stored separately.
Fields§
§triples: HashSet<String>Set of (subject, predicate, object) triples
prefixes: BTreeMap<String, String>Prefix → IRI mappings
Implementations§
Source§impl Graph
impl Graph
Sourcepub fn add_triple(&mut self, triple: PatchTriple) -> bool
pub fn add_triple(&mut self, triple: PatchTriple) -> bool
Add a triple to the graph; returns true if newly inserted
Sourcepub fn remove_triple(&mut self, triple: &PatchTriple) -> bool
pub fn remove_triple(&mut self, triple: &PatchTriple) -> bool
Remove a triple from the graph; returns true if it was present
Sourcepub fn contains(&self, triple: &PatchTriple) -> bool
pub fn contains(&self, triple: &PatchTriple) -> bool
Return true if the triple is present in the graph
Sourcepub fn iter(&self) -> impl Iterator<Item = &PatchTriple>
pub fn iter(&self) -> impl Iterator<Item = &PatchTriple>
Iterate over all triples in the graph
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Graph
impl RefUnwindSafe for Graph
impl Send for Graph
impl Sync for Graph
impl Unpin for Graph
impl UnsafeUnpin for Graph
impl UnwindSafe for Graph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more