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: CanonicalTriplePattern<&'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: PredicateTraversableGraph { ... }
    fn triple_objects<'p>(
        &self,
        subject: &'p Self::Resource,
        predicate: &'p Self::Resource,
    ) -> TripleObjects<'_, 'p, Self>  { ... }
}
Expand description

Pattern-matching-capable dataset.

Required Associated Types§

Source

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

Required Methods§

Source

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

Provided Methods§

Source

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

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>

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", so this trait is not object safe.

Implementors§