Skip to content

[core-spec] Add Relational Query Interface specification - #354

Open
justint-db wants to merge 2 commits into
apache:mainfrom
justint-db:add-relational-query-interface-spec
Open

[core-spec] Add Relational Query Interface specification#354
justint-db wants to merge 2 commits into
apache:mainfrom
justint-db:add-relational-query-interface-spec

Conversation

@justint-db

@justint-db justint-db commented Sep 2, 2026

Copy link
Copy Markdown

Summary

Adds the Relational Query Interface specification to core-spec/ as relational_semantics.md. It defines Layer 2, the Relational Interface of the layered Ossie query interface: how a semantic layer exposes an Ossie model to SQL-native BI and AI tools as a set of related SQL relations, and the semantics and correctness guarantees of querying the model's measures through ordinary SQL.

Grounded in Hyde and Fremlin's Measures in SQL (https://arxiv.org/abs/2406.00251), a measure is a column evaluated by a MEASURE() aggregate. A tool writes the SQL it always would and substitutes MEASURE(name) for a raw aggregate; the engine evaluates each measure at its own grain, so results stay correct across joins, filters, and grouping.

It realizes two Ossie design proposals: the BI-Semantic Layer Interface and the Layered Query Interface. It is the "semantics of a layer" companion foreshadowed in #344, sits alongside the foundational semantics in #246, and builds on the dataset-scoped metrics proposed in #343.

Related Issues

Related: #246, #343, #344.

Checklist

Specification

  • Spec changes are included in core-spec/ and follow the existing structure
  • Spec changes have been discussed on the mailing list or in a linked issue — the intent to open this PR was announced on dev@ossie.apache.org; on-list discussion of its contents is still to come
  • Breaking changes to the spec are clearly called out in the summary — N/A, purely additive (new file)

Ontology

  • Ontology changes in ontology/ are consistent with spec changes — N/A, no ontology change
  • New or modified terms are defined and documented — N/A

Converters

  • Converter logic in converters/ is updated to reflect spec or ontology changes — N/A, no converter change
  • New converters include tests under the converter's test directory — N/A, no new converters

Validation

  • Validation rules in validation/ are updated if the spec changed — N/A, no schema/validation change
  • New validation cases are covered by tests — N/A

Documentation

  • docs/ is updated to reflect any user-facing changes — N/A, the change is itself a spec document
  • New features or behaviors are documented with examples where appropriate — the spec includes worked examples
  • CONTRIBUTING.md is updated if the contribution process changed — N/A

Examples

  • examples/ are added or updated for any new spec constructs or converter support — N/A, no new constructs requiring example models

Tests

  • All existing tests pass (pytest / CI green) — N/A, documentation only, no code
  • New functionality is covered by tests — N/A

Compliance

  • ASF license headers are present on all new source files
  • No third-party dependencies are added

AI disclosure

Per the ASF Generative Tooling Guidance, this contribution was prepared with AI assistance. All specification decisions and design choices are mine. I have reviewed and verified every change.

Adds core-spec/relational_semantics.md, a draft specification for querying
Ossie semantic models through SQL extended with measure semantics -- Layer 2
of the layered query interface (the Relational Interface).
Syncs the relational_semantics.md spec with the upstream draft, adding
Appendix D relating the design to Hyde and Fremlin's Measures in SQL.
@justint-db
justint-db marked this pull request as ready for review September 3, 2026 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant