Struct HashDataset

Source
pub struct HashDataset<S = Term, P = S, O = S, G = S> { /* private fields */ }

Implementations§

Source§

impl<S, P, O, G> HashDataset<S, P, O, G>

Source

pub fn new() -> Self

Source

pub fn is_empty(&self) -> bool

Returns the number of quads in the dataset.

Source

pub fn len(&self) -> usize

Returns the number of quads in the dataset.

Source

pub fn graph<W: ?Sized + Equivalent<G> + Hash>( &self, id: Option<&W>, ) -> Option<&HashGraph<S, P, O>>
where G: Eq + Hash,

Source

pub fn graph_entry<W: ?Sized + Equivalent<G> + Hash>( &self, id: Option<&W>, ) -> Option<(Option<&G>, &HashGraph<S, P, O>)>
where G: Eq + Hash,

Source

pub fn graphs(&self) -> Graphs<'_, S, P, O, G>

Source

pub fn quads(&self) -> Quads<'_, S, P, O, G>

Source

pub fn graph_mut<W: ?Sized + Equivalent<G> + Hash>( &mut self, id: Option<&W>, ) -> Option<&mut HashGraph<S, P, O>>
where G: Eq + Hash,

Source

pub fn graphs_mut(&mut self) -> GraphsMut<'_, S, P, O, G>

Source

pub fn insert_graph( &mut self, id: G, graph: HashGraph<S, P, O>, ) -> Option<HashGraph<S, P, O>>
where G: Eq + Hash,

Source

pub fn into_graph(self, id: Option<&G>) -> Option<HashGraph<S, P, O>>
where G: Eq + Hash,

Source

pub fn into_graphs(self) -> IntoGraphs<S, P, O, G>

Source

pub fn into_quads(self) -> IntoQuads<S, P, O, G>

Source§

impl<S: Eq + Hash, P: Eq + Hash, O: Eq + Hash, G: Eq + Hash> HashDataset<S, P, O, G>

Source

pub fn insert(&mut self, quad: Quad<S, P, O, G>) -> bool

Source

pub fn remove<T: ?Sized + Equivalent<S> + Hash, U: ?Sized + Equivalent<P> + Hash, V: ?Sized + Equivalent<O> + Hash, W: ?Sized + Equivalent<G> + Hash>( &mut self, Quad: Quad<&T, &U, &V, &W>, )

Source

pub fn remove_graph<W: ?Sized + Equivalent<G> + Hash>( &mut self, g: &W, ) -> Option<HashGraph<S, P, O>>

Source

pub fn take<T: ?Sized + Equivalent<S> + Hash, U: ?Sized + Equivalent<P> + Hash, V: ?Sized + Equivalent<O> + Hash, W: ?Sized + Equivalent<G> + Hash>( &mut self, Quad: Quad<&T, &U, &V, &W>, ) -> Option<Quad<S, P, O, G>>
where S: Clone, P: Clone, G: Clone,

Source

pub fn take_match<T: ?Sized + Equivalent<S> + Hash, U: ?Sized + Equivalent<P> + Hash, V: ?Sized + Equivalent<O> + Hash, W: ?Sized + Equivalent<G> + Hash>( &mut self, Quad: Quad<Option<&T>, Option<&U>, Option<&V>, Option<&W>>, ) -> Option<Quad<S, P, O, G>>
where S: Clone, P: Clone, O: Clone, G: Clone,

Source

pub fn absorb<D: SizedDataset<Subject = S, Predicate = P, Object = O, GraphLabel = G>>( &mut self, other: D, )
where D::Graph: SizedGraph,

Source

pub fn substitute_blank_ids<B>(self, f: impl Fn(B) -> B) -> Self
where S: Clone + MaybeBlankId<BlankId = B> + IntoBlankId + FromBlankId, P: Clone + MaybeBlankId<BlankId = B> + IntoBlankId + FromBlankId, O: MaybeBlankId<BlankId = B> + IntoBlankId + FromBlankId, G: Clone + MaybeBlankId<BlankId = B> + IntoBlankId + FromBlankId,

Substitutes the blank node identifiers in the dataset.

Source

pub fn view<'a, A>( &'a self, graph_label: Option<&'a G>, subject: &'a S, access: A, ) -> View<'a, Self, A>

Source§

impl<S: Eq + Hash, P: Eq + Hash, O: Eq + Hash, G: Eq + Hash> HashDataset<S, P, O, G>

Source

pub fn is_isomorphic_to<I, B, L>(&self, other: &Self) -> bool
where S: AsRdfTerm<I, B, L>, P: AsRdfTerm<I, B, L>, O: AsRdfTerm<I, B, L>, G: AsRdfTerm<I, B, L>, I: PartialEq, L: PartialEq, B: Eq + Hash,

