Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 02a9c94

Browse files
committedMar 29, 2022
Add relationship text
1 parent e6cb55f commit 02a9c94

File tree

5 files changed

+20
-8
lines changed

5 files changed

+20
-8
lines changed
 

‎articles/digital-twins/concepts-ontologies-extend.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ titleSuffix: Azure Digital Twins
55
description: Learn about the reasons and strategies behind extending an ontology
66
author: baanders
77
ms.author: baanders # Microsoft employees only
8-
ms.date: 12/13/2021
8+
ms.date: 3/29/2022
99
ms.topic: conceptual
1010
ms.service: digital-twins
1111

@@ -29,7 +29,7 @@ In the DTDL-based RealEstateCore ontology, the Space hierarchy is used to define
2929

3030
A portion of the hierarchy looks like the diagram below.
3131

32-
:::image type="content" source="media/concepts-ontologies-extend/real-estate-core-original.png" alt-text="Diagram illustrating part of the RealEstateCore space hierarchy. It shows elements for Space, Room, ConferenceRoom, and Office.":::
32+
:::image type="content" source="media/concepts-ontologies-extend/real-estate-core-original.png" alt-text="Diagram showing part of the RealEstateCore space hierarchy. It shows elements for Space, Room, ConferenceRoom, and Office.":::
3333

