Skip to main content

DatasetGraph

Struct DatasetGraph 

Source
pub struct DatasetGraph<D, G>
where 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 MutableDataset::graph_mut. It is not designed to be usable “from scratch”.

Implementations§

Source§

impl<D, G> DatasetGraph<D, G>
where D: Dataset, G: Term,

Source

pub fn new(d: D, g: Option<G>) -> DatasetGraph<D, G>

Wrap the given dataset as a single Graph (selected via the given graph name).

Source

pub fn unwrap(self) -> (D, Option<G>)

Unwrap the inner GraphName and Dataset.

Trait Implementations§

Source§

impl<D, G> Clone for DatasetGraph<D, G>
where D: Clone + Dataset, G: Clone + Term,

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl<D, G> Debug for DatasetGraph<D, G>
where D: Debug + Dataset, G: Debug + Term,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<D, G> Graph for DatasetGraph<D, G>
where D: Dataset, G: Term,

Source§

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§

type Error = <D as Dataset>::Error

The error type that this graph may raise.
Source§

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
where 's: 't, S: TermMatcher + 't, P: TermMatcher + 't, O: TermMatcher + 't,

An iterator visiting all triples matching the given subject, predicate and object. See crate::term::matcher. Read more
Source§

fn contains<TS, TP, TO>(&self, s: TS, p: TP, o: TO) -> Result<bool, Self::Error>
where TS: Term, TP: Term, TO: Term,

Return true if this graph contains the given triple.
Source§

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>> + 's
where M: TermMatcher + 's,

Build a fallible iterator of all the terms used as subject in this Graph and matching the given TermMatcher. Read more
Source§

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>> + 's
where M: TermMatcher + 's,

Build a fallible iterator of all the terms used as predicate in this Graph and matching the given TermMatcher. Read more
Source§

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>> + 's
where M: TermMatcher + 's,

Build a fallible iterator of all the terms used as object in this Graph and matching the given TermMatcher. Read more
Source§

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>>

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>>

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>
where <Self::Triple<'s> as Triple>::Term: Clone,

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>>

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>

Dataset adapter borrowing this graph
Source§

fn as_dataset_mut(&mut self) -> GraphAsDataset<&mut Self>

Dataset adapter borrowing this graph mutably
Source§

fn into_dataset(self) -> GraphAsDataset<Self>
where Self: Sized,

Dataset adapter taking ownership of this graph
Source§

impl<D, G> MutableGraph for DatasetGraph<D, G>
where D: MutableDataset, G: Term,

Source§

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>
where TS: Term, TP: Term, TO: Term,

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>
where TS: Term, TP: Term, TO: Term,

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,

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,

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,

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,

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>
where S: TermMatcher, P: TermMatcher, O: TermMatcher, Self::MutationError: From<Self::Error>,

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>
where S: TermMatcher, P: TermMatcher, O: TermMatcher, Self::MutationError: From<Self::Error>,

Keep only the triples matching the given matchers. Read more
Source§

impl<D, G> Copy for DatasetGraph<D, G>
where D: Copy + Dataset, G: Copy + Term,

Source§

impl<D, G> SetGraph for DatasetGraph<D, G>
where D: SetDataset, G: Term,

Auto Trait Implementations§

§

impl<D, G> Freeze for DatasetGraph<D, G>
where D: Freeze, G: Freeze,

§

impl<D, G> RefUnwindSafe for DatasetGraph<D, G>

§

impl<D, G> Send for DatasetGraph<D, G>
where D: Send, G: Send,

§

impl<D, G> Sync for DatasetGraph<D, G>
where D: Sync, G: Sync,

§

impl<D, G> Unpin for DatasetGraph<D, G>
where D: Unpin, G: Unpin,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> At for T

Source§

fn at<M>(self, metadata: M) -> Meta<T, M>

Wraps self inside a Meta<Self, M> using the given metadata. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> BorrowStripped for T

Source§

fn stripped(&self) -> &Stripped<T>

Source§

impl<T> BorrowUnordered for T

Source§

fn unordered(&self) -> &Unordered<T>

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, C> FromWithContext<T, C> for T

Source§

fn from_with(value: T, _context: &C) -> T

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U, C> IntoWithContext<U, C> for T
where U: FromWithContext<T, C>,

Source§

fn into_with(self, context: &C) -> U

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToOwned for T

Source§

type Owned = T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U, C> TryFromWithContext<U, C> for T
where U: IntoWithContext<T, C>,

Source§

type Error = Infallible

Source§

fn try_from_with( value: U, context: &C, ) -> Result<T, <T as TryFromWithContext<U, C>>::Error>

Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T, U, C> TryIntoWithContext<U, C> for T
where U: TryFromWithContext<T, C>,

Source§

type Error = <U as TryFromWithContext<T, C>>::Error

Source§

fn try_into_with( self, context: &C, ) -> Result<U, <T as TryIntoWithContext<U, C>>::Error>

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithContext for T
where T: ?Sized,

Source§

fn with<C>(&self, context: C) -> Contextual<&T, C>

Source§

fn into_with<C>(self, context: C) -> Contextual<T, C>

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more