You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Quickstart - Get started with a sample scenario in Azure Digital Twins Explorer
14
14
15
-
This quickstart is an introduction to Azure Digital Twins, showing how Azure Digital Twins represents data and demonstrating what it's like to interact with a digital *twin graph* of a physical building. You'll use the [Azure portal site](https://portal.azure.com) and the [Azure Digital Twins Explorer](concepts-azure-digital-twins-explorer.md), which is a tool for visualizing and interacting with your Azure Digital Twins data in a web browser.
15
+
This quickstart is an introduction to Azure Digital Twins, showing how Azure Digital Twins represents data and demonstrating what it's like to interact with a digital twin graph of a physical building. You'll use the [Azure portal site](https://portal.azure.com) and the [Azure Digital Twins Explorer](concepts-azure-digital-twins-explorer.md), which is a tool for visualizing and interacting with Azure Digital Twins data in a web browser.
16
16
17
-
In this quickstart, you'll look at pre-built sample *models* that digitally define the concepts of a *Building*, a *Floor*, and a *Room*, and use these model definitions to create digital *twins* that represent specific floors and rooms from a physical building. These individual twin elements will be connected into a virtual *twin graph* that reflects their relationships to each other, to form a complete digital representation of the sample building. The sample graph you'll be working with represents a building that contains two floors, and each floor contains one room. The graph will look like this image:
17
+
In this quickstart, you'll look at pre-built sample **models** that digitally define the concepts of a *Building*, a *Floor*, and a *Room*, and use these model definitions to create **digital twins** that represent specific floors and rooms from a physical building. These individual twins will be connected into a virtual **twin graph** that reflects their relationships to each other, forming a complete digital representation of the sample building. The graph you'll be working with represents a building that contains two floors, and each floor contains rooms. The graph will look like this image:
18
18
19
19
:::image type="content" source="media/quickstart-azure-digital-twins-explorer/graph-view-2.png" alt-text="Screenshot of a graph made of four circular nodes connected by arrows in Azure Digital Twins Explorer.":::
20
20
21
21
Here are the steps you'll use to explore the graph in this article:
22
22
23
23
1. Create an Azure Digital Twins instance, and open it in Azure Digital Twins Explorer.
24
-
1. Upload prebuilt models and graph data to construct the sample scenario.
25
-
1. Explore and expand the sample graph.
24
+
1. Upload pre-built models and graph data to construct the sample scenario. Add one more twin manually.
26
25
1. Simulate changing IoT data, and query the graph to see results.
27
26
1. Review your learnings from the experience.
28
27
29
28
>[!NOTE]
30
-
>For simplicity, this quickstart does not cover setup of a live data flow from IoT devices inside the modeled environment. To set up a simulated end-to-end data flow that drives your twin graph, move ahead to the tutorials: [Connect an end-to-end solution](tutorial-end-to-end.md). For more information on data flow between services and integrating Azure Digital Twins into a wider IoT solution, see [Data ingress and egress](concepts-data-ingress-egress.md).
29
+
>For simplicity, this quickstart does not cover setting up a live data flow from IoT devices inside the modeled environment. To set up a simulated end-to-end data flow that drives your twin graph, move ahead to the tutorials: [Connect an end-to-end solution](tutorial-end-to-end.md). For more information on data flow between services and integrating Azure Digital Twins into a wider IoT solution, see [Data ingress and egress](concepts-data-ingress-egress.md).
31
30
32
31
## Prerequisites
33
32
@@ -80,19 +79,19 @@ In Azure Digital Twins Explorer, follow these steps to upload the *Building*, *F
80
79
:::image type="content" source="media/quickstart-azure-digital-twins-explorer/upload-model.png" alt-text="Screenshot of the Azure Digital Twins Explorer, highlighting the Models panel and the 'Upload a Model' icon in it." lightbox="media/quickstart-azure-digital-twins-explorer/upload-model.png":::
81
80
82
81
1. In the Open window that appears, navigate to the folder containing the downloaded *.json* files on your machine.
83
-
1. Select *Building.json*, *Floor.json*, and *Room.json*, and select **Open** to upload them all at once.
82
+
1. Select *Building.json*, *Floor.json*, and *Room.json*, and select **Open** to upload them all at once.
84
83
85
84
Azure Digital Twins Explorer will upload these model files to your Azure Digital Twins instance. They should show up in the **Models** panel and display their friendly names and full model IDs.
86
85
87
-
You can select **View Model**for either model to see the DTDL code that defines each model type.
86
+
You can select **View Model**from any of the models' options to see the DTDL code that defines each model type.
88
87
89
88
:::image type="content" source="media/quickstart-azure-digital-twins-explorer/model-info.png" alt-text="Screenshot of the Azure Digital Twins Explorer showing the Models panel with three model definitions listed inside: Building, Floor, and Room." lightbox="media/quickstart-azure-digital-twins-explorer/model-info.png":::
90
89
91
90
### Twins and the twin graph
92
91
93
92
Now that some model definitions have been uploaded to your Azure Digital Twins instance, you can use these definitions to create *digital twins* for the elements in your environment.
94
93
95
-
Every digital twin in your solution represents an entity from the physical environment. You can create many twins based on the same model type, like multiple room twins that all use the *Room* model. In this quickstart, you'll need a digital twin for the building, and a digital twin for each floor and room in the building. The twins will be connected with relationships into a *twin graph* that represents the full sample building environment.
94
+
Every digital twin in your solution represents an entity from the physical environment. You can create many twins based on the same model type, like multiple room twins that all use the *Room* model. In this quickstart, you'll need a digital twin for the building, and a digital twin for each floor and room in the building. The twins will be connected with relationships into a *twin graph* that represents the full building environment.
96
95
97
96
In this section, you'll upload a pre-created graph containing a building twin, two floor twins, and two room twins.
98
97
@@ -124,31 +123,31 @@ In Azure Digital Twins Explorer, follow these steps to import the sample graph (
124
123
125
124
:::image type="content" source="media/quickstart-azure-digital-twins-explorer/run-query.png" alt-text="Screenshot of the Azure Digital Twins Explorer highlighting the 'Run Query' button in the upper-right corner of the window." lightbox="media/quickstart-azure-digital-twins-explorer/run-query.png":::
126
125
127
-
This action runs the default query to select and display all digital twins. Azure Digital Twins Explorer retrieves all twins and relationships from the service. It draws the graph defined by them in the **Twin Graph** panel.
128
-
129
-
Now you can see the uploaded graph of the sample scenario. The circles (graph "nodes") represent digital twins. The lines represent relationships. The BuildingA twin "contains" the Floor0 and Floor1 twins, the Floor0 twin "contains" Room0, and the Floor1 twin "contains" Room1. If you're using a mouse, you can click and drag in the graph to move elements around.
126
+
This action runs the default query to select and display all digital twins. Azure Digital Twins Explorer retrieves all twins and relationships from the service. It draws the graph defined by them in the **Twin Graph** panel. Now you can see the uploaded graph of the sample scenario.
130
127
131
128
:::image type="content" source="media/quickstart-azure-digital-twins-explorer/graph-view-1.png" alt-text="Screenshot of Azure Digital Twins Explorer showing the uploaded graph.'":::
132
129
130
+
The circles (graph "nodes") represent digital twins. The lines represent relationships. The BuildingA twin "contains" the Floor0 and Floor1 twins, the Floor0 twin "contains" Room0, and the Floor1 twin "contains" Room1. If you're using a mouse, you can click and drag in the graph to move around elements.
131
+
133
132
#### Add another twin
134
133
135
-
You can continue to edit the structure of a digital twin graph after its initial creation. Imagine that another room has recently been constructed on Floor1 of this example building. In this section, you'll add a new twin to the graph, to represent the new room.
134
+
You can continue to edit the structure of a digital twin graph after it's been created. Imagine that another room has recently been constructed on Floor1 of this example building. In this section, you'll add a new twin to the graph, to represent the new room.
136
135
137
136
Start by selecting the model that defines the type of twin you want to create. In the **Models** panel on the left, open the options menu for the **Room** model. Select **Create a Twin** to create a new instance of this model type.
138
137
139
138
:::image type="content" source="media/quickstart-azure-digital-twins-explorer/create-twin.png" alt-text="Screenshot of the Azure Digital Twins Explorer showing the Models panel, and the option to Create a Twin from the Room model." lightbox="media/quickstart-azure-digital-twins-explorer/create-twin.png":::
140
139
141
140
Enter *Room2* for the **New Twin name** and select **Save**. This will create a new digital twin, which is not yet connected by relationships to the rest of the graph.
142
141
143
-
Next, you'll add a relationship to express that Floor1 contains Room2. Use the CTRL/CMD or SHIFT keys to simultaneously select Floor1 and Room2 in the graph. When both twins are selected, right-click Room2 and choose **Add relationships**.
142
+
Next, you'll add a relationship to show that Floor1 contains Room2. Use the CTRL/CMD or SHIFT keys to simultaneously select Floor1 and Room2 in the graph. When both twins are selected, right-click Room2 and choose **Add relationships**.
144
143
145
144
:::image type="content" source="media/quickstart-azure-digital-twins-explorer/add-relationships.png" alt-text="Screenshot of the Azure Digital Twins Explorer, adding a relationship between Floor1 and Room2." lightbox="media/quickstart-azure-digital-twins-explorer/add-relationships.png":::
146
145
147
-
This will open a **Create Relationship** dialog that's pre-filled with the details of a "contains"-type relationship from Floor1 to Room2. Select **Save**.
146
+
This will open a **Create Relationship** dialog that's pre-filled with the details of a "contains" relationship from Floor1 to Room2. Select **Save**.
148
147
149
148
:::image type="content" source="media/quickstart-azure-digital-twins-explorer/create-relationship-save.png" alt-text="Screenshot of the Create Relationship options." lightbox="media/quickstart-azure-digital-twins-explorer/create-relationship-save.png":::
150
149
151
-
Now Room2 is a connected part of the graph. If you're using a mouse, you can click and drag twins in the graph to arrange them in a configuration that you like.
150
+
Now Room2 is connected in the graph. If you're using a mouse, you can click and drag twins in the graph to arrange them into a configuration that you like.
152
151
153
152
:::image type="content" source="media/quickstart-azure-digital-twins-explorer/graph-view-2.png" alt-text="Screenshot of Azure Digital Twins Explorer showing the graph, which now includes Room2.'":::
154
153
@@ -164,36 +163,36 @@ Here are the properties of Room1. Notice that Room1 has a temperature of 80.
164
163
165
164
:::image type="content" source="media/quickstart-azure-digital-twins-explorer/properties-room1.png" alt-text="Screenshot of the Azure Digital Twins Explorer highlighting the Twin Properties panel, which shows $dtId, Temperature, and Humidity properties for Room1." lightbox="media/quickstart-azure-digital-twins-explorer/properties-room1.png":::
166
165
167
-
Room2 doesn't have values set for its properties yet, since this twin was created manually. To set values for its properties, edit the fields so that humidity is 50 and temperature is 72. Select the **Save** icon.
166
+
Room2 doesn't have values set for its properties yet, since this twin was created manually. To set its property values, edit the fields so that humidity is 50 and temperature is 72. Select the **Save** icon.
168
167
169
168
:::image type="content" source="media/quickstart-azure-digital-twins-explorer/properties-room2.png" alt-text="Screenshot of the Azure Digital Twins Explorer highlighting the Twin Properties panel, where Temperature and Humidity are being set for Room2." lightbox="media/quickstart-azure-digital-twins-explorer/properties-room2.png":::
170
169
171
-
## Query changing data
170
+
## Query changing IoT data
172
171
173
-
In Azure Digital Twins, you can query your twin graph to answer questions about your environment, using the SQL-style *Azure Digital Twins query language*. One way to query the twins in your graph is by their properties. Querying based on properties can help answer questions about—or identify outliers in—your environment. In a fully-connected, data-driven scenario, the properties of your twins will change frequently in response to IoT data from the sensors in your environment. In this quickstart, you'll change the values manually to simulate a changing sensor reading.
172
+
In Azure Digital Twins, you can query your twin graph to answer questions about your environment, using the SQL-style *Azure Digital Twins query language*. One way to query the twins in your graph is by their properties. Querying based on properties can help answer questions about—or identify outliers in—your environment. In a fullyconnected, data-driven scenario, the properties of your twins will change frequently in response to IoT data from the sensors in your environment. In this quickstart, you'll change the values manually to simulate a changing sensor reading.
174
173
175
-
Start by running a query to answer the question of how many twins in your environment have a temperature above 75. Run the following query in the **Query Explorer** panel.
174
+
Start by running a query to see how many twins in your environment have a temperature above 75. Run the following query in the **Query Explorer** panel.
Recall from viewing the twin properties earlier that Room0 has a temperature reading of 70, Room1 has a temperature reading of 80, and Room2 has a temperature reading of 72. The building and floor twins don't have a Temperature property at all. For these reasons, only Room1 shows up in the results here.
178
+
Recall from viewing the twin properties earlier that Room0 has a temperature reading of 70, Room1 has a temperature reading of 80, and Room2 has a temperature reading of 72. The building and floor twins don't have a temperature property at all. For these reasons, only Room1 shows up in the results here.
180
179
181
180
:::image type="content" source="media/quickstart-azure-digital-twins-explorer/result-query-property-before.png" alt-text="Screenshot of the Azure Digital Twins Explorer showing the results of property query, which shows only Room1." lightbox="media/quickstart-azure-digital-twins-explorer/result-query-property-before.png":::
182
181
183
182
>[!TIP]
184
-
> Other comparison operators (<,>, =, or !=) are also supported within the preceding query. You can try plugging these operators, different values, or different twin properties into the query to try out answering your own questions.
183
+
> Other comparison operators (<,>, =, or !=) are also supported in queries. You can try plugging these operators, different values, or different twin properties into the query to try out answering your own questions.
185
184
186
185
### Edit temperature data
187
186
188
-
In a fully-connected Azure Digital Twins solution, the twins in your graph can receive live updates from real IoT devices and update their properties to stay synchronized with your real-world environment. You can also manually set the properties of the twins in your graph, using Azure Digital Twins Explorer or another development interface (like the APIs or Azure CLI). For simplicity, you'll use Azure Digital Twins Explorer here to manually set the temperature reading of Room0 to 76.
187
+
In a fullyconnected Azure Digital Twins solution, the twins in your graph receive live updates from real IoT devices, and update their properties automatically to stay synchronized with your real-world environment. For simplicity in this quickstart, you'll use Azure Digital Twins Explorer here to manually set the temperature reading of Room0 to 76.
189
188
190
-
First, rerun the following query to select all digital twins. This will display the full graph once more in the **Twin Graph** panel.
189
+
First, rerun the following query to select all digital twins. This will display the full graph again in the **Twin Graph** panel.
Select **Room0** to bring up its property list in the **Twin Properties** panel.
195
194
196
-
The properties in this list are editable. Select the temperature value of**70** to enable entering a new value. Enter *76* and select the **Save** icon to update the temperature.
195
+
Change the temperature value from**70** to *76*, and select the **Save** icon to update the temperature.
197
196
198
197
:::image type="content" source="media/quickstart-azure-digital-twins-explorer/new-properties-room0.png" alt-text="Screenshot of the Azure Digital Twins Explorer highlighting that the Twin Properties panel is showing properties that can be edited for Room0." lightbox="media/quickstart-azure-digital-twins-explorer/new-properties-room0.png":::
199
198
@@ -205,7 +204,7 @@ After a successful property update, you'll see a **Patch Information** box showi
205
204
206
205
### Query to see the new result
207
206
208
-
To verify that the graph successfully registered your update to the temperature for Room0, rerun the query from earlier to get all the twins in the environment with a temperature above 75.
207
+
To see the new temperature for Room0 reflected in the graph, rerun the query from earlier to get all the twins in the environment with a temperature above 75.
@@ -217,13 +216,13 @@ Now that the temperature of Room0 has been changed from 70 to 76, both Room0 and
217
216
218
217
In this quickstart, you created an Azure Digital Twins instance and used Azure Digital Twins Explorer to populate it with a sample scenario. You also added a digital twin manually.
219
218
220
-
You then explored the graph, by:
219
+
Then, you explored the graph, including...
221
220
222
221
* Using a query to answer a question about the scenario.
223
222
* Editing a property on a digital twin.
224
223
* Running the query again to see how the answer changed as a result of your update.
225
224
226
-
The intent of this exercise is to demonstrate how you can use the Azure Digital Twins graph to answer questions about your environment, even as the environment continues to change.
225
+
The intent of this exercise is to demonstrate how you can use the Azure Digital Twins graph to answer questions about your environment, especially as IoT environments continue to change.
227
226
228
227
In this quickstart, you made the temperature update manually. It's common in Azure Digital Twins to connect digital twins to real IoT devices so that they receive updates automatically, based on telemetry data. In this way, you can build a live graph that always reflects the real state of your environment. You can use queries to get information about what's happening in your environment in real time.
229
228
@@ -243,7 +242,7 @@ To clean up after this quickstart, choose which Azure Digital Twins resources yo
243
242
244
243
:::image type="content" source="media/quickstart-azure-digital-twins-explorer/delete-instance.png" alt-text="Screenshot of the Overview page for an Azure Digital Twins instance in the Azure portal. The Delete button is highlighted.":::
245
244
246
-
You may also want to delete the sample project folder from your local machine.
245
+
You may also want to delete the sample project files from your local machine.
0 commit comments