pub struct DatasetGraph<D, G>{ /* 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 MutableDataset::graph_mut.
It is not designed to be usable “from scratch”.
Implementations§
Trait Implementations§
Source§impl<D, G> Clone for DatasetGraph<D, G>
impl<D, G> Clone for DatasetGraph<D, G>
Source§fn clone(&self) -> DatasetGraph<D, G>
fn clone(&self) -> DatasetGraph<D, G>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<D, G> Debug for DatasetGraph<D, G>
impl<D, G> Debug for DatasetGraph<D, G>
Source§impl<D, G> Graph for DatasetGraph<D, G>
impl<D, G> Graph for DatasetGraph<D, G>
Source§type Triple<'x> = [<<D as Dataset>::Quad<'x> as Quad>::Term; 3]
where
DatasetGraph<D, G>: 'x
type Triple<'x> = [<<D as Dataset>::Quad<'x> as Quad>::Term; 3] where DatasetGraph<D, G>: 'x
Determine the type of
Triples
that the methods of this graph will yield.Source§fn triples(
&self,
) -> impl Iterator<Item = Result<<DatasetGraph<D, G> as Graph>::Triple<'_>, <DatasetGraph<D, G> as Graph>::Error>>
fn triples( &self, ) -> impl Iterator<Item = Result<<DatasetGraph<D, G> as Graph>::Triple<'_>, <DatasetGraph<D, G> as Graph>::Error>>
An iterator visiting all triples of this graph in arbitrary order. Read more
Source§fn triples_matching<'s, 't, S, P, O>(
&'s self,
sm: S,
pm: P,
om: O,
) -> impl Iterator<Item = Result<<DatasetGraph<D, G> as Graph>::Triple<'s>, <DatasetGraph<D, G> as Graph>::Error>> + 't
fn triples_matching<'s, 't, S, P, O>( &'s self, sm: S, pm: P, om: O, ) -> impl Iterator<Item = Result<<DatasetGraph<D, G> as Graph>::Triple<'s>, <DatasetGraph<D, G> as Graph>::Error>> + 't
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) -> Result<bool, Self::Error>
fn contains<TS, TP, TO>(&self, s: TS, p: TP, o: TO) -> Result<bool, Self::Error>
Return
true if this graph contains the given triple.Source§fn subjects(
&self,
) -> impl Iterator<Item = Result<<Self::Triple<'_> as Triple>::Term, Self::Error>>
fn subjects( &self, ) -> impl Iterator<Item = Result<<Self::Triple<'_> as Triple>::Term, Self::Error>>
Build a fallible iterator of all the terms used as subject in this Graph. Read more
Source§fn subjects_matching<'s, M>(
&'s self,
matcher: M,
) -> impl Iterator<Item = Result<<Self::Triple<'s> as Triple>::Term, Self::Error>> + 'swhere
M: TermMatcher + 's,
fn subjects_matching<'s, M>(
&'s self,
matcher: M,
) -> impl Iterator<Item = Result<<Self::Triple<'s> as Triple>::Term, Self::Error>> + 'swhere
M: TermMatcher + 's,
Build a fallible iterator of all the terms used as subject in this Graph and matching the given
TermMatcher. Read moreSource§fn predicates(
&self,
) -> impl Iterator<Item = Result<<Self::Triple<'_> as Triple>::Term, Self::Error>>
fn predicates( &self, ) -> impl Iterator<Item = Result<<Self::Triple<'_> as Triple>::Term, Self::Error>>
Build a fallible iterator of all the terms used as predicate in this Graph. Read more
Source§fn predicates_matching<'s, M>(
&'s self,
matcher: M,
) -> impl Iterator<Item = Result<<Self::Triple<'s> as Triple>::Term, Self::Error>> + 'swhere
M: TermMatcher + 's,
fn predicates_matching<'s, M>(
&'s self,
matcher: M,
) -> impl Iterator<Item = Result<<Self::Triple<'s> as Triple>::Term, Self::Error>> + 'swhere
M: TermMatcher + 's,
Build a fallible iterator of all the terms used as predicate in this Graph and matching the given
TermMatcher. Read moreSource§fn objects(
&self,
) -> impl Iterator<Item = Result<<Self::Triple<'_> as Triple>::Term, Self::Error>>
fn objects( &self, ) -> impl Iterator<Item = Result<<Self::Triple<'_> as Triple>::Term, Self::Error>>
Build a fallible iterator of all the terms used as object in this Graph. Read more
Source§fn objects_matching<'s, M>(
&'s self,
matcher: M,
) -> impl Iterator<Item = Result<<Self::Triple<'s> as Triple>::Term, Self::Error>> + 'swhere
M: TermMatcher + 's,
fn objects_matching<'s, M>(
&'s self,
matcher: M,
) -> impl Iterator<Item = Result<<Self::Triple<'s> as Triple>::Term, Self::Error>> + 'swhere
M: TermMatcher + 's,
Build a fallible iterator of all the terms used as object in this Graph and matching the given
TermMatcher. Read moreSource§fn iris(
&self,
) -> impl Iterator<Item = Result<<Self::Triple<'_> as Triple>::Term, Self::Error>>
fn iris( &self, ) -> impl Iterator<Item = Result<<Self::Triple<'_> as Triple>::Term, Self::Error>>
Build a fallible iterator of all the IRIs used in this Graph
(including those used inside triple terms, if any). Read more
Source§fn blank_nodes(
&self,
) -> impl Iterator<Item = Result<<Self::Triple<'_> as Triple>::Term, Self::Error>>
fn blank_nodes( &self, ) -> impl Iterator<Item = Result<<Self::Triple<'_> as Triple>::Term, Self::Error>>
Build a fallible iterator of all the blank nodes used in this Graph
(including those used inside triple terms, if any). Read more
Source§fn literals(
&self,
) -> impl Iterator<Item = Result<<Self::Triple<'_> as Triple>::Term, Self::Error>>
fn literals( &self, ) -> impl Iterator<Item = Result<<Self::Triple<'_> as Triple>::Term, Self::Error>>
Build a fallible iterator of all the literals used in this Graph
(including those used inside triple terms, if any). Read more
Source§fn triple_terms<'s>(
&'s self,
) -> Box<dyn Iterator<Item = Result<<Self::Triple<'s> as Triple>::Term, Self::Error>> + 's>
fn triple_terms<'s>( &'s self, ) -> Box<dyn Iterator<Item = Result<<Self::Triple<'s> as Triple>::Term, Self::Error>> + 's>
Build a fallible iterator of all the triple terms used in this Graph
(including those used inside other triple terms, if any). Read more
Source§fn variables(
&self,
) -> impl Iterator<Item = Result<<Self::Triple<'_> as Triple>::Term, Self::Error>>
fn variables( &self, ) -> impl Iterator<Item = Result<<Self::Triple<'_> as Triple>::Term, Self::Error>>
Build a fallible iterator of all the variables used in this Graph
(including those used inside triple terms, 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, G> MutableGraph for DatasetGraph<D, G>where
D: MutableDataset,
G: Term,
impl<D, G> MutableGraph for DatasetGraph<D, G>where
D: MutableDataset,
G: Term,
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,
) -> Result<bool, <DatasetGraph<D, G> as MutableGraph>::MutationError>
fn insert<TS, TP, TO>( &mut self, s: TS, p: TP, o: TO, ) -> Result<bool, <DatasetGraph<D, G> as MutableGraph>::MutationError>
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,
) -> Result<bool, <DatasetGraph<D, G> as MutableGraph>::MutationError>
fn remove<TS, TP, TO>( &mut self, s: TS, p: TP, o: TO, ) -> Result<bool, <DatasetGraph<D, G> as MutableGraph>::MutationError>
Remove from this graph the triple made of the the given terms. Read more
Source§fn insert_triple<T>(&mut self, triple: T) -> Result<bool, Self::MutationError>where
T: Triple,
fn insert_triple<T>(&mut self, triple: T) -> Result<bool, Self::MutationError>where
T: Triple,
Insert in this graph the given triple. Read more
Source§fn remove_triple<T>(&mut self, triple: T) -> Result<bool, Self::MutationError>where
T: Triple,
fn remove_triple<T>(&mut self, triple: T) -> Result<bool, Self::MutationError>where
T: Triple,
Remoe from this graph the given triple. Read more
Source§fn insert_all<TS>(
&mut self,
src: TS,
) -> Result<usize, StreamError<<TS as Source>::Error, Self::MutationError>>where
TS: TripleSource,
fn insert_all<TS>(
&mut self,
src: TS,
) -> Result<usize, StreamError<<TS as Source>::Error, Self::MutationError>>where
TS: TripleSource,
Insert into this graph all triples from the given source. Read more
Source§fn remove_all<TS>(
&mut self,
src: TS,
) -> Result<usize, StreamError<<TS as Source>::Error, Self::MutationError>>where
TS: TripleSource,
fn remove_all<TS>(
&mut self,
src: TS,
) -> Result<usize, StreamError<<TS as Source>::Error, Self::MutationError>>where
TS: TripleSource,
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, G> Copy for DatasetGraph<D, G>
impl<D, G> SetGraph for DatasetGraph<D, G>where
D: SetDataset,
G: Term,
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> UnsafeUnpin for DatasetGraph<D, G>where
D: UnsafeUnpin,
G: UnsafeUnpin,
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
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