[−][src]Struct sophia::graph::inmem::HashGraph
A generic implementation of Graph
and MutableGraph
,
storing its terms in a TermIndexMap
,
and its triples in a HashSet
.
Methods
impl<I> HashGraph<I> where
I: TermIndexMap,
I::Index: Hash,
[src]
I: TermIndexMap,
I::Index: Hash,
Trait Implementations
impl<I> IndexedGraph for HashGraph<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_term(&self, i: Self::Index) -> Option<&Term<Self::TermData>>
[src]
fn insert_indexed<T, U, V>(
&mut self,
s: &Term<T>,
p: &Term<U>,
o: &Term<V>
) -> Option<[I::Index; 3]> where
T: TermData,
U: TermData,
V: TermData,
[src]
&mut self,
s: &Term<T>,
p: &Term<U>,
o: &Term<V>
) -> Option<[I::Index; 3]> where
T: TermData,
U: TermData,
V: TermData,
fn remove_indexed<T, U, V>(
&mut self,
s: &Term<T>,
p: &Term<U>,
o: &Term<V>
) -> Option<[I::Index; 3]> where
T: TermData,
U: TermData,
V: TermData,
[src]
&mut self,
s: &Term<T>,
p: &Term<U>,
o: &Term<V>
) -> Option<[I::Index; 3]> where
T: TermData,
U: TermData,
V: TermData,
fn shrink_to_fit(&mut self)
[src]
impl<'a, I> Graph<'a> for HashGraph<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 Triple = [&'a Term<Self::TermData>; 3]
The type of Triple
s that the methods of this graph will yield. Read more
type Error = Never
The error type that this graph may raise. Read more
fn triples(&'a self) -> GTripleSource<'a, Self>
[src]
fn triples_with_s<T>(&'a self, s: &'a Term<T>) -> GTripleSource<'a, Self> where
T: TermData,
[src]
T: TermData,
An iterator visiting all triples with the given subject. Read more
fn triples_with_p<T>(&'a self, p: &'a Term<T>) -> GTripleSource<'a, Self> where
T: TermData,
[src]
T: TermData,
An iterator visiting all triples with the given predicate. Read more
fn triples_with_o<T>(&'a self, o: &'a Term<T>) -> GTripleSource<'a, Self> where
T: TermData,
[src]
T: TermData,
An iterator visiting all triples with the given object. Read more
fn triples_with_sp<T, U>(
&'a self,
s: &'a Term<T>,
p: &'a Term<U>
) -> GTripleSource<'a, Self> where
T: TermData,
U: TermData,
[src]
&'a self,
s: &'a Term<T>,
p: &'a Term<U>
) -> GTripleSource<'a, Self> where
T: TermData,
U: TermData,
An iterator visiting all triples with the given subject and predicate. Read more
fn triples_with_so<T, U>(
&'a self,
s: &'a Term<T>,
o: &'a Term<U>
) -> GTripleSource<'a, Self> where
T: TermData,
U: TermData,
[src]
&'a self,
s: &'a Term<T>,
o: &'a Term<U>
) -> GTripleSource<'a, Self> where
T: TermData,
U: TermData,
An iterator visiting all triples with the given subject and object. Read more
fn triples_with_po<T, U>(
&'a self,
p: &'a Term<T>,
o: &'a Term<U>
) -> GTripleSource<'a, Self> where
T: TermData,
U: TermData,
[src]
&'a self,
p: &'a Term<T>,
o: &'a Term<U>
) -> GTripleSource<'a, Self> where
T: TermData,
U: TermData,
An iterator visiting all triples with the given predicate and object. Read more
fn triples_with_spo<T, U, V>(
&'a self,
s: &'a Term<T>,
p: &'a Term<U>,
o: &'a Term<V>
) -> GTripleSource<'a, Self> where
T: TermData,
U: TermData,
V: TermData,
[src]
&'a self,
s: &'a Term<T>,
p: &'a Term<U>,
o: &'a Term<V>
) -> GTripleSource<'a, Self> where
T: TermData,
U: TermData,
V: TermData,
An iterator visiting all triples with the given subject, predicate and object. Read more
fn contains<T, U, V>(
&'a self,
s: &'a Term<T>,
p: &'a Term<U>,
o: &'a Term<V>
) -> GResult<'a, Self, bool> where
T: TermData,
U: TermData,
V: TermData,
[src]
&'a self,
s: &'a Term<T>,
p: &'a Term<U>,
o: &'a Term<V>
) -> GResult<'a, Self, bool> where
T: TermData,
U: TermData,
V: TermData,
Return true
if this graph contains the given triple.
fn triples_matching<S: ?Sized, P: ?Sized, O: ?Sized>(
&'a self,
ms: &'a S,
mp: &'a P,
mo: &'a O
) -> GTripleSource<'a, Self> where
S: TermMatcher,
P: TermMatcher,
O: TermMatcher,
[src]
&'a self,
ms: &'a S,
mp: &'a P,
mo: &'a O
) -> GTripleSource<'a, Self> where
S: TermMatcher,
P: TermMatcher,
O: TermMatcher,
An iterator visiting all triples matching the given subject, predicate and object. Read more
fn subjects(&'a self) -> GResultTermSet<'a, Self>
[src]
Build a Hashset of all the terms used as subject in this Graph.
fn predicates(&'a self) -> GResultTermSet<'a, Self>
[src]
Build a Hashset of all the terms used as predicate in this Graph.
fn objects(&'a self) -> GResultTermSet<'a, Self>
[src]
Build a Hashset of all the terms used as object in this Graph.
fn iris(&'a self) -> GResultTermSet<'a, Self>
[src]
Build a Hashset of all the IRIs used in this Graph.
fn bnodes(&'a self) -> GResultTermSet<'a, Self>
[src]
Build a Hashset of all the BNodes used in this Graph.
fn literals(&'a self) -> GResultTermSet<'a, Self>
[src]
Build a Hashset of all the Literals used in this Graph.
fn variables(&'a self) -> GResultTermSet<'a, Self>
[src]
Build a Hashset of all the variables used in this Graph.
fn borrow_as_dataset(&self) -> GraphAsDataset<Self, &Self>
[src]
Dataset
adapter borrowing this graph
fn borrow_mut_as_dataset(&mut self) -> GraphAsDataset<Self, &mut Self>
[src]
Dataset
adapter borrowing this graph mutably
fn as_dataset(self) -> GraphAsDataset<Self, Self> where
Self: Sized,
[src]
Self: Sized,
Dataset
adapter taking ownership of this graph
impl<I> MutableGraph for HashGraph<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 graph may raise during mutations. Read more
fn insert<T_, U_, V_>(
&mut self,
s: &Term<T_>,
p: &Term<U_>,
o: &Term<V_>
) -> MGResult<Self, bool> where
T_: TermData,
U_: TermData,
V_: TermData,
[src]
&mut self,
s: &Term<T_>,
p: &Term<U_>,
o: &Term<V_>
) -> MGResult<Self, bool> where
T_: TermData,
U_: TermData,
V_: TermData,
fn remove<T_, U_, V_>(
&mut self,
s: &Term<T_>,
p: &Term<U_>,
o: &Term<V_>
) -> MGResult<Self, bool> where
T_: TermData,
U_: TermData,
V_: TermData,
[src]
&mut self,
s: &Term<T_>,
p: &Term<U_>,
o: &Term<V_>
) -> MGResult<Self, bool> where
T_: TermData,
U_: TermData,
V_: TermData,
fn inserter(&mut self) -> Inserter<Self>
[src]
Return a TripleSink
that will insert into this graph all the triples it receives. Read more
fn insert_all<'a, TS>(
&mut self,
src: &mut TS
) -> CoercedResult<usize, TS::Error, Self::MutationError> where
TS: TripleSource<'a>,
TS::Error: CoercibleWith<Self::MutationError>,
[src]
&mut self,
src: &mut TS
) -> CoercedResult<usize, TS::Error, Self::MutationError> where
TS: TripleSource<'a>,
TS::Error: CoercibleWith<Self::MutationError>,
Insert into this graph all triples from the given source.
fn remover(&mut self) -> Remover<Self>
[src]
Return a TripleSink
that will remove from this graph all the triples it receives. Read more
fn remove_all<'a, TS>(
&mut self,
src: &mut TS
) -> CoercedResult<usize, TS::Error, Self::MutationError> where
TS: TripleSource<'a>,
TS::Error: CoercibleWith<Self::MutationError>,
[src]
&mut self,
src: &mut TS
) -> CoercedResult<usize, TS::Error, Self::MutationError> where
TS: TripleSource<'a>,
TS::Error: CoercibleWith<Self::MutationError>,
Remove from this graph all triples from the given source.
fn remove_matching<S: ?Sized, P: ?Sized, O: ?Sized>(
&mut self,
ms: &S,
mp: &P,
mo: &O
) -> MGResult<Self, usize> where
S: TermMatcher,
P: TermMatcher,
O: TermMatcher,
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
) -> MGResult<Self, usize> where
S: TermMatcher,
P: TermMatcher,
O: TermMatcher,
Self::Error: Into<Self::MutationError>,
Never: CoercibleWith<Self::MutationError>,
Self::MutationError: From<CoercedError<Never, Self::MutationError>>,
Remove all triples matching the given matchers. Read more
fn retain<S: ?Sized, P: ?Sized, O: ?Sized>(
&mut self,
ms: &S,
mp: &P,
mo: &O
) -> MGResult<Self, ()> where
S: TermMatcher,
P: TermMatcher,
O: TermMatcher,
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
) -> MGResult<Self, ()> where
S: TermMatcher,
P: TermMatcher,
O: TermMatcher,
Self::Error: Into<Self::MutationError>,
Never: CoercibleWith<Self::MutationError>,
Self::MutationError: From<CoercedError<Never, Self::MutationError>>,
Keep only the triples matching the given matchers. Read more
impl<I> SetGraph for HashGraph<I> where
I: TermIndexMap,
I::Index: Hash,
[src]
I: TermIndexMap,
I::Index: Hash,
impl<I: Default> Default for HashGraph<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,
Auto Trait Implementations
impl<I> Sync for HashGraph<I> where
I: Sync,
<I as TermIndexMap>::Index: Sync,
I: Sync,
<I as TermIndexMap>::Index: Sync,
impl<I> Send for HashGraph<I> where
I: Send,
<I as TermIndexMap>::Index: Send,
I: Send,
<I as TermIndexMap>::Index: Send,
impl<I> Unpin for HashGraph<I> where
I: Unpin,
<I as TermIndexMap>::Index: Unpin,
I: Unpin,
<I as TermIndexMap>::Index: Unpin,
impl<I> RefUnwindSafe for HashGraph<I> where
I: RefUnwindSafe,
<I as TermIndexMap>::Index: RefUnwindSafe,
I: RefUnwindSafe,
<I as TermIndexMap>::Index: RefUnwindSafe,
impl<I> UnwindSafe for HashGraph<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,