SemanticModel-määritelmä

Tässä artikkelissa on erittely semanttisten mallikohteiden määritysrakenteesta.

Tuettu muodot

Semanttisen mallin määrityksiä voidaan käyttää joko TMDL tai TMSL muotoa, mutta ei molempia samanaikaisesti.

Muotoa TMDL käytetään oletusarvoisesti.

Määritysosat

Määritysosan polku tyyppi Pakollinen Description
definition/ definition/parts (TMDL) tosi 1 Analysis Servicesin taulukkomuotoinen määritys TMDL-muotoa käyttämällä.
model.bim model.bim part (TMSL) tosi 1 Analysis Servicesin taulukkomuotoinen määritys TMSL-muotoa käyttämällä.
diagramLayout.json diagramLayout.json osa epätosi Sisältää semanttisen mallin kaavion metatiedot.
definition.pbism definition.pbism osa tosi Sisältää semanttisen mallin ja tiedostomuotoversion ydinasetukset.

1 – Osaa definition/ tarvitaan muotoilua varten TMDL , mutta model.bim se vaaditaan muotoa varten TMSL . Ne ovat toisensa poissulkeisia – semanttinen malli käyttää yhtä tai toista, ei molempia.

Lue lisätietoja semanttisista mallin määritystiedostoista Power BI -projektin dokumentaatiosta.

Hyötykuorman esimerkki käyttäen muotoa TMDL :

SemanticModel/
├── definition/ 
│   ├── tables/
│   │   ├── product.tmdl
│   │   ├── sales.tmdl
│   │   ├── calendar.tmdl
│   ├── relationships.tmdl
│   ├── model.tmdl
│   ├── database.tmdl
├── Copilot/
│   ├── Instructions/
│   │   ├── instructions.md
│   │   ├── version.json
│   ├── VerifiedAnswers/
│   ├── schema.json
│   ├── examplePrompts.json
│   ├── settings.json
│   └── version.json
├── diagramLayout.json 
└── definition.pbism 
{
    "parts": [
        {
            "path": "definition/database.tmdl",
            "payload": "<base64 encoded string>",
            "payloadType": "InlineBase64"
        },
        {
            "path": "definition/model.tmdl",
            "payload": "<base64 encoded string>",
            "payloadType": "InlineBase64"
        },
        {
            "path": "definition/tables/product.tmdl",
            "payload": "<base64 encoded string>",
            "payloadType": "InlineBase64"
        },
        {
            "path": "definition/tables/sales.tmdl",
            "payload": "<base64 encoded string>",
            "payloadType": "InlineBase64"
        },
        ...
        {
            "path": "definition.pbism",
            "payload": "<base64 encoded string>",
            "payloadType": "InlineBase64"
        },
        {
            "path": "diagramLayout.json",
            "payload": "<base64 encoded string>",
            "payloadType": "InlineBase64"
        }
    ]
}

definition/part

Esimerkki kansiosta definition/ :

definition/ 
├── tables/
│   ├── product.tmdl
│   ├── sales.tmdl
│   ├── calendar.tmdl
├── relationships.tmdl
├── model.tmdl
├── database.tmdl

Esimerkki seuraavista: tables/product.tmdl

table Product

	measure '# Products' = COUNTROWS('Product')
		formatString: #,##0

	column Product
		dataType: string
		isDefaultLabel
		summarizeBy: none
		sourceColumn: Product

	column ProductKey
		dataType: int64
		isHidden
		isKey
		summarizeBy: none
		sourceColumn: ProductKey

	column Category
		dataType: string
		summarizeBy: none
		sourceColumn: Category		

	partition Product-171f48b3-e0ea-4ea3-b9a0-c8c673eb0648 = m
		mode: import
		source =
				let				    
				    ...
				in
				    #"FinalStep"

model.bim osa

Esimerkki tiedostosta model.bim :

{
  "compatibilityLevel": 1702,
  "model": {
    "annotations": [],
    "culture": "en-US",
    "sourceQueryCulture": "en-US",
    "cultures": [],
    "dataAccessOptions": {
      "legacyRedirects": true,
      "returnErrorValuesAsNull": true
    },
    "defaultPowerBIDataSourceVersion": "powerBI_V3",
    "discourageImplicitMeasures": true,
    "expressions": [],
    "functions": [],
    "perspectives": [],
    "relationships": [],
    "roles": [],    
    "tables": [      
      {
        "name": "Product",
        "annotations": [],
        "columns": [
          {
            "name": "Product",
            "dataType": "string",
            "isDefaultLabel": true,            
            "sourceColumn": "Product",
            "summarizeBy": "none"
          },
          {
            "name": "ProductKey",        
            "dataType": "int64",
            "formatString": "0",
            "isAvailableInMdx": false,
            "isHidden": true,
            "isKey": true,            
            "sourceColumn": "ProductKey",
            "summarizeBy": "none"
          }
          ,
          {
            "name": "Category",
            "dataType": "string",            
            "sourceColumn": "Category",
            "summarizeBy": "none"
          }
        ],        
        "measures": [
          {
            "name": "# Products",
            "expression": "COUNTROWS('Product')",
            "formatString": "#,##0",
            "lineageTag": "1f8f1a2a-06b6-4989-8af7-212719cf3617"
          }
        ],
        "partitions": [
          {
            "name": "Product-171f48b3-e0ea-4ea3-b9a0-c8c673eb0648",
            "mode": "import",
            "source": {
              "expression": [
                "let",
                "    ...",
                "in",
                "    #\"FinalStep\""
              ],
              "type": "m"
            }
          }
        ]
      }
    ]
  }
}

diagramLayout.json osa

Esimerkki tiedostosta diagramLayout.json :

{
  "version": "1.1.0",
  "diagrams": [
    {
      "ordinal": 0,
      "scrollPosition": {
        "x": 0,
        "y": 74.883720930232556
      },
      "nodes": [
        {
          "location": {
            "x": 942.5095849858792,
            "y": 14.090768666666882
          },
          "nodeIndex": "[Table Name]",
          "nodeLineageTag": "[Table Lineage Tag]",
          "size": {
            "height": 1000,
            "width": 254
          },
          "zIndex": 5
        },
        {
          "location": {
            "x": 537.83428438628755,
            "y": 836.33418866666739
          },
          "nodeIndex": "[Table Name]",
          "nodeLineageTag": "[Table Lineage Tag]",
          "size": {
            "height": 481,
            "width": 276
          },
          "zIndex": 2
        }
      ],
      "name": "All tables",
      "zoomValue": 74.782608695652172,
      "pinKeyFieldsToTop": false,
      "showExtraHeaderInfo": false,
      "hideKeyFieldsWhenCollapsed": false,
      "tablesLocked": false
    }
  ],
  "selectedDiagram": "All tables",
  "defaultDiagram": "All tables"
}

definition.pbism osa

Esimerkki tiedostosta definition.pbism :

{
  "$schema": "https://developer.microsoft.com/json-schemas/fabric/item/semanticModel/definitionProperties/1.0.0/schema.json",
  "version": "5.0",
  "settings": {
    "qnaEnabled": false
  }
}