pub enum PathOp {
Attr(RawId),
NotAttr(RawId),
Concat,
Union,
Star,
Plus,
Optional,
Inverse,
}Expand description
Postfix-encoded path operations (used by the path! macro).
The macro compiles a path expression into a sequence of these
operations. RegularPathConstraint::new converts the postfix
sequence into a tree for evaluation.
Variants§
Attr(RawId)
Single-attribute hop: traverse the given attribute.
NotAttr(RawId)
Negated single-attribute hop: traverse any attribute
other than the given one (corresponds to SPARQL 1.1 §9.4’s
negated property set !p). Used in (!p)+ / (!p)* to
enumerate reachability under “anything but this predicate”
edges.
Concat
Concatenation: compose the two preceding sub-expressions.
Union
Alternation: match either of the two preceding sub-expressions.
Star
Reflexive-transitive closure (*): zero or more repetitions.
Plus
Transitive closure (+): one or more repetitions.
Optional
Zero-or-one (?): match the preceding sub-expression once or
not at all. Semantically Optional(p) ↔ Union(Identity, p),
but recognised inline so the zero-step branch reuses the
bound start node directly instead of materialising every node.
Inverse
Inverse (^): reverse the direction of the preceding sub-
expression. ^p traverses p backwards (object → subject).
Compound expressions (^(a/b), ^(a+)) are normalised at
from_postfix time: Inverse is pushed down to Attr leaves
via the standard rewrites
^(a/b) ↔ ^b/^a, ^(a|b) ↔ ^a|^b, ^(a+) ↔ (^a)+, etc.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PathOp
impl RefUnwindSafe for PathOp
impl Send for PathOp
impl Sync for PathOp
impl Unpin for PathOp
impl UnsafeUnpin for PathOp
impl UnwindSafe for PathOp
Blanket Implementations§
impl<T> ArchiveOwner for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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