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
* docs(query-language): add normative "Query Evaluation Semantics"
Specify how AAS queries MUST be evaluated, covering:
- parse and schema validation (400 / 422 mapping),
- behaviour of FieldIdentifiers that do not resolve on the target
(candidate excluded, no error),
- behaviour under profile restrictions (non-applicable prefix is
treated like "field not present"),
- semantics of list-valued FieldIdentifiers (existential match),
- behaviour on casting errors (candidate excluded, query stays green),
- interaction with Access Rules (IDTA-01004): applicable ALLOW rules
filter the candidate set; "not applicable" rules do not fail the
query.
Refs: Review Finding T-15
Made-with: Cursor
* fix local reference
---------
Co-authored-by: sebbader-sap <107036549+sebbader-sap@users.noreply.github.com>
Copy file name to clipboardExpand all lines: documentation/IDTA-01002-3/modules/ROOT/pages/query-language.adoc
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -329,6 +329,7 @@ Paranthesises `(` `)` allow to combine logical expressions to define precedence.
329
329
For explicite casting the following casting operators are used:
330
330
331
331
[.table-with-appendix-table]
332
+
[[casting]]
332
333
[width=100%, cols="10%,40%,50%"]
333
334
|===
334
335
h| Casting Operator h| Description h| Definition
@@ -544,6 +545,31 @@ a|
544
545
545
546
The AAS Query Language does not introduce additional functionalities to control the pagination or sorting of the result sets. The general capabilities available for Operations apply as well for queries. See for instance xref:http-rest-api/http-rest-api.adoc#pagination[Pagination] for the pagination mechanism for the HTTP APIs, which also define the pagination and sorting behavior for AAS queries that are exchanged via HTTP.
546
547
548
+
[[query-evaluation-semantics]]
549
+
== Query Evaluation Semantics (normative)
550
+
551
+
This clause defines how an AAS query MUST be evaluated so that client and server implementations behave deterministically.
552
+
553
+
=== Parse and Validation
554
+
555
+
* A query that does not match the BNF `grammar.bnf` or does not validate against the JSON Schema MUST be rejected with HTTP status `400 Bad Request`.
556
+
* Combinations that parse but are semantically unsupported by the server (e.g. operator/type combinations the server does not implement) MUST be rejected with HTTP status `422 Unprocessable Entity`.
557
+
558
+
=== Evaluation of FieldIdentifiers
559
+
560
+
* A FieldIdentifier that does not resolve to any value on a candidate object (because the field does not exist on that target) produces *no comparison match*: the candidate is excluded from the result set. This MUST NOT raise an error.
561
+
* A FieldIdentifier that is not applicable for the active profile (see xref:http-rest-api/service-specifications-and-profiles.adoc#fieldidentifier-applicability[FieldIdentifier Applicability per Profile]) is treated like "field does not exist": the candidate is excluded, no error is raised.
562
+
* A list-valued FieldIdentifier (`submodels[]`, `specificAssetIds[]`, `supplementalSemanticIds[]`, ...) matches when *at least one* list element satisfies the comparison, unless an explicit index is provided.
563
+
564
+
=== Casting Errors
565
+
566
+
* An explicit cast that fails on the current candidate (e.g. `num("abc")`) MUST exclude the candidate from the result set; it MUST NOT fail the whole query.
567
+
* Implicit casts between the types listed in the xref:casting[casting table] follow the same rule.
568
+
569
+
=== Combination with Access Rules
570
+
571
+
When a query is evaluated by a service that also enforces Access Rules (see IDTA-01004), the query's candidate set MUST be filtered through the applicable access rules before being returned. Access rules that evaluate to `not applicable` for a candidate (e.g. because a referenced FieldIdentifier does not exist in the current profile) MUST NOT cause the query to fail; such rules simply do not contribute an ALLOW for the candidate.
572
+
547
573
== JSON Schema
548
574
549
575
The AAS HTTP API represents AAS Queries as JSON objects. A JSON schema according to the grammar above has been defined.
0 commit comments