Checks that there is an isomorphism between this dataset and other.

There is an isomorphism if there exists a blank node identifier bijection between self and other. This is equivalent to self.find_blank_id_bijection(other).is_some().

Source

pub fn find_blank_id_bijection<'u, 'v, I, B, L>( &'u self, other: &'v Self, ) -> Option<HashBijection<'u, 'v, B, B>>
where S: AsRdfTerm<I, B, L>, P: AsRdfTerm<I, B, L>, O: AsRdfTerm<I, B, L>, G: AsRdfTerm<I, B, L>, I: PartialEq + 'u + 'v, L: PartialEq + 'u + 'v, B: Eq + Hash,

Finds a blank node identifier bijection between from self to other. If such bijection exists, there is an isomorphism between self and other.

Source§

impl<S: Eq + Hash, P: Eq + Hash, O: Eq + Hash, G: Eq + Hash> HashDataset<S, P, O, G>

Source

pub fn default_graph(&self) -> &<Self as Dataset>::Graph

Get the default graph of the dataset.

This is the same as graph(None).

Source

pub fn subjects<'a>( &'a self, id: Option<&<Self as Dataset>::GraphLabel>, ) -> Option<<<Self as Dataset>::Graph as Graph>::Subjects<'a>>
where <Self as Dataset>::Graph: 'a, <Self as Dataset>::Subject: 'a, <Self as Dataset>::Predicate: 'a, <Self as Dataset>::Object: 'a,

Iterate through all the subjects of the given graph.

Source

pub fn predicates<'a>( &'a self, id: Option<&<Self as Dataset>::GraphLabel>, subject: &<Self as Dataset>::Subject, ) -> Option<<<Self as Dataset>::Graph as Graph>::Predicates<'a>>
where <Self as Dataset>::Graph: 'a, <Self as Dataset>::Predicate: 'a, <Self as Dataset>::Object: 'a,

Iterate through all the predicates of the given subject of the given graph.

Source

pub fn objects<'a>( &'a self, id: Option<&<Self as Dataset>::GraphLabel>, subject: &<Self as Dataset>::Subject, predicate: &<Self as Dataset>::Predicate, ) -> Option<<<Self as Dataset>::Graph as Graph>::Objects<'a>>
where <Self as Dataset>::Graph: 'a, <Self as Dataset>::Object: 'a,

Iterate through all the objects of the given subject and predicate of the given graph.

Source§

impl<S: Clone + Eq + Hash, P: Clone + Eq + Hash, O: Eq + Hash, G: Clone + Eq + Hash> HashDataset<S, P, O, G>

Source

pub fn into_default_graph(self) -> <Self as Dataset>::Graph

Consumes the dataset and returns the default graph.

Source

pub fn into_subjects( self, id: Option<&<Self as Dataset>::GraphLabel>, ) -> Option<<<Self as Dataset>::Graph as SizedGraph>::IntoSubjects>

Consumes the dataset and returns an iterator over the subjects of the given graph.

Source

pub fn into_predicates( self, id: Option<&<Self as Dataset>::GraphLabel>, subject: &<Self as Dataset>::Subject, ) -> Option<<<Self as Dataset>::Graph as SizedGraph>::IntoPredicates>

Consumes the dataset and returns an iterator over the predicates of the given subject of the given graph.

Source

pub fn into_objects( self, id: Option<&<Self as Dataset>::GraphLabel>, subject: &<Self as Dataset>::Subject, predicate: &<Self as Dataset>::Predicate, ) -> Option<<<Self as Dataset>::Graph as SizedGraph>::IntoObjects>

Consumes the dataset and returns an iterator over the objects of the given subject and predicate of the given graph.

Source§

impl<S: Eq + Hash, P: Eq + Hash, O: Eq + Hash, G: Eq + Hash> HashDataset<S, P, O, G>

Source

pub fn default_graph_mut(&mut self) -> &mut <Self as Dataset>::Graph

Get the default graph mutably.

Note to implementors: the default graph should always exists.

Trait Implementations§

Source§

impl<S: Clone, P: Clone, O: Clone, G: Clone> Clone for HashDataset<S, P, O, G>

Source§

fn clone(&self) -> HashDataset<S, P, O, G>

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<S: Eq + Hash, P: Eq + Hash, O: Eq + Hash, G: Eq + Hash> Dataset for HashDataset<S, P, O, G>

Source§

type Subject = S

Source§

type Predicate = P

Source§

type Object = O

Source§

