Compile GASP metrics into an Ossie model
compile_modelCompiles the GASP Standard metrics your mapping covers into your Ossie semantic model, adding a gasp_ metric per fully mapped formula and listing any entries still missing field pairs.
Instructions
Compile the GASP Standard metrics your mapping covers into your Apache Ossie semantic model. Takes the same input as validate_mapping (a GASP adapter, or an Ossie mapping with your semantic_model) and returns your model with a gasp_ metric for every formula entry whose fields are all mapped (main formula, O and M forms, variants and named breakdowns): a direct OSSIE_SQL_2026 expression over your datasets and fields where the expression language can state it, else staged through a dataset whose source is the compiled SQL over your tables in your warehouse dialect (a gasp_staged_ dataset with one row per period, or for Net and Gross Revenue Retention the table gasp_account_cohorts, one row per customer per period, which their expressions sum), reading a period spine table you provide (one row per reporting period; gasp.period_spine unless you pass period_spine). Entries with unmapped pairs are left out and listed with the pairs they need; recompiling replaces every gasp_ metric and staged dataset and leaves the rest of the model as it was. The compiled metrics are checked against the bundled Ossie model schema and GASP's reference checks. A GASP adapter compiles into the model synthesised from its tables and columns, which validate_mapping shows. Pass metrics or department to compile a subset, output 'report' to get the coverage without the document.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"adapter": "<adapter>"
},
"name": "compile_model"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| output | No | 'model' (default) returns the coverage report with the compiled model as YAML; 'report' returns the coverage alone. | |
| adapter | Yes | Your mapping as text: a GASP adapter (JSON; schema: https://gaspwiki.com/schemas/gasp-adapter-v1.json) or an Ossie mapping document (YAML or JSON). Check it with validate_mapping first. | |
| dialect | No | SQL dialect of the staged sources: postgres (also Redshift), snowflake, bigquery or databricks. Omit to use the adapter's warehouse when it names one of them, else postgres. | |
| metrics | No | Comma-separated metric names, abbreviations, aliases or formula ids to compile (each resolved as in lookup_metric), with their forms, variants and breakdowns. Omit for every metric. | |
| department | No | Compile every metric of one department (e.g. 'Core'); combines with metrics. | |
| period_spine | No | The table of (period_start, period_end) rows the staged sources read, as it is named in your warehouse. Default gasp.period_spine. | |
| semantic_model | No | With an Ossie mapping: your semantic model document (YAML or JSON). The metrics compile into it, reading its sources and field expressions. Without it, dataset names stand for tables and every field is its bare column. |