You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
openCypher: label expressions with ! / % / mixed &| on variable-length relationships ([r:!R*], shortestPath) are refused #9117
The fix for #8992 evaluates the full label expression (!, %, and & mixed with |) on node patterns, single-hop relationship patterns, quantified path patterns, pattern predicates, pattern comprehensions and in WHERE. It does so by turning the expression into a predicate over the element, which the single-hop steps already evaluate per relationship.
A variable-length relationship has no such per-hop predicate in the expansion steps (ExpandPathStep, VarLengthExpand, ShortestPathStep's hop filter works on the type list only), so these shapes are now refused at parse time with an error that names the expression, instead of silently dropping the operator as before #8992:
MATCH (a)-[:!R*1..3]->(b) RETURNbMATCHp=shortestPath((a)-[:!R*]-(b)) RETURNpMATCH (a)-[:(R|S)&!T*]->(b) RETURNb
Neo4j evaluates the expression against every relationship of the path. Supporting it needs the variable-length expansion to filter each hop with a LabelPredicate (or the type list to be resolved against the schema's edge types at plan time, which a relationship's single type makes possible).
Entry point: CypherASTBuilder.visitRelationshipPattern / CypherExpressionBuilder.parseRelationshipPattern, the pathLength != null branch that throws.
Fixed by #9477. Label expressions on variable-length relationships now run instead of being refused at parse time: [:!R*1..3], [:%*], [:(R|S)&!T*], and inside shortestPath/allShortestPaths, pattern predicates and pattern comprehensions. The expression is checked at every hop, on both the legacy and the optimized execution paths.
Performance note: an expression that needs a per-hop check (!, %, or & mixed with |) does not get the faster VarLengthExpand path, and [:!R*] expands over every relationship type. A plain type list such as [:R|S*] is unchanged. The fix is complete.
❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
Activity
address review: test label expression with property map and allShorte…
address review: unbounded expansion over a cycle, explain each assert…
feat(#9117): evaluate openCypher label expressions on variable-length…
robfrank commentedon Oct 8, 2026
Fixed by #9477. Label expressions on variable-length relationships now run instead of being refused at parse time:
[:!R*1..3],[:%*],[:(R|S)&!T*], and insideshortestPath/allShortestPaths, pattern predicates and pattern comprehensions. The expression is checked at every hop, on both the legacy and the optimized execution paths.Performance note: an expression that needs a per-hop check (
!,%, or&mixed with|) does not get the fasterVarLengthExpandpath, and[:!R*]expands over every relationship type. A plain type list such as[:R|S*]is unchanged. The fix is complete.❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
feat(#9117): evaluate openCypher label expressions on variable-length…