Ontology (preview) tutorial part 1: Create an ontology

In this step of the tutorial, you create a new ontology (preview) item that represents the Lakeshore Retail scenario. Then you add entity types, data bindings, and relationships to build out the ontology.

Important

This feature is in preview.

Create ontology (preview) item

  1. In your Fabric workspace, select + New item. Search for and select the Ontology (preview) item.

    Screenshot of the ontology (preview) item.

  2. In the New Ontology dialog, enter a Name of LakeshoreOntology. Set the Location to your workspace. Select Create.

The ontology opens when it's ready.

Screenshot of empty ontology in Fabric item.

Note

If you see an error that Fabric is unable to create the ontology (preview) item, ensure that all the required settings are enabled for your tenant, as described in the Tutorial prerequisites.

Next, create entity types, data bindings, and relationships based on data from your lakehouse tables.

Create entity types and data bindings

First, create entity types. Entity types represent types of objects in a business. After you create the entity types, create their properties by binding source data columns from the LakeshoreStaticDataLH lakehouse tables.

Add base entity type (Location)

  1. From the top ribbon, select + Add entity type.

    Screenshot of adding entity type from the top ribbon.

  2. Enter Location for the entity type name and select Add Entity Type.

  3. The Location entity type appears on the configuration canvas.

    Screenshot of the new Location entity type.

Bind Location data

  1. On the configuration canvas or the Explorer, select ... next to the entity name and select Bind data.

    Screenshot of selecting Bind data for Location.

  2. Select Add to add a data source.

  3. Find the data source in the OneLake catalog. Expand LakeshoreStaticDataLH > dbo and select the dimlocations table. Confirm with Select table.

  4. The data source loads.

    Screenshot of the data source after it is loaded.

  5. Select Entity type properties to see properties of the entity type. The columns from the dimlocations table automatically populate as proposed properties.

    Screenshot of properties automatically populated on the entity type.

  6. Without making any changes to the properties, select Create to save the data binding. You see a banner confirming that Entity type updated successfully.

  7. Select Cancel to close the property binding dialog.

  8. You see the Configure page of the entity type details. This page surfaces information about the entity type, including its properties and data bindings. View your configured data bindings.

    Screenshot of the data bindings in the Configure page.

Now the Location entity type is complete.

Add inherited entity type (Store)

Next, add an inherited entity type. The Store entity inherits from Location, which automatically gives it all of Location's properties.

  1. Select Home to return to the configuration canvas where you can add new entity types.

    Screenshot of returning home to the configuration canvas.

  2. From the top ribbon, select + Add entity type.

  3. Enter Store for the Entity type name. Expand Additional configuration and set Choose entity to inherit from to Location. Select Add Entity Type.

    Screenshot of adding the Store entity type that inherits from Location.

  4. The Store entity type appears on the configuration canvas.

  5. Select the Store entity type and select View Entity Type details.

    Screenshot of opening entity type details for the Store entity type.

  6. In the Configure tab, confirm that the Store entity type already has properties. These properties are inherited from the Location parent, but you still need to bind them to a source.

    Screenshot of the Store entity type's inherited properties.

Bind Store data

  1. Select Manage property bindings > Add binding and properties.

    Screenshot of adding binding and properties to the Store entity type.

    The property binding page opens.

  2. Add the LakeshoreStaticDataLH > dbo > dimlocations table as a data source.

  3. Select Entity type properties, verify that properties have a populated source column, and select Create.

    Screenshot of source columns in the data binding.

  4. Select Cancel to return to the Configure page for the entity type.

Now the Store entity type is complete. Continue to the next section to create the rest of the entity types in the sample scenario.

Add other entity types

Use the same steps that you used for the Location and Store entity types to create the entity types described in the following table. Add all of their source columns as properties.

Entity type name Inherits from Data source table Notes
Distribution Center Location LakeshoreStaticDataLH > dimlocations
Product LakeshoreStaticDataLH > dimproducts
Frozen Product Product LakeshoreStaticDataLH > dimproducts
Perishable Product Product LakeshoreStaticDataLH > dimproducts
Inventory LakeshoreStaticDataLH > fact_inventory_positions
Supplier LakeshoreStaticDataLH > dimsuppliers
Shipment LakeshoreStaticDataLH > factshipments
Refrigeration Unit LakeshoreStaticDataLH > dim_refrigeration_units
Refrigeration Telemetry LakeshoreTelemetryDataEH > RefrigerationTelemetry This entity type uses the eventhouse table, not a lakehouse table, as its data source.

