Problem
An ordinary traversal removes roots with no matching neighbor. There is no optional traversal construct to retain those roots and return nullable neighbor/edge bindings. Clients retrieving an entity with optional context need separate queries or client-side joins.
An attempted optional { ... } block fails parsing on 0.10.0; this is a requested language capability, not an existing syntax contract being violated.
Proposed change
Define optional match/traversal semantics with nullable bindings and clear variable scope. A root that matches the required portion should survive when the optional pattern has no match. Specify multiple matches, filters inside/outside the optional block, chained optional hops and interaction with aggregation/order/limit.
Acceptance criteria
- Root rows with zero, one and multiple optional matches have documented multiplicity.
- Nullability is reflected in compile-time result types/descriptors and JSON output.
- Optional edge bindings expose properties only when the edge exists; parallel edges retain multiplicity.
- Filters do not accidentally convert an optional traversal into a required one unless explicitly requested.
- Indexed and scan execution produce the same rows, including empty graphs and self-loops.
Scope this issue to optional traversal. Nested maps/collections can be designed separately rather than making them prerequisites. Grammar, type checking, executor.
Problem
An ordinary traversal removes roots with no matching neighbor. There is no optional traversal construct to retain those roots and return nullable neighbor/edge bindings. Clients retrieving an entity with optional context need separate queries or client-side joins.
An attempted
optional { ... }block fails parsing on 0.10.0; this is a requested language capability, not an existing syntax contract being violated.Proposed change
Define optional match/traversal semantics with nullable bindings and clear variable scope. A root that matches the required portion should survive when the optional pattern has no match. Specify multiple matches, filters inside/outside the optional block, chained optional hops and interaction with aggregation/order/limit.
Acceptance criteria
Scope this issue to optional traversal. Nested maps/collections can be designed separately rather than making them prerequisites. Grammar, type checking, executor.