Edit

Share via


Ontology (preview) tutorial part 2: Enrich the ontology with additional data

In this tutorial step, enrich your ontology further 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 have the option to create properties without binding data and bind data afterwards, or to create properties and bind data to them in a single step. This article demonstrates both approaches.

Finally, 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.

Note

Properties can be created on entity types without binding data to them, and you can bind either static or time series data to them afterwards. This section shows that process. Alternatively, you can bind data to properties while they're being created in a single data binding operation (shown in the next section with time series data).

  1. Select Add entity type from the top ribbon. Enter Freezer for the name of your entity type and select Add Entity Type.

  2. In the Entity type configuration pane, go to the Properties tab. Select Add properties.

    Screenshot of adding properties to the Freezer entity type.

  3. Add the following properties and select Save.

    Name Value type Property type
    FreezerId String Static
    Model String Static
    minSafeTempC Double Static
    StoreId String Static

    Here's what it looks like before saving:

    Screenshot of the properties for the Freezer entity type.

  4. Select Add entity type key.

    Screenshot of adding an entity type key.

    Select FreezerId as the key value.

Bind static data to properties

Next, bind static data to the properties you created on the Freezer entity type.

  1. In the Entity type configuration pane, go to the Bindings tab. Select Add data to entity type.

    Screenshot of adding data to Freezer.

  2. For your data source, select the OntologyDataLH lakehouse and the freezer table. Select Next.

  3. Configure a static data binding for the properties.

    1. For Binding type, leave the default selection of Static.
    2. Under Bind your properties, the properties you created populate automatically with links to matching columns from the freezer table.
    3. Select Save.

    Screenshot of static data for Freezer.

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.

Note

Both static and time series data can be bound to properties while they're being created. This section shows that process. Alternatively, you can create properties on entity types without binding data to them, and bind data to them afterwards (shown in the previous section with static data).

  1. In the Entity type configuration pane's Bindings tab, select Add data to entity type.

  2. For your data source, select the TelemetryDataEH eventhouse and the FreezerTelemetry table. Select Next.

  3. Configure a time series data binding.

    1. For Binding type, leave the default selection of Timeseries. For Source data timestamp column, select timestamp.

    2. Under Bind your properties > Static, remove both properties that populate automatically to avoid duplicating the static properties already on the entity.

      Screenshot of removing the default static properties.

      Then, select + Add static property > Add static property. Select freezerId as the Source column and select FreezerId (beginning with a capital letter) from the dropdown menu in the Property name column. This step ensures that the freezerId column in the FreezerTelemetry table is bound to the same FreezerId property that is already defined on the Freezer entity type from the static data source.

    3. Under Bind your properties > Timeseries, the time series columns from the FreezerTelemetry table populate automatically with matching property names for the Freezer entity type. Leave the default selections.

    4. Select Save.

    Screenshot of time series data for Freezer.

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.

Screenshot of both data bindings for Freezer.

Add relationship type

Finally, create a new relationship type to represent the connection between a store and its freezers.

Create Store operates Freezer

  1. Select Add relationship type from the menu ribbon.

  2. Enter the following relationship type details and select Add relationship type.

    1. Relationship type name: operates
    2. Source entity type: Store
    3. Target entity type: Freezer
  3. The Relationship configuration pane opens, where you can configure additional information. Enter the following details (some fields become visible based on other selections) and select Create.

    1. Source data: Select your tutorial workspace, the OntologyDataLH lakehouse, and the freezer table.
    2. Source entity type > Source column: Select StoreId to match the entity type key property.
    3. Target entity type > Source column: Select FreezerId to match the entity type key property.

    Here's what the relationship configuration looks like:

Screenshot of the Store operates Freezer relationship type.

Next steps

Now your ontology includes a Freezer entity type that is connected in the ontology and bound to time series data.

Next, continue to Preview the ontology.