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 tutorial step, you enrich your ontology by adding a new Freezer entity type. This entity type adds more domain context and introduces properties for time series data, which reflects live operational information.
Important
This feature is in preview.
First, you create the new entity type and define properties without binding them to specific data. Then, you bind the static data to those properties in a separate step. Later, you add time series data to the entity type by creating new properties and binding time series data to them in a single data binding operation.
Note
For both static and time series data, you can create properties without binding data and bind data later, or create properties and bind data to them in a single step. This article demonstrates both approaches.
After you complete data binding for the freezer entity, you create a new relationship type to represent the connection between a store and its freezers.
Create Freezer entity type and add properties
Follow these steps to create the Freezer entity type and add properties to it. The properties aren't bound to data yet.
Start in the Home configuration canvas of ontology. Select Add entity type from the top ribbon. Enter Freezer for the name of your entity type and select Add Entity Type.
With the Freezer entity type selected in the Explorer, select View entity type details from the top ribbon.
The Configure page of the entity type details opens. This page surfaces important information about the entity type, including its properties and data bindings.
Expand Manage property bindings and select Add properties.
Add the following properties and select Save.
Name Property type FreezerIdString ModelString minSafeTempCDouble StoreIdString Here's what it looks like before saving:
The properties are added to the Configure page, unbound to any data source.
Bind static data to properties
Next, bind static data to the properties you created on the Freezer entity type.
Expand Manage property bindings and select Add binding and properties.
Select Add data binding > Lakehouse table.
Choose your data source.
- Select the OntologyDataLH lakehouse and select Next.
- Select the freezer table and Select.
Fields from the source table populate the data binding configuration. Observe the sections of the configuration page:
- Entity type key: Identifies the field (or fields) that can be used to uniquely identify each record of ingested data.
- Binding selection: Identifies the source table that holds the data for the binding.
- Entity type key mapping: Identifies the column(s) in the source data table that map to the entity type key property. You can select string and integer columns from your source data as the entity type key. Together, the columns you select uniquely identify a record.
- Properties: Lists the columns from the source data and corresponding properties on the Freezer entity type. The Source column side populates automatically with the columns from the freezer table, and the Property name side lists their corresponding property names on the Freezer entity type within ontology. For this tutorial, keep the default property names.
Select Define entity type key at the top of the configuration. Select
FreezerIdfrom the property list and select Save.
Save the data binding. Confirm that the entity type updated successfully, then select Cancel to close the configuration options.
Back in the Configure page for Freezer, view the list of properties and see that they're now bound to a data source.
Now the Freezer entity has static data bound to it.
Bind time series data to additional properties
Next, add time series data on the Freezer entity, by creating new properties and binding time series data to them in a single data binding operation.
In the Configure page, expand Manage property bindings and select Add binding and properties again to reopen the binding configuration.
Tip
Though this tutorial shows adding static and time series data in separate visits to the configuration page, you could also bind all the data in the first visit to this configuration page, as long as you complete the static binding before the time series one.
Under Binding selection, expand Add data binding and select Eventhouse table or materialized view.
Choose your data source.
- Select the TelemetryDataEH eventhouse and select Add.
- Select the FreezerTelemetry table and Add.
A Timeseries data section appears in the configuration. For Timestamp column, select
timestamp.Scroll down to the Properties section, where the
StoreIdshows an error because it is already bound in the static data binding. Use the trash icon to delete the duplicated property.Save the data binding. Confirm that the entity type updated successfully, then select Cancel to close the configuration options.
Back in the Configure page for Freezer, notice that there are now more entity type properties, and the new ones are bound to the FreezerTelemetry data source.
Now the Freezer entity has two data bindings: one with static data from the freezer lakehouse table and one with streaming data from the FreezerTelemetry eventhouse table.
Add relationship type
Finally, create a new relationship type to represent the connection between a store and its freezers.
Create Store operates Freezer
In the Configure page, expand Manage relationships and select Add new relationship.
Enter the following relationship type details and select Create.
- Relationship type name: operates
- Origin entity type: Store
- Target entity type: Freezer
The relationship is added to the Relationships section. Select the operates relationship on the canvas to open the relationship details configuration. Observe the sections of the configuration page:
- Origin entity type: Lists details of the origin entity (Store in this case).
- Relationship type: Sets details of the relationship type.
- Target entity type: Lists details of the target entity (Freezer in this case).
In the middle section, enter the following details.
- Mapping table: Select the freezer table. This table in the source data can link Store and Freezer entities together, because it contains identifying information for both entity types. Each row in this table references a store and a freezer by ID.
- Matched Store: StoreId: Select
StoreId. This setting specifies the column in the relationship source data table (freezer >StoreId) whose values match the key property defined on the Store entity (dimstore >StoreId). In the tutorial data, the column name is the same (StoreId) in both tables. - Matched Freezer: FreezerId: Select
FreezerId. This setting specifies the column in the relationship source data table whose values match the key property defined on the Freezer entity. In this case, the relationship data source and the entity data source both use the freezer table, so you're selecting the same column (FreezerId).
Important
Make sure to select the correct source columns that match the entity type key properties.
Save the relationship type. Confirm that the relationship type updated successfully, then select Cancel to close the configuration options.
You see the Configure page for the entity, where the updated relationship remains visible in the Relationships section.
Next steps
Now your ontology includes a Freezer entity type that is bound to both static and time series data, and is connected in the ontology with a relationship.
Next, continue to View the ontology.