Open Semantic Interchange support
Count supports importing and on-the-fly conversion of OSI (Open Semantic Interchange) files into Count catalog views and datasets. This allows teams to maintain their semantic layer in OSI and use it in Count. Not all OSI features are supported. See Limitations for details.
General support
OSI files are just one type of third-party file that Count Metrics supports. This support includes:
- on-the-fly (or automatic) conversion for teams who want to continue maintaining their semantic layer definitions outside of Count;
- once-off (or manual) conversion for teams who want to fully migrate their existing semantic layer definitions into Count; and
- extending automatically converted views and definitions to adjust them without needing to change the third-party files.
See here for more details on how Count Metrics supports third-party files generally. This page will focus just on the specific details of this related to OSI files.
OSI Conversion Details
OSI (Open Semantic Interchange) is a vendor-neutral open standard for defining and exchanging semantic model metadata across BI, analytics, and AI platforms. See the core specification for full details.
What Is Converted
- OSI semantic model -> Count dataset
- OSI dataset with
source-> Count view with table source - OSI field -> Count field (typed as
stringby default) - OSI field with
dimension.is_time-> Count field with timeframes (typed as `date`) - OSI metric -> Count field with aggregate (parsed from expression)
- OSI relationship -> Count join
- OSI
primary_key-> Primary key fields on view
Supported Types
OSI fields do not carry explicit type information. All fields are converted as string by default, except fields with dimension.is_time: true, which are converted as date.
Supported Aggregation Types
Metric expressions are parsed for standard SQL aggregate functions: count, count_distinct, sum, avg, average (converted to avg), median, mode, max, min, stddev, stddev_pop, stddev_samp, var_pop, var_samp, variance (converted to var_samp).
Supported Timeframes
Time fields (those with dimension.is_time: true) are converted with the following timeframes: year_trunc, quarter_trunc, month_trunc, week_trunc, day_trunc, hour_trunc, day_of_week, and the raw (untruncated) value.
Multi-Dialect Expressions
OSI supports expressions in multiple SQL dialects. During conversion, the ANSI_SQL dialect is preferred. If no ANSI_SQL dialect is present, the first available dialect is used as a fallback.
The supported dialects in the OSI spec are: ANSI_SQL, SNOWFLAKE, MDX, TABLEAU, DATABRICKS.
Relationships and Joins
OSI relationships are converted to Count joins using from_columns and to_columns to build the join constraint. Joins are placed on the from dataset's view, joining to the to dataset. The relationship type (one_to_one, one_to_many, many_to_one, many_to_many) is inferred based on whether the join columns form a primary or unique key on each side of the relationship.
Model-Level Metrics
Metrics are defined at the semantic model level in OSI and are distributed to dataset views by analyzing datasetName.fieldName references in the metric expression:
- Single-dataset reference: assigned to that dataset's view as a normal metric field
- Multi-dataset reference: assigned to the first referenced dataset's view but commented out (cross-view field expressions are not supported)
- No dataset reference: assigned to the first dataset's view but commented out
Limitations
Certain OSI features do not have direct equivalents in Count. During conversion, unsupported definitions are included as commented sections with an inline explanation, so nothing is silently dropped.
Cross-View Metric Expressions
Metrics that reference fields from multiple datasets are not supported. These are commented out with an explanation.
AI Context
The ai_context property on fields, datasets, metrics, relationships, and semantic models is not converted, as Count does not have an equivalent concept.
Custom Extensions
The custom_extensions property (vendor-specific data) on fields, datasets, metrics, relationships, and semantic models is not converted.
Non-ANSI SQL Dialects
Only the ANSI_SQL dialect is fully supported for field and metric expressions. Expressions in other dialects (SNOWFLAKE, MDX, TABLEAU, DATABRICKS) are used as a fallback but may contain dialect-specific syntax that does not convert successfully.
Field Expression SQL
Field expressions can only use a limited SQL dialect that Count uses in various places such as visuals and low-code cells (see here). Complex SQL constructs, warehouse-specific functions, or deeply nested subqueries may not convert successfully.