pub struct PatternMatcher<'a> { /* private fields */ }Expand description
Pattern matcher for RDF triples
Provides efficient pattern matching over in-memory triple collections.
Implementations§
Source§impl<'a> PatternMatcher<'a>
impl<'a> PatternMatcher<'a>
Sourcepub fn new(triples: &'a [Triple]) -> Self
pub fn new(triples: &'a [Triple]) -> Self
Create a new pattern matcher for a collection of triples
This builds indices for efficient pattern matching.
Sourcepub fn find_matches(&self, pattern: &TriplePattern) -> Vec<&Triple>
pub fn find_matches(&self, pattern: &TriplePattern) -> Vec<&Triple>
Find all triples matching a pattern
Returns references to matching triples.
Sourcepub fn count_matches(&self, pattern: &TriplePattern) -> usize
pub fn count_matches(&self, pattern: &TriplePattern) -> usize
Count matches for a pattern without collecting results
Sourcepub fn has_match(&self, pattern: &TriplePattern) -> bool
pub fn has_match(&self, pattern: &TriplePattern) -> bool
Check if any triple matches the pattern
Sourcepub fn predicates(&self) -> Vec<String>
pub fn predicates(&self) -> Vec<String>
Get all unique predicates
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for PatternMatcher<'a>
impl<'a> RefUnwindSafe for PatternMatcher<'a>
impl<'a> Send for PatternMatcher<'a>
impl<'a> Sync for PatternMatcher<'a>
impl<'a> Unpin for PatternMatcher<'a>
impl<'a> UnsafeUnpin for PatternMatcher<'a>
impl<'a> UnwindSafe for PatternMatcher<'a>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more