type GraphLabel = G

Source§

type Graph = HashGraph<S, P, O>

Type of graphs in the dataset.
Source§

type Graphs<'a> = Graphs<'a, S, P, O, G> where Self: 'a, S: 'a, P: 'a, O: 'a, G: 'a

Graph iterator. Read more
Source§

type Quads<'a> = Quads<'a, S, P, O, G> where Self: 'a, S: 'a, P: 'a, O: 'a

Quads iterator.
Source§

type PatternMatching<'a, 'p> = PatternMatching<'a, 'p, S, P, O, G> where Self: 'a, S: 'p, P: 'p, O: 'p, G: 'p

Source§

fn graph(&self, id: Option<&G>) -> Option<&HashGraph<S, P, O>>

Get the graph with the given name. Input None to get the default graph.
Source§

fn graphs(&self) -> Graphs<'_, S, P, O, G>

Returns an iterator over the graphs of the dataset.
Source§

fn quads(&self) -> Quads<'_, S, P, O, G>

Returns an iterator over the quads of the dataset.
Source§

fn pattern_matching<'p>( &self, Quad: Quad<Option<&'p Self::Subject>, Option<&'p Self::Predicate>, Option<&'p Self::Object>, Option<&'p Self::GraphLabel>>, ) -> Self::PatternMatching<'_, 'p>

Source§

fn default_graph(&self) -> &Self::Graph

Get the default graph of the dataset. Read more
Source§

fn len(&self) -> usize

Returns the number of quads in the dataset.
Source§

fn is_empty(&self) -> bool

Checks is the dataset is empty.
Source§

fn subjects<'a>( &'a self, id: Option<&Self::GraphLabel>, ) -> Option<<Self::Graph as Graph>::Subjects<'a>>
where Self::Graph: 'a, Self::Subject: 'a, Self::Predicate: 'a, Self::Object: 'a,

Iterate through all the subjects of the given graph.
Source§

fn view<'a, A>( &'a self, graph_label: Option<&'a Self::GraphLabel>, subject: &'a Self::Subject, access: A, ) -> View<'_, Self, A>

Creates a view for the dataset, using the given subject from the given graph.
Source§

fn predicates<'a>( &'a self, id: Option<&Self::GraphLabel>, subject: &Self::Subject, ) -> Option<<Self::Graph as Graph>::Predicates<'a>>
where Self::Graph: 'a, Self::Predicate: 'a, Self::Object: 'a,

Iterate through all the predicates of the given subject of the given graph.
Source§

fn objects<'a>( &'a self, id: Option<&Self::GraphLabel>, subject: &Self::Subject, predicate: &Self::Predicate, ) -> Option<<Self::Graph as Graph>::Objects<'a>>
where Self::Graph: 'a, Self::Object: 'a,

Iterate through all the objects of the given subject and predicate of the given graph.
Source§

fn contains( &self, Quad: Quad<&Self::Subject, &Self::Predicate, &Self::Object, &Self::GraphLabel>, ) -> bool

Checks if the given quad is defined in the dataset.
Source§

fn any_match( &self, pattern: Quad<Option<&Self::Subject>, Option<&Self::Predicate>, Option<&Self::Object>, Option<&Self::GraphLabel>>, ) -> Option<Quad<&Self::Subject, &Self::Predicate, &Self::Object, &Self::GraphLabel>>

Source§

fn first_match( &self, pattern: Quad<Option<&Self::Subject>, Option<&Self::Predicate>, Option<&Self::Object>, Option<&Self::GraphLabel>>, ) -> Option<Quad<&Self::Subject, &Self::Predicate, &Self::Object, &Self::GraphLabel>>

👎Deprecated: use any_match instead
Source§

impl<S: Debug, P: Debug, O: Debug, G: Debug> Debug for HashDataset<S, P, O, G>

Source§

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

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

impl<S, P, O, G> Default for HashDataset<S, P, O, G>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<S: Eq + Hash, P: Eq + Hash, O: Eq + Hash, G: Eq + Hash> Extend<Quad<S, P, O, G>> for HashDataset<S, P, O, G>

Source§

fn extend<I: IntoIterator<Item = Quad<S, P, O, G>>>(&mut self, iter: I)

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl<S: Eq + Hash, P: Eq + Hash, O: Eq + Hash, G: Eq + Hash> FromIterator<Quad<S, P, O, G>> for HashDataset<S, P, O, G>

Source§

fn from_iter<I: IntoIterator<Item = Quad<S, P, O, G>>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl<'a, S, P, O, G> IntoIterator for &'a HashDataset<S, P, O, G>

Source§

