Skip to content

Commit 82281dd

Browse files
authored
fix: Update dataplex context for new syntax (#60)
1 parent 88552f3 commit 82281dd

File tree

1 file changed

+49
-15
lines changed

1 file changed

+49
-15
lines changed

DATAPLEX.md

Lines changed: 49 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -218,24 +218,38 @@ Finds resources that were created within, before, or after a given date or time.
218218

219219
To search for entries based on their attached aspects, use the following query syntax.
220220

221-
aspect:x Matches x as a substring of the full path to the aspect type of an aspect that is attached to the entry, in the format projectid.location.ASPECT_TYPE_ID
222-
aspect=x Matches x as the full path to the aspect type of an aspect that is attached to the entry, in the format projectid.location.ASPECT_TYPE_ID
223-
aspect:xOPERATORvalue
224-
Searches for aspect field values. Matches x as a substring of the full path to the aspect type and field name of an aspect that is attached to the entry, in the format projectid.location.ASPECT_TYPE_ID.FIELD_NAME
225-
226-
The list of supported {OPERATOR}s depends on the type of field in the aspect, as follows:
221+
`has:x`
222+
Matches `x` as a substring of the full path to the aspect type of an aspect that is attached to the entry, in the format `projectid.location.ASPECT_TYPE_ID`
227223

228-
* String: = (exact match) and : (substring)
229-
* All number types: =, :, <, >, <=, >=, =>, =<
230-
* Enum: =
231-
* Datetime: same as for numbers, but the values to compare are treated as datetimes instead of numbers
232-
* Boolean: =
224+
`has=x`
225+
Matches `x` as the full path to the aspect type of an aspect that is attached to the entry, in the format `projectid.location.ASPECT_TYPE_ID`
233226

234-
Only top-level fields of the aspect are searchable. For example, all of the following queries match entries where the value of the is-enrolled field in the employee-info aspect type is true. Other entries that match on the substring are also returned.
227+
`xOPERATORvalue`
228+
Searches for aspect field values. Matches x as a substring of the full path to the aspect type and field name of an aspect that is attached to the entry, in the format projectid.location.ASPECT_TYPE_ID.FIELD_NAME
235229

236-
* aspect:example-project.us-central1.employee-info.is-enrolled=true
237-
* aspect:example-project.us-central1.employee=true
238-
* aspect:employee=true
230+
The list of supported operators depends on the type of field in the aspect, as follows:
231+
* **String**: `=` (exact match)
232+
* **All number types**: `=`, `:`, `<`, `>`, `<=`, `>=`, `=>`, `=<`
233+
* **Enum**: `=` (exact match only)
234+
* **Datetime**: same as for numbers, but the values to compare are treated as datetimes instead of numbers
235+
* **Boolean**: `=`
236+
237+
Only top-level fields of the aspect are searchable.
238+
239+
* Syntax for system aspect types:
240+
* `ASPECT_TYPE_ID.FIELD_NAME`
241+
* `dataplex-types.ASPECT_TYPE_ID.FIELD_NAME`
242+
* `dataplex-types.LOCATION.ASPECT_TYPE_ID.FIELD_NAME`
243+
For example, the following queries match entries where the value of the `type` field in the `bigquery-dataset` aspect is `default`:
244+
* `bigquery-dataset.type=default`
245+
* `dataplex-types.bigquery-dataset.type=default`
246+
* `dataplex-types.global.bigquery-dataset.type=default`
247+
* Syntax for custom aspect types:
248+
* If the aspect is created in the global region: `PROJECT_ID.ASPECT_TYPE_ID.FIELD_NAME`
249+
* If the aspect is created in a specific region: `PROJECT_ID.REGION.ASPECT_TYPE_ID.FIELD_NAME`
250+
For example, the following queries match entries where the value of the `is-enrolled` field in the `employee-info` aspect is `true`.
251+
* `example-project.us-central1.employee-info.is-enrolled=true`
252+
* `example-project.employee-info.is-enrolled=true`
239253

240254
Example:-
241255
You can use following filters
@@ -251,6 +265,25 @@ Logical AND and logical OR are supported. For example, foo OR bar.
251265
You can negate a predicate with a - (hyphen) or NOT prefix. For example, -name:foo returns resources with names that don't match the predicate foo.
252266
Logical operators are case-sensitive. `OR` and `AND` are acceptable whereas `or` and `and` are not.
253267

268+
### Abbreviated syntax
269+
270+
An abbreviated search syntax is also available, using `|` (vertical bar) for `OR` operators and `,` (comma) for `AND` operators.
271+
272+
For example, to search for entries inside one of many projects using the `OR` operator, you can use the following abbreviated syntax:
273+
274+
`projectid:(id1|id2|id3|id4)`
275+
276+
The same search without using abbreviated syntax looks like the following:
277+
278+
`projectid:id1 OR projectid:id2 OR projectid:id3 OR projectid:id4`
279+
280+
To search for entries with matching column names, use the following:
281+
282+
* **AND**: `column:(name1,name2,name3)`
283+
* **OR**: `column:(name1|name2|name3)`
284+
285+
This abbreviated syntax works for the qualified predicates except for `label` in keyword search.
286+
254287
### Request
255288

256289
1. Always try to rewrite the prompt using search syntax.
@@ -300,6 +333,7 @@ Logical operators are case-sensitive. `OR` and `AND` are acceptable whereas `or`
300333
- description: Table contains list of best customers.
301334
```
302335
336+
303337
3. Ask to select one of the presented search results
304338
2. If there is only one search result found
305339
1. Present the search result immediately.

0 commit comments

Comments
 (0)