Skip to main content

Module ast

Module ast 

Source

Structs§

AllReduceExpr
allReduce(accumulator = init, x IN list | expression, predicate)
AlterCurrentGraphTypeClause
See Clause::AlterCurrentGraphType.
AlterDatabaseClause
See Clause::AlterDatabase.
BinaryExpr
Binary expression like a + b. op is the operator’s AST spelling, a &'static str drawn from the parser’s operator-constant table (parser/mod.rs, ADR-0505 §2) — never a runtime-built String.
CallProcedureClause
CALL db.procedure() YIELD … clause.
CallSubqueryClause
CALL { … } subquery clause.
CaseExpr
CASE expression. The simple form’s test operand is lowered at parse time into each WHEN’s equality comparison (parser/case.rs), so the stored model is the searched form only: every condition is a predicate.
ChronologicalCompareExpr
a IS [NOT] <chronological operator> b (Cypher 25). SameInstant compares UTC instants, SameRepresentation the local clock plus zone identity (the = relation), and Before/After the instant ordering; the executor owns the null/mixed-kind policy.
CollectSubqueryExpr
COLLECT { <RegularQuery> } subquery expression (CIP-71): evaluates the inner <RegularQuery> once per outer row and collects the single projected column’s value from every inner row into a list. Unlike EXISTS/COUNT, COLLECT has no bare-pattern shorthand – the inner query is always a full <RegularQuery> (any read clause, including UNION) and must end in a RETURN with exactly one non-* return item.
ComparisonExpr
Comparison expression like a > b. op is the operator’s AST spelling, a &'static str from the comparison_op token-to-spelling table (parser/mod.rs, ADR-0505 §2) — never a runtime-built String.
ConditionalClause
CIP-135 conditional clause: WHEN <pred> THEN { <body> } [WHEN <pred> THEN { <body> }]* [ELSE { <body> }]. Each branch’s body/else_body is itself a <single-query> (own Statement, possibly carrying its own .union chain).
ConstraintTypeFilter
SHOW <type filter> CONSTRAINTS – entity narrows by entityType, kind narrows by constraint kind. ConstraintTypeFilter::all() (empty entity, no kind) is the default for bare SHOW CONSTRAINTS/SHOW ALL CONSTRAINTS, matching every constraint.
CountSubqueryExpr
COUNT { … } subquery expression: evaluates to the number of rows the subquery produces against the current row, run independently per row (like EXISTS { ... }, just returning a count instead of a boolean).
CreateClause
CREATE clause.
CreateConstraintClause
CREATE CONSTRAINT clause.
CreateGraphTypeClause
See Clause::CreateGraphType.
CreateIndexClause
CREATE INDEX clause.
DeleteClause
DELETE clause.
DropConstraintClause
DROP CONSTRAINT clause.
DropIndexClause
DROP INDEX clause.
DynamicLabelExpr
The payload of LabelExpr::Dynamic: the value expression plus its quantifier.
ExistsSubqueryExpr
EXISTS { … } subquery expression.
ForeachClause
FOREACH clause.
FunctionCallExpr
Function call like count(x).
GraphTypeBody
A fully parsed <graph type specification body> (CIP-178): the { ... } contents shared by CreateGraphTypeClause and AlterCurrentGraphTypeClause. Parsing is grammar-only (always succeeds once the tokens match); the CIP-178 “shall” rules (alias/label uniqueness, reference resolution, …) are enforced separately by relate-executor’s graph-type validator (validate_graph_type_body), which only CREATE GRAPH TYPE invokes – ALTER CURRENT GRAPH TYPE bodies legitimately reference element types declared by an earlier statement (e.g. ADD), which a single-body validation pass cannot see.
GraphTypeConstraintSpec
[CONSTRAINT [<name>]] FOR <node/edge type reference> REQUIRE <property name spec> <constraint verb> [OPTIONS <map>] (CIP-178 <constraint specification>) – also the target of a node/edge type spec’s trailing inline REQUIRE ... list and a property’s own inline IS KEY/IS UNIQUE (both rewritten to this same shape at parse time, per Rules 10-12).
GraphTypeEdgeTypeSpec
<source endpoint> '-' '[' [alias] (':'|IS) <identifying label> ('=>'|IMPLIES) ['{' <property types> '}'] ']' '->' <destination endpoint> (<edge type specification>).
GraphTypeInlineConstraint
An inline property-type constraint ({prop :: TYPE IS [qualifier] KEY|UNIQUE}). qualifier records which (if any) NODE/REL/ RELATIONSHIP keyword was written, so the graph-type validator can enforce that a node type must not contain REL/ RELATIONSHIP; an edge type must not contain NODE.
GraphTypeNodeTypeSpec
'(' [alias] (':'|IS) <identifying label> ('=>'|IMPLIES) [(':'|IS) <implied label> ('&' <implied label>)*] ['{' <property types> '}'] ')' (<node type specification>).
GraphTypePropertyType
One <property type>: a name, its declared value type, an optional DEFAULT ON COMMIT <value expression> (CIP-262), and an optional inline IS [NODE|REL|RELATIONSHIP] (KEY|UNIQUE) constraint (CIP-178 Rules 10-12 rewrite these into standalone GraphTypeConstraintSpecs during registration).
HasLabelExpr
A label/type predicate: n:Label, n IS Label (CIP-14), or n IS [NOT] LABELED <label-expr> / the n IS NOT <label-expr> shorthand (CIP-249).
InExpr
x IN list.
InTransactionsClause
The full IN [<concExpr>] CONCURRENT? TRANSACTIONS [OF <n> ROW|ROWS] [ON ERROR ...] [REPORT STATUS AS <var>] production trailing a CALL subquery. Parsed in its entirety (CIP-32 base batching, CIP-34 concurrency, CIP-198 retry, CIP-30 status/error) so later CIPs only need to add validation/execution on top of this AST – CIP-32 itself only implements sequential batching plus the nesting/preceding-write restrictions; concurrency and retry are parsed but currently execute as plain sequential batching (see Engine’s Clause::CallSubquery arm).
IndexHint
One USING INDEX [SEEK] <variable>:<Label>(<property>[, …]) hint.
IsNormalizedExpr
x IS [NOT] [] NORMALIZED (CIP-133). form is one of “NFC”/“NFD”/“NFKC”/“NFKD”, or None when the form is omitted (defaults to NFC at evaluation time).
IsNullExpr
x IS NULL or x IS NOT NULL.
IsTypeExpr
x IS [NOT] :: (CIP-86/CIP-87 type predicate expression); also produced by the IS [NOT] TYPED <value type> and bare x :: <value type> surface forms, which are equivalent.
JoinHint
One USING JOIN ON <variable>[, <variable>…] hint: the join key identifiers, in written order.
ListComprehensionExpr
[x IN list WHERE pred | expr]
LoadCSVClause
LOAD CSV clause.
LocalDefinition
CIP-231 DEFINE block entry: one local callable definition, parsed at the head of a <statement block> (top level or a braced nested body) and rewritten away by the front-end resolver (relate-front’s local_callables) before lowering – the planner/executor never see local callables.
LocalOutputField
One field of a procedure’s :: (a :: INT, ...) output signature.
LocalParam
One <input field signature> of a local callable (CIP-231): a field name, an optional [<typed>] <value type>, and an optional = <value expression> default (which makes the parameter optional).
MapComprehensionExpr
CIP-272 map comprehension: {k : v IN map [WHERE p] | keyExpr : valueExpr} (map source) or {item IN list [WHERE p] | keyExpr : valueExpr} (list source).
MapPair
A key-value pair in a map literal.
MapProjectionExpr
<variable> <map projection> (n {.foo, bar, baz: qux}): openCypher’s map projection, syntactically always rooted at a plain variable (expr is always an Expr::Variable). Needed for CIP-190’s near-ambiguity coverage: exists {name: exists.name} etc. must parse as a map projection on a variable named exists, not as EXISTS { <subquery> }, when the filler between the braces looks like projection items rather than subquery content (near-ambiguities.feature).
MatchClause
MATCH clause.
MergeClause
MERGE clause.
NodePattern
A node pattern like (n:Label {prop: value}).
OrderByItem
An item in ORDER BY.
PathQuantifier
The {min, max} bounds of a CIP-28 quantifier (*, +, {m,n}, {m,}, {,n}, {,}, {n}). max = None means unbounded. Bounds are already normalized and validated by the parser: {,} -> {0,} and the bounds checks (upper bound > 0, lower bound <= upper bound) are enforced at parse time, so every PathQuantifier that reaches the AST is legal.
PatternComprehensionExpr
[p = (n)–>() | expr] or [(n)–>() | expr]
PatternPath
A path pattern like (a)-[r]->(b), optionally named: p = (a)-[r]->(b).
PatternPredicateExpr
Pattern used as boolean predicate in WHERE, e.g. (n)-[:REL]->(m)
PropertyAccess
Property access like n.prop.
QuantifiedPathPattern
A quantified path pattern: a parenthesized subpath (elements), optionally assigned a subpath variable (e.g. (p2 = (x)-->(y))*) and/or a trailing WHERE evaluated once per iteration, followed by a quantifier. Appears as a PatternElement alongside plain Node/Relationship elements so it composes freely with them by concatenation.
QuantifierExpr
all/any/none/single(x IN list WHERE pred)
ReduceExpr
reduce(accumulator = init, x IN list | expression)
RelPattern
A relationship pattern like -[r:TYPE {prop: value}]->.
RemoveClause
REMOVE clause.
RemoveItem
A single item in a REMOVE clause.
ReturnClause
RETURN clause.
ReturnItem
A single item in a RETURN clause.
ScanHint
One USING SCAN <variable>:<Label> hint. The label is retained at the same fidelity as IndexHint’s properties, so the hint family keeps one shape; the planner’s scan fork keys on the variable.
SearchClause
<search clause>: the SEARCH ... IN (<source specification clause>) [SCORE AS ...] subclause of MatchClause.
SearchCombineSpec
<combined specification clause>: COMBINE ( <weighted source clause>, ... ) USING WRRF [ WITH CONSTANT <expr> ] [ LIMIT <expr> ].
SearchIndexSpec
<index specification clause>: { VECTOR | FULLTEXT } INDEX <index name> <index for and control clause>.
SearchWeightedSource
<weighted source clause>: <source specification clause> [ WEIGHT <value expression> ].
SetClause
SET clause.
SetItem
A single item in a SET clause.
ShortestPathExpr
shortestPath() / allShortestPaths()
ShowConstraintsClause
SHOW [<type filter>] CONSTRAINTS [YIELD ...] [WHERE ...] (CIP-85’s observation surface, needed by CIP-100 to expose a property type constraint’s normalized propertyType; the <type filter> grammar is CIP-62/CIP-64/CIP-74’s [ALL] [NODE|REL[ATIONSHIP]] [PROPERTY]? (UNIQUE[NESS]|KEY|EXIST[ENCE]|TYPE) surface). Mirrors ShowFunctionsClause otherwise.
ShowCurrentGraphTypeClause
See Clause::ShowCurrentGraphType.
ShowDatabasesClause
SHOW DATABASE[S] [<filter>] [YIELD ...] [WHERE ...] (CIP-42/CIP-68).
ShowFunctionsClause
SHOW FUNCTIONS [YIELD ...] [WHERE ...] — the built-in function catalog (CIP-245/CIP-247/CIP-263 discoverability scenarios). A minimal, dedicated clause rather than a generic SHOW-command framework: only the function catalog is modeled, not indexes/constraints/databases (out of this batch’s scope). where_expr is embedded here (rather than requiring a standalone WHERE clause, which this AST has no variant for — WHERE is always embedded in the clause that produces its rows, matching MatchClause) so SHOW FUNCTIONS YIELD name WHERE name = 'x' RETURN name parses as a single clause producing already-filtered rows.
ShowGraphTypeClause
See Clause::ShowGraphType.
ShowIndexesClause
SHOW [ALL|RANGE|POINT|TEXT|FULLTEXT|VECTOR|LOOKUP] INDEXES [YIELD ...] [WHERE ...] (CIP-11). Mirrors ShowConstraintsClause; kind_filter is None for bare SHOW INDEXES/SHOW ALL INDEXES (every index kind).
ShowProceduresClause
SHOW PROCEDURE[S] [YIELD ...] [WHERE ...] (CIP-68 grammar foundation).
ShowRolesClause
SHOW [ALL|POPULATED] ROLE[S] [WITH USER[S]] [YIELD ...] [WHERE ...] (CIP-68).
ShowServersClause
SHOW SERVER[S] [YIELD ...] [WHERE ...] (CIP-68).
ShowSettingsClause
SHOW SETTING[S] [<names>] [YIELD ...] [WHERE ...] (CIP-68 grammar foundation). names is the optional expression naming the setting(s) to filter to: a STRING or a LIST (or a null/parameter resolving to either). The executor selects from its own fixed settings catalog – a null selects nothing, an empty list means “no filter” (CIP-253), and any other shape is a TypeError.
ShowTransactionsClause
SHOW TRANSACTION[S] [<id-list>] [YIELD ...] [WHERE ...] (CIP-68 grammar foundation). ids is the optional comma-separated list of transaction-id expressions to filter to (empty = no filter) – Relate has no live-transaction catalog, so it’s parsed but never changes the (always empty) result.
ShowUsersClause
SHOW USER[S] [YIELD ...] [WHERE ...] / SHOW CURRENT USER (CIP-68).
StandaloneOrderByClause
CIP-168: a standalone <order by and page statement>. See Clause::StandaloneOrderBy.
Statement
AST node types for the Cypher parser.
StringMatchExpr
STARTS WITH, ENDS WITH, CONTAINS. op is the operator’s AST spelling, a &'static str drawn from the parser’s operator-constant table (parser/mod.rs, ADR-0505 §2) — never a runtime-built String.
SubscriptExpr
expr[index] or expr[from..to]
TerminateTransactionsClause
TERMINATE TRANSACTION[S] <id-list> [YIELD ...] (CIP-68 grammar foundation). Since ShowTransactions never reports a live transaction, every requested id is reported as not found.
UnaryExpr
Unary expression like NOT x or -x. op is the operator’s AST spelling, a &'static str drawn from the parser’s operator-constant table (parser/mod.rs, ADR-0505 §2) — never a runtime-built String.
UnionPart
Represents a UNION or UNION ALL between statements.
UnwindClause
UNWIND clause. A FOR <variable> IN <expression> clause normalizes here at parse time – the same expr/alias pair with UnwindClause::for_syntax recording the source spelling – so every downstream consumer (validation, lowering, planning, execution) treats the two spellings identically, exactly as the CIP requires (no new operators). The flag is the parse-spelling record the FOREACH-body renderer reads (FOR, not UNWIND, in the 42I01 text) — the one consumer that must distinguish the spellings.
UseClause
USE <graph-expr> clause.
WhenBranch
One WHEN <predicate> THEN <single-query> branch of a ConditionalClause.
WhenClause
WHEN … THEN … part of a CASE: the condition is always a predicate (the simple form’s operand = value lowering included).
WithClause
WITH clause.
YieldItem
One YIELD <name> [AS <alias>] item of a procedure call or catalog command. alias is None when no AS was written, so “no alias” is represented by the optional itself rather than an empty-string sentinel in a parallel array.
YieldList
A clause’s YIELD tail, modeled once: the explicit items in source order plus whether YIELD * was written. Empty items with all == false means no YIELD at all (the grammar never reads an empty explicit list).

