pub struct IndexedBTreeGraph<R = Term> { /* private fields */ }
Expand description
Indexed BTree-based RDF graph, optimized for pattern matching operations.
Implementations§
Source§impl<R> IndexedBTreeGraph<R>
impl<R> IndexedBTreeGraph<R>
Sourcepub fn from_non_indexed(graph: BTreeGraph<R>) -> Self
pub fn from_non_indexed(graph: BTreeGraph<R>) -> Self
Creates a new indexed graph from a non-indexed one.
Sourcepub fn resources(&self) -> Resources<'_, R> ⓘ
pub fn resources(&self) -> Resources<'_, R> ⓘ
Returns an iterator over the resources of the graph.
Sourcepub fn subjects(&self) -> Subjects<'_, R> ⓘ
pub fn subjects(&self) -> Subjects<'_, R> ⓘ
Returns an iterator over the subjects of the graph.
Sourcepub fn predicates(&self) -> Predicates<'_, R> ⓘ
pub fn predicates(&self) -> Predicates<'_, R> ⓘ
Returns an iterator over the predicates of the graph.
Source§impl<R: Ord> IndexedBTreeGraph<R>
impl<R: Ord> IndexedBTreeGraph<R>
Sourcepub fn contains_resource(&self, resource: &R) -> bool
pub fn contains_resource(&self, resource: &R) -> bool
Checks if the provided resource appears in any triple in the graph.
Sourcepub fn contains(&self, triple: Triple<&R>) -> bool
pub fn contains(&self, triple: Triple<&R>) -> bool
Checks if the provided triple is in the graph.
Sourcepub fn insert(&mut self, triple: Triple<R>) -> bool
pub fn insert(&mut self, triple: Triple<R>) -> bool
Inserts the given triple in the graph.
Returns true
if the triple was not already in the graph, and false
if it was.
Sourcepub fn remove(&mut self, triple: Triple<&R>) -> bool
pub fn remove(&mut self, triple: Triple<&R>) -> bool
Removes the given triple from the graph.
Returns whether or not the triple was in the graph. Does nothing if the triple was not in the graph.
Sourcepub fn pattern_matching(
&self,
pattern: CanonicalTriplePattern<&R>,
) -> PatternMatching<'_, R> ⓘ
pub fn pattern_matching( &self, pattern: CanonicalTriplePattern<&R>, ) -> PatternMatching<'_, R> ⓘ
Returns an iterator over all the triples matching the given canonical triple pattern.
Trait Implementations§
Source§impl<R: Clone> Clone for IndexedBTreeGraph<R>
impl<R: Clone> Clone for IndexedBTreeGraph<R>
Source§fn clone(&self) -> IndexedBTreeGraph<R>
fn clone(&self) -> IndexedBTreeGraph<R>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<R: Debug> Debug for IndexedBTreeGraph<R>
impl<R: Debug> Debug for IndexedBTreeGraph<R>
Source§impl<R> Default for IndexedBTreeGraph<R>
impl<R> Default for IndexedBTreeGraph<R>
Source§impl<R: Clone + Ord> Extend<Triple<R>> for IndexedBTreeGraph<R>
impl<R: Clone + Ord> Extend<Triple<R>> for IndexedBTreeGraph<R>
Source§fn extend<T: IntoIterator<Item = Triple<R>>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Triple<R>>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
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)
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<R> From<BTreeGraph<R>> for IndexedBTreeGraph<R>
impl<R> From<BTreeGraph<R>> for IndexedBTreeGraph<R>
Source§fn from(value: BTreeGraph<R>) -> Self
fn from(value: BTreeGraph<R>) -> Self
Converts to this type from the input type.
Source§impl<R: Clone + Ord> FromIterator<Triple<R>> for IndexedBTreeGraph<R>
impl<R: Clone + Ord> FromIterator<Triple<R>> for IndexedBTreeGraph<R>
Source§impl<R: Hash> Hash for IndexedBTreeGraph<R>
impl<R: Hash> Hash for IndexedBTreeGraph<R>
Source§impl<'a, R> IntoIterator for &'a IndexedBTreeGraph<R>
impl<'a, R> IntoIterator for &'a IndexedBTreeGraph<R>
Source§impl<R: Clone> IntoIterator for IndexedBTreeGraph<R>
impl<R: Clone> IntoIterator for IndexedBTreeGraph<R>
Source§impl<R> ObjectTraversableGraph for IndexedBTreeGraph<R>
impl<R> ObjectTraversableGraph for IndexedBTreeGraph<R>
type GraphObjects<'a> = Objects<'a, R> where R: 'a
fn graph_objects(&self) -> Self::GraphObjects<'_>
fn graph_object_count(&self) -> usize
Source§impl<R: Ord> Ord for IndexedBTreeGraph<R>
impl<R: Ord> Ord for IndexedBTreeGraph<R>
Source§impl<R: PartialEq> PartialEq for IndexedBTreeGraph<R>
impl<R: PartialEq> PartialEq for IndexedBTreeGraph<R>
Source§impl<R: PartialOrd> PartialOrd for IndexedBTreeGraph<R>
impl<R: PartialOrd> PartialOrd for IndexedBTreeGraph<R>
Source§impl<R: Ord> PatternMatchingGraph for IndexedBTreeGraph<R>
impl<R: Ord> PatternMatchingGraph for IndexedBTreeGraph<R>
type TriplePatternMatching<'a, 'p> = PatternMatching<'a, R> where R: 'a, Self::Resource: 'p
fn triple_pattern_matching<'p>( &self, pattern: CanonicalTriplePattern<&'p Self::Resource>, ) -> Self::TriplePatternMatching<'_, 'p>
fn contains_triple(&self, triple: Triple<&Self::Resource>) -> bool
Source§fn contains_triple_subject(&self, subject: &Self::Resource) -> bool
fn contains_triple_subject(&self, subject: &Self::Resource) -> bool
Checks if the graph contains the given subject.
Source§fn contains_triple_predicate(&self, predicate: &Self::Resource) -> bool
fn contains_triple_predicate(&self, predicate: &Self::Resource) -> bool
Checks if the graph contains the given predicate.
Source§fn contains_triple_object(&self, object: &Self::Resource) -> bool
fn contains_triple_object(&self, object: &Self::Resource) -> bool
Checks if the graph contains the given object.
Source§fn triple_predicates_objects<'p>(
&self,
subject: &'p Self::Resource,
) -> TriplePredicatesObjects<'_, 'p, Self> ⓘwhere
Self: PredicateTraversableGraph,
fn triple_predicates_objects<'p>(
&self,
subject: &'p Self::Resource,
) -> TriplePredicatesObjects<'_, 'p, Self> ⓘwhere
Self: PredicateTraversableGraph,
Returns an iterator over all the predicates
p
matching the triple subject p o
present in the graph, for some o
.Source§fn triple_objects<'p>(
&self,
subject: &'p Self::Resource,
predicate: &'p Self::Resource,
) -> TripleObjects<'_, 'p, Self> ⓘ
fn triple_objects<'p>( &self, subject: &'p Self::Resource, predicate: &'p Self::Resource, ) -> TripleObjects<'_, 'p, Self> ⓘ
Returns an iterator over all the objects
o
matching the triple subject predicate o
present in the graph.Source§impl<R> PredicateTraversableGraph for IndexedBTreeGraph<R>
impl<R> PredicateTraversableGraph for IndexedBTreeGraph<R>
type GraphPredicates<'a> = Predicates<'a, R> where R: 'a
fn graph_predicates(&self) -> Self::GraphPredicates<'_>
fn graph_predicate_count(&self) -> usize
Source§impl<R: RdfDisplay> RdfDisplay for IndexedBTreeGraph<R>
impl<R: RdfDisplay> RdfDisplay for IndexedBTreeGraph<R>
Source§fn rdf_fmt(&self, f: &mut Formatter<'_>) -> Result
fn rdf_fmt(&self, f: &mut Formatter<'_>) -> Result
Formats the value using the given formatter.
Source§fn rdf_display(&self) -> RdfDisplayed<&Self>
fn rdf_display(&self) -> RdfDisplayed<&Self>
Prepare the value to be formatted as an RDF syntax element.
Source§impl<R> ResourceTraversableGraph for IndexedBTreeGraph<R>
impl<R> ResourceTraversableGraph for IndexedBTreeGraph<R>
type GraphResources<'a> = Resources<'a, R> where R: 'a
fn graph_resources(&self) -> Self::GraphResources<'_>
fn graph_resource_count(&self) -> usize
Source§impl<R> SubjectTraversableGraph for IndexedBTreeGraph<R>
impl<R> SubjectTraversableGraph for IndexedBTreeGraph<R>
type GraphSubjects<'a> = Subjects<'a, R> where R: 'a
fn graph_subjects(&self) -> Self::GraphSubjects<'_>
fn graph_subject_count(&self) -> usize
Source§impl<R> TraversableGraph for IndexedBTreeGraph<R>
impl<R> TraversableGraph for IndexedBTreeGraph<R>
impl<R: Eq> Eq for IndexedBTreeGraph<R>
Auto Trait Implementations§
impl<R> Freeze for IndexedBTreeGraph<R>
impl<R> RefUnwindSafe for IndexedBTreeGraph<R>where
R: RefUnwindSafe,
impl<R> Send for IndexedBTreeGraph<R>where
R: Send,
impl<R> Sync for IndexedBTreeGraph<R>where
R: Sync,
impl<R> Unpin for IndexedBTreeGraph<R>where
R: Unpin,
impl<R> UnwindSafe for IndexedBTreeGraph<R>where
R: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<D> FallibleDataset for Dwhere
D: Dataset,
impl<D> FallibleDataset for Dwhere
D: Dataset,
Source§impl<D> FallibleGraph for Dwhere
D: Graph,
impl<D> FallibleGraph for Dwhere
D: Graph,
Source§impl<D> FallibleGraphMut for Dwhere
D: GraphMut,
impl<D> FallibleGraphMut for Dwhere
D: GraphMut,
fn try_insert( &mut self, triple: Triple<<D as FallibleGraph>::Resource>, ) -> Result<(), <D as FallibleGraph>::Error>
Source§impl<D> FalliblePatternMatchingDataset for Dwhere
D: PatternMatchingDataset,
impl<D> FalliblePatternMatchingDataset for Dwhere
D: PatternMatchingDataset,
type TryQuadPatternMatching<'a, 'p> = InfallibleIterator<<D as PatternMatchingDataset>::QuadPatternMatching<'a, 'p>> where D: 'a, <D as FallibleDataset>::Resource: 'p
fn try_quad_pattern_matching<'p>( &self, pattern: CanonicalQuadPattern<&'p <D as FallibleDataset>::Resource>, ) -> <D as FalliblePatternMatchingDataset>::TryQuadPatternMatching<'_, 'p>
fn try_contains_triple( &self, triple: Triple<&Self::Resource>, ) -> Result<bool, Self::Error>
Source§impl<D> FalliblePatternMatchingGraph for Dwhere
D: PatternMatchingGraph,
impl<D> FalliblePatternMatchingGraph for Dwhere
D: PatternMatchingGraph,
type TryTriplePatternMatching<'a, 'p> = InfallibleIterator<<D as PatternMatchingGraph>::TriplePatternMatching<'a, 'p>> where D: 'a, <D as FallibleGraph>::Resource: 'p
fn try_triple_pattern_matching<'p>( &self, pattern: CanonicalTriplePattern<&'p <D as FallibleGraph>::Resource>, ) -> <D as FalliblePatternMatchingGraph>::TryTriplePatternMatching<'_, 'p>
fn try_contains_triple( &self, triple: Triple<&Self::Resource>, ) -> Result<bool, Self::Error>
Source§impl<D> FallibleTraversableDataset for Dwhere
D: TraversableDataset,
impl<D> FallibleTraversableDataset for Dwhere
D: TraversableDataset,
Source§type TryQuads<'a> = InfallibleIterator<<D as TraversableDataset>::Quads<'a>>
where
D: 'a
type TryQuads<'a> = InfallibleIterator<<D as TraversableDataset>::Quads<'a>> where D: 'a
Fallible quads iterator.
fn try_quads(&self) -> <D as FallibleTraversableDataset>::TryQuads<'_>
Source§impl<D> FallibleTraversableGraph for Dwhere
D: TraversableGraph,
impl<D> FallibleTraversableGraph for Dwhere
D: TraversableGraph,
type TryTriples<'a> = InfallibleIterator<<D as TraversableGraph>::Triples<'a>> where D: 'a
fn try_triples(&self) -> <D as FallibleTraversableGraph>::TryTriples<'_>
Source§impl<G> NamedGraphTraversableDataset for Gwhere
G: Graph,
impl<G> NamedGraphTraversableDataset for Gwhere
G: Graph,
type NamedGraphs<'a> = Empty<&'a <G as Dataset>::Resource> where G: 'a
fn named_graphs(&self) -> <G as NamedGraphTraversableDataset>::NamedGraphs<'_>
fn named_graph_count(&self) -> usize
Source§impl<G> ObjectTraversableDataset for Gwhere
G: ObjectTraversableGraph,
impl<G> ObjectTraversableDataset for Gwhere
G: ObjectTraversableGraph,
type Objects<'a> = <G as ObjectTraversableGraph>::GraphObjects<'a> where G: 'a
fn objects(&self) -> <G as ObjectTraversableDataset>::Objects<'_>
fn object_count(&self) -> usize
Source§impl<G> PatternMatchingDataset for Gwhere
G: PatternMatchingGraph,
impl<G> PatternMatchingDataset for Gwhere
G: PatternMatchingGraph,
Source§type QuadPatternMatching<'a, 'p> = OptionIterator<TripleToQuadIterator<<G as PatternMatchingGraph>::TriplePatternMatching<'a, 'p>, &'a <G as Graph>::Resource>>
where
G: 'a,
<G as Dataset>::Resource: 'p
type QuadPatternMatching<'a, 'p> = OptionIterator<TripleToQuadIterator<<G as PatternMatchingGraph>::TriplePatternMatching<'a, 'p>, &'a <G as Graph>::Resource>> where G: 'a, <G as Dataset>::Resource: 'p
Pattern-matching iterator.
Source§fn quad_pattern_matching<'p>(
&self,
pattern: CanonicalQuadPattern<&'p <G as Dataset>::Resource>,
) -> <G as PatternMatchingDataset>::QuadPatternMatching<'_, 'p>
fn quad_pattern_matching<'p>( &self, pattern: CanonicalQuadPattern<&'p <G as Dataset>::Resource>, ) -> <G as PatternMatchingDataset>::QuadPatternMatching<'_, 'p>
Returns an iterator over all the quads of the dataset matching the given
pattern.
Source§fn contains_quad(&self, quad: Quad<&Self::Resource>) -> bool
fn contains_quad(&self, quad: Quad<&Self::Resource>) -> bool
Checks if the dataset contains the given quad.
Source§fn contains_quad_subject(&self, subject: &Self::Resource) -> bool
fn contains_quad_subject(&self, subject: &Self::Resource) -> bool
Checks if the dataset contains the given subject.
Source§fn contains_quad_predicate(&self, predicate: &Self::Resource) -> bool
fn contains_quad_predicate(&self, predicate: &Self::Resource) -> bool
Checks if the dataset contains the given predicate.
Source§fn contains_quad_object(&self, object: &Self::Resource) -> bool
fn contains_quad_object(&self, object: &Self::Resource) -> bool
Checks if the dataset contains the given object.
Source§fn contains_named_graph(&self, named_graph: &Self::Resource) -> bool
fn contains_named_graph(&self, named_graph: &Self::Resource) -> bool
Checks if the dataset contains the given named graph.
Source§fn quad_predicates_objects<'p>(
&self,
graph: Option<&'p Self::Resource>,
subject: &'p Self::Resource,
) -> QuadPredicatesObjects<'_, 'p, Self> ⓘwhere
Self: PredicateTraversableDataset,
fn quad_predicates_objects<'p>(
&self,
graph: Option<&'p Self::Resource>,
subject: &'p Self::Resource,
) -> QuadPredicatesObjects<'_, 'p, Self> ⓘwhere
Self: PredicateTraversableDataset,
Returns an iterator over all the predicates
p
matching any quad
subject p o graph
present in the dataset, for any object o
.Source§fn quad_objects<'p>(
&self,
graph: Option<&'p Self::Resource>,
subject: &'p Self::Resource,
predicate: &'p Self::Resource,
) -> QuadObjects<'_, 'p, Self> ⓘ
fn quad_objects<'p>( &self, graph: Option<&'p Self::Resource>, subject: &'p Self::Resource, predicate: &'p Self::Resource, ) -> QuadObjects<'_, 'p, Self> ⓘ
Returns an iterator over all the objects
o
matching the quad subject predicate o graph
.Source§impl<G> PredicateTraversableDataset for Gwhere
G: PredicateTraversableGraph,
impl<G> PredicateTraversableDataset for Gwhere
G: PredicateTraversableGraph,
type Predicates<'a> = <G as PredicateTraversableGraph>::GraphPredicates<'a> where G: 'a
fn predicates(&self) -> <G as PredicateTraversableDataset>::Predicates<'_>
fn predicate_count(&self) -> usize
Source§impl<G> ResourceTraversableDataset for Gwhere
G: ResourceTraversableGraph,
impl<G> ResourceTraversableDataset for Gwhere
G: ResourceTraversableGraph,
type Resources<'a> = <G as ResourceTraversableGraph>::GraphResources<'a> where G: 'a
fn resources(&self) -> <G as ResourceTraversableDataset>::Resources<'_>
fn resource_count(&self) -> usize
Source§impl<G> SubjectTraversableDataset for Gwhere
G: SubjectTraversableGraph,
impl<G> SubjectTraversableDataset for Gwhere
G: SubjectTraversableGraph,
type Subjects<'a> = <G as SubjectTraversableGraph>::GraphSubjects<'a> where G: 'a
fn subjects(&self) -> <G as SubjectTraversableDataset>::Subjects<'_>
fn subject_count(&self) -> usize
Source§impl<G> TraversableDataset for Gwhere
G: TraversableGraph,
impl<G> TraversableDataset for Gwhere
G: TraversableGraph,
Source§type Quads<'a> = TripleToQuadIterator<<G as TraversableGraph>::Triples<'a>, &'a <G as Graph>::Resource>
where
G: 'a
type Quads<'a> = TripleToQuadIterator<<G as TraversableGraph>::Triples<'a>, &'a <G as Graph>::Resource> where G: 'a
Quads iterator.
Source§fn quads(&self) -> <G as TraversableDataset>::Quads<'_>
fn quads(&self) -> <G as TraversableDataset>::Quads<'_>
Returns an iterator over the quads of the dataset.