You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-7Lines changed: 22 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,22 @@
1
1

2
2
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
+
3
10
# 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.
5
13
6
14
SML delivers on the following requirements:
7
15
8
16
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.
9
17
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.
10
18
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.
12
20
5.**Extensible**: SML syntax can be enhanced to support additional properties and features.
13
21
6.**Open**: SML is Apache open-sourced to support community innovation and is free to use in any application or use case.
14
22
@@ -21,10 +29,11 @@ We are or will be open-sourcing the following:
21
29
1.**A YAML-based Language Specification**: The SML specification is documented and encompasses tabular and multidimensional constructs.
22
30
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.
23
31
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.
25
33
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.
26
34
27
35
## SML Example
36
+
28
37
The following is an example of an SML `model` object:
29
38
30
39
```
@@ -59,6 +68,7 @@ metrics:
59
68
```
60
69
61
70
## SML Object Hierarchy
71
+
62
72
The following graphic illustrates the key SML objects and their relationships:
63
73
64
74
```mermaid
@@ -85,7 +95,7 @@ The following sections describe the different SML object types as well
85
95
as the properties available for each:
86
96
87
97
-[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.
89
99
-[Model](sml-reference/model.md) - Defines the logical, business-friendly representation on top of the physical data.
90
100
-[Dimension](sml-reference/dimension.md) - Defines the logical collection of attributes and hierarchies for supporting drill-down.
91
101
-[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:
95
105
-[Connection](sml-reference/connection.md) - Defines a database and schema for connecting datasets to the physical data platform.
96
106
-[Composite Model](sml-reference/composite-model.md) - Defines a model made up of multiple other models.
97
107
98
-
## SML Converters
108
+
## SML Tools and Converters
99
109
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.
101
113
102
114
## Model Library
103
115
104
116
### Tutorial Models
117
+
105
118
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.
106
119
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.
107
120
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.
108
121
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.
110
123
111
124
### Data Warehouse Usage/Cost Models
125
+
112
126
1.[Snowflake Usage Model](https://github.com/semanticdatalayer/sml-models-usage-snowflake) - a semantic model for analyzing Snowflake credit and data warehouse usage.
113
127
114
128
### Marketplace Models
129
+
115
130
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.
116
131
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.
Copy file name to clipboardExpand all lines: sml-reference/dimension.md
+47Lines changed: 47 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -270,6 +270,7 @@ namespace Dimensions{
270
270
Boolean is_aggregatable
271
271
Boolean exclude_from_fact_agg
272
272
String time_unit
273
+
Int constraint_translation_rank
273
274
Array~String~ allowed_calcs_for_dma
274
275
CustomEmptyMember custom_empty_member
275
276
String folder
@@ -309,12 +310,15 @@ namespace Dimensions{
309
310
String label
310
311
String description
311
312
String folder
313
+
Number precedence
312
314
Array~CalculatedMembers~ calculated_members
315
+
Boolean is_hidden
313
316
}
314
317
class CalculatedMembers{
315
318
String unique_name
316
319
String description
317
320
String format
321
+
Boolean is_hidden
318
322
String expression
319
323
Boolean use_input_metric_format
320
324
String template
@@ -549,13 +553,36 @@ Defines the individual calculated members in the group.
549
553
550
554
A description of the calculation group.
551
555
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
+
552
568
## folder
553
569
554
570
-**Type:** string
555
571
-**Required:** N
556
572
557
573
The name of the folder in which the calculation group is displayed in BI tools.
558
574
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
+
559
586
# Calculated Members Properties
560
587
561
588
## unique_name
@@ -585,6 +612,18 @@ Supported templates:
585
612
586
613
If you do not want to use a built-in template, you can define a custom expression using the `expression` property (see below).
587
614
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
+
588
627
## expression
589
628
590
629
-**Type:** string
@@ -1196,6 +1235,14 @@ If the key consists of one column, the values in that column must be
1196
1235
unique. If the key is a compound key, the columns together must provide
1197
1236
unique values.
1198
1237
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.
0 commit comments