Skip to content

docs(examples): add the GASP SaaS core example - #773

Open
403pagelabs wants to merge 10 commits into
apache:mainfrom
403pagelabs:examples-gasp-saas
Open

403pagelabs wants to merge 10 commits into
apache:mainfrom
403pagelabs:examples-gasp-saas

Conversation

@403pagelabs

Copy link
Copy Markdown
Contributor

Adds the Core department of the GASP Standard (Generally Accepted SaaS Principles, https://gaspwiki.com) as an example set in the layout of the flights files: an ontology, a semantic model and the mapping between them. GASP is an open standard for SaaS metrics. I offered this on dev@ in the [INTRO] thread (https://lists.apache.org/thread/hyo7xqcyn2339cjtnn31bwsjnxd6rxs3) as a candidate for the roadmap's "Industry / Domain-Specific Semantic Models".

What is in it:

  • gasp_saas.ontology.yaml: 6 entity types (one per dataset), their relationships with multiplicity and 46 value types with enum constraints.
  • gasp_saas.semantic_model.yaml: 6 datasets (revenue_event, cost_event, customer, subscription, survey_response, financials), 5 relationships and 39 metrics. The metrics are MRR, ARR, NRR, GRR, logo churn, CAC, LTV, gross margin, Rule of 40 and the MRR movements, with Operating and Market forms where the standard defines both. 23 of them are OSSIE_SQL_2026 expressions, with filtered aggregates in the FILTER (WHERE ...) form. The other 16 need a cohort, a prior period or an opening snapshot, which an expression cannot state, so each reads a per-period dataset whose source is the compiled SQL. The reason is in the GASP extension on that dataset.
  • gasp_saas.mapping.yaml: the ontology mapped onto the model. It names the other two files by name and relative IRI, so the cross-document checks run.

The files are generated from the standard's formulas by its exporter (https://github.com/GASP-Standard/standard, Apache 2.0) and I will refresh them from there when the standard changes. The full export, 363 metrics, stays in that repository.

All three pass validate.py with the cross-document checks. The PR adds their validate lines and path filter to validation-ci.yml beside the flights set. The nonportable_extensions entries use the GASP token registered in #765. With main merged in at 8bbffde, validation/tests/ gives 819 passed, 1 skipped and the Python and scripts suites pass.

A runnable demo sits beside the source: data for the six tables, one query per metric and the expected values, for DuckDB or Postgres (https://github.com/GASP-Standard/standard/tree/main/standard/exports/ossie/example/demo). GASP's own test suite runs it on DuckDB and compares each value with the compiled SQL.

Two things a reviewer may want to weigh in on. The staged datasets carry their Snowflake, BigQuery and Databricks sources in the GASP extension, because source is one string. That makes the semantic model about 150 KB, far larger than the flights one. If the size is a problem I can drop the other dialects from this copy and keep them in the full export.

The Core department of the GASP Standard (Generally Accepted SaaS Principles,
https://gaspwiki.com) as three documents in the layout of the flights set: an
ontology (6 entity types, 46 value types with enum constraints), a semantic
model (6 datasets, 5 relationships, 39 metrics; 16 staged per-period datasets
for the formulas the portable language cannot state in one expression) and
the mapping between them, referencing the ontology by name and relative IRI.

Generated from the standard's canonical formulas by its exporter and kept in
sync there; every metric is an OSSIE_SQL_2026 expression where the language
can state it, with filtered aggregates in the FILTER (WHERE ...) form. All
three files pass validate.py, including the cross-document checks, and are
added to the validation workflow. A runnable demo (data, one query per
metric and the expected values, for DuckDB or Postgres) lives beside the
source: https://github.com/GASP-Standard/standard/tree/main/standard/exports/ossie/example
The exporter now writes each field and metric expression as the top-level
sql form alone, as the flights example does since apache#640, instead of a
one-entry dialects list. No expression text changes; all three files still
pass validate.py.
…tensions

Regenerated from the GASP Standard after apache#522 and apache#691: the three documents
declare 0.3.0.dev0 and carry the GASP payloads under nonportable_extensions
with data as an object. They pass validate.py, the cross-document checks
included.
# Conflicts:
#	.github/workflows/validation-ci.yml
# Conflicts:
#	.github/workflows/validation-ci.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant