Skip to content

GQ: general Boolean OR with explicit grouping and precedence #651

Description

@ragnorc

Problem

Read predicates cannot express a general alternative across different properties. For example, this 0.10.0 query fails to parse at or:

query q() {
  match { $p: Person $p.name = "Alice" or $p.name = "Bob" }
  return { $p.slug }
}

Literal-list membership already works for some same-field alternatives (including tested enum membership). It does not provide general Boolean composition across properties or nested predicate groups.

Proposed change

Add typed Boolean disjunction with documented conjunction/negation precedence and grouping. Define null semantics, variable scope and evaluation behavior. Start with read predicates; explicitly decide whether the same expression grammar is shared by update/delete predicates rather than silently making their contracts diverge.

Acceptance criteria

  • Same-property and cross-property OR, nested grouping, OR combined with existing conjunction/negation, and nullable comparisons behave consistently.
  • Type errors and unsupported variable scopes are rejected during compilation.
  • A row matching both alternatives is returned once unless ordinary traversal multiplicity produces additional rows.
  • Planner pushdown preserves expression semantics; include indexed and scan paths.

This request concerns Boolean predicates, not choosing alternative edge types. Grammar, type checking.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureFeature proposalneeds-triageAwaiting maintainer triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions