Skip to content

Commit 487389a

Browse files
Merge branch 'main' into ATSCALE-27878-m2m
2 parents 07b066e + 22b68a6 commit 487389a

File tree

5 files changed

+133
-40
lines changed

5 files changed

+133
-40
lines changed

README.md

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
![logo](images/sml-logo-large.png)
22

3+
# SML version 1.2
4+
5+
This is documentation for SML spec version `1.2`. For earlier versions browse the repository tags. Examples:
6+
7+
- [SML version 1.0](https://github.com/semanticdatalayer/SML/tree/v1.0)
8+
- [SML version 1.1](https://github.com/semanticdatalayer/SML/tree/v1.1)
9+
310
# What is SML?
4-
Semantic Modeling Language, or SML for short, encompasses over a decade of hands-on development, solving use cases for hundreds of customers across industries such as finance, healthcare, retail, manufacturing, CPG, and more. SML covers more than just tabular use cases. At its core, it is a multidimensional semantic modeling language that supports metrics, dimensions, hierarchies, semi-additive measures, many-to-many relationships, cell-based expressions, and much more.
11+
12+
Semantic Modeling Language, or SML for short, encompasses over a decade of hands-on development, solving use cases for hundreds of customers across industries such as finance, healthcare, retail, manufacturing, CPG, and more. SML covers more than just tabular use cases. At its core, it is a multidimensional semantic modeling language that supports metrics, dimensions, hierarchies, semi-additive measures, many-to-many relationships, cell-based expressions, and much more.
513

614
SML delivers on the following requirements:
715

816
1. **Object-oriented**: SML is an object-oriented language that promotes composability and inheritance. This allows semantic objects to be shared within other semantic objects and across organizations, supporting easy and consistent model-building.
917
2. **Comprehensive**: SML is based on more than a decade of modeling experience across various industry verticals and use cases. SML handles multi-dimensional constructs and serves as a superset of all other existing semantic modeling languages.
1018
3. **Familiar**: SML is based on YAML, a widely adopted, human-readable, industry-standard syntax.
11-
4. **CI/CD Friendly**: SML is code, so it is compatible with Git and CI/CD practices for version control, automated deployment, and software lifecycle management.
19+
4. **CI/CD Friendly**: SML is code, so it is compatible with Git and CI/CD practices for version control, automated deployment, and software lifecycle management.
1220
5. **Extensible**: SML syntax can be enhanced to support additional properties and features.
1321
6. **Open**: SML is Apache open-sourced to support community innovation and is free to use in any application or use case.
1422

@@ -21,10 +29,11 @@ We are or will be open-sourcing the following:
2129
1. **A YAML-based Language Specification**: The SML specification is documented and encompasses tabular and multidimensional constructs.
2230
2. **Pre-built Semantic Models**: The GitHub repository contains pre-built semantic models that incorporate standard data models, such as TPC-DS, common training models like Worldwide Importers and AdventureWorks, and marketplace models like Snowplow and CRISP. We expect to add semantic models for SaaS applications such as Salesforce, Google Analytics, and Jira soon.
2331
3. **SML SDK**: An SDK that facilitates the programmatic reading and writing of SML syntax.
24-
4. **SML CLIs**: Command line interfaces (CLIs) for installing SML dependencies and validating SML syntax. This includes a reference CLI for deploying SML models to a proprietary semantic layer platform.
32+
4. **SML CLI**: Command line interface (CLI) for installing SML dependencies and validating SML syntax. This includes a reference CLI for deploying SML models to a proprietary semantic layer platform.
2533
5. **Semantic Converters**: A CLI for translating other semantic modeling languages to and from SML, including Snowflake Cortex semantic models, Databricks UC Metrics, and Power BI semantic models.
2634

2735
## SML Example
36+
2837
The following is an example of an SML `model` object:
2938

3039
```
@@ -59,6 +68,7 @@ metrics:
5968
```
6069

6170
## SML Object Hierarchy
71+
6272
The following graphic illustrates the key SML objects and their relationships:
6373

6474
```mermaid
@@ -85,7 +95,7 @@ The following sections describe the different SML object types as well
8595
as the properties available for each:
8696

8797
- [Catalog](sml-reference/catalog.md) - Defines the control file for a SML repository. It contains all repository-level definitions.
88-
- [Package](sml-reference/package.md) - Defines additional Git repositories references whose objects can be used in the current repository.
98+
- [Package](sml-reference/package.md) - Defines additional Git repositories references whose objects can be used in the current repository.
8999
- [Model](sml-reference/model.md) - Defines the logical, business-friendly representation on top of the physical data.
90100
- [Dimension](sml-reference/dimension.md) - Defines the logical collection of attributes and hierarchies for supporting drill-down.
91101
- [Row Security](sml-reference/row-security.md) - Defines row-level data access rules for users and groups.
@@ -95,22 +105,27 @@ as the properties available for each:
95105
- [Connection](sml-reference/connection.md) - Defines a database and schema for connecting datasets to the physical data platform.
96106
- [Composite Model](sml-reference/composite-model.md) - Defines a model made up of multiple other models.
97107

98-
## SML Converters
108+
## SML Tools and Converters
99109

100-
[SML Converters and Tooling](https://github.com/semanticdatalayer/sml-converters) - Library of bi-directional SML converters and tooling for different semantic layer platforms.
110+
- SML SDK [(npm download)](https://www.npmjs.com/package/sml-sdk) - SDK for creating and updating SML objects. Used by converters.
111+
- SML CLI [(npm download)](https://www.npmjs.com/package/sml-cli) - Command line interface (CLI) for installing SML dependencies, validating SML syntax, and a reference implementation for deploying SML models to a proprietary semantic layer platform.
112+
- [SML Converters](https://github.com/semanticdatalayer/sml-converters) [(npm download)](https://www.npmjs.com/package/sml-converters)- Library of bi-directional SML converters for different semantic layer platforms.
101113

102114
## Model Library
103115

104116
### Tutorial Models
117+
105118
1. [Internet Sales Model](https://github.com/semanticdatalayer/sml-models-tutorials-internet-sales) - a simple, single-fact model derived from the fictitious AdventureWorks retail dataset.
106119
2. [World Wide Importers Model](https://github.com/semanticdatalayer/sml-models-tutorials-ww-importers) - a more complex, multi-fact model representing a fictional wholesale and distribution company.
107120
3. [TPC-DS Model](https://github.com/semanticdatalayer/sml-models-tutorials-tpcds) - a complex, multi-fact model that encodes the [TPC-DS](https://www.tpc.org/tpcds/) benchmark model in SML.
108121
4. [TPC-H Model](https://github.com/semanticdatalayer/sml-models-tutorials-tpch) - a complex, multi-fact model that encodes the [TPC-H](https://www.tpc.org/tpch/) benchmark model in SML.
109-
5. [AdventureWorks2012 Model](https://github.com/semanticdatalayer/sml-models-tutorials-adventureworks2012) - the standard Microsoft SSAS tutorial in SML.
122+
5. [AdventureWorks2012 Model](https://github.com/semanticdatalayer/sml-models-tutorials-adventureworks2012) - the standard Microsoft SSAS tutorial in SML.
110123

111124
### Data Warehouse Usage/Cost Models
125+
112126
1. [Snowflake Usage Model](https://github.com/semanticdatalayer/sml-models-usage-snowflake) - a semantic model for analyzing Snowflake credit and data warehouse usage.
113127

114128
### Marketplace Models
129+
115130
1. [Snowplow Digital Analytics Model](https://github.com/semanticdatalayer/sml-models-snowplow) - Snowplow empowers organizations to create a scalable, first-party data foundation so marketing and data teams can effectively analyze and tackle Customer 360 use cases.
116131
2. [CRISP CPG Retail and Distributor Data Model](https://github.com/semanticdatalayer/sml-models-crisp-cpg-retail) - Crisp connects to over 40 leading U.S. retailers and distributors.

sml-reference/catalog.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ label: SML Model Library
1414
version: 1.0
1515
aggressive_agg_promotion: false
1616
build_speculative_aggs: false
17+
hidden_models:
18+
- Supply Model
19+
- Sales Model
1720
```
1821
1922
# Entitity Relationships
@@ -28,6 +31,7 @@ classDiagram
2831
Boolean aggressive_agg_promotion
2932
Boolean build_speculative_aggs
3033
Object dataset_properties
34+
Array~String hidden_models
3135
}
3236
```
3337

@@ -64,6 +68,15 @@ not need to be unique.
6468

6569
The version of SML being used.
6670

71+
## hidden_models
72+
73+
- **Type:** array<string>
74+
- **Required:** Y
75+
- **Added in** v1.2
76+
- **Use case:** When deploying a composite model the referenced component models may not need to be accessible as separate models.
77+
78+
A list of the models that will be excluded from the deploy. Cannot reference composite models, only regular models.
79+
6780
## aggressive_agg_promotion
6881

6982
- **Type:** boolean
@@ -114,7 +127,7 @@ Supported properties:
114127
- `allow_peer_aggs`: Boolean, optional. Enables aggregation on data
115128
derived from datasets in data warehouses that are different from the
116129
source dataset.
117-
- `allow_preferred_aggs`: Boolean, optional. Allow aggregates to be built
130+
- `allow_preferred_aggs`: Boolean, optional. Allow aggregates to be built
118131
in preferred storage.
119132

120133
Specify the `unique_name` of the dataset followed by the properties and

sml-reference/connection.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ into your repository.
66

77
Each connection file should define a single database connection *and*
88
its schema. If you need to use additional schemas for the same database,
9-
each must be defined in a separate connection file.
9+
each must be defined in a separate connection file. If a dataset uses a query
10+
instead of tables, the database and schema do not need to be specified in the
11+
connection file.
1012

1113
Sample `connection` file:
1214

@@ -69,13 +71,13 @@ The name of the database connection itself, excluding the schema.
6971
## database
7072

7173
- **Type:** string
72-
- **Required:** Y
74+
- **Required:** N
7375

74-
The source database used for this connection.
76+
The source database is required when used in the table datasets, but it is not necessary for query datasets.
7577

7678
## schema
7779

7880
- **Type:** string
79-
- **Required:** Y
81+
- **Required:** N
8082

81-
The source schema used for this connection.
83+
The source schema is required when used in the table datasets, but it is not necessary for query datasets.

sml-reference/dimension.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ namespace Dimensions{
270270
Boolean is_aggregatable
271271
Boolean exclude_from_fact_agg
272272
String time_unit
273+
Int constraint_translation_rank
273274
Array~String~ allowed_calcs_for_dma
274275
CustomEmptyMember custom_empty_member
275276
String folder
@@ -309,12 +310,15 @@ namespace Dimensions{
309310
String label
310311
String description
311312
String folder
313+
Number precedence
312314
Array~CalculatedMembers~ calculated_members
315+
Boolean is_hidden
313316
}
314317
class CalculatedMembers{
315318
String unique_name
316319
String description
317320
String format
321+
Boolean is_hidden
318322
String expression
319323
Boolean use_input_metric_format
320324
String template
@@ -549,13 +553,36 @@ Defines the individual calculated members in the group.
549553

550554
A description of the calculation group.
551555

556+
## is_hidden
557+
558+
- **Type:** boolean
559+
- **Required:** N
560+
561+
Determines whether the calculation group is visible in BI tools.
562+
563+
Supported values:
564+
565+
- `false` (default)
566+
- `true`
567+
552568
## folder
553569

554570
- **Type:** string
555571
- **Required:** N
556572

557573
The name of the folder in which the calculation group is displayed in BI tools.
558574

575+
## precedence
576+
577+
- **Type:** number
578+
- **Required:** N
579+
580+
Update to "Precedence" explicitly defines the order of Calculation Group evaluation, making it consistent across BI tools.
581+
582+
Supported values:
583+
584+
- Integer and floating point numbers
585+
559586
# Calculated Members Properties
560587

561588
## unique_name
@@ -585,6 +612,18 @@ Supported templates:
585612

586613
If you do not want to use a built-in template, you can define a custom expression using the `expression` property (see below).
587614

615+
## is_hidden
616+
617+
- **Type:** boolean
618+
- **Required:** N
619+
620+
Determines whether the attribute is visible in BI tools.
621+
622+
Supported values:
623+
624+
- `false` (default)
625+
- `true`
626+
588627
## expression
589628

590629
- **Type:** string
@@ -1196,6 +1235,14 @@ If the key consists of one column, the values in that column must be
11961235
unique. If the key is a compound key, the columns together must provide
11971236
unique values.
11981237

1238+
## constraint_translation_rank
1239+
1240+
- **Type:** integer
1241+
- **Required:** N
1242+
- **Range:** should be a valid 32 bit integer
1243+
1244+
Defines the translation of dimension filter constraints into fact table partition column constraints. This can significantly improve query performance for cases where fact-based aggregates are not used.
1245+
11991246
## shared_degenerate_columns
12001247

12011248
- **Type:** array

0 commit comments

Comments
 (0)