Improve documentation of 'matches' operator


Covred by Git :

The documentation of matches:

It says: "Right operand of matches operator has three forms:"

There is only listed two and each of them is numbered 1.

Below is copied docs:

The matches operator is used in the WHERE clause. This operator needs left operand and right operand. Left operand is an AQL identified path. Right operand is enclosed within curly braces. Right operand of matches operator has three forms:

type of constraint ADL (cADL): this type of right operand can be a value list or a value range. Value range is not supported in the current AQL grammar. Below is an example with matches a string value list:

Ehr [uid=$ehrUid]
CONTAINS Composition c
CONTAINS Observation o[openEHR-EHR-OBSERVATION.microbiology.v1]
o/data[at0002]/events[at0003]/data/items[at0015]/items[at0018]/items[at0019]/items[at0021]/name/defining_code/code_string matches {'18919-1', '18961-3', '19000-9'}
URI: can be a terminology URI, openEHR EHR URI, or other URI. An example with a terminology URI is shown below:

e/ehr_status/subject/external_ref/id/value, diagnosis/data/items[at0002.1]/value
CONTAINS Composition c[openEHR-EHR-COMPOSITION.problem_list.v1]
CONTAINS Evaluation diagnosis[openEHR-EHR-EVALUATION.problem-diagnosis.v1]
c/name/value='Current Problems'
AND diagnosis/data/items[at0002.1]/value/defining_code matches { terminology://Snomed-CT/hierarchy?rootConceptId=50043002 }


Matija Polajnar
April 10, 2020, 9:17 AM

Is this now duplicated with SPECQUERY-15?

Thomas Beale
April 10, 2020, 10:04 AM

I think Pablo did the changes in the same Pull request as for the changes for - we didn’t quite get the CRs matched up cleanly with changes made to the spec. I have found the exact commit with the change; it’s now in the change description.

Matija Polajnar
April 10, 2020, 10:46 AM
  • a string list. It Equivalent toA string list. It is equivalent to

  • a missing quote in the very next line’s comment

  • Value range is not supported in the current AQL grammar.: But is it supported by any implementation? If not, do we really need value ranges in the spec?

  • In AQL, a URI can be either terminology URI or an EHR URI.: This is explained already just before the example. Although I’m not sure when one would use an EHR URI and what that would mean in an AQL.


Matija Polajnar
June 16, 2020, 7:04 AM

Are there any new commits resolving my comment?

Thomas Beale
June 16, 2020, 8:09 AM

Aha - somehow I missed that one. Working on it now… Now completed.



Bjørn Næss

Raised By

Bjørn Næss


Affects versions