Re: [openEHR SEC] CONTAINS in AQL

2017-10-01 Thread Pablo Pazos
Perfect!

I think the spec needs to clarify this. The only place that the
relationship involved in CONTAINS is mentioned seems to be here:

"Since archetypes are in hierarchical structure, AQL has a containment
constraint which specifies the hierarchical *relationships between parent
and child data items*."

And only mentions parent-child, that can be interpreted as direct child. It
would be good to add the semantics of CONTAINS explicitly as parent to
child-or-descendant.

"descendant" is not mentioned in the current spec.



On Oct 1, 2017 4:37 PM, "Bjørn Næss"  wrote:

> Yes - this is the way DIPS openEHR server works as well.
>
> For Composition we match any descendant .  Any structure which matches
> will be valid no matter how deep the location is.
>
> For Folder we have another case. There we only match the first level .
> This must be treated differently since we for Folder navigate through
> object references.
>
>
>
> Vennlig hilsen
>
> Bjørn Næss
>
> Produktansvarlig
>
> DIPS ASA
>
>
>  Opprinnelig melding 
> Fra: Ian McNicoll 
> Dato: 01.10.2017 19:05 (GMT+01:00)
> Til: For openEHR technical discussions  hr.org>, sec 
> Emne: Re: [openEHR SEC] CONTAINS in AQL
>
> Hi Pablo,
>
> The contains statement is intended to pick up any descendent and this is
> how it is implemented by marand ocean and Ethercis.
>
> This works down to cluster level and I suspect to element if we had any
> element archetypes.
>
> On 1 Oct 2017 at 16:12, > wrote:
>
> Hi all,
>
> I'm reading through the AQL specs, on this section http://openehr.org/rel
> eases/QUERY/latest/docs/AQL/AQL.html#_containment it is mentioned that
> CONTAINS is from parent to child.
>
> Most examples there show COMPOSITION CONTAINS ENTRY. In a case that there
> is a SECTION in the middle, should AQL be always COMPOSITION CONTAINS
> SECTION CONTAINS ENTRY?
>
> Before reading this specific point I was thinking that CONTAINS allowed to
> look anywhere on the COMPOSITION tree, semantically looking for "child or
> descendant", instead of just "child".
>
> If we have only direct "child" references, having a small tree of SECTIONs
> can make queries more complex, like COMPOSITION CONTAINS SECTION CONTAINS
> SECTION CONTAINS SECTION CONTAINS ENTRY ...
>
> Would it be useful to have that kind of "child or descendant" containment
> operator added to AQL?
>
>
> What do others think?
>
> --
> Ing. Pablo Pazos Gutiérrez
> e: pablo.pa...@cabolabs.com
> p: +598 99 043 145 <099%20043%20145>
> skype: cabolabs
> 
> http://www.cabolabs.com
> https://cloudehrserver.com
> Subscribe to our newsletter 
> ___ openEHR-technical mailing
> list openEHR-technical@lists.openehr.org http://lists.openehr.org/mailm
> an/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
>
___
openEHR-technical mailing list
openEHR-technical@lists.openehr.org
http://lists.openehr.org/mailman/listinfo/openehr-technical_lists.openehr.org

Re: AQL FROM & CONTAINS with many entries

2017-10-01 Thread Birger Haarbrandt

OK, makes sense! Please excuse me for stating the obvious :)BirgerPablo Pazos  hat am 1. Oktober 2017 um 21:21 geschrieben:Thanks, my goal besides understanding the syntax is to improve the current spec, so I'm testing some use cases against the AQL spec instead of using specific implementations.Cheers,Pablo.On Oct 1, 2017 3:33 PM, "Birger Haarbrandt"  wrote:Hi Pablo,I hope I understood correctly:select a_a/data[at0002]/events[at0003]/data[at0001]/items[at0004]/value, a_b/data[at0001]/events[at0006]/data[at0003]/items[at0004]/value from EHR econtains COMPOSITION acontains ( OBSERVATION a_a[openEHR-EHR-OBSERVATION.body_temperature.v1] and OBSERVATION a_b[openEHR-EHR-OBSERVATION.blood_pressure.v1])this should be the right way to express the query. I think an account for EHRSCAPE could be of help if you want to dig deeper into AQL. Cheers,BirgerPablo Pazos  hat am 1. Oktober 2017 um 17:52 geschrieben:Hi all, another question about AQL and CONTAINS.Most of the AQL samples use just one branch in the FROM clause, like:EHR CONTAINS COMPOSITION CONTAINS OBSERVATION.I'm wondering what would be the correct FROM notation when more than one ENTRY is needed. Some examples below.SELECT o1/data[...]/.../value, o2/..., FROM   COMPOSITION c [archid] CONTAINS OBSERVATION o1 [archid2],   COMPOSITION c [archid] CONTAINS OBSERVATION o2 [archid3],   COMPOSITION c [archid] CONTAINS OBSERVATION o3 [archid4]WHERE ...SELECT o1/data[...]/.../value, o2/..., FROM   COMPOSITION c [archid]      CONTAINS OBSERVATION o1 [archid2] AND      CONTAINS OBSERVATION o2 [archid3] AND      CONTAINS OBSERVATION o3 [archid4]WHERE ...Thanks!-- Ing. Pablo Pazos Gutiérreze: pablo.pa...@cabolabs.comp: +598 99 043 145skype: cabolabshttp://www.cabolabs.comhttps://cloudehrserver.comSubscribe to our newsletter___openEHR-technical mailing listopenEHR-technical@lists.openehr.orghttp://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___openEHR-technical mailing listopenEHR-technical@lists.openehr.orghttp://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

