automatic demotion of lists in AQL ?

2019-04-26 Thread Georg Fette

Hello,
Is it allowed to use an element that is allowed to appear multiple times 
within a path ?

For example in the query

SELECT a/items[at0001]/value
    FROM EHR e
        CONTAINS CLUSTER a[openEHR-EHR-CLUSTER.laboratory_test_analyte.v1]

the field items[at0001] may appear 0..* times. Thus the access to the 
value field is not properly defined from a type checking point of view.
Does the AQL specification allow such constructs and how is this 
situation interpreted ?

Greetings
Georg

--
-
Dipl.-Inf. Georg Fette  Raum: B001
Universität WürzburgTel.: +49-(0)931-31-85516
Am Hubland  Fax.: +49-(0)931-31-86732
97074 Würzburg  mail: georg.fe...@uni-wuerzburg.de
-


___
openEHR-technical mailing list
openEHR-technical@lists.openehr.org
http://lists.openehr.org/mailman/listinfo/openehr-technical_lists.openehr.org


RE: AQL questions

2019-04-26 Thread Bjørn Næss
Thomas answered the CONTAINS operator. 

I am not sure how to best answer your second question. I will try the following 
:-) 

The node predicates as below: 

*c2/items[at0002]/items[at0001]/value/magnitude
*o/data[at0001]/events[at0002]/time

Here the "c2" and "o" is a reference to a path in the Composition, and the 
reference is defined in the FROM part of the AQL. The "c2" is synonymous with 
the following path: 

"c2" == 
"/content[openEHR-EHR-OBSERVATION.laboratory_test.v1]/data[at0001]/events[at0002]/data[at0003]/items[openEHR-EHR-CLUSTER.laboratory_test_panel.v1]"

Which gives "c2" + "path" to be: 

"/content[openEHR-EHR-OBSERVATION.laboratory_test.v1]/data[at0001]/events[at0002]/data[at0003]/items[openEHR-EHR-CLUSTER.laboratory_test_panel.v1]/
 /items[at0002]/items[at0001]/value/magnitude"


Vennlig hilsen
Bjørn Næss
Produktansvarlig 
DIPS ASA

Mobil +47 93 43 29 10

-Original Message-
From: openEHR-technical  On Behalf 
Of Georg Fette
Sent: torsdag 25. april 2019 19:30
To: openehr-technical@lists.openehr.org
Subject: Re: AQL questions

Hi Bjørn,
Thank you for your answers. They make me assume that the CONTAINS-operator is 
recursive because in your second query you ommited the part with "CONTAINS 
OBSERVATION o[openEHR-EHR-OBSERVATION.laboratory_test.v1]". Is this assumption 
correct ? This would make writing AQL a lot simpler.
Another assumption I have is that the predicate namespaces always relate to the 
aliased archetype the path they are used within starts with. In your first 
query you use at0001 and at0002 each two times but they seem to have different 
meanings.
Greetings
Georg

--
-
Dipl.-Inf. Georg Fette  Raum: B009
Universität WürzburgTel.: +49-(0)931-31-85516
Am Hubland  Fax.: +49-(0)931-31-86732
97074 Würzburg  mail: georg.fe...@uni-wuerzburg.de
-


___
openEHR-technical mailing list
openEHR-technical@lists.openehr.org
http://lists.openehr.org/mailman/listinfo/openehr-technical_lists.openehr.org
___
openEHR-technical mailing list
openEHR-technical@lists.openehr.org
http://lists.openehr.org/mailman/listinfo/openehr-technical_lists.openehr.org