Apache Ossie export
Astrato exports a connected semantic layer as Apache Ossie YAML. The export is generated from the exact current Semantic Layer V3 draft. It does not publish the layer, read the published engine model, or query the datasource.
The file has two complementary parts:
- a standard Apache Ossie projection for other tools;
- a versioned Astrato extension containing the exact authoring document and migration metadata.
The current target is Snowflake’s Apache Ossie 0.1.1 single-model import shape. A file starts with
version: 0.1.1 and has name, datasets, optional relationships and metrics, and
custom_extensions at the root. The model is also checked against Apache’s published 0.1.1 schema.
Before exporting
Section titled “Before exporting”Resolve every semantic-layer validation error and warning. Export is permissive about Ossie portability, but it is not permissive about an invalid or ambiguous source document. This distinction keeps expected interchange limitations separate from problems in the model itself.
You do not need to publish. Measures are compiled from the current draft. If the draft changes while the export runs, request a fresh export.
Use either:
- Developer View → Export → Export Ossie; or
- the
astrato_semantic_layer_export_ossieMCP tool withsl:read.
The MCP result includes the exact draft revision, portability diagnostics, and a resource_link to
the YAML file.
Why measures have two forms
Section titled “Why measures have two forms”Apache Ossie expects a reusable metric expression. The semantic engine compiles a complete query.
For a simple measure, the exporter can safely take the single outer expression between SELECT and
FROM and remove the generated alias.
For example, an engine query such as:
SELECT SUM("amount") AS "Revenue"FROM "orders"becomes this portable metric expression:
SUM("amount")Simple measures may combine ordinary aggregates and arithmetic, including a ratio such as
SUM(amount) / COUNT(order_id). A measure is advanced when it contains totals, filters, scope,
fan-out behavior, window ordering or partitioning, parameters, UDF calls, measure references, or
opaque engine options. If the exporter cannot prove that one reusable outer expression is safe, it
treats the measure as advanced.
Advanced measures still appear in the standard metric list, but their expression is comment-only:
-- ASTRATO_REFERENCE_ONLY_MEASURE: Total Revenue uses advanced semantics that Apache Ossie cannot represent as one reusable metric expression. The engine-generated query below is context for people and AI agents; it is not directly executable as this metric.-- SELECT SUM("amount") OVER () AS "Total Revenue"-- FROM "orders"Every line is commented deliberately. The text helps a person or an AI assistant understand and
adapt the calculation for the target system, but it is not directly executable as the Ossie metric.
The complete unmodified engine query is also stored in the Astrato extension with
portability: "reference-only".
Portable and extension-only content
Section titled “Portable and extension-only content”| Astrato content | Standard Ossie projection | Astrato extension |
|---|---|---|
| Physical table or custom SQL view | Dataset source | Exact V3 view |
| Inline table | Generated SQL dataset source | Exact typed columns and CSV |
| Physical field | Dataset field | Exact V3 field and datatype |
| Ordinary field dimension | Dataset field with dimension metadata | Exact result type, format, date options, and synonyms |
| Bucket or drill-through dimension | Not projected | Exact definition |
| Many-to-one relationship | Relationship | Exact join and conditions |
| One-to-many relationship | Inverted to Ossie’s many-to-one direction | Original direction and cardinality |
| Many-to-many or non-equality relationship | Not projected | Exact join and conditions |
| Simple measure | Reusable engine SQL expression | Complete compiled query |
| Advanced measure | Comment-only reference expression | Complete compiled query and reference-only status |
| UDF definition | Not projected | Exact definition and metadata |
Calculated field SQL is preserved as authored and may need adaptation in the target system. Exact Astrato datatypes remain in the extension because Ossie 0.1.1 does not define a field datatype.
Dialects and datasource aliases
Section titled “Dialects and datasource aliases”- Snowflake compiles as Snowflake SQL and uses the
SNOWFLAKEOssie dialect. - PostgreSQL, Supabase, and Dremio compile as PostgreSQL SQL. Ossie 0.1.1 has no PostgreSQL
dialect, so the file uses
ANSI_SQLwhile the extension records the actual data source type. - Databricks uses
DATABRICKS. - Other data sources use
ANSI_SQLwhen Ossie 0.1.1 has no matching dialect. - Google Sheets is not exportable.
Portability diagnostics
Section titled “Portability diagnostics”Diagnostics are machine-readable so people and AI agents do not need to infer meaning from prose:
REFERENCE_ONLY_FIELD— calculated field SQL may require target-specific adaptation.REFERENCE_ONLY_MEASURE— the metric contains comment-only advanced SQL.EXTENSION_ONLY_DIMENSION— a bucket, drill-through or mapped-values dimension exists only in the extension.EXTENSION_ONLY_DIMENSION_OPTIONS— a portable field dimension has format or date options only in the extension.EXTENSION_ONLY_RELATIONSHIP— the join cannot enter the standard relationship list.EXTENSION_ONLY_UDF— the UDF definition exists only in the extension.
These diagnostics explain a successful permissive export. They are different from semantic-layer validation errors and warnings, which block export.
Astrato extension and fingerprint
Section titled “Astrato extension and fingerprint”Ossie 0.1.1 permits a fixed vendor list, so Astrato uses a schema-valid COMMON custom extension
whose JSON payload contains "namespace": "ASTRATO". The versioned payload contains:
- the exact canonical V3 document and exported draft revision;
- the datasource driver and normalized semantic-runtime vendor;
- portability diagnostics;
- every compiled measure query and its portability status; and
- a SHA-256 fingerprint of the standard projection.
The fingerprint excludes the extension itself and uses deterministic JSON ordering. If someone edits the standard projection after export, its fingerprint no longer matches. An importer must then ask which representation is authoritative instead of silently discarding either the external edit or the embedded Astrato document.
The extension makes an Astrato round trip lossless. It does not make extension-only constructs
portable to third-party tools that do not understand the ASTRATO namespace.
Downloaded file
Section titled “Downloaded file”The download is a YAML file named after the semantic layer, such as Bike Sales-ossie.yaml. If the
name has no characters a filename can use, the file is named semantic-layer-<uuid>-ossie.yaml
instead. MCP clients use the MCP tool.
References: Apache Ossie 0.1.1 schema and Snowflake Ossie import support.