Re: [openEHR SEC] CONTAINS in AQL

2017-10-01 Thread Bjørn Næss
Yes - this is the way DIPS openEHR server works as well.

For Composition we match any descendant .  Any structure which matches will be 
valid no matter how deep the location is.

For Folder we have another case. There we only match the first level .  This 
must be treated differently since we for Folder navigate through object 
references.



Vennlig hilsen
Bjørn Næss
Produktansvarlig
DIPS ASA


 Opprinnelig melding 
Fra: Ian McNicoll 
Dato: 01.10.2017 19:05 (GMT+01:00)
Til: For openEHR technical discussions , 
sec 
Emne: Re: [openEHR SEC] CONTAINS in AQL

Hi Pablo,

The contains statement is intended to pick up any descendent and this is  how 
it is implemented by marand ocean and Ethercis.

This works down to cluster level and I suspect to element if we had any element 
archetypes.

On 1 Oct 2017 at 16:12, mailto:pablo.pa...@cabolabs.com>> wrote:

Hi all,

I'm reading through the AQL specs, on this section 
http://openehr.org/releases/QUERY/latest/docs/AQL/AQL.html#_containment it is 
mentioned that CONTAINS is from parent to child.

Most examples there show COMPOSITION CONTAINS ENTRY. In a case that there is a 
SECTION in the middle, should AQL be always COMPOSITION CONTAINS SECTION 
CONTAINS ENTRY?

Before reading this specific point I was thinking that CONTAINS allowed to look 
anywhere on the COMPOSITION tree, semantically looking for "child or 
descendant", instead of just "child".

If we have only direct "child" references, having a small tree of SECTIONs can 
make queries more complex, like COMPOSITION CONTAINS SECTION CONTAINS SECTION 
CONTAINS SECTION CONTAINS ENTRY ...

Would it be useful to have that kind of "child or descendant" containment 
operator added to AQL?


What do others think?

--
Ing. Pablo Pazos Gutiérrez
e: pablo.pa...@cabolabs.com
p: +598 99 043 145
skype: cabolabs

