docs(query): commit query-language EBNF and finalize edge traversal (S-03/S-04) - #89
Open
dotnetcadet wants to merge 2 commits into
Open
docs(query): commit query-language EBNF and finalize edge traversal (S-03/S-04)#89dotnetcadet wants to merge 2 commits into
dotnetcadet wants to merge 2 commits into
Conversation
Add the normative query-language grammar at docs/grammar/ograph-query.ebnf covering the full surface syntax (entry keyword, filter/sort/page/project/edge clauses, precedence-layered filter expressions, string/collection/numeric functions, any/all lambdas, literals, $var variables, # comments), grounded in .designing/query.ograph and the committed Syntax lexer/parser tests, with a RECONCILIATION section recording rejected design-sketch constructs. Rewrite specification.md §5: reference the grammar as normative (§5.2), define the operator/function vocabulary deferred by §2.3.6 (§5.3), specify clause evaluation order (§5.4) and paging modes (§5.5), and finalize edge traversal and scoping (§5.6) — the path form is canonical, the arrow form is rejected (not lexable; unsupported by tests; the /-selector matches the GDM edge model). Closes #20 Closes #21 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Reconcile normative prose, grammar, and executable ground truth for the query-language grammar (issues #20/#21): - §5.5: drop the "token MUST NOT be combined with skip" exclusion; skip is an optional starting offset for cursor mode, matching page-set and the golden CompleteParseSuccessful test. - §5.6.2/§5.6.3 + edge-clause grammar comment: a scope always carries an implicit alias (entry Node Name for root, Edge Name for edge scopes) that can head a qualified path, so companies/addresses and providers/languages re-anchor as the worked examples require. - EdgeParseSuccessTest: add Assert.Empty(document.Errors) so the edge path-form decision actually rests on a passing assertion. - EBNF RECONCILIATION R6: record the trailing .v(employees).project() fragment so the completeness invariant holds over the whole sketch. - EBNF Provenance: flag length() and the $ sigil as forward-looking normative additions not yet in FunctionType.cs / the lexer (X-01/X-02/X-03). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Delivers roadmap features S-03 [O01.01.01.03] (committed query-language EBNF) and S-04 [O01.01.01.04] (edge-traversal syntax and scoping) on one branch. Adds a normative grammar file and rewrites specification.md §5 only; §2/§3/§4/§6 are untouched.
The grammar and semantics are grounded in the real corpus (
.designing/query.ograph, three worked queries) and the committed Syntax lexer/parser tests (libraries/Assimalign.OGraph.Syntax/tests/**). Where the design sketch and the executable tests diverged, the tests govern (they assert what the parser accepts and which diagnostics it raises), and every rejected sketch construct is recorded with its canonical replacement.Changes
docs/grammar/ograph-query.ebnf(new, normative). Full surface syntax: entry keyword (node/n/vertex/v);.filter/.sort/.page/.project/.edgeclauses; precedence-layered filter expressions (or → and → comparison → additive → multiplicative → primary); binary operator table; grouping;any/alllambda forms (braced or bare body, empty allowed); string/collection/numeric functions; sort keys with nested key sets; offset and cursor paging; nested projections, aliases, member functions,@-directives; literals (string/number/boolean/null);$varvariables;#comments. ARECONCILIATIONsection lists every rejected sketch construct (arrow edge form, brace-less/positional clause bodies, colon aliasing,r(...)entry,@-as-variable) with rationale.docs/specification.md§5 (rewritten): §5.2 references the grammar as normative; §5.3 defines the operator/function name vocabulary that §2.3.6 defers to S-03; §5.4 specifies full clause evaluation-order semantics (filter → sort → page → project); §5.5 specifies offset and cursor paging; §5.6 records the edge-traversal decision, canonical syntax, and scope-resolution rules. The §5.0 intro and §5.1 rule 3 now point at the grammar file and §5.4.Work items resolved
Closes #20
Closes #21
Testing & verification
.designing/query.ographqueries and every lexer/parser test against the grammar: each is either derivable or listed inRECONCILIATION.[/]are not tokens, so-[has]->is not lexable), the passing edge tests (path form only,Assert.Empty(document.Errors)), and the GDM edge model (§2.3.3,spec-notes.mdwalk/trail/path).🤖 Generated with Claude Code