pub enum SHACLPath {
Predicate {
pred: IriS,
},
Alternative {
paths: Vec<SHACLPath>,
},
Sequence {
paths: Vec<SHACLPath>,
},
Inverse {
path: Box<SHACLPath>,
},
ZeroOrMore {
path: Box<SHACLPath>,
},
OneOrMore {
path: Box<SHACLPath>,
},
ZeroOrOne {
path: Box<SHACLPath>,
},
}Expand description
Represents a SHACL property path for navigating RDF graphs.
SHACL paths follow the SHACL property paths spec which are a subset of SPARQL property paths. They enable complex navigation patterns through RDF graphs, extending simple predicate-based traversal with operations like sequences, alternatives, inverses, and quantifiers.
Variants§
Predicate
A direct predicate path using a single IRI.
Alternative
An alternative path representing a union of multiple paths.
Sequence
A sequence path representing composed navigation.
Inverse
An inverse path representing reverse property navigation.
ZeroOrMore
A zero-or-more quantified path (transitive closure).
OneOrMore
A one-or-more quantified path (non-empty transitive closure).
ZeroOrOne
A zero-or-one quantified path (optional path).
Implementations§
Source§impl SHACLPath
impl SHACLPath
Sourcepub fn iri(pred: IriS) -> Self
pub fn iri(pred: IriS) -> Self
Creates a simple predicate path from an IRI.
This is a convenience constructor for the most common path type,
equivalent to SHACLPath::Predicate { pred }.
§Arguments
pred- The IRI representing the predicate to navigate
Sourcepub fn sequence(paths: Vec<SHACLPath>) -> Self
pub fn sequence(paths: Vec<SHACLPath>) -> Self
Creates a sequence path from multiple paths.
§Arguments
paths- A vector of paths to compose in sequence
Sourcepub fn alternative(paths: Vec<SHACLPath>) -> Self
pub fn alternative(paths: Vec<SHACLPath>) -> Self
Sourcepub fn zero_or_more(path: SHACLPath) -> Self
pub fn zero_or_more(path: SHACLPath) -> Self
Sourcepub fn one_or_more(path: SHACLPath) -> Self
pub fn one_or_more(path: SHACLPath) -> Self
Creates a one-or-more quantified path (non-empty transitive closure).
§Arguments
path- The path to repeat
Sourcepub fn zero_or_one(path: SHACLPath) -> Self
pub fn zero_or_one(path: SHACLPath) -> Self
Trait Implementations§
Source§impl Display for SHACLPath
impl Display for SHACLPath
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Formats the SHACL path as a SPARQL-like property path expression.
The output follows SPARQL property path syntax conventions:
- Predicates are displayed as IRIs
- Alternatives use
|separator with parentheses - Sequences use
/separator with parentheses - Inverses use
^prefix with parentheses - Quantifiers use postfix operators:
*,+,?
impl Eq for SHACLPath
impl StructuralPartialEq for SHACLPath
Auto Trait Implementations§
impl Freeze for SHACLPath
impl RefUnwindSafe for SHACLPath
impl Send for SHACLPath
impl Sync for SHACLPath
impl Unpin for SHACLPath
impl UnsafeUnpin for SHACLPath
impl UnwindSafe for SHACLPath
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
key and return true if they are equal.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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.