Enums§

AlterCurrentGraphTypeTarget
What an ALTER CURRENT GRAPH TYPE verb applies: an inline { <body> }, or — ADR-0211’s ALTER CURRENT GRAPH TYPE SET GRAPH TYPE <name> — a reference to a CREATE GRAPH TYPE-declared named type, promoted to current. The invalid combinations (a verb body and a named reference) are unrepresentable; no parser placeholder and no consumer-side doc invariant.
AlterGraphTypeVerb
The four ALTER CURRENT GRAPH TYPE verbs (CIP-176/CIP-182 overview scope): SET replaces the whole current graph type (and, as observed live, every constraint in the database); ADD extends it; ALTER replaces an existing element type (matched by identifying label) with a new declaration; DROP removes the element types named in its body.
AnyNodeMode
CIP-257’s “Future improvements” any-node keyword, controlling how many synthetic (:AnyLabel {}) nodes an unconstrained relationship endpoint gets: Separate (the default, whether or not the keyword is written) – one any-node per relationship that needs one; Single – every unconstrained endpoint across the whole graph type shares one any-node.
CallScope
The (...) variable scope clause on a CALL subquery (CIP-141).
ChronologicalOp
The four chronological comparison operators (Cypher 25): a IS [NOT] BEFORE | AFTER | SAME INSTANT | SAME REPRESENTATION b. The four words stay non-reserved identifiers everywhere else (TemporalChronologicalCompare’s non-reserved-identifier scenario), so the parser recognizes them contextually after an IS introducer, the same policy as TYPED/NORMALIZED/LABELED.
Clause
All clause types in the Cypher language.
Concurrency
CIP-34 IN [<concExpr>] CONCURRENT? TRANSACTIONS concurrency modifier.
ConstraintEntityFilter
The entity half of a SHOW <type filter> CONSTRAINTS filter – Any for bare SHOW CONSTRAINTS/SHOW ALL CONSTRAINTS or a kind-only filter with no NODE/REL[ATIONSHIP] prefix.
ConstraintKindFilter
The constraint-kind half of a SHOW <type filter> CONSTRAINTS filter. None (on ConstraintTypeFilter::kind) means every kind (bare SHOW CONSTRAINTS/SHOW ALL CONSTRAINTS/SHOW NODE CONSTRAINTS).
DatabaseFilter
Which database(s) a SHOW DATABASE[S] clause reports (CIP-68’s DEFAULT/HOME singular-only forms).
Direction
Direction of a relationship.
DisjointBy
DISJOINT BY operand.
DynamicLabelQuantifier
A dynamic label/type expression’s quantifier: $(expr) (Default), $all(expr) (All), or $any(expr) (Any). Default and All share conjunction semantics for list-valued expr (and are otherwise interchangeable); Any is disjunction. Kept distinct from All so callers (e.g. CREATE/MERGE label resolution) can reject the explicit $any(...) form while still accepting the implicit-all $(...) form.
ExecutableBy
The EXECUTABLE BY <user> selector of SHOW FUNCTIONS/SHOW PROCEDURES: the commands a user may execute. The bare EXECUTABLE form applies no privilege filter, so it is the same state as writing no selector at all (None on the clause) and has no variant of its own.
Expr
All expression types.
ExprEdge
One direct child of an Expr node, in the table’s visit order.
ExprEdgeMut
Mutable twin of ExprEdge.
FunctionScope
Scope filter for SHOW [ALL | BUILT IN | USER DEFINED] FUNCTIONS (CIP-84/CIP-157). See ShowFunctionsClause::scope.
GraphTypeConstraintVerb
GraphTypeElementRef
A <node type reference> / <edge type reference> (CIP-178): how a node/edge type spec’s endpoint, or a constraint specification’s FOR target, names the element type it applies to.
GraphTypeEntityQualifier
GraphTypeInlineVerb
GroupBySpec
<group by clause> on RETURN/WITH.
IndexKind
The DDL index kind (CIP-11 RANGE/POINT/TEXT, CIP-38 FULLTEXT, the pre-existing VECTOR, and the label/type-token LOOKUP index).
InterpPart
One segment of a CIP-261 interpolated string literal.
LabelExpr
A GQL label/relationship-type expression (CIP-14): & (conjunction), | (disjunction), ! (negation), % (wildcard – matches any non-empty label set, or any relationship since every relationship has exactly one type), parenthesized grouping (folded directly into the tree, so no explicit Group variant is needed), and CIP-249’s dynamic label name $(expr). The legacy colon-conjunction shorthand :A:B:C lowers to And([Label(A), Label(B), Label(C)]), and the legacy relationship-type disjunction shorthand :A|B lowers to Or([Label(A), Label(B)]), preserving pre-CIP-14 behavior exactly.
LabelsFunctionOp
The operator of a SET labels(<expr>) <op> <expr> item.
LiteralValue
A literal value in the AST.
LocalCallableKind
DEFINE PROCEDURE vs DEFINE FUNCTION (CIP-231). The two namespaces are independent (CIP-230: a procedure and a function may share a name).
LocalDefinitionBody
The body of a local callable definition (CIP-231).
LocalOutput
A declared output type of a local callable (CIP-231): the procedure form :: (a :: INT, ...) or the function form :: STRING.
MapProjectionItem
One item of a <map projection>.
MatchMode
CIP-51/CIP-60 match mode: governs the default relationship-uniqueness pool that spans one MATCH clause’s entire comma-separated graph pattern.
OnErrorMode
ON ERROR ... mode.
OptionsForm
The optional OPTIONS tail of a schema DDL command (ADR-0489): the three states the old options + options_param pair encoded in a comment only.
PageStage
One stage of a CIP-168 standalone <order by and page statement>. Neo4j 2026.05 accepts ORDER BY/OFFSET/SKIP/LIMIT in any order at the start of the clause and applies them sequentially in the order written – not the fixed ORDER-BY-then-OFFSET-then-LIMIT semantic order the CIP-168 text describes (e.g. LIMIT 3 OFFSET 1 keeps 3 rows then drops the first 1 of those, rather than offsetting first). A Vec<PageStage> records exactly the written sequence so execution can replay it faithfully.
PathCount
The <number of paths>/<number of groups> non-terminal (extended by CIP-191 to accept a $parameter). A literal is validated (> 0) at parse time; a parameter is validated at runtime once its value is known (CIP-191 “Non-negative integer” rule).
PathMode
CIP-51 path mode: an explicit restrictor on one path pattern’s candidate bindings. PatternPath::mode is None when no explicit keyword was written – the resolved default is Walk.
PathSelector
CIP-73 path selector prefix (<path search prefix>). PatternPath has no selector when this is None – the path pattern is then non-selective, equivalent to an implicit ALL.
PatternElement
A pattern element is either a node pattern, a relationship pattern, or a quantified path pattern (CIP-28).
PreambleMode
The statement preamble mode (CIP-150): which of EXPLAIN/PROFILE heads the statement, or neither. The preamble grammar is top-level only and each keyword is admitted at most once, so exactly one mode heads a statement — never a pair of flags that could disagree.
PredefinedKind
The predefined leaf type names from the <value type> grammar.
RetryFallback
The THEN CONTINUE|BREAK|FAIL fallback mode of ON ERROR RETRY.
RoleModifier
The [ALL|POPULATED] modifier of SHOW ROLE[S] – Any (bare SHOW ROLE[S]) and All (SHOW ALL ROLE[S]) report the identical row set (every role); Populated narrows to roles with at least one member.
SchemaEntityType
Which kind of graph element a CREATE INDEX / CREATE CONSTRAINT FOR pattern targets (CIP-11’s relationship-pattern generalization: FOR (n:Label) vs. FOR ()-[r:TYPE]-() in all four direction spellings).
SchemaName
The name of an index or constraint in CREATE INDEX / CREATE CONSTRAINT / DROP INDEX / DROP CONSTRAINT: either a literal identifier or a $param reference resolved against the query’s parameter map at execution time (CIP-134).
SearchKind
<index specification clause>: { VECTOR | FULLTEXT } INDEX.
SearchSpec
<source specification clause>: <index specification clause> | <combined specification clause>.
TypeExpr
A parsed <value type> per the CIP-86 grammar: the vocabulary used by the CIP-87 type predicate expression (IS [NOT] :: <type>) and, once CIP-90 ships, by valueType().
VectorCoordKind
A vector coordinate type (CIP-216): the six numeric types valid inside VECTOR<...>/VECTOR(...). Int64/Float64 double as ordinary plain property types (aliases for INTEGER/FLOAT, see PredefinedKind) outside a vector type; the other four (Float32, Int8/Int16/ Int32) are valid only as a vector coordinate type.
WithOrigin
Which surface syntax produced a WithClause. Plain WITH, CIP-206’s LET, and CIP-203’s FILTER all desugar into the same WithClause so they share WITH’s projection/aggregation/ORDER BY/SKIP/LIMIT/WHERE execution machinery and its generic variable-scope tracking – but LET and FILTER each carry restrictions ordinary WITH does not (LET: no shadowing of an in-scope variable, no sibling/forward/self reference within one LET’s item list, no aggregation function in a value expression; FILTER: its search condition’s declared type must be Boolean). The origin is recorded so the validation passes enforcing those extra rules only fire for the syntax that actually carries them.
YieldMode
A clause’s yield mode, derived once from its YieldList: YIELD * projects every column, a bare clause its default table, and an explicit list its named (post-alias) columns. Consumers select their behavior from this instead of each re-testing (all, is_empty).