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 c01abcd

Browse files
committedJan 20, 2022
replaced screenshots that were using powershell with bash
1 parent 58eb3bb commit c01abcd

13 files changed

+4
-4
lines changed
 

‎articles/digital-twins/how-to-query-graph.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Get digital twins by **properties** (including ID and metadata):
4242
As shown in the query above, the ID of a digital twin is queried using the metadata field `$dtId`.
4343

4444
>[!TIP]
45-
> If you are using Cloud Shell to run a query with metadata fields that begin with `$`, you should escape the `$` with a backtick to let Cloud Shell know it's not a variable and should be consumed as a literal in the query text.
45+
> If you are using Cloud Shell to run a query with metadata fields that begin with `$`, you should escape the `$` with a backslash to let Cloud Shell know it's not a variable and should be consumed as a literal in the query text.
4646
4747
You can also get twins based on **whether a certain property is defined**. Here's a query that gets twins that have a defined *Location* property:
4848

Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

‎articles/digital-twins/tutorial-command-line-cli.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ Run the following queries in the Cloud Shell to answer some questions about the
275275
1. **What are all the rooms on floor0?** (query by relationship)
276276
277277
```azurecli-interactive
278-
az dt twin query --dt-name <Azure-Digital-Twins-instance-name> --query-command "SELECT room FROM DIGITALTWINS floor JOIN room RELATED floor.contains where floor.`$dtId = 'floor0'"
278+
az dt twin query --dt-name <Azure-Digital-Twins-instance-name> --query-command "SELECT room FROM DIGITALTWINS floor JOIN room RELATED floor.contains where floor.\$dtId = 'floor0'"
279279
```
280280
281281
You can query based on relationships in your graph, to get information about how twins are connected or to restrict your query to a certain area. Only room0 is on floor0, so it's the only room in the result.
@@ -285,7 +285,7 @@ Run the following queries in the Cloud Shell to answer some questions about the
285285
> [!NOTE]
286286
> A twin's ID (like floor0 in the query above) is queried using the metadata field `$dtId`.
287287
>
288-
>When using Cloud Shell to run a query with metadata fields like this one that begin with `$`, you should escape the `$` with a backtick to let Cloud Shell know it's not a variable and should be consumed as a literal in the query text. This is reflected in the screenshot above.
288+
>When using Cloud Shell to run a query with metadata fields like this one that begin with `$`, you should escape the `$` with a backslash to let Cloud Shell know it's not a variable and should be consumed as a literal in the query text. This is reflected in the screenshot above.
289289
290290
1. **What are all the twins in my environment with a temperature above 75?** (query by property)
291291
@@ -300,7 +300,7 @@ Run the following queries in the Cloud Shell to answer some questions about the
300300
1. **What are all the rooms on *floor0* with a temperature above 75?** (compound query)
301301
302302
```azurecli-interactive
303-
az dt twin query --dt-name <Azure-Digital-Twins-instance-name> --query-command "SELECT room FROM DIGITALTWINS floor JOIN room RELATED floor.contains where floor.`$dtId = 'floor0' AND IS_OF_MODEL(room, 'dtmi:example:Room;2') AND room.Temperature > 75"
303+
az dt twin query --dt-name <Azure-Digital-Twins-instance-name> --query-command "SELECT room FROM DIGITALTWINS floor JOIN room RELATED floor.contains where floor.\$dtId = 'floor0' AND IS_OF_MODEL(room, 'dtmi:example:Room;2') AND room.Temperature > 75"
304304
```
305305
306306
You can also combine the earlier queries like you would in SQL, using combination operators such as `AND`, `OR`, `NOT`. This query uses `AND` to make the previous query about twin temperatures more specific. The result now only includes rooms with temperatures above 75 that are on floor0—which in this case, is none of them. The result set is empty.

0 commit comments

Comments
 (0)
Please sign in to comment.