[https://docs.google.com/uc?export=download&id=0B27lX-sxkymfdEdPLVI5UTZuZlU&revid=0B27lX-sxkymfcUwzT0N2RUs3bGU2UUovakc4VXBxWFZ6OXNnPQ]
 
http://www.cabolabs.com
https://cloudehrserver.com
Subscribe to our newsletter

___ 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

Re: AQL FROM & CONTAINS with many entries

2017-10-01 Thread Pablo Pazos
gotcha, makes sense, I need to check the grammar in the specs to see where
parenthesis can be used.

On Oct 1, 2017 3:38 PM, "Seref Arikan" 
wrote:

> X contains (y and z and t)
>
> The paranthesis are optional above but would help avoid ambiguity when we
> have
>
> X contains y and z contains t and o
> Is it:
> X contains y and (z contains t) and o
> Or
> X contains y and (z contains t and o)
>
> ??
>
> As you can see the paranthesis help define the containment structure
>
>
>
>
> On Sunday, October 1, 2017, Pablo Pazos  wrote:
>
>> Hi all, another question about AQL and CONTAINS.
>>
>> Most of the AQL samples use just one branch in the FROM clause, like:
>>
>> EHR CONTAINS COMPOSITION CONTAINS OBSERVATION.
>>
>> I'm wondering what would be the correct FROM notation when more than one
>> ENTRY is needed. Some examples below.
>>
>> SELECT o1/data[...]/.../value, o2/..., 
>> FROM
>>COMPOSITION c [archid] CONTAINS OBSERVATION o1 [archid2],
>>COMPOSITION c [archid] CONTAINS OBSERVATION o2 [archid3],
>>COMPOSITION c [archid] CONTAINS OBSERVATION o3 [archid4]
>> WHERE ...
>>
>>
>> SELECT o1/data[...]/.../value, o2/..., 
>> FROM
>>COMPOSITION c [archid]
>>   CONTAINS OBSERVATION o1 [archid2] AND
>>   CONTAINS OBSERVATION o2 [archid3] AND
>>   CONTAINS OBSERVATION o3 [archid4]
>> WHERE ...
>>
>>
>> Thanks!
>>
>> --
>> Ing. Pablo Pazos Gutiérrez
>> e: pablo.pa...@cabolabs.com
>> p: +598 99 043 145 <099%20043%20145>
>> skype: cabolabs
>> 
>> http://www.cabolabs.com
>> https://cloudehrserver.com
>> Subscribe to our newsletter 
>>
>
> ___
> 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

Re: AQL FROM & CONTAINS with many entries

2017-10-01 Thread Pablo Pazos
Thanks, my goal besides understanding the syntax is to improve the current
spec, so I'm testing some use cases against the AQL spec instead of using
specific implementations.

Cheers,
Pablo.

On Oct 1, 2017 3:33 PM, "Birger Haarbrandt" 
wrote:

> Hi Pablo,
>
> I hope I understood correctly:
>
> select
> a_a/data[at0002]/events[at0003]/data[at0001]/items[at0004]/value,
> a_b/data[at0001]/events[at0006]/data[at0003]/items[at0004]/value
> from EHR e
> contains COMPOSITION a
> contains (
> OBSERVATION a_a[openEHR-EHR-OBSERVATION.body_temperature.v1] and
> OBSERVATION a_b[openEHR-EHR-OBSERVATION.blood_pressure.v1])
>
> this should be the right way to express the query. I think an account for
> EHRSCAPE could be of help if you want to dig deeper into AQL.
>
> Cheers,
>
> Birger
>
>
> Pablo Pazos  hat am 1. Oktober 2017 um 17:52
> geschrieben:
>
> Hi all, another question about AQL and CONTAINS.
>
> Most of the AQL samples use just one branch in the FROM clause, like:
>
> EHR CONTAINS COMPOSITION CONTAINS OBSERVATION.
>
> I'm wondering what would be the correct FROM notation when more than one
> ENTRY is needed. Some examples below.
>
> SELECT o1/data[...]/.../value, o2/..., 
> FROM
>COMPOSITION c [archid] CONTAINS OBSERVATION o1 [archid2],
>COMPOSITION c [archid] CONTAINS OBSERVATION o2 [archid3],
>COMPOSITION c [archid] CONTAINS OBSERVATION o3 [archid4]
> WHERE ...
>
>
> SELECT o1/data[...]/.../value, o2/..., 
> FROM
>COMPOSITION c [archid]
>   CONTAINS OBSERVATION o1 [archid2] AND
>   CONTAINS OBSERVATION o2 [archid3] AND
>   CONTAINS OBSERVATION o3 [archid4]
> WHERE ...
>
>
> Thanks!
>
> --
> Ing. Pablo Pazos Gutiérrez
> e: pablo.pa...@cabolabs.com
> p: +598 99 043 145 <099%20043%20145>
> skype: cabolabs
> 
> http://www.cabolabs.com
> https://cloudehrserver.com
> Subscribe to our newsletter 
> ___
> 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
>
___
openEHR-technical mailing list
openEHR-technical@lists.openehr.org
http://lists.openehr.org/mailman/listinfo/openehr-technical_lists.openehr.org

Re: AQL FROM & CONTAINS with many entries

2017-10-01 Thread Seref Arikan
Also see this, just in case it may help clarify relevant  Qs:
https://github.com/serefarikan/aql-discussion

On Sunday, October 1, 2017, Pablo Pazos  wrote:

> Hi all, another question about AQL and CONTAINS.
>
> Most of the AQL samples use just one branch in the FROM clause, like:
>
> EHR CONTAINS COMPOSITION CONTAINS OBSERVATION.
>
> I'm wondering what would be the correct FROM notation when more than one
> ENTRY is needed. Some examples below.
>
> SELECT o1/data[...]/.../value, o2/..., 
> FROM
>COMPOSITION c [archid] CONTAINS OBSERVATION o1 [archid2],
>COMPOSITION c [archid] CONTAINS OBSERVATION o2 [archid3],
>COMPOSITION c [archid] CONTAINS OBSERVATION o3 [archid4]
> WHERE ...
>
>
> SELECT o1/data[...]/.../value, o2/..., 
> FROM
>COMPOSITION c [archid]
>   CONTAINS OBSERVATION o1 [archid2] AND
>   CONTAINS OBSERVATION o2 [archid3] AND
>   CONTAINS OBSERVATION o3 [archid4]
> WHERE ...
>
>
> Thanks!
>
> --
> Ing. Pablo Pazos Gutiérrez
> e: pablo.pa...@cabolabs.com
> 
> p: +598 99 043 145
> skype: cabolabs
> 
> http://www.cabolabs.com
> https://cloudehrserver.com
> Subscribe to our newsletter 
>
___
openEHR-technical mailing list
openEHR-technical@lists.openehr.org
http://lists.openehr.org/mailman/listinfo/openehr-technical_lists.openehr.org

Re: AQL FROM & CONTAINS with many entries

2017-10-01 Thread Seref Arikan
X contains (y and z and t)

The paranthesis are optional above but would help avoid ambiguity when we
have

X contains y and z contains t and o
Is it:
X contains y and (z contains t) and o
Or
X contains y and (z contains t and o)

??

As you can see the paranthesis help define the containment structure




On Sunday, October 1, 2017, Pablo Pazos  wrote:

> Hi all, another question about AQL and CONTAINS.
>
> Most of the AQL samples use just one branch in the FROM clause, like:
>
> EHR CONTAINS COMPOSITION CONTAINS OBSERVATION.
>
> I'm wondering what would be the correct FROM notation when more than one
> ENTRY is needed. Some examples below.
>
> SELECT o1/data[...]/.../value, o2/..., 
> FROM
>COMPOSITION c [archid] CONTAINS OBSERVATION o1 [archid2],
>COMPOSITION c [archid] CONTAINS OBSERVATION o2 [archid3],
>COMPOSITION c [archid] CONTAINS OBSERVATION o3 [archid4]
> WHERE ...
>
>
> SELECT o1/data[...]/.../value, o2/..., 
> FROM
>COMPOSITION c [archid]
>   CONTAINS OBSERVATION o1 [archid2] AND
>   CONTAINS OBSERVATION o2 [archid3] AND
>   CONTAINS OBSERVATION o3 [archid4]
> WHERE ...
>
>
> Thanks!
>
> --
> Ing. Pablo Pazos Gutiérrez
> e: pablo.pa...@cabolabs.com
> 
> p: +598 99 043 145
> skype: cabolabs
> 
> http://www.cabolabs.com
> https://cloudehrserver.com
> Subscribe to our newsletter 
>
___
openEHR-technical mailing list
openEHR-technical@lists.openehr.org
http://lists.openehr.org/mailman/listinfo/openehr-technical_lists.openehr.org

Re: AQL FROM & CONTAINS with many entries

2017-10-01 Thread Birger Haarbrandt

Hi Pablo,I hope I understood correctly:select a_a/data[at0002]/events[at0003]/data[at0001]/items[at0004]/value, a_b/data[at0001]/events[at0006]/data[at0003]/items[at0004]/value from EHR econtains COMPOSITION acontains ( OBSERVATION a_a[openEHR-EHR-OBSERVATION.body_temperature.v1] and OBSERVATION a_b[openEHR-EHR-OBSERVATION.blood_pressure.v1])this should be the right way to express the query. I think an account for EHRSCAPE could be of help if you want to dig deeper into AQL. Cheers,BirgerPablo Pazos  hat am 1. Oktober 2017 um 17:52 geschrieben:Hi all, another question about AQL and CONTAINS.Most of the AQL samples use just one branch in the FROM clause, like:EHR CONTAINS COMPOSITION CONTAINS OBSERVATION.I'm wondering what would be the correct FROM notation when more than one ENTRY is needed. Some examples below.SELECT o1/data[...]/.../value, o2/..., FROM   COMPOSITION c [archid] CONTAINS OBSERVATION o1 [archid2],   COMPOSITION c [archid] CONTAINS OBSERVATION o2 [archid3],   COMPOSITION c [archid] CONTAINS OBSERVATION o3 [archid4]WHERE ...SELECT o1/data[...]/.../value, o2/..., FROM   COMPOSITION c [archid]      CONTAINS OBSERVATION o1 [archid2] AND      CONTAINS OBSERVATION o2 [archid3] AND      CONTAINS OBSERVATION o3 [archid4]WHERE ...Thanks!-- Ing. Pablo Pazos Gutiérreze: pablo.pa...@cabolabs.comp: +598 99 043 145skype: cabolabshttp://www.cabolabs.comhttps://cloudehrserver.comSubscribe to our newsletter___openEHR-technical mailing listopenEHR-technical@lists.openehr.orghttp://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

Re: CONTAINS in AQL

2017-10-01 Thread Thomas Beale

Hi Pablo,

CONTAINS is like the '//' operator in Xpath - it's matches the thing on 
the right hand side, anywhere under the object on the left hand side.


So doing COMPOSITION CONTAINS OBSERVATION and similar things is normal.

The AQL documentation may need to be fixed.

- thomas


On 01/10/2017 16:11, Pablo Pazos wrote:

Hi all,

I'm reading through the AQL specs, on this section 
http://openehr.org/releases/QUERY/latest/docs/AQL/AQL.html#_containment 
it is mentioned that CONTAINS is from parent to child.


Most examples there show COMPOSITION CONTAINS ENTRY. In a case that 
there is a SECTION in the middle, should AQL be always COMPOSITION 
CONTAINS SECTION CONTAINS ENTRY?


Before reading this specific point I was thinking that CONTAINS 
allowed to look anywhere on the COMPOSITION tree, semantically looking 
for "child or descendant", instead of just "child".


If we have only direct "child" references, having a small tree of 
SECTIONs can make queries more complex, like COMPOSITION CONTAINS 
SECTION CONTAINS SECTION CONTAINS SECTION CONTAINS ENTRY ...


Would it be useful to have that kind of "child or descendant" 
containment operator added to AQL?






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

AQL FROM & CONTAINS with many entries

2017-10-01 Thread Pablo Pazos
Hi all, another question about AQL and CONTAINS.

Most of the AQL samples use just one branch in the FROM clause, like:

EHR CONTAINS COMPOSITION CONTAINS OBSERVATION.

I'm wondering what would be the correct FROM notation when more than one
ENTRY is needed. Some examples below.

SELECT o1/data[...]/.../value, o2/..., 
FROM
   COMPOSITION c [archid] CONTAINS OBSERVATION o1 [archid2],
   COMPOSITION c [archid] CONTAINS OBSERVATION o2 [archid3],
   COMPOSITION c [archid] CONTAINS OBSERVATION o3 [archid4]
WHERE ...


SELECT o1/data[...]/.../value, o2/..., 
FROM
   COMPOSITION c [archid]
  CONTAINS OBSERVATION o1 [archid2] AND
  CONTAINS OBSERVATION o2 [archid3] AND
  CONTAINS OBSERVATION o3 [archid4]
WHERE ...


Thanks!

-- 
Ing. Pablo Pazos Gutiérrez
e: pablo.pa...@cabolabs.com
p: +598 99 043 145
skype: cabolabs

http://www.cabolabs.com
https://cloudehrserver.com
Subscribe to our newsletter 
___
openEHR-technical mailing list
openEHR-technical@lists.openehr.org
http://lists.openehr.org/mailman/listinfo/openehr-technical_lists.openehr.org

CONTAINS in AQL

2017-10-01 Thread Pablo Pazos
Hi all,

I'm reading through the AQL specs, on this section
http://openehr.org/releases/QUERY/latest/docs/AQL/AQL.html#_containment it
is mentioned that CONTAINS is from parent to child.

Most examples there show COMPOSITION CONTAINS ENTRY. In a case that there
is a SECTION in the middle, should AQL be always COMPOSITION CONTAINS
SECTION CONTAINS ENTRY?

Before reading this specific point I was thinking that CONTAINS allowed to
look anywhere on the COMPOSITION tree, semantically looking for "child or
descendant", instead of just "child".

If we have only direct "child" references, having a small tree of SECTIONs
can make queries more complex, like COMPOSITION CONTAINS SECTION CONTAINS
SECTION CONTAINS SECTION CONTAINS ENTRY ...

Would it be useful to have that kind of "child or descendant" containment
operator added to AQL?


What do others think?

-- 
Ing. Pablo Pazos Gutiérrez
e: pablo.pa...@cabolabs.com
p: +598 99 043 145
skype: cabolabs

http://www.cabolabs.com
https://cloudehrserver.com
Subscribe to our newsletter 
___
openEHR-technical mailing list
openEHR-technical@lists.openehr.org
http://lists.openehr.org/mailman/listinfo/openehr-technical_lists.openehr.org