Repository navigation
docs(examples): add the GASP SaaS core example - #773
Open
403pagelabs wants to merge 10 commits into
Open
403pagelabs wants to merge 10 commits into
403pagelabs wants to merge 10 commits into
Conversation
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
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.
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 areOSSIE_SQL_2026expressions, with filtered aggregates in theFILTER (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 whosesourceis 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.pywith the cross-document checks. The PR adds their validate lines and path filter tovalidation-ci.ymlbeside the flights set. Thenonportable_extensionsentries use theGASPtoken registered in #765. Withmainmerged in at8bbffde,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
sourceis 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.