[−][src]Struct sophia::dataset::inmem::HashDataset
A generic implementation of Dataset
and MutableDataset
,
storing its terms in a TermIndexMap
,
and its triples in a HashSet
.
Methods
impl<I> HashDataset<I> where
I: TermIndexMap,
I::Index: Hash,
[src]
I: TermIndexMap,
I::Index: Hash,
pub fn new() -> HashDataset<I>
[src]
pub fn len(&self) -> usize
[src]
pub fn is_empty(&self) -> bool
[src]
Trait Implementations
impl<I> IndexedDataset for HashDataset<I> where
I: TermIndexMap,
I::Index: Hash,
<I::Factory as TermFactory>::TermData: 'static,
[src]
I: TermIndexMap,
I::Index: Hash,
<I::Factory as TermFactory>::TermData: 'static,
type Index = I::Index
The type used to represent terms internally.
type TermData = <I::Factory as TermFactory>::TermData
fn get_index<T>(&self, t: &Term<T>) -> Option<Self::Index> where
T: TermData,
[src]
T: TermData,
fn get_index_for_graph_name<T>(
&self,
g: Option<&Term<T>>
) -> Option<Self::Index> where
T: TermData,
[src]
&self,
g: Option<&Term<T>>
) -> Option<Self::Index> where
T: TermData,
fn get_term(&self, i: Self::Index) -> Option<&Term<Self::TermData>>
[src]
fn get_graph_name(
&self,
i: Self::Index
) -> Option<Option<&Term<Self::TermData>>>
[src]
&self,
i: Self::Index
) -> Option<Option<&Term<Self::TermData>>>
fn insert_indexed<T, U, V, W>(
&mut self,
s: &Term<T>,
p: &Term<U>,
o: &Term<V>,
g: Option<&Term<W>>
) -> Option<[I::Index; 4]> where
T: TermData,
U: TermData,
V: TermData,
W: TermData,
[src]
&mut self,
s: &Term<T>,
p: &Term<U>,
o: &Term<V>,
g: Option<&Term<W>>
) -> Option<[I::Index; 4]> where
T: TermData,
U: TermData,
V: TermData,
W: TermData,
fn remove_indexed<T, U, V, W>(
&mut self,
s: &Term<T>,
p: &Term<U>,
o: &Term<V>,
g: Option<&Term<W>>
) -> Option<[I::Index; 4]> where
T: TermData,
U: TermData,
V: TermData,
W: TermData,
[src]
&mut self,
s: &Term<T>,
p: &Term<U>,
o: &Term<V>,
g: Option<&Term<W>>
) -> Option<[I::Index; 4]> where
T: TermData,
U: TermData,
V: TermData,
W: TermData,
fn shrink_to_fit(&mut self)
[src]
impl<'a, I> Dataset<'a> for HashDataset<I> where
I: TermIndexMap,
I::Index: Hash,
<I::Factory as TermFactory>::TermData: 'static,
[src]
I: TermIndexMap,
I::Index: Hash,
<I::Factory as TermFactory>::TermData: 'static,
type Quad = ([&'a Term<Self::TermData>; 3], Option<&'a Term<Self::TermData>>)
The type of Quad
s that the methods of this dataset will yield. Read more
type Error = Never
The error type that this dataset may raise. Read more
fn quads(&'a self) -> DQuadSource<'a, Self>
[src]
fn quads_with_s<T>(&'a self, s: &'a Term<T>) -> DQuadSource<'a, Self> where
T: TermData,
[src]
T: TermData,
An iterator visiting all quads with the given subject. Read more
fn quads_with_p<T>(&'a self, p: &'a Term<T>) -> DQuadSource<'a, Self> where
T: TermData,
[src]
T: TermData,
An iterator visiting all quads with the given predicate. Read more
fn quads_with_o<T>(&'a self, o: &'a Term<T>) -> DQuadSource<'a, Self> where
T: TermData,
[src]
T: TermData,
An iterator visiting add quads with the given object. Read more
fn quads_with_g<T>(&'a self, g: Option<&'a Term<T>>) -> DQuadSource<'a, Self> where
T: TermData,
[src]
T: TermData,
An iterator visiting add quads with the given graph name. Read more
fn quads_with_sp<T, U>(
&'a self,
s: &'a Term<T>,
p: &'a Term<U>
) -> DQuadSource<'a, Self> where
T: TermData,
U: TermData,
[src]
&'a self,
s: &'a Term<T>,
p: &'a Term<U>
) -> DQuadSource<'a, Self> where
T: TermData,
U: TermData,
An iterator visiting add quads with the given subject and predicate. Read more
fn quads_with_so<T, U>(
&'a self,
s: &'a Term<T>,
o: &'a Term<U>
) -> DQuadSource<'a, Self> where
T: TermData,
U: TermData,
[src]
&'a self,
s: &'a Term<T>,
o: &'a Term<U>
) -> DQuadSource<'a, Self> where
T: TermData,
U: TermData,
An iterator visiting add quads with the given subject and object. Read more
fn quads_with_sg<T, U>(
&'a self,
s: &'a Term<T>,
g: Option<&'a Term<U>>
) -> DQuadSource<'a, Self> where
T: TermData,
U: TermData,
[src]
&'a self,
s: &'a Term<T>,
g: Option<&'a Term<U>>
) -> DQuadSource<'a, Self> where
T: TermData,
U: TermData,
An iterator visiting add quads with the given subject and graph name. Read more
fn quads_with_po<T, U>(
&'a self,
p: &'a Term<T>,
o: &'a Term<U>
) -> DQuadSource<'a, Self> where
T: TermData,
U: TermData,
[src]
&'a self,
p: &'a Term<T>,
o: &'a Term<U>
) -> DQuadSource<'a, Self> where
T: TermData,
U: TermData,
An iterator visiting add quads with the given predicate and object. Read more
fn quads_with_pg<T, U>(
&'a self,
p: &'a Term<T>,
g: Option<&'a Term<U>>
) -> DQuadSource<'a, Self> where
T: TermData,
U: TermData,
[src]
&'a self,
p: &'a Term<T>,
g: Option<&'a Term<U>>
) -> DQuadSource<'a, Self> where
T: TermData,
U: TermData,
An iterator visiting add quads with the given predicate and graph name. Read more
fn quads_with_og<T, U>(
&'a self,
o: &'a Term<T>,
g: Option<&'a Term<U>>
) -> DQuadSource<'a, Self> where
T: TermData,
U: TermData,
[src]
&'a self,
o: &'a Term<T>,
g: Option<&'a Term<U>>
) -> DQuadSource<'a, Self> where
T: TermData,
U: TermData,
An iterator visiting add quads with the given object and graph name. Read more
fn quads_with_spo<T, U, V>(
&'a self,
s: &'a Term<T>,
p: &'a Term<U>,
o: &'a Term<V>
) -> DQuadSource<'a, Self> where
T: TermData,
U: TermData,
V: TermData,
[src]
&'a self,
s: &'a Term<T>,
p: &'a Term<U>,
o: &'a Term<V>
) -> DQuadSource<'a, Self> where
T: TermData,
U: TermData,
V: TermData,
An iterator visiting add quads with the given subject, predicate and object. Read more
fn quads_with_spg<T, U, V>(
&'a self,
s: &'a Term<T>,
p: &'a Term<U>,
g: Option<&'a Term<V>>
) -> DQuadSource<'a, Self> where
T: TermData,
U: TermData,
V: TermData,
[src]
&'a self,
s: &'a Term<T>,
p: &'a Term<U>,
g: Option<&'a Term<V>>
) -> DQuadSource<'a, Self> where
T: TermData,
U: TermData,
V: TermData,
An iterator visiting add quads with the given subject, predicate and graph name. Read more
fn quads_with_sog<T, U, V>(
&'a self,
s: &'a Term<T>,
o: &'a Term<U>,
g: Option<&'a Term<V>>
) -> DQuadSource<'a, Self> where
T: TermData,
U: TermData,
V: TermData,
[src]
&'a self,
s: &'a Term<T>,
o: &'a Term<U>,
g: Option<&'a Term<V>>
) -> DQuadSource<'a, Self> where
T: TermData,
U: TermData,
V: TermData,
An iterator visiting add quads with the given subject, object and graph name. Read more
fn quads_with_pog<T, U, V>(
&'a self,
p: &'a Term<T>,
o: &'a Term<U>,
g: Option<&'a Term<V>>
) -> DQuadSource<'a, Self> where
T: TermData,
U: TermData,
V: TermData,
[src]
&'a self,
p: &'a Term<T>,
o: &'a Term<U>,
g: Option<&'a Term<V>>
) -> DQuadSource<'a, Self> where
T: TermData,
U: TermData,
V: TermData,
An iterator visiting add quads with the given predicate, object and graph name. Read more
fn quads_with_spog<T, U, V, W>(
&'a self,
s: &'a Term<T>,
p: &'a Term<U>,
o: &'a Term<V>,
g: Option<&'a Term<W>>
) -> DQuadSource<'a, Self> where
T: TermData,
U: TermData,
V: TermData,
W: TermData,
[src]
&'a self,
s: &'a Term<T>,
p: &'a Term<U>,
o: &'a Term<V>,
g: Option<&'a Term<W>>
) -> DQuadSource<'a, Self> where
T: TermData,
U: TermData,
V: TermData,
W: TermData,
An iterator visiting add quads with the given subject, predicate, object and graph name. Read more
fn contains<T, U, V, W>(
&'a self,
s: &'a Term<T>,
p: &'a Term<U>,
o: &'a Term<V>,
g: Option<&'a Term<W>>
) -> DResult<'a, Self, bool> where
T: TermData,
U: TermData,
V: TermData,
W: TermData,
[src]
&'a self,
s: &'a Term<T>,
p: &'a Term<U>,
o: &'a Term<V>,
g: Option<&'a Term<W>>
) -> DResult<'a, Self, bool> where
T: TermData,
U: TermData,
V: TermData,
W: TermData,
Return true
if this dataset contains the given quad.
fn quads_matching<S: ?Sized, P: ?Sized, O: ?Sized, G: ?Sized>(
&'a self,
ms: &'a S,
mp: &'a P,
mo: &'a O,
mg: &'a G
) -> DQuadSource<'a, Self> where
S: TermMatcher,
P: TermMatcher,
O: TermMatcher,
G: GraphNameMatcher,
[src]
&'a self,
ms: &'a S,
mp: &'a P,
mo: &'a O,
mg: &'a G
) -> DQuadSource<'a, Self> where
S: TermMatcher,
P: TermMatcher,
O: TermMatcher,
G: GraphNameMatcher,
An iterator visiting add quads matching the given subject, predicate, object and graph name. Read more
fn subjects(&'a self) -> DResultTermSet<'a, Self>
[src]
Build a Hashset of all the terms used as subject in this Dataset.
fn predicates(&'a self) -> DResultTermSet<'a, Self>
[src]
Build a Hashset of all the terms used as predicate in this Dataset.
fn objects(&'a self) -> DResultTermSet<'a, Self>
[src]
Build a Hashset of all the terms used as object in this Dataset.
fn graph_names(&'a self) -> DResultTermSet<'a, Self>
[src]
Build a Hashset of all the terms used as graph names in this Dataset.
fn iris(&'a self) -> DResultTermSet<'a, Self>
[src]
Build a Hashset of all the IRIs used in this Dataset.
fn bnodes(&'a self) -> DResultTermSet<'a, Self>
[src]
Build a Hashset of all the BNodes used in this Dataset.
fn literals(&'a self) -> DResultTermSet<'a, Self>
[src]
Build a Hashset of all the Literals used in this Dataset.
fn variables(&'a self) -> DResultTermSet<'a, Self>
[src]
Build a Hashset of all the variables used in this Dataset.
fn graph<T>(
&self,
graph_name: Option<&Term<T>>
) -> DatasetGraph<Self, &Self, Option<BoxTerm>> where
T: TermData,
[src]
&self,
graph_name: Option<&Term<T>>
) -> DatasetGraph<Self, &Self, Option<BoxTerm>> where
T: TermData,
Borrows one of the graphs of this dataset
fn graph_mut<T>(
&mut self,
graph_name: Option<&Term<T>>
) -> DatasetGraph<Self, &mut Self, Option<BoxTerm>> where
T: TermData,
[src]
&mut self,
graph_name: Option<&Term<T>>
) -> DatasetGraph<Self, &mut Self, Option<BoxTerm>> where
T: TermData,
Borrows mutably one of the graphs of this dataset
fn union_graph<T>(&'a self, gmatcher: T) -> DatasetGraph<Self, &Self, T> where
T: GraphNameMatcher,
[src]
T: GraphNameMatcher,
Borrows a graph containing the union of all graphs matched by gmatcher
impl<I> MutableDataset for HashDataset<I> where
I: TermIndexMap,
I::Index: Hash,
<I::Factory as TermFactory>::TermData: 'static,
[src]
I: TermIndexMap,
I::Index: Hash,
<I::Factory as TermFactory>::TermData: 'static,
type MutationError = Never
The error type that this dataset may raise during mutations. Read more
fn insert<T_, U_, V_, W_>(
&mut self,
s: &Term<T_>,
p: &Term<U_>,
o: &Term<V_>,
g: Option<&Term<W_>>
) -> MDResult<Self, bool> where
T_: TermData,
U_: TermData,
V_: TermData,
W_: TermData,
[src]
&mut self,
s: &Term<T_>,
p: &Term<U_>,
o: &Term<V_>,
g: Option<&Term<W_>>
) -> MDResult<Self, bool> where
T_: TermData,
U_: TermData,
V_: TermData,
W_: TermData,
fn remove<T_, U_, V_, W_>(
&mut self,
s: &Term<T_>,
p: &Term<U_>,
o: &Term<V_>,
g: Option<&Term<W_>>
) -> MDResult<Self, bool> where
T_: TermData,
U_: TermData,
V_: TermData,
W_: TermData,
[src]
&mut self,
s: &Term<T_>,
p: &Term<U_>,
o: &Term<V_>,
g: Option<&Term<W_>>
) -> MDResult<Self, bool> where
T_: TermData,
U_: TermData,
V_: TermData,
W_: TermData,
fn inserter(&mut self) -> Inserter<Self>
[src]
Return a QuadSink
that will insert into this dataset all the quads it receives. Read more
fn insert_all<'a, TS>(
&mut self,
src: &mut TS
) -> CoercedResult<usize, TS::Error, Self::MutationError> where
TS: QuadSource<'a>,
TS::Error: CoercibleWith<Self::MutationError>,
[src]
&mut self,
src: &mut TS
) -> CoercedResult<usize, TS::Error, Self::MutationError> where
TS: QuadSource<'a>,
TS::Error: CoercibleWith<Self::MutationError>,
Insert into this dataset all quads from the given source.
fn remover(&mut self) -> Remover<Self>
[src]
Return a QuadSink
that will remove from this dataset all the quads it receives. Read more
fn remove_all<'a, TS>(
&mut self,
src: &mut TS
) -> CoercedResult<usize, TS::Error, Self::MutationError> where
TS: QuadSource<'a>,
TS::Error: CoercibleWith<Self::MutationError>,
[src]
&mut self,
src: &mut TS
) -> CoercedResult<usize, TS::Error, Self::MutationError> where
TS: QuadSource<'a>,
TS::Error: CoercibleWith<Self::MutationError>,
Remove from this dataset all quads from the given source.
fn remove_matching<S: ?Sized, P: ?Sized, O: ?Sized, G: ?Sized>(
&mut self,
ms: &S,
mp: &P,
mo: &O,
mg: &G
) -> MDResult<Self, usize> where
S: TermMatcher,
P: TermMatcher,
O: TermMatcher,
G: GraphNameMatcher,
Self::Error: Into<Self::MutationError>,
Never: CoercibleWith<Self::MutationError>,
Self::MutationError: From<CoercedError<Never, Self::MutationError>>,
[src]
&mut self,
ms: &S,
mp: &P,
mo: &O,
mg: &G
) -> MDResult<Self, usize> where
S: TermMatcher,
P: TermMatcher,
O: TermMatcher,
G: GraphNameMatcher,
Self::Error: Into<Self::MutationError>,
Never: CoercibleWith<Self::MutationError>,
Self::MutationError: From<CoercedError<Never, Self::MutationError>>,
Remove all quads matching the given matchers. Read more
fn retain<S: ?Sized, P: ?Sized, O: ?Sized, G: ?Sized>(
&mut self,
ms: &S,
mp: &P,
mo: &O,
mg: &G
) -> MDResult<Self, ()> where
S: TermMatcher,
P: TermMatcher,
O: TermMatcher,
G: GraphNameMatcher,
Self::Error: Into<Self::MutationError>,
Never: CoercibleWith<Self::MutationError>,
Self::MutationError: From<CoercedError<Never, Self::MutationError>>,
[src]
&mut self,
ms: &S,
mp: &P,
mo: &O,
mg: &G
) -> MDResult<Self, ()> where
S: TermMatcher,
P: TermMatcher,
O: TermMatcher,
G: GraphNameMatcher,
Self::Error: Into<Self::MutationError>,
Never: CoercibleWith<Self::MutationError>,
Self::MutationError: From<CoercedError<Never, Self::MutationError>>,
Keep only the quads matching the given matchers. Read more
impl<I> SetDataset for HashDataset<I> where
I: TermIndexMap,
I::Index: Hash,
[src]
I: TermIndexMap,
I::Index: Hash,
impl<I: Default> Default for HashDataset<I> where
I: TermIndexMap,
I::Index: Hash,
<I::Factory as TermFactory>::TermData: 'static,
I::Index: Default,
[src]
I: TermIndexMap,
I::Index: Hash,
<I::Factory as TermFactory>::TermData: 'static,
I::Index: Default,
fn default() -> HashDataset<I>
[src]
Auto Trait Implementations
impl<I> Sync for HashDataset<I> where
I: Sync,
<I as TermIndexMap>::Index: Sync,
I: Sync,
<I as TermIndexMap>::Index: Sync,
impl<I> Send for HashDataset<I> where
I: Send,
<I as TermIndexMap>::Index: Send,
I: Send,
<I as TermIndexMap>::Index: Send,
impl<I> Unpin for HashDataset<I> where
I: Unpin,
<I as TermIndexMap>::Index: Unpin,
I: Unpin,
<I as TermIndexMap>::Index: Unpin,
impl<I> RefUnwindSafe for HashDataset<I> where
I: RefUnwindSafe,
<I as TermIndexMap>::Index: RefUnwindSafe,
I: RefUnwindSafe,
<I as TermIndexMap>::Index: RefUnwindSafe,
impl<I> UnwindSafe for HashDataset<I> where
I: UnwindSafe,
<I as TermIndexMap>::Index: UnwindSafe,
I: UnwindSafe,
<I as TermIndexMap>::Index: UnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,