sophia_api::dataset::adapter

Struct GraphAsDataset

Source
pub struct GraphAsDataset<T>(/* private fields */);
Expand description

I wrap a Graph as a Dataset containing only that graph as the default graph.

Implementations§

Source§

impl<T> GraphAsDataset<T>
where T: Graph,

Source

pub fn new(graph: T) -> Self

Wrap the given graph with the given name.

Source

pub fn unwrap(self) -> T

Unwrap the inner graph and name.

Trait Implementations§

Source§

impl<T: Clone> Clone for GraphAsDataset<T>

Source§

fn clone(&self) -> GraphAsDataset<T>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> Dataset for GraphAsDataset<T>
where T: Graph,

Source§

type Quad<'x> = ([<<T as Graph>::Triple<'x> as Triple>::Term; 3], Option<<<T as Graph>::Triple<'x> as Triple>::Term>) where Self: 'x

Determine the type of Quads that the methods of this dataset will yield.
Source§

type Error = <T as Graph>::Error

The error type that this dataset may raise.
Source§

fn quads(&self) -> DQuadSource<'_, Self>

An iterator visiting all quads of this dataset in arbitrary order. Read more
Source§

fn quads_matching<'s, S, P, O, G>( &'s self, sm: S, pm: P, om: O, gm: G, ) -> DQuadSource<'s, Self>
where S: TermMatcher + 's, P: TermMatcher + 's, O: TermMatcher + 's, G: GraphNameMatcher + 's,

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

fn contains<TS, TP, TO, TG>( &self, s: TS, p: TP, o: TO, g: GraphName<TG>, ) -> DResult<Self, bool>
where TS: Term, TP: Term, TO: Term, TG: Term,

Return true if this dataset contains the given quad.
Source§

fn subjects(&self) -> DTermSource<'_, Self>

Build a fallible iterator of all the terms used as subject in this Dataset. Read more
Source§

fn predicates(&self) -> DTermSource<'_, Self>

Build a fallible iterator of all the terms used as predicate in this Dataset. Read more
Source§

fn objects(&self) -> DTermSource<'_, Self>

Build a fallible iterator of all the terms used as object in this Dataset. Read more
Source§

fn graph_names(&self) -> DTermSource<'_, Self>

Build a fallible iterator of all the terms used as graph name in this Dataset. Read more
Source§

fn iris(&self) -> DTermSource<'_, Self>

Build a fallible iterator of all the IRIs used in this Dataset (including those used inside quoted quads, if any). Read more
Source§

fn blank_nodes(&self) -> DTermSource<'_, Self>

Build a fallible iterator of all the blank nodes used in this Dataset (including those used inside quoted quads, if any). Read more
Source§

fn literals(&self) -> DTermSource<'_, Self>

Build a fallible iterator of all the literals used in this Dataset (including those used inside quoted quads, if any). Read more
Source§

fn quoted_triples<'s>(&'s self) -> DTermSource<'s, Self>
where GTerm<'s, T>: Clone,

Build a fallible iterator of all the quoted triples used in this Dataset (including those used inside quoted triples, if any). Read more
Source§

fn variables(&self) -> DTermSource<'_, Self>

Build a fallible iterator of all the variables used in this Dataset (including those used inside quoted quads, if any). Read more
Source§

fn graph<T>(&self, graph_name: GraphName<T>) -> DatasetGraph<&Self, T>
where T: for<'x> Term<BorrowTerm<'x> = DTerm<'x, Self>> + 'static,

Borrows one of the graphs of this dataset
Source§

fn graph_mut<T>( &mut self, graph_name: GraphName<T>, ) -> DatasetGraph<&mut Self, T>
where T: for<'x> Term<BorrowTerm<'x> = DTerm<'x, Self>> + 'static,

Borrows mutably one of the graphs of this dataset
Source§

fn partial_union_graph<M>(&self, selector: M) -> PartialUnionGraph<&Self, M>

Borrows a graph that is the union of some of this dataset’s graphs
Source§

fn union_graph(&self) -> UnionGraph<&Self>

Borrows a graph that is the union of all this dataset’s graphs (default and named)
Source§

fn into_union_graph(self) -> UnionGraph<Self>
where Self: Sized,

Convert into a graph that is the union of all this dataset’s graphs (default and named)
Source§

impl<T: Debug> Debug for GraphAsDataset<T>

Source§

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

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

impl<T> MutableDataset for GraphAsDataset<T>
where T: MutableGraph,

Source§

type MutationError = GraphAsDatasetMutationError<<T as MutableGraph>::MutationError>

The error type that this dataset may raise during mutations.
Source§

fn insert<TS, TP, TO, TG>( &mut self, s: TS, p: TP, o: TO, g: GraphName<TG>, ) -> MdResult<Self, bool>
where TS: Term, TP: Term, TO: Term, TG: Term,

Insert the given quad in this dataset. Read more
Source§

fn remove<TS, TP, TO, TG>( &mut self, s: TS, p: TP, o: TO, g: GraphName<TG>, ) -> MdResult<Self, bool>
where TS: Term, TP: Term, TO: Term, TG: Term,

Remove the given quad from this dataset. Read more
Source§

fn insert_quad<T>(&mut self, quad: T) -> MdResult<Self, bool>
where T: Quad,

Insert in this graph the given quad. Read more
Source§

fn remove_quad<T>(&mut self, quad: T) -> MdResult<Self, bool>
where T: Quad,

Remove from this graph a the given quad. Read more
Source§

fn insert_all<TS: QuadSource>( &mut self, src: TS, ) -> StreamResult<usize, TS::Error, <Self as MutableDataset>::MutationError>

Insert into this dataset all quads from the given source. Read more
Source§

fn remove_all<TS: QuadSource>( &mut self, src: TS, ) -> StreamResult<usize, TS::Error, <Self as MutableDataset>::MutationError>

Remove from this dataset all quads from the given source. Read more
Source§

fn remove_matching<S, P, O, G>( &mut self, ms: S, mp: P, mo: O, mg: G, ) -> Result<usize, Self::MutationError>

Remove all quads matching the given matchers. Read more
Source§

fn retain_matching<S, P, O, G>( &mut self, ms: S, mp: P, mo: O, mg: G, ) -> Result<(), Self::MutationError>

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

impl<T: Copy> Copy for GraphAsDataset<T>

Auto Trait Implementations§

§

impl<T> Freeze for GraphAsDataset<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for GraphAsDataset<T>
where T: RefUnwindSafe,

§

impl<T> Send for GraphAsDataset<T>
where T: Send,

§

impl<T> Sync for GraphAsDataset<T>
where T: Sync,

§

impl<T> Unpin for GraphAsDataset<T>
where T: Unpin,

§

impl<T> UnwindSafe for GraphAsDataset<T>
where T: 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> 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> CloneToUninit for T
where T: Clone,

Source§

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

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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