Skip to content

Commit f36a166

Browse files
committed
Clarify language
1 parent 81d7dd2 commit f36a166

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

articles/digital-twins/reference-query-clause-match.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ titleSuffix: Azure Digital Twins
55
description: Reference documentation for the Azure Digital Twins query language MATCH clause
66
author: baanders
77
ms.author: baanders # Microsoft employees only
8-
ms.date: 05/11/2022
8+
ms.date: 11/01/2022
99
ms.topic: article
1010
ms.service: digital-twins
1111

@@ -25,7 +25,7 @@ This clause is optional while querying.
2525

2626
## Core syntax: MATCH
2727

28-
`MATCH` supports any query that finds a path between twins with an unpredictable number of hops, based on certain relationship conditions.
28+
`MATCH` supports any query that finds a path between twins within a range of hops, based on certain relationship conditions.
2929

3030
The relationship condition can include one or more of the following details:
3131
* [Relationship direction](#specify-relationship-direction) (left-to-right, right-to-left, or non-directional)
@@ -42,11 +42,14 @@ A query with a `MATCH` clause must also use the [WHERE clause](reference-query-c
4242

4343
Here's the basic `MATCH` syntax.
4444

45-
The placeholder values shown in the `MATCH` clause that should be replaced with your values are `twin_1`, `relationship_condition`, and `twin_2`. The placeholder values in the `WHERE` clause that should be replaced with your values are `twin_or_twin_collection` and `twin_ID`.
45+
It contains these placeholders:
46+
* `twin_or_twin_collection` (x2): The `MATCH` clause requires one operand to represent a single twin. The other operand can represent another single twin, or a collection of twins.
47+
* `relationship_condition`: In this space, define a condition that describes the relationship between the twins or twin collections. The condition can [specify relationship direction](#specify-relationship-direction), [specify relationship name](#specify-relationship-name), [specify number of hops](#specify-number-of-hops), [specify relationship properties](#assign-query-variable-to-relationship-and-specify-relationship-properties), or [any combination of these options](#combine-match-operations).
48+
* `twin_ID`: Here, specify a `$dtId` within one of the twin collections so that one of the operands represents a single twin.
4649

4750
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchSyntax":::
4851

49-
You can leave out the name of one of the twins in order to allow any twin name to work in that spot.
52+
You can leave one of the twin collections blank in order to allow any twin to work in that spot.
5053

5154
You can also change the number of relationship conditions, to have multiple [chained](#combine-match-operations) relationship conditions or no relationship condition at all:
5255

@@ -81,7 +84,7 @@ Use the relationship condition in the `MATCH` clause to specify a relationship d
8184
8285
Directional relationship descriptions use a visual depiction of an arrow to indicate the direction of the relationship. The arrow includes a space set aside by square brackets (`[]`) for an optional [relationship name](#specify-number-of-hops).
8386

84-
This section shows the syntax for different directions of relationships. The placeholder values that should be replaced with your values are `source_twin` and `target_twin`.
87+
This section shows the syntax for different directions of relationships. The placeholder values that should be replaced with your values are `source_twin_or_twin_collection` and `target_twin_or_twin_collection`.
8588

8689
For a *left-to-right* relationship, use the following syntax.
8790

@@ -140,11 +143,11 @@ If you don't provide a relationship name, the query will include all relationshi
140143
141144
Specify the name of a relationship to traverse in the `MATCH` clause within square brackets (`[]`). This section shows the syntax of specifying named relationships.
142145

143-
For a single name, use the following syntax. The placeholder values that should be replaced with your values are `twin_1`, `relationship_name`, and `twin_2`.
146+
For a single name, use the following syntax. The placeholder values that should be replaced with your values are `twin_or_twin_collection_1`, `relationship_name`, and `twin_or_twin_collection_2`.
144147

145148
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchNameSingleSyntax":::
146149

147-
For multiple possible names use the following syntax. The placeholder values that should be replaced with your values are `twin_1`, `relationship_name_option_1`, `relationship_name_option_2`, `twin_2`, and the note to continue the pattern as needed for the number of relationship names you want to enter.
150+
For multiple possible names use the following syntax. The placeholder values that should be replaced with your values are `twin_or_twin_collection_1`, `relationship_name_option_1`, `relationship_name_option_2`, `twin_or_twin_collection_2`, and the note to continue the pattern as needed for the number of relationship names you want to enter.
148151

149152
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchNameMultiSyntax":::
150153

@@ -188,11 +191,11 @@ If you don't provide a number of hops, the query will default to one hop.
188191
189192
Specify the number of hops to traverse in the `MATCH` clause within the square brackets (`[]`).
190193

191-
To specify an exact number of hops, use the following syntax. The placeholder values that should be replaced with your values are `twin_1`, `number_of_hops`, and `twin_2`.
194+
To specify an exact number of hops, use the following syntax. The placeholder values that should be replaced with your values are `twin_or_twin_collection_1`, `number_of_hops`, and `twin_or_twin_collection_2`.
192195

193196
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchHopsExactSyntax":::
194197

195-
To specify a range of hops, use the following syntax. The placeholder values that should be replaced with your values are `twin_1`, `starting_limit`, `ending_limit` and `twin_2`. The starting limit isn't included in the range, while the ending limit is included.
198+
To specify a range of hops, use the following syntax. The placeholder values that should be replaced with your values are `twin_or_twin_collection_1`, `starting_limit`, `ending_limit` and `twin_or_twin_collection_2`. The starting limit isn't included in the range, while the ending limit is included.
196199

197200
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchHopsRangeSyntax":::
198201

@@ -236,7 +239,7 @@ A useful result of doing this is the ability to filter on relationship propertie
236239
>[!NOTE]
237240
>The examples in this section focus on a query variable for the relationship. They all show non-directional relationships without specifying names. For instructions on how to do more with these other conditions, see [Specify relationship direction](#specify-relationship-direction) and [Specify relationship name](#specify-relationship-name). For information about how to use several of these together in the same query, see [Combine MATCH operations](#combine-match-operations).
238241
239-
To assign a query variable to the relationship, put the variable name in the square brackets (`[]`). The placeholder values shown below that should be replaced with your values are `twin_1`, `relationship_variable`, and `twin_2`.
242+
To assign a query variable to the relationship, put the variable name in the square brackets (`[]`). The placeholder values shown below that should be replaced with your values are `twin_or_twin_collection_1`, `relationship_variable`, and `twin_or_twin_collection_2`.
240243

241244
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchVariableSyntax":::
242245

@@ -256,18 +259,18 @@ In a single query, you can combine [relationship direction](#specify-relationshi
256259

257260
The following syntax examples show how these attributes can be combined. You can also leave out any of the optional details shown in placeholders to omit that part of the condition.
258261

259-
To specify relationship direction, relationship name, and number of hops within a single query, use the following syntax within the relationship condition. The placeholder values that should be replaced with your values are `twin_1` and `twin_2`, `optional_left_angle_bracket` and `optional_right_angle_bracket`, `relationship_name(s)`, and `number_of_hops`.
262+
To specify relationship direction, relationship name, and number of hops within a single query, use the following syntax within the relationship condition. The placeholder values that should be replaced with your values are `twin_or_twin_collection_1` and `twin_or_twin_collection_2`, `optional_left_angle_bracket` and `optional_right_angle_bracket`, `relationship_name(s)`, and `number_of_hops`.
260263

261264
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchCombinedHopsSyntax":::
262265

263-
To specify relationship direction, relationship name, and a query variable for the relationship within a single query, use the following syntax within the relationship condition. The placeholder values that should be replaced with your values are `twin_1` and `twin_2`, `optional_left_angle_bracket` and `optional_right_angle_bracket`, `relationship_variable`, and `relationship_name(s)`.
266+
To specify relationship direction, relationship name, and a query variable for the relationship within a single query, use the following syntax within the relationship condition. The placeholder values that should be replaced with your values are `twin_or_twin_collection_1` and `twin_or_twin_collection_2`, `optional_left_angle_bracket` and `optional_right_angle_bracket`, `relationship_variable`, and `relationship_name(s)`.
264267

265268
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchCombinedVariableSyntax":::
266269

267270
>[!NOTE]
268271
>As per the options for [specifying relationship direction](#specify-relationship-direction), you must pick between a left angle bracket for a left-to-right relationship or a right angle bracket for a right-to-left relationship. You can't include both on the same arrow, but can represent bi-directional relationships by chaining.
269272
270-
You can chain multiple relationship conditions together, like this. The placeholder values that should be replaced with your values are `twin_1`, all instances of `relationship_condition`, and `twin_2`.
273+
You can chain multiple relationship conditions together, like this. The placeholder values that should be replaced with your values are `twin_or_twin_collection_1`, all instances of `relationship_condition`, and `twin_or_twin_collection_2`.
271274

272275
:::code language="sql" source="~/digital-twins-docs-samples/queries/reference.sql" id="MatchChainSyntax":::
273276

0 commit comments

Comments
 (0)