type Item = Quad<&'a S, &'a P, &'a O, &'a G>

The type of the elements being iterated over.
Source§

type IntoIter = Quads<'a, S, P, O, G>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<S: Clone, P: Clone, O, G: Clone> IntoIterator for HashDataset<S, P, O, G>

Source§

type Item = Quad<S, P, O, G>

The type of the elements being iterated over.
Source§

type IntoIter = IntoQuads<S, P, O, G>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<S: Eq + Hash, P: Eq + Hash, O: Eq + Hash, G: Eq + Hash> MutableDataset for HashDataset<S, P, O, G>

Source§

type GraphsMut<'a> = GraphsMut<'a, S, P, O, G> where Self: 'a, S: 'a, P: 'a, O: 'a, G: 'a

Iterator over mutable graphs.
Source§

fn graph_mut(&mut self, id: Option<&G>) -> Option<&mut Self::Graph>

Get the given graph mutably. Read more
Source§

fn graphs_mut(&mut self) -> Self::GraphsMut<'_>

Returns an iterator over the (mutable) graphs of the dataset.
Source§

fn insert_graph(&mut self, id: G, graph: Self::Graph) -> Option<Self::Graph>

Insert a graph in the dataset with the given name. Read more
Source§

fn insert(&mut self, quad: Quad<S, P, O, G>) -> bool

Insert a quad in the dataset.
Source§

fn remove(&mut self, quad: Quad<&S, &P, &O, &G>)

Remove a quad from the dataset.
Source§

fn absorb<D: SizedDataset<Subject = S, Predicate = P, Object = O, GraphLabel = G>>( &mut self, other: D, )
where D::Graph: SizedGraph,

Absorb the given other dataset. Read more
Source§

fn default_graph_mut(&mut self) -> &mut Self::Graph

Get the default graph mutably. Read more
Source§

impl<S, P, O, G> PartialEq for HashDataset<S, P, O, G>
where S: Eq + Hash, P: Eq + Hash, O: Eq + Hash, G: Eq + Hash,

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<S: Clone + Eq + Hash, P: Clone + Eq + Hash, O: Eq + Hash, G: Clone + Eq + Hash> SizedDataset for HashDataset<S, P, O, G>

Source§

type IntoGraphs = IntoGraphs<S, P, O, G>

Consuming graphs iterator.
Source§

type IntoQuads = IntoQuads<S, P, O, G>

Consuming quads iterator.
Source§

fn into_graph(self, id: Option<&G>) -> Option<Self::Graph>

Consumes the dataset and returns the given graph.
Source§

fn into_graphs(self) -> Self::IntoGraphs

Consumes the dataset and returns an iterator over its graphs.
Source§

fn into_quads(self) -> Self::IntoQuads

Consumes the dataset and returns an iterator over its quads.
Source§

fn into_default_graph(self) -> Self::Graph

Consumes the dataset and returns the default graph.
Source§

fn into_subjects( self, id: Option<&Self::GraphLabel>, ) -> Option<<Self::Graph as SizedGraph>::IntoSubjects>

Consumes the dataset and returns an iterator over the subjects of the given graph.
Source§

fn into_predicates( self, id: Option<&Self::GraphLabel>, subject: &Self::Subject, ) -> Option<<Self::Graph as SizedGraph>::IntoPredicates>

Consumes the dataset and returns an iterator over the predicates of the given subject of the given graph.
Source§

fn into_objects( self, id: Option<&Self::GraphLabel>, subject: &Self::Subject, predicate: &Self::Predicate, ) -> Option<<Self::Graph as SizedGraph>::IntoObjects>

Consumes the dataset and returns an iterator over the objects of the given subject and predicate of the given graph.
Source§

impl<S, P, O, G> Eq for HashDataset<S, P, O, G>
where S: Eq + Hash, P: Eq + Hash, O: Eq + Hash, G: Eq + Hash,

Auto Trait Implementations§

§

impl<S, P, O, G> Freeze for HashDataset<S, P, O, G>

§

impl<S, P, O, G> RefUnwindSafe for HashDataset<S, P, O, G>

§

impl<S, P, O, G> Send for HashDataset<S, P, O, G>
where G: Send, S: Send, P: Send, O: Send,

§

impl<S, P, O, G> Sync for HashDataset<S, P, O, G>
where G: Sync, S: Sync, P: Sync, O: Sync,

§

impl<S, P, O, G> Unpin for HashDataset<S, P, O, G>
where G: Unpin, S: Unpin, P: Unpin, O: Unpin,

§

impl<S, P, O, G> UnwindSafe for HashDataset<S, P, O, G>

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, dest: *mut u8)

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

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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.