3434
For more information about the RealEstateCore ontology, see [Digital Twins Definition Language-based RealEstateCore ontology for smart buildings](https://github.com/Azure/opendigitaltwins-building) on GitHub.
3535

@@ -52,7 +52,7 @@ To extend the industry ontology with this new concept, create a new interface th
5252

5353
After adding the focus room interface, the extended hierarchy shows the new room type.
5454

55-
:::image type="content" source="media/concepts-ontologies-extend/real-estate-core-extended-1.png" alt-text="Diagram illustrating part of the RealEstateCore space hierarchy, including the new addition.":::
55+
:::image type="content" source="media/concepts-ontologies-extend/real-estate-core-extended-new.png" alt-text="Diagram showing part of the RealEstateCore space hierarchy, including a new addition of Focus Room.":::
5656

5757
### Add extra capabilities to existing interfaces
5858

@@ -62,23 +62,35 @@ In this section, you'll see two examples:
6262
* If you're building a solution that displays 3D drawings of spaces that you already have in an existing system, you might want to associate each digital twin to its 3D drawing (by ID) so that when the solution displays information about the space, it can also retrieve the 3D drawing from the existing system.
6363
* If your solution needs to track the online/offline status of conference rooms, then you might want to track the conference room status for use in display or queries.
6464

65-
Both examples can be implemented with new properties: a `drawingId` property that associates the 3D drawing with the digital twin and an "online" property that indicates whether the conference room is online or not.
65+
Both examples can be implemented with new properties: a `drawingId` property that associates the 3D drawing with the digital twin and an `online` property that indicates whether the conference room is online or not.
6666

6767
Typically, you don't want to modify the industry ontology directly because you want to be able to incorporate updates to it in your solution in the future (which would overwrite your additions). Instead, these kinds of additions can be made in your own interface hierarchy that extends from the DTDL-based RealEstateCore ontology. Each interface you create uses multiple interface inheritances to extend its parent RealEstateCore interface and its parent interface from your extended interface hierarchy. This approach enables you to make use of the industry ontology and your additions together.
6868

69-
To extend the industry ontology, you create your own interfaces that extend from the interfaces in the industry ontology and add the new capabilities to your extended interfaces. For each interface that you want to extend, you create a new interface. The extended interfaces are written in DTDL (see the DTDL for Extended Interfaces section later in this document).
69+
To extend the industry ontology, create your own interfaces that extend from the interfaces in the industry ontology and add the new capabilities to your extended interfaces. For each interface that you want to extend, create a new interface. The extended interfaces are written in DTDL (see [DTDL for Extended Interfaces](#dtdl-for-extended-interfaces) later in this document).
7070

71-
After extending the portion of the hierarchy shown above, the extended hierarchy looks like the diagram below. Here the extended Space interface adds the `drawingId` property that will contain an ID that associates the digital twin with the 3D drawing. Additionally, the ConferenceRoom interface adds an "online" property that will contain the online status of the conference room. Through inheritance, the ConferenceRoom interface contains all capabilities from the RealEstateCore ConferenceRoom interface and all capabilities from the extended Space interface.
71+
After extending the portion of the hierarchy shown above, the extended hierarchy looks like the diagram below. Here the extended Space interface adds the `drawingId` property that will contain an ID that associates the digital twin with the 3D drawing. Additionally, the ConferenceRoom interface adds an `online` property that will contain the online status of the conference room. Through inheritance, the ConferenceRoom interface contains all capabilities from the RealEstateCore ConferenceRoom interface and all capabilities from the extended Space interface.
7272

73-
:::image type="content" source="media/concepts-ontologies-extend/real-estate-core-extended-2.png" alt-text="Diagram illustrating the extended RealEstateCore space hierarchy, with more new additions as described.":::
73+
:::image type="content" source="media/concepts-ontologies-extend/real-estate-core-extended-existing.png" alt-text="Diagram showing the extended RealEstateCore space hierarchy, with more new additions as described.":::
74+
75+
You don't have to extend every interface in the industry ontology, only those where you need to add new capabilities. For example, if you need to add a new capability, such as an `arterial` property to the Hallway interface, you can extend that interface without extending other interfaces that also extend from Room.
76+
77+
:::image type="content" source="media/concepts-ontologies-extend/real-estate-core-extended-existing-small.png" alt-text="Diagram showing an extended RealEstateCore space hierarchy, containing an extended Hallway interface with an arterial property.":::
78+
79+
#### Relationships to extended interfaces
80+
81+
Extended interfaces can also be used as the target for relationships, even if the relationship is originally modeled to target a base interface. As an example, in the DTDL-based RealEstateCore ontology, the Apartment interface contains a Relationship named *includes* that targets a Room interface (shown in the diagram below). This lets you create a graph of rooms to make up the apartment.
82+
83+
Based on the portion of the Room hierarchy from the [previous section](#add-extra-capabilities-to-existing-interfaces), an Apartment digital twin can include Room-type twins, and Hallway is an extension of Room (so an Apartment can include Hallways). This also means that an Apartment can include an extended Hallway with the `arterial` property, because an extended Hallway counts as a Hallway as it's referenced in the original relationships.
84+
85+
:::image type="content" source="media/concepts-ontologies-extend/real-estate-core-extended-relationships.png" alt-text="Diagram showing an extended RealEstateCore space hierarchy, with an extended Hallway interface and relationships to it.":::
7486

7587
## Using the extended space hierarchy
7688

7789
When you create digital twins using the extended Space hierarchy, each digital twin's model will be one from the extended Space hierarchy (not the original industry ontology) and will include all the capabilities from the industry ontology and the extended interfaces though interface inheritance.
7890

7991
Each digital twin's model will be an interface from the extended hierarchy, shown in the diagram below.
8092

81-
:::image type="content" source="media/concepts-ontologies-extend/ontology-with-models.png" alt-text="Diagram illustrating the extended RealEstateCore space hierarchy, including the connected models Space, Room, ConferenceRoom, Office, and FocusRoom.":::
93+
:::image type="content" source="media/concepts-ontologies-extend/ontology-with-models.png" alt-text="Diagram showing the extended RealEstateCore space hierarchy, including the connected models Space, Room, ConferenceRoom, Office, and FocusRoom.":::
8294

8395
When querying for digital twins using the model ID (the `IS_OF_MODEL` operator), the model IDs from the extended hierarchy should be used. For example, `SELECT * FROM DIGITALTWINS WHERE IS_OF_MODEL('dtmi:com:example:Office;1')`.
8496

0 commit comments

Comments
 (0)
Please sign in to comment.