pub struct DatasetGraph<D: Dataset, G: Term> { /* private fields */ }
Expand description
I wrap a Dataset
as a Graph
corresponding to a specific graph (default or named) of the wrapped dataset.
This graph is also mutable if the underlying dataset is.
NB: this type is design to be the return type of Dataset::graph
and Dataset::graph_mut
.
It is not designed to be usable “from scratch”.
Implementations§
Trait Implementations§
Source§impl<D: Clone + Dataset, G: Clone + Term> Clone for DatasetGraph<D, G>
impl<D: Clone + Dataset, G: Clone + Term> Clone for DatasetGraph<D, G>
Source§fn clone(&self) -> DatasetGraph<D, G>
fn clone(&self) -> DatasetGraph<D, G>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<D: Dataset, G: Term> Graph for DatasetGraph<D, G>
impl<D: Dataset, G: Term> Graph for DatasetGraph<D, G>
Source§type Triple<'x> = [<<D as Dataset>::Quad<'x> as Quad>::Term; 3]
where
Self: 'x
type Triple<'x> = [<<D as Dataset>::Quad<'x> as Quad>::Term; 3] where Self: 'x
Determine the type of
Triple
s
that the methods of this graph will yield.Source§fn triples(&self) -> GTripleSource<'_, Self>
fn triples(&self) -> GTripleSource<'_, Self>
An iterator visiting all triples of this graph in arbitrary order. Read more
Source§fn triples_matching<'s, S, P, O>(
&'s self,
sm: S,
pm: P,
om: O,
) -> GTripleSource<'s, Self>
fn triples_matching<'s, S, P, O>( &'s self, sm: S, pm: P, om: O, ) -> GTripleSource<'s, Self>
An iterator visiting all triples matching the given subject, predicate and object.
See
crate::term::matcher
. Read moreSource§fn contains<TS, TP, TO>(&self, s: TS, p: TP, o: TO) -> GResult<Self, bool>
fn contains<TS, TP, TO>(&self, s: TS, p: TP, o: TO) -> GResult<Self, bool>
Return
true
if this graph contains the given triple.Source§fn subjects(&self) -> GTermSource<'_, Self>
fn subjects(&self) -> GTermSource<'_, Self>
Build a fallible iterator of all the terms used as subject in this Graph. Read more
Source§fn predicates(&self) -> GTermSource<'_, Self>
fn predicates(&self) -> GTermSource<'_, Self>
Build a fallible iterator of all the terms used as predicate in this Graph. Read more
Source§fn objects(&self) -> GTermSource<'_, Self>
fn objects(&self) -> GTermSource<'_, Self>
Build a fallible iterator of all the terms used as object in this Graph. Read more
Source§fn iris(&self) -> GTermSource<'_, Self>
fn iris(&self) -> GTermSource<'_, Self>
Build a fallible iterator of all the IRIs used in this Graph
(including those used inside quoted triples, if any). Read more
Source§fn blank_nodes(&self) -> GTermSource<'_, Self>
fn blank_nodes(&self) -> GTermSource<'_, Self>
Build a fallible iterator of all the blank nodes used in this Graph
(including those used inside quoted triples, if any). Read more
Source§fn literals(&self) -> GTermSource<'_, Self>
fn literals(&self) -> GTermSource<'_, Self>
Build a fallible iterator of all the literals used in this Graph
(including those used inside quoted triples, if any). Read more
Source§fn quoted_triples<'s>(&'s self) -> GTermSource<'s, Self>
fn quoted_triples<'s>(&'s self) -> GTermSource<'s, Self>
Build a fallible iterator of all the quoted triples used in this Graph
(including those used inside quoted triples, if any). Read more
Source§fn variables(&self) -> GTermSource<'_, Self>
fn variables(&self) -> GTermSource<'_, Self>
Build a fallible iterator of all the variables used in this Graph
(including those used inside quoted triples, if any). Read more
Source§fn as_dataset(&self) -> GraphAsDataset<&Self>
fn as_dataset(&self) -> GraphAsDataset<&Self>
Dataset
adapter borrowing this graphSource§fn as_dataset_mut(&mut self) -> GraphAsDataset<&mut Self>
fn as_dataset_mut(&mut self) -> GraphAsDataset<&mut Self>
Dataset
adapter borrowing this graph mutablySource§fn into_dataset(self) -> GraphAsDataset<Self>where
Self: Sized,
fn into_dataset(self) -> GraphAsDataset<Self>where
Self: Sized,
Dataset
adapter taking ownership of this graphSource§impl<D: MutableDataset, G: Term> MutableGraph for DatasetGraph<D, G>
impl<D: MutableDataset, G: Term> MutableGraph for DatasetGraph<D, G>
Source§type MutationError = <D as MutableDataset>::MutationError
type MutationError = <D as MutableDataset>::MutationError
The error type that this graph may raise during mutations.
Source§fn insert<TS, TP, TO>(&mut self, s: TS, p: TP, o: TO) -> MgResult<Self, bool>
fn insert<TS, TP, TO>(&mut self, s: TS, p: TP, o: TO) -> MgResult<Self, bool>
Insert in this graph a triple made of the the given terms. Read more
Source§fn remove<TS, TP, TO>(&mut self, s: TS, p: TP, o: TO) -> MgResult<Self, bool>
fn remove<TS, TP, TO>(&mut self, s: TS, p: TP, o: TO) -> MgResult<Self, bool>
Remove from this graph the triple made of the the given terms. Read more
Source§fn insert_triple<T>(&mut self, triple: T) -> MgResult<Self, bool>where
T: Triple,
fn insert_triple<T>(&mut self, triple: T) -> MgResult<Self, bool>where
T: Triple,
Insert in this graph the given triple. Read more
Source§fn remove_triple<T>(&mut self, triple: T) -> MgResult<Self, bool>where
T: Triple,
fn remove_triple<T>(&mut self, triple: T) -> MgResult<Self, bool>where
T: Triple,
Remoe from this graph the given triple. Read more
Source§fn insert_all<TS: TripleSource>(
&mut self,
src: TS,
) -> StreamResult<usize, TS::Error, <Self as MutableGraph>::MutationError>
fn insert_all<TS: TripleSource>( &mut self, src: TS, ) -> StreamResult<usize, TS::Error, <Self as MutableGraph>::MutationError>
Insert into this graph all triples from the given source. Read more
Source§fn remove_all<TS: TripleSource>(
&mut self,
src: TS,
) -> StreamResult<usize, TS::Error, <Self as MutableGraph>::MutationError>
fn remove_all<TS: TripleSource>( &mut self, src: TS, ) -> StreamResult<usize, TS::Error, <Self as MutableGraph>::MutationError>
Remove from this graph all triples from the given source. Read more
Source§fn remove_matching<S, P, O>(
&mut self,
ms: S,
mp: P,
mo: O,
) -> Result<usize, Self::MutationError>
fn remove_matching<S, P, O>( &mut self, ms: S, mp: P, mo: O, ) -> Result<usize, Self::MutationError>
Remove all triples matching the given matchers. Read more
Source§fn retain_matching<S, P, O>(
&mut self,
ms: S,
mp: P,
mo: O,
) -> Result<(), Self::MutationError>
fn retain_matching<S, P, O>( &mut self, ms: S, mp: P, mo: O, ) -> Result<(), Self::MutationError>
Keep only the triples matching the given matchers. Read more
impl<D: Copy + Dataset, G: Copy + Term> Copy for DatasetGraph<D, G>
impl<D: SetDataset, G: Term> SetGraph for DatasetGraph<D, G>
Auto Trait Implementations§
impl<D, G> Freeze for DatasetGraph<D, G>
impl<D, G> RefUnwindSafe for DatasetGraph<D, G>where
D: RefUnwindSafe,
G: RefUnwindSafe,
impl<D, G> Send for DatasetGraph<D, G>
impl<D, G> Sync for DatasetGraph<D, G>
impl<D, G> Unpin for DatasetGraph<D, G>
impl<D, G> UnwindSafe for DatasetGraph<D, G>where
D: UnwindSafe,
G: UnwindSafe,
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