Skip to main content

PatternMatchingDataset

Trait PatternMatchingDataset 

Source
pub trait PatternMatchingDataset: Dataset {
    type QuadPatternMatching<'a, 'p>: Iterator<Item = Quad<&'a Self::Resource>>
       where Self: 'a,
             Self::Resource: 'p;

    // Required method
    fn quad_pattern_matching<'p>(
        &self,
        pattern: Quad<Option<&'p Self::Resource>>,
    ) -> Self::QuadPatternMatching<'_, 'p>;

    // Provided methods
    fn contains_quad(&self, quad: Quad<&Self::Resource>) -> bool { ... }
    fn contains_quad_subject(&self, subject: &Self::Resource) -> bool { ... }
    fn contains_quad_predicate(&self, predicate: &Self::Resource) -> bool { ... }
    fn contains_quad_object(&self, object: &Self::Resource) -> bool { ... }
    fn contains_named_graph(&self, named_graph: &Self::Resource) -> bool { ... }
    fn quad_predicates_objects<'p>(
        &self,
        graph: Option<&'p Self::Resource>,
        subject: &'p Self::Resource,
    ) -> QuadPredicatesObjects<'_, 'p, Self> 
       where Self: PredicateFiniteDataset { ... }
    fn quad_objects<'p>(
        &self,
        graph: Option<&'p Self::Resource>,
        subject: &'p Self::Resource,
        predicate: &'p Self::Resource,
    ) -> QuadObjects<'_, 'p, Self>  { ... }
}
Expand description

Pattern-matching-capable dataset.

A dataset that can be queried with a LinearQuadPattern, i.e. a quad where each component is either a fixed resource or left unconstrained.

Required Associated Types§

Source

type QuadPatternMatching<'a, 'p>: Iterator<Item = Quad<&'a Self::Resource>> where Self: 'a, Self::Resource: 'p

Pattern-matching iterator.

Required Methods§

Source

fn quad_pattern_matching<'p>( &self, pattern: Quad<Option<&'p Self::Resource>>, ) -> Self::QuadPatternMatching<'_, 'p>

Returns an iterator over all the quads of the dataset matching the given pattern.

Provided Methods§

Source

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

Checks if the dataset contains the given subject.

Source

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

Checks if the dataset contains the given object.

Source

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>

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>

Returns an iterator over all the objects o matching the quad subject predicate o graph.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<G> PatternMatchingDataset for G

Any single-graph, pattern-matching-capable graph is a pattern-matching dataset, matching only quads in the default graph.

Source§

impl<R> PatternMatchingDataset for IndexedBTreeDataset<R>
where R: Ord,

Source§

type QuadPatternMatching<'a, 'p> = PatternMatching<'a, R> where R: 'a, <IndexedBTreeDataset<R> as Dataset>::Resource: 'p