Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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
In your Fabric workspace, select + New item. Search for and select the Ontology (preview) item.
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.
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)
From the top ribbon, select + Add entity type.
Enter Location for the entity type name and select Add Entity Type.
The Location entity type appears on the configuration canvas.
Bind Location data
On the configuration canvas or the Explorer, select ... next to the entity name and select Bind data.
Select Add to add a data source.
Find the data source in the OneLake catalog. Expand LakeshoreStaticDataLH > dbo and select the dimlocations table. Confirm with Select table.
The data source loads.
Select Entity type properties to see properties of the entity type. The columns from the dimlocations table automatically populate as proposed properties.
Without making any changes to the properties, select Create to save the data binding. You see a banner confirming that Entity type updated successfully.
Select Cancel to close the property binding dialog.
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.
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.
Select Home to return to the configuration canvas where you can add new entity types.
From the top ribbon, select + Add entity type.
Enter Store for the Entity type name. Expand Additional configuration and set Choose entity to inherit from to Location. Select Add Entity Type.
The Store entity type appears on the configuration canvas.
Select the Store entity type and select View Entity Type details.
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.
Bind Store data
Select Manage property bindings > Add binding and properties.
The property binding page opens.
Add the LakeshoreStaticDataLH > dbo > dimlocations table as a data source.
Select Entity type properties, verify that properties have a populated source column, and select Create.
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.
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.
Select Ontology agent from the top ribbon. The ontology agent opens in Plan mode.
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.
The ontology agent reasons and creates a plan for adding the new entity type.
Toggle to Act mode and send Apply the entity type plan.
The ontology agent adds the Sale entity type to the canvas.
With the new Sale entity type highlighted, select View Entity Type details.
Verify that Properties are populated and bound to the semantic model data source.
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.
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
Select the Store entity type from the Explorer.
Select Add relationship from the menu ribbon or the Explorer, or Add relationship type from the entity on the configuration canvas.
Enter the following relationship type details and select Create.
- Relationship type name: operates
- Origin entity type: Store
- Target entity type: Refrigeration Unit
The relationship appears on the semantic canvas. Select it to open the relationship details configuration.
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)
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 theLocationIdon a Store can be matched to theStoreIdon a Refrigeration Unit to relate them to each other.Save the relationship type. You see a banner confirming that the ontology Successfully updated the relationship type. Select Cancel to close the configuration options.
You see the Configure page for the Store entity type, where the new relationship is visible in the Relationships section.
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.
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.