Skip to main content

PatternMatchingGraph

Trait PatternMatchingGraph 

Source
pub trait PatternMatchingGraph: Graph {
    type TriplePatternMatching<'a, 'p>: Iterator<Item = Triple<&'a Self::Resource>>
       where Self: 'a,
             Self::Resource: 'p;

    // Required method
    fn triple_pattern_matching<'p>(
        &self,
        pattern: LinearTriplePattern<&'p Self::Resource>,
    ) -> Self::TriplePatternMatching<'_, 'p>;

    // Provided methods
    fn contains_triple(&self, triple: Triple<&Self::Resource>) -> bool { ... }
    fn contains_triple_subject(&self, subject: &Self::Resource) -> bool { ... }
    fn contains_triple_predicate(&self, predicate: &Self::Resource) -> bool { ... }
    fn contains_triple_object(&self, object: &Self::Resource) -> bool { ... }
    fn triple_predicates_objects<'p>(
        &self,
        subject: &'p Self::Resource,
    ) -> TriplePredicatesObjects<'_, 'p, Self> 
       where Self: PredicateFiniteGraph,
             Self::Resource: 'p { ... }
    fn triple_objects<'p>(
        &self,
        subject: &'p Self::Resource,
        predicate: &'p Self::Resource,
    ) -> TripleObjects<'_, 'p, Self>  { ... }
}
Expand description

Pattern-matching-capable graph.

A graph that can be queried with a LinearTriplePattern, i.e. a triple where each component is either a fixed resource or left unconstrained.

Required Associated Types§

Source

type TriplePatternMatching<'a, 'p>: Iterator<Item = Triple<&'a Self::Resource>> where Self: 'a, Self::Resource: 'p

Pattern-matching iterator.

Required Methods§

Source

fn triple_pattern_matching<'p>( &self, pattern: LinearTriplePattern<&'p Self::Resource>, ) -> Self::TriplePatternMatching<'_, 'p>

Returns an iterator over all the triples of the graph matching the given pattern.

Provided Methods§

Source

fn contains_triple(&self, triple: Triple<&Self::Resource>) -> bool

Checks if the graph contains the given triple.

Source

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

Checks if the graph contains the given predicate.

Source

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: PredicateFiniteGraph, Self::Resource: 'p,

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>

Returns an iterator over all the objects o matching the triple subject predicate o present in the graph.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§