When you finish, you see all the entity types listed in the Explorer in the configuration canvas.

Screenshot of the scenario entity types.

Add Sale with the ontology agent

Finally, add one more entity type: Sale. Unlike the other entity types, Sale's source data is in a semantic model and has associated DAX measures. To bind this Sale data without having to recreate it manually, use the ontology agent.

  1. Select Ontology agent from the top ribbon. The ontology agent opens in Plan mode.

    Screenshot of opening the ontology agent in Plan mode.

  2. Send the following query: Create a new entity type called Sale, bound to data in the Sales table from the SalesReport semantic model inside this workspace.

  3. The ontology agent reasons and creates a plan for adding the new entity type.

    Screenshot of the ontology agent's plan for adding the entity type.

  4. Toggle to Act mode and send Apply the entity type plan.

  5. The ontology agent adds the Sale entity type to the canvas.

    Screenshot of the ontology agent's success message and the Sale entity type added to the canvas.

  6. With the new Sale entity type highlighted, select View Entity Type details.

  7. Verify that Properties are populated and bound to the semantic model data source.

    Screenshot of the Sale entity properties.

  8. Scroll down to view the Metrics section and verify that two metrics are added. Ontology metrics are based on DAX measures from the semantic model source.

    Screenshot of the Sale entity metrics with two entries.

Now you have all entity types for the scenario created and bound to source data.

Create relationship types

Next, create relationship types between the entity types to represent contextual connections in your data.

Store operates Refrigeration Unit

  1. Select the Store entity type from the Explorer.

  2. Select Add relationship from the menu ribbon or the Explorer, or Add relationship type from the entity on the configuration canvas.

    Screenshot of adding a relationship type.

  3. Enter the following relationship type details and select Create.

    1. Relationship type name: operates
    2. Origin entity type: Store
    3. Target entity type: Refrigeration Unit

    Screenshot of entering relationship type details.

  4. The relationship appears on the semantic canvas. Select it to open the relationship details configuration.

  5. Observe the sections of the configuration page:

    • Origin entity type: Lists details of the origin entity type (Store)
    • Relationship: Sets details of the relationship type (operates)
    • Target entity type: Lists details of the target entity type (Refrigeration Unit)

    Screenshot of the relationship type configuration.

  6. In the Origin entity type section, expand Property and select LocationId.

    In the Target entity type section, expand Property and select StoreId. These fields indicate that the LocationId on a Store can be matched to the StoreId on a Refrigeration Unit to relate them to each other.

    Screenshot of the details filled out in the relationship type configuration.

  7. Save the relationship type. You see a banner confirming that the ontology Successfully updated the relationship type. Select Cancel to close the configuration options.

  8. You see the Configure page for the Store entity type, where the new relationship is visible in the Relationships section.

    Screenshot of the relationship type in the Configure page.

Now the first relationship is complete. Continue to the next section to create the rest of the relationship types in the sample scenario.

Add other relationship types

Select Home to return to the configuration canvas where you can add new relationship types.

Follow the same steps that you used for the first relationship type to create the relationship types described in the following table.

Relationship type name Origin entity type (Property) Target entity type (Property)
operates Store (LocationId) Refrigeration Unit (StoreId)
deliversTo Shipment (ToStoreId) Store (LocationId)
occursAt Sale (StoreId) Store (LocationId)
stockedAt Inventory (StoreId) Store (LocationId)
originatesAt Shipment (FromLocationId) Distribution Center (LocationId)
forProduct Sale (ProductId) Product (ProductId)
stockedAt Product (ProductId) Inventory (ProductId)
suppliedBy Product (SupplierId) Supplier (SupplierId)
contains Shipment (ProductId) Product (ProductId)
hasTelemetryReading Refrigeration Unit (UnitId) Refrigeration Telemetry (UnitId)

When you're done, the relationship types are visible on the configuration canvas.

Screenshot of the scenario relationship types.

Next steps

In this step, you created an ontology (preview) item and populated it with entity types, their properties, and relationship types between them. Next, enrich the entity types with more detail.

Next, continue to Enrich the ontology with additional data.