pub struct PatternPath {
pub variable: Option<SmallName>,
pub subpath_variable: Option<SmallName>,
pub elements: Vec<PatternElement>,
pub where_expr: Option<Expr>,
pub mode: Option<PathMode>,
pub selector: Option<PathSelector>,
pub is_shortest_path_function: bool,
}Expand description
A path pattern like (a)-[r]->(b), optionally named: p = (a)-[r]->(b).
Fields§
§variable: Option<SmallName>§subpath_variable: Option<SmallName>CIP-73: the subpath variable of a named parenthesized group that is
itself the whole path body (MATCH p = ANY SHORTEST (q = (:A)-->+(:B)),
MATCH ANY SHORTEST (q = (:A)-->+(:B))). Self::variable carries
only the enclosing p = … name; both names bind the same path value
and Self::path_names lists them. A lone group name (no enclosing
path name) stays here, not in variable, so a group reading its own
name inside its WHERE stays distinguishable from an enclosing path
variable read there (42I21).
elements: Vec<PatternElement>§where_expr: Option<Expr>The trailing WHERE of a parenthesized path pattern, e.g.
((n)-[r]->(m) WHERE n.p > m.q AND r:S) (CIP-14 “parenthesized path
pattern” location). Evaluated once every element in the path is
bound, ANDed with the pattern match itself.
mode: Option<PathMode>CIP-51 explicit path mode prefix (WALK/TRAIL/ACYCLIC/SIMPLE),
written directly or nested inside a selector’s own [path mode]
slot. None means no explicit keyword (resolves to Walk).
selector: Option<PathSelector>CIP-73/CIP-191 path selector prefix (ALL/ANY/SHORTEST/…).
None means no explicit selector (equivalent to an implicit ALL).
is_shortest_path_function: boolTrue if this path pattern is sugar for the pre-GPM
shortestPath(...)/allShortestPaths(...) function (CIP-40/CIP-73),
rather than an explicit SHORTEST/ALL SHORTEST
selector keyword – even though both normalize to the same
selector value. The two are NOT interchangeable for CIP-40’s
mixing rules: the legacy function forms are exempt from the
explicit-match-mode and multiple-selective-path-pattern
restrictions that apply to the keyword selector syntax (see
Parser::parse_match).
Implementations§
Source§impl PatternPath
impl PatternPath
Sourcepub fn path_names(&self) -> impl Iterator<Item = &SmallName>
pub fn path_names(&self) -> impl Iterator<Item = &SmallName>
The names this path binds its path value under, in declaration order:
the outer path variable, then a named parenthesized subpath. The two
name the same path value; the IR twin is PathPattern::path_names.