Does anyone implemented a transformation between AQL and XML?

2015-01-19 Thread pazospa...@hotmail.com




  

Hi Thomas, thanks for your input.
I understand perfectly the what and why. Personally I'm looking for the easiest 
path possible to start _testing_ (not implementing) how to integrate AQL with 
the EHRServer, because I don't have much developmwnt time and don't have money 
to hire developers. Actually I'm looking for partners that want to fund this 
open source project.
In the other hand, the published grammars are a little old and don't know who's 
maintaining them, or if those are being maintained at all. And I don't have 
much experience working with grammars, so for me the learning curve will be 
huge. So for me a XML or JSON form of AQL queries is a nice starting point.
Also I would like AQL to become normative (part of the openEHR specs, as well 
as opts :). Right now the docs we have available is one paper (I think from 
2007), and a couple of wiki pages. Not sure if the doc and the grammars match 
or not.
Sent from my LG Mobile


-- Original message--From: Thomas BealeDate: Mon, Jan 19, 2015 7:57 
AMTo: openehr-technical at lists.openehr.org;Subject:Re: Does anyone 
implemented a transformation between AQL and XML?
  Hi Pablo,
  
  I see Seref has provided some technical input. Just a note on what  
AQL is for, and why it is a language with a parser etc. The goal  is to 
have queries that rely only on archetypes, and that can be  shared across 
systems and vendors, enabling CDS and other second  level processing 
solutions to be economic. The point of having a  language is that the 
language is standard for this purpose, and  that in each type of 
installation, an interpreter, or pre-compiler  or similar, converts the AQL 
statements to what they need to be in  that installation. The result will 
usually be different for each  different vendor / type of solution - due to 
different DB, schema  etc.
  
  The AQL grammars currently online are what is in use - AQL is in  
fact very stable. However it will certainly get upgraded this  year, due to 
useful changes made by the guys at Marand, to do with  server side 
processing, functions etc. We also need to upgrade its  terminology 
handling and specify some of the semantics better,  which Seref knows a lot 
about.
  
  - thomas
  
  On 17/12/2014 20:31, pablo pazos wrote:
  Hi Seref, what I asked here was if anyone did
implemented that, so I don't have to :)
As I said, my experience tells me it requires more  
hours-man to work with a syntax, a model and a parser than  having XML 
and parse parts of it when required (so I can have  1. many ad-hoc 
parsers, 2. no model just ad-hoc data  structures, 3. no API, 4. no 
parser e.g. it requires a lot of  time to find a problem update the jj, 
generate the parser and  test).
Hope that clarifies my vision.
Of course, I didn't started yet to do anything about AQL
  support, just trying to make the community aware that I'll do  so and 
maybe generate some collaboration momentum. Maybe the  syntax 
definition is very stable and there are a lot of good  parsers for 
Java, but the syntax definition I found seems to  be old 
(https://openehr.atlassian.net/wiki/display/spec/Archetype+Query+Language+Grammar?&?https://openehr.atlassian.net/wiki/display/spec/AQL-+Archetype+Query+Language)
 and I don't know about AQLparsers for Java (just found this old 
discussion, noresponse about the 
parser:?http://lists.openehr.org/pipermail/openehr-technical_lists.openehr.org/2009-March/004400.html).

I'm sure I need to do more research, but I doubt I can find 
 the basic building blocks, even to start working with AQL  
directly.
Please if you know where I can find stuff to help me, any   
   pointers will be very welcome!  

  
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.openehr.org/pipermail/openehr-technical_lists.openehr.org/attachments/20150119/3cb4117a/attachment.html>


Does anyone implemented a transformation between AQL and XML?

2015-01-19 Thread Thomas Beale

Hi Pablo,

I see Seref has provided some technical input. Just a note on what AQL 
is for, and why it is a language with a parser etc. The goal is to have 
queries that rely only on archetypes, and that can be shared across 
systems and vendors, enabling CDS and other second level processing 
solutions to be economic. The point of having a language is that the 
language is standard for this purpose, and that in each type of 
installation, an interpreter, or pre-compiler or similar, converts the 
AQL statements to what they need to be in that installation. The result 
will usually be different for each different vendor / type of solution - 
due to different DB, schema etc.

The AQL grammars currently online are what is in use - AQL is in fact 
very stable. However it will certainly get upgraded this year, due to 
useful changes made by the guys at Marand, to do with server side 
processing, functions etc. We also need to upgrade its terminology 
handling and specify some of the semantics better, which Seref knows a 
lot about.

- thomas

On 17/12/2014 20:31, pablo pazos wrote:
> Hi Seref, what I asked here was if anyone did implemented that, so I 
> don't have to :)
>
> As I said, my experience tells me it requires more hours-man to work 
> with a syntax, a model and a parser than having XML and parse parts of 
> it when required (so I can have 1. many ad-hoc parsers, 2. no model 
> just ad-hoc data structures, 3. no API, 4. no parser e.g. it requires 
> a lot of time to find a problem update the jj, generate the parser and 
> test).
>
> Hope that clarifies my vision.
>
> Of course, I didn't started yet to do anything about AQL support, just 
> trying to make the community aware that I'll do so and maybe generate 
> some collaboration momentum. Maybe the syntax definition is very 
> stable and there are a lot of good parsers for Java, but the syntax 
> definition I found seems to be old 
> (https://openehr.atlassian.net/wiki/display/spec/Archetype+Query+Language+Grammar
>  & 
> https://openehr.atlassian.net/wiki/display/spec/AQL-+Archetype+Query+Language)
>  
> and I don't know about AQL parsers for Java (just found this old 
> discussion, no response about the parser: 
> http://lists.openehr.org/pipermail/openehr-technical_lists.openehr.org/2009-March/004400.html).
>
> I'm sure I need to do more research, but I doubt I can find the basic 
> building blocks, even to start working with AQL directly.
>
> Please if you know where I can find stuff to help me, any pointers 
> will be very welcome!


-- next part --
An HTML attachment was scrubbed...
URL: 



Does anyone implemented a transformation between AQL and XML?

2014-12-28 Thread Erik Sundvall
Hi!

Sorry for joining the discussion late. (Vacation season)

During the development of LiU EEE (https://github.com/LiU-IMT/EEE) we (in
addition to AQL-to-XQuery-translation) actually created a simple
XML-representation of the AQL parse-tree for initial debugging/analysis
purposes. I do not think we maintained this XML-debugging feature in the
later parts of application development so it is most likely buggy or
defunct. You may play around with the code in
https://github.com/LiU-IMT/EEE/blob/master/src/main/java/se/liu/imt/mi/eee/AQL_Parser/AqlParser.jj
and set the return type to XML instead of XQuery_EEE_0_1.

Be warned: messing around in JavaCC is error prone. ANTLR is probably nicer
and has good tooling support. It would be a good community contribution for
somebody to make an open source implementation of an ANTLR-based AQL
parse-tree generator and query language transformation engine :-)

Best regards,
Erik Sundvall

Ph.D. Medical Informatics. Information Architect. Tel: +46-72-524 54 55 (or
010-1036252 in Sweden)
Li?: erik.sundvall at regionostergotland.se (lio.se changing name 1 Jan 2015)
LiU: erik.sundvall at liu.se http://www.imt.liu.se/~erisu/

On Wed, Dec 17, 2014 at 9:52 PM, pablo pazos  wrote:

> Great! Thanks for the info.
>
> --
> Kind regards,
> Eng. Pablo Pazos Guti?rrez
> http://cabolabs.com <http://cabolabs.com/es/home>
> <http://twitter.com/ppazos>
>
> --
> Date: Wed, 17 Dec 2014 21:50:22 +0000
>
> Subject: Re: Does anyone implemented a transformation between AQL and XML?
> From: serefarikan at kurumsalteknoloji.com
> To: openehr-technical at lists.openehr.org
>
> Ok, I think I see what you mean now.
>
> AQL is not part of the official specification and there is not much other
> than the grammar for the implementers so you're right about not having a
> lot to work with.
> On the other hand, if you're going to do AQL, you're going to have to have
> a parser. Marand has kindly provided an ANTLR grammar here:
> https://openehr.atlassian.net/wiki/display/spec/AQL-+Archetype+Query+Language
>
> To use this grammar, you're going to have to invest into learning ANLTR
> and inevitably into parser generators. Not an easy topic if you're not
> familiar with it but I personally think it is worth it.
>
> due to way ANTLR works, Marand's grammar should get you really close to
> what you're asking without much effort. You'll probably have more of a
> challenge when trying to map the output of the parser to your query
> mechanism.
>
> So the obvious pointer is the ANTLR grammar, the rest depends on your
> efforts :)
>
> All the best
> Seref
>
>
> On Wed, Dec 17, 2014 at 8:31 PM, pablo pazos 
> wrote:
>
> Hi Seref, what I asked here was if anyone did implemented that, so I don't
> have to :)
>
> As I said, my experience tells me it requires more hours-man to work with
> a syntax, a model and a parser than having XML and parse parts of it when
> required (so I can have 1. many ad-hoc parsers, 2. no model just ad-hoc
> data structures, 3. no API, 4. no parser e.g. it requires a lot of time to
> find a problem update the jj, generate the parser and test).
>
> Hope that clarifies my vision.
>
> Of course, I didn't started yet to do anything about AQL support, just
> trying to make the community aware that I'll do so and maybe generate some
> collaboration momentum. Maybe the syntax definition is very stable and
> there are a lot of good parsers for Java, but the syntax definition I found
> seems to be old (
> https://openehr.atlassian.net/wiki/display/spec/Archetype+Query+Language+Grammar
>  &
> https://openehr.atlassian.net/wiki/display/spec/AQL-+Archetype+Query+Language)
> and I don't know about AQL parsers for Java (just found this old
> discussion, no response about the parser:
> http://lists.openehr.org/pipermail/openehr-technical_lists.openehr.org/2009-March/004400.html
> ).
>
> I'm sure I need to do more research, but I doubt I can find the basic
> building blocks, even to start working with AQL directly.
>
> Please if you know where I can find stuff to help me, any pointers will be
> very welcome!
>
> --
> Kind regards,
> Eng. Pablo Pazos Guti?rrez
> http://cabolabs.com <http://cabolabs.com/es/home>
> <http://twitter.com/ppazos>
>
> --
> Date: Wed, 17 Dec 2014 19:03:28 +
>
> Subject: Re: Does anyone implemented a transformation between AQL and XML?
> From: serefarikan at kurumsalteknoloji.com
> To: openehr-technical at lists.openehr.org
>
> Hi Pablo,
> Sorry but I still don't get it :) How are you going to do the following
> without an AQL parser?:
>
> AQL (syntax) <=(t

Does anyone implemented a transformation between AQL and XML?

2014-12-17 Thread Birger Haarbrandt
Hi Pablo,

I think I have seen an AQL parser and some basic query generation within Liu 
EEE. Maybe Erik can provide further information on this. 

Best,

Birger


Von meinem iPad gesendet

> Am 17.12.2014 um 21:31 schrieb pablo pazos :
> 
> Hi Seref, what I asked here was if anyone did implemented that, so I don't 
> have to :)
> 
> As I said, my experience tells me it requires more hours-man to work with a 
> syntax, a model and a parser than having XML and parse parts of it when 
> required (so I can have 1. many ad-hoc parsers, 2. no model just ad-hoc data 
> structures, 3. no API, 4. no parser e.g. it requires a lot of time to find a 
> problem update the jj, generate the parser and test).
> 
> Hope that clarifies my vision.
> 
> Of course, I didn't started yet to do anything about AQL support, just trying 
> to make the community aware that I'll do so and maybe generate some 
> collaboration momentum. Maybe the syntax definition is very stable and there 
> are a lot of good parsers for Java, but the syntax definition I found seems 
> to be old 
> (https://openehr.atlassian.net/wiki/display/spec/Archetype+Query+Language+Grammar
>  & 
> https://openehr.atlassian.net/wiki/display/spec/AQL-+Archetype+Query+Language)
>  and I don't know about AQL parsers for Java (just found this old discussion, 
> no response about the parser: 
> http://lists.openehr.org/pipermail/openehr-technical_lists.openehr.org/2009-March/004400.html).
> 
> I'm sure I need to do more research, but I doubt I can find the basic 
> building blocks, even to start working with AQL directly.
> 
> Please if you know where I can find stuff to help me, any pointers will be 
> very welcome!
> 
> -- 
> Kind regards,
> Eng. Pablo Pazos Guti?rrez
> http://cabolabs.com
> 
> Date: Wed, 17 Dec 2014 19:03:28 +
> Subject: Re: Does anyone implemented a transformation between AQL and XML?
> From: serefarikan at kurumsalteknoloji.com
> To: openehr-technical at lists.openehr.org
> 
> Hi Pablo, 
> Sorry but I still don't get it :) How are you going to do the following 
> without an AQL parser?:
> 
> AQL (syntax) <=(transformation)=> XML (syntax) 
> 
> 
> If you have an xml form of AQL and use only that, you'd have to force your 
> users write queries in the xml form of AQL which would defeat the whole 
> purpose of the AQL. 
> 
> So I'm still not seeing how you're gaining anything with an XML form of AQL. 
> 
> Best regards
> Seref
> 
> 
> On Wed, Dec 17, 2014 at 4:17 PM, pablo pazos  
> wrote:
> Hi Seref,
> 
> Yes! Just need the transformation to have an AQL in XML syntax.
> 
> What I was thinking is trying to add support to AQL in the EHRServer, doing 
> something like this:
> 
> AQL (syntax) <=(transformation)=> XML (syntax) <=(mapping)=> EHRServer Query 
> Model (OO) <=(ORM)=> Query Storage
> 
> I already have the part for Evaluating/Executing queries that are represented 
> in the EHRServer Query Model.
> 
> Having this I can import and export AQL, and I don't need to actualy 
> "execute" AQL.
> 
> 
> This is in fact one way of implementing "The point of AQL is sending the same 
> query to multiple implementations".
> 
> 
> Why not dealing with AQL directly?
> 
> In my experience in implementing software with ADLs and OPTs, managing OPTs 
> in XML is way simpler: I can write my own parsers for specific tasks without 
> the need of parsing the whole structure and then deal with an object instance 
> in memory (sometimes buggy, difficult to access specific data, APIs not so 
> well defined, non implemented methods, etc). So it is a matter of risk 
> management and cost reduction (since I'm the only one working on the 
> EHRServer I need to search for the shortest path to do each task will a 
> certain level of quality).
> 
> So I have the same idea with AQL: not deal with AQL parsers or object 
> instances, just the XML. The idea of this request is that I don't want to 
> develop an XML syntax for XML: it would be great if someone else already have 
> that done so I can reuse.
> 
> This way I don't need to "have to deal with an AQL parser" :)
> 
> 
> Hope that helps!
> 
> -- 
> Kind regards,
> Eng. Pablo Pazos Guti?rrez
> http://cabolabs.com
> 
> Date: Tue, 16 Dec 2014 17:42:51 +
> Subject: Re: Does anyone implemented a transformation between AQL and XML?
> From: serefarikan at kurumsalteknoloji.com
> To: openehr-technical at lists.openehr.org
> 
> 
> Hi Pablo, 
> I'm a bit confused. What are you asking for? AQL does not have an object 
> model that has been published, i

Does anyone implemented a transformation between AQL and XML?

2014-12-17 Thread Seref Arikan
Ok, I think I see what you mean now.

AQL is not part of the official specification and there is not much other
than the grammar for the implementers so you're right about not having a
lot to work with.
On the other hand, if you're going to do AQL, you're going to have to have
a parser. Marand has kindly provided an ANTLR grammar here:
https://openehr.atlassian.net/wiki/display/spec/AQL-+Archetype+Query+Language

To use this grammar, you're going to have to invest into learning ANLTR and
inevitably into parser generators. Not an easy topic if you're not familiar
with it but I personally think it is worth it.

due to way ANTLR works, Marand's grammar should get you really close to
what you're asking without much effort. You'll probably have more of a
challenge when trying to map the output of the parser to your query
mechanism.

So the obvious pointer is the ANTLR grammar, the rest depends on your
efforts :)

All the best
Seref


On Wed, Dec 17, 2014 at 8:31 PM, pablo pazos  wrote:
>
> Hi Seref, what I asked here was if anyone did implemented that, so I don't
> have to :)
>
> As I said, my experience tells me it requires more hours-man to work with
> a syntax, a model and a parser than having XML and parse parts of it when
> required (so I can have 1. many ad-hoc parsers, 2. no model just ad-hoc
> data structures, 3. no API, 4. no parser e.g. it requires a lot of time to
> find a problem update the jj, generate the parser and test).
>
> Hope that clarifies my vision.
>
> Of course, I didn't started yet to do anything about AQL support, just
> trying to make the community aware that I'll do so and maybe generate some
> collaboration momentum. Maybe the syntax definition is very stable and
> there are a lot of good parsers for Java, but the syntax definition I found
> seems to be old (
> https://openehr.atlassian.net/wiki/display/spec/Archetype+Query+Language+Grammar
>  &
> https://openehr.atlassian.net/wiki/display/spec/AQL-+Archetype+Query+Language)
> and I don't know about AQL parsers for Java (just found this old
> discussion, no response about the parser:
> http://lists.openehr.org/pipermail/openehr-technical_lists.openehr.org/2009-March/004400.html
> ).
>
> I'm sure I need to do more research, but I doubt I can find the basic
> building blocks, even to start working with AQL directly.
>
> Please if you know where I can find stuff to help me, any pointers will be
> very welcome!
>
> --
> Kind regards,
> Eng. Pablo Pazos Guti?rrez
> http://cabolabs.com <http://cabolabs.com/es/home>
> <http://twitter.com/ppazos>
>
> --
> Date: Wed, 17 Dec 2014 19:03:28 +
>
> Subject: Re: Does anyone implemented a transformation between AQL and XML?
> From: serefarikan at kurumsalteknoloji.com
> To: openehr-technical at lists.openehr.org
>
> Hi Pablo,
> Sorry but I still don't get it :) How are you going to do the following
> without an AQL parser?:
>
> AQL (syntax) <=(transformation)=> XML (syntax)
>
>
> If you have an xml form of AQL and use only that, you'd have to force your
> users write queries in the xml form of AQL which would defeat the whole
> purpose of the AQL.
>
> So I'm still not seeing how you're gaining anything with an XML form of
> AQL.
>
> Best regards
> Seref
>
>
> On Wed, Dec 17, 2014 at 4:17 PM, pablo pazos 
> wrote:
>
> Hi Seref,
>
> Yes! Just need the transformation to have an AQL in XML syntax.
>
> What I was thinking is trying to add support to AQL in the EHRServer,
> doing something like this:
>
> AQL (syntax) <=(transformation)=> XML (syntax) <=(mapping)=> EHRServer
> Query Model (OO) <=(ORM)=> Query Storage
>
> I already have the part for Evaluating/Executing queries that are
> represented in the EHRServer Query Model.
>
> Having this I can import and export AQL, and I don't need to actualy
> "execute" AQL.
>
>
> This is in fact one way of implementing "The point of AQL is sending the
> same query to multiple implementations".
>
>
> Why not dealing with AQL directly?
>
> In my experience in implementing software with ADLs and OPTs, managing
> OPTs in XML is way simpler: I can write my own parsers for specific tasks
> without the need of parsing the whole structure and then deal with an
> object instance in memory (sometimes buggy, difficult to access specific
> data, APIs not so well defined, non implemented methods, etc). So it is a
> matter of risk management and cost reduction (since I'm the only one
> working on the EHRServer I need to search for the shortest path to do each
> task will a certain level of quality).
>
&

Does anyone implemented a transformation between AQL and XML?

2014-12-17 Thread Seref Arikan
Hi Pablo,
Sorry but I still don't get it :) How are you going to do the following
without an AQL parser?:

AQL (syntax) <=(transformation)=> XML (syntax)


If you have an xml form of AQL and use only that, you'd have to force your
users write queries in the xml form of AQL which would defeat the whole
purpose of the AQL.

So I'm still not seeing how you're gaining anything with an XML form of
AQL.

Best regards
Seref


On Wed, Dec 17, 2014 at 4:17 PM, pablo pazos  wrote:
>
> Hi Seref,
>
> Yes! Just need the transformation to have an AQL in XML syntax.
>
> What I was thinking is trying to add support to AQL in the EHRServer,
> doing something like this:
>
> AQL (syntax) <=(transformation)=> XML (syntax) <=(mapping)=> EHRServer
> Query Model (OO) <=(ORM)=> Query Storage
>
> I already have the part for Evaluating/Executing queries that are
> represented in the EHRServer Query Model.
>
> Having this I can import and export AQL, and I don't need to actualy
> "execute" AQL.
>
>
> This is in fact one way of implementing "The point of AQL is sending the
> same query to multiple implementations".
>
>
> Why not dealing with AQL directly?
>
> In my experience in implementing software with ADLs and OPTs, managing
> OPTs in XML is way simpler: I can write my own parsers for specific tasks
> without the need of parsing the whole structure and then deal with an
> object instance in memory (sometimes buggy, difficult to access specific
> data, APIs not so well defined, non implemented methods, etc). So it is a
> matter of risk management and cost reduction (since I'm the only one
> working on the EHRServer I need to search for the shortest path to do each
> task will a certain level of quality).
>
> So I have the same idea with AQL: not deal with AQL parsers or object
> instances, just the XML. The idea of this request is that I don't want to
> develop an XML syntax for XML: it would be great if someone else already
> have that done so I can reuse.
>
> This way I don't need to "have to deal with an AQL parser" :)
>
>
> Hope that helps!
>
> --
> Kind regards,
> Eng. Pablo Pazos Guti?rrez
> http://cabolabs.com <http://cabolabs.com/es/home>
> <http://twitter.com/ppazos>
>
> --
> Date: Tue, 16 Dec 2014 17:42:51 +
> Subject: Re: Does anyone implemented a transformation between AQL and XML?
> From: serefarikan at kurumsalteknoloji.com
> To: openehr-technical at lists.openehr.org
>
>
> Hi Pablo,
> I'm a bit confused. What are you asking for? AQL does not have an object
> model that has been published, it has a grammar, so an XML representation
> of AQL would at best be AQL in XML syntax. If that is what you're after, I
> can't see how that could help? The point of AQL is sending the same query
> to multiple implementations, so its use means that you'd have to deal with
> an AQL parser.
>
> If you want to develop an XML syntax for AQL, you'd still have to use an
> AQL parser to import AQL as you've described in your OP. It sounds like
> you're trying to develop a mapping from AQL to your internal query
> execution, which is fine, but the XML syntax for AQL sounds redundant in
> that scenario.
>
> Care to explain a bit more?
>
> Regards
> Seref
>
>
> On Tue, Dec 16, 2014 at 5:34 PM, pablo pazos 
> wrote:
>
> Hi Bert,
>
> I don't have any XML :D My question is about ADL, not it's
> interpretation/execution, that is already handled by the current querying
> component of the EHRServer.
>
> What I'm curious about is if someone has a transformation between AQL
> syntax and XML, in other words, a XML expression of an AQL query.
>
> An AQL query can be instantiated and executed over any database, while
> XQuery is already an instance of a query (because it uses XPaths not ADL
> paths) and can be executed only in XML databases (and relational that
> support XML columns). The EHRServer database is relational, without any XML
> columns.
>
> Also, what I need is a bidirectional transformation AQL <-> XML. I guess
> it would be difficult to generate AQL from an XQuery expression.
>
> --
> Kind regards,
> Eng. Pablo Pazos Guti?rrez
> http://cabolabs.com <http://cabolabs.com/es/home>
> <http://twitter.com/ppazos>
>
> --
> Date: Tue, 16 Dec 2014 07:34:13 +0100
> Subject: Re: Does anyone implemented a transformation between AQL and XML?
> From: bert.verhees at rosa.nl
> To: openehr-technical at lists.openehr.org
>
>
> Depending on how your XML is constructed, it is very easy 

Does anyone implemented a transformation between AQL and XML?

2014-12-17 Thread pablo pazos
Great! Thanks for the info.

-- 
Kind regards,
Eng. Pablo Pazos Guti?rrez
http://cabolabs.com

Date: Wed, 17 Dec 2014 21:50:22 +
Subject: Re: Does anyone implemented a transformation between AQL and XML?
From: serefari...@kurumsalteknoloji.com
To: openehr-technical at lists.openehr.org

Ok, I think I see what you mean now.
 
AQL is not part of the official specification and there is not much other than 
the grammar for the implementers so you're right about not having a lot to work 
with. 
On the other hand, if you're going to do AQL, you're going to have to have a 
parser. Marand has kindly provided an ANTLR grammar here: 
https://openehr.atlassian.net/wiki/display/spec/AQL-+Archetype+Query+Language 

To use this grammar, you're going to have to invest into learning ANLTR and 
inevitably into parser generators. Not an easy topic if you're not familiar 
with it but I personally think it is worth it. 

due to way ANTLR works, Marand's grammar should get you really close to what 
you're asking without much effort. You'll probably have more of a challenge 
when trying to map the output of the parser to your query mechanism. 

So the obvious pointer is the ANTLR grammar, the rest depends on your efforts :)

All the best
Seref


On Wed, Dec 17, 2014 at 8:31 PM, pablo pazos  wrote:


Hi Seref, what I asked here was if anyone did implemented that, so I don't have 
to :)
As I said, my experience tells me it requires more hours-man to work with a 
syntax, a model and a parser than having XML and parse parts of it when 
required (so I can have 1. many ad-hoc parsers, 2. no model just ad-hoc data 
structures, 3. no API, 4. no parser e.g. it requires a lot of time to find a 
problem update the jj, generate the parser and test).
Hope that clarifies my vision.
Of course, I didn't started yet to do anything about AQL support, just trying 
to make the community aware that I'll do so and maybe generate some 
collaboration momentum. Maybe the syntax definition is very stable and there 
are a lot of good parsers for Java, but the syntax definition I found seems to 
be old 
(https://openehr.atlassian.net/wiki/display/spec/Archetype+Query+Language+Grammar
 & 
https://openehr.atlassian.net/wiki/display/spec/AQL-+Archetype+Query+Language) 
and I don't know about AQL parsers for Java (just found this old discussion, no 
response about the parser: 
http://lists.openehr.org/pipermail/openehr-technical_lists.openehr.org/2009-March/004400.html).
I'm sure I need to do more research, but I doubt I can find the basic building 
blocks, even to start working with AQL directly.
Please if you know where I can find stuff to help me, any pointers will be very 
welcome!
-- 
Kind regards,
Eng. Pablo Pazos Guti?rrez
http://cabolabs.com

Date: Wed, 17 Dec 2014 19:03:28 +0000
Subject: Re: Does anyone implemented a transformation between AQL and XML?
From: serefari...@kurumsalteknoloji.com
To: openehr-technical at lists.openehr.org

Hi Pablo, 
Sorry but I still don't get it :) How are you going to do the following without 
an AQL parser?:

AQL (syntax) <=(transformation)=> XML (syntax) 


If you have an xml form of AQL and use only that, you'd have to force your 
users write queries in the xml form of AQL which would defeat the whole purpose 
of the AQL. 

So I'm still not seeing how you're gaining anything with an XML form of AQL. 

Best regards
Seref


On Wed, Dec 17, 2014 at 4:17 PM, pablo pazos  wrote:


Hi Seref,
Yes! Just need the transformation to have an AQL in XML syntax.
What I was thinking is trying to add support to AQL in the EHRServer, doing 
something like this:
AQL (syntax) <=(transformation)=> XML (syntax) <=(mapping)=> EHRServer Query 
Model (OO) <=(ORM)=> Query Storage
I already have the part for Evaluating/Executing queries that are represented 
in the EHRServer Query Model.
Having this I can import and export AQL, and I don't need to actualy "execute" 
AQL.

This is in fact one way of implementing "The point of AQL is sending the same 
query to multiple implementations".

Why not dealing with AQL directly?
In my experience in implementing software with ADLs and OPTs, managing OPTs in 
XML is way simpler: I can write my own parsers for specific tasks without the 
need of parsing the whole structure and then deal with an object instance in 
memory (sometimes buggy, difficult to access specific data, APIs not so well 
defined, non implemented methods, etc). So it is a matter of risk management 
and cost reduction (since I'm the only one working on the EHRServer I need to 
search for the shortest path to do each task will a certain level of quality).
So I have the same idea with AQL: not deal with AQL parsers or object 
instances, just the XML. The idea of this request is that I don't want to 
develop an XML syntax for XML: it would be great if someone else already have 
that don

Does anyone implemented a transformation between AQL and XML?

2014-12-17 Thread pablo pazos
Hi Seref, what I asked here was if anyone did implemented that, so I don't have 
to :)
As I said, my experience tells me it requires more hours-man to work with a 
syntax, a model and a parser than having XML and parse parts of it when 
required (so I can have 1. many ad-hoc parsers, 2. no model just ad-hoc data 
structures, 3. no API, 4. no parser e.g. it requires a lot of time to find a 
problem update the jj, generate the parser and test).
Hope that clarifies my vision.
Of course, I didn't started yet to do anything about AQL support, just trying 
to make the community aware that I'll do so and maybe generate some 
collaboration momentum. Maybe the syntax definition is very stable and there 
are a lot of good parsers for Java, but the syntax definition I found seems to 
be old 
(https://openehr.atlassian.net/wiki/display/spec/Archetype+Query+Language+Grammar
 & 
https://openehr.atlassian.net/wiki/display/spec/AQL-+Archetype+Query+Language) 
and I don't know about AQL parsers for Java (just found this old discussion, no 
response about the parser: 
http://lists.openehr.org/pipermail/openehr-technical_lists.openehr.org/2009-March/004400.html).
I'm sure I need to do more research, but I doubt I can find the basic building 
blocks, even to start working with AQL directly.
Please if you know where I can find stuff to help me, any pointers will be very 
welcome!
-- 
Kind regards,
Eng. Pablo Pazos Guti?rrez
http://cabolabs.com

Date: Wed, 17 Dec 2014 19:03:28 +0000
Subject: Re: Does anyone implemented a transformation between AQL and XML?
From: serefari...@kurumsalteknoloji.com
To: openehr-technical at lists.openehr.org

Hi Pablo, 
Sorry but I still don't get it :) How are you going to do the following without 
an AQL parser?:

AQL (syntax) <=(transformation)=> XML (syntax) 


If you have an xml form of AQL and use only that, you'd have to force your 
users write queries in the xml form of AQL which would defeat the whole purpose 
of the AQL. 

So I'm still not seeing how you're gaining anything with an XML form of AQL. 

Best regards
Seref


On Wed, Dec 17, 2014 at 4:17 PM, pablo pazos  wrote:


Hi Seref,
Yes! Just need the transformation to have an AQL in XML syntax.
What I was thinking is trying to add support to AQL in the EHRServer, doing 
something like this:
AQL (syntax) <=(transformation)=> XML (syntax) <=(mapping)=> EHRServer Query 
Model (OO) <=(ORM)=> Query Storage
I already have the part for Evaluating/Executing queries that are represented 
in the EHRServer Query Model.
Having this I can import and export AQL, and I don't need to actualy "execute" 
AQL.

This is in fact one way of implementing "The point of AQL is sending the same 
query to multiple implementations".

Why not dealing with AQL directly?
In my experience in implementing software with ADLs and OPTs, managing OPTs in 
XML is way simpler: I can write my own parsers for specific tasks without the 
need of parsing the whole structure and then deal with an object instance in 
memory (sometimes buggy, difficult to access specific data, APIs not so well 
defined, non implemented methods, etc). So it is a matter of risk management 
and cost reduction (since I'm the only one working on the EHRServer I need to 
search for the shortest path to do each task will a certain level of quality).
So I have the same idea with AQL: not deal with AQL parsers or object 
instances, just the XML. The idea of this request is that I don't want to 
develop an XML syntax for XML: it would be great if someone else already have 
that done so I can reuse.

This way I don't need to "have to deal with an AQL parser" :)

Hope that helps!
-- 
Kind regards,
Eng. Pablo Pazos Guti?rrez
http://cabolabs.com

Date: Tue, 16 Dec 2014 17:42:51 +
Subject: Re: Does anyone implemented a transformation between AQL and XML?
From: serefari...@kurumsalteknoloji.com
To: openehr-technical at lists.openehr.org

Hi Pablo, 
I'm a bit confused. What are you asking for? AQL does not have an object model 
that has been published, it has a grammar, so an XML representation of AQL 
would at best be AQL in XML syntax. If that is what you're after, I can't see 
how that could help? The point of AQL is sending the same query to multiple 
implementations, so its use means that you'd have to deal with an AQL parser. 

If you want to develop an XML syntax for AQL, you'd still have to use an AQL 
parser to import AQL as you've described in your OP. It sounds like you're 
trying to develop a mapping from AQL to your internal query execution, which is 
fine, but the XML syntax for AQL sounds redundant in that scenario. 

Care to explain a bit more? 

Regards
Seref


On Tue, Dec 16, 2014 at 5:34 PM, pablo pazos  wrote:


Hi Bert,
I don't have any XML :D My question is about ADL, not it's 
interpretation/execution, that is already h

Does anyone implemented a transformation between AQL and XML?

2014-12-17 Thread pablo pazos
Hi Seref,
Yes! Just need the transformation to have an AQL in XML syntax.
What I was thinking is trying to add support to AQL in the EHRServer, doing 
something like this:
AQL (syntax) <=(transformation)=> XML (syntax) <=(mapping)=> EHRServer Query 
Model (OO) <=(ORM)=> Query Storage
I already have the part for Evaluating/Executing queries that are represented 
in the EHRServer Query Model.
Having this I can import and export AQL, and I don't need to actualy "execute" 
AQL.

This is in fact one way of implementing "The point of AQL is sending the same 
query to multiple implementations".

Why not dealing with AQL directly?
In my experience in implementing software with ADLs and OPTs, managing OPTs in 
XML is way simpler: I can write my own parsers for specific tasks without the 
need of parsing the whole structure and then deal with an object instance in 
memory (sometimes buggy, difficult to access specific data, APIs not so well 
defined, non implemented methods, etc). So it is a matter of risk management 
and cost reduction (since I'm the only one working on the EHRServer I need to 
search for the shortest path to do each task will a certain level of quality).
So I have the same idea with AQL: not deal with AQL parsers or object 
instances, just the XML. The idea of this request is that I don't want to 
develop an XML syntax for XML: it would be great if someone else already have 
that done so I can reuse.

This way I don't need to "have to deal with an AQL parser" :)

Hope that helps!
-- 
Kind regards,
Eng. Pablo Pazos Guti?rrez
http://cabolabs.com

Date: Tue, 16 Dec 2014 17:42:51 +0000
Subject: Re: Does anyone implemented a transformation between AQL and XML?
From: serefari...@kurumsalteknoloji.com
To: openehr-technical at lists.openehr.org

Hi Pablo, 
I'm a bit confused. What are you asking for? AQL does not have an object model 
that has been published, it has a grammar, so an XML representation of AQL 
would at best be AQL in XML syntax. If that is what you're after, I can't see 
how that could help? The point of AQL is sending the same query to multiple 
implementations, so its use means that you'd have to deal with an AQL parser. 

If you want to develop an XML syntax for AQL, you'd still have to use an AQL 
parser to import AQL as you've described in your OP. It sounds like you're 
trying to develop a mapping from AQL to your internal query execution, which is 
fine, but the XML syntax for AQL sounds redundant in that scenario. 

Care to explain a bit more? 

Regards
Seref


On Tue, Dec 16, 2014 at 5:34 PM, pablo pazos  wrote:


Hi Bert,
I don't have any XML :D My question is about ADL, not it's 
interpretation/execution, that is already handled by the current querying 
component of the EHRServer.
What I'm curious about is if someone has a transformation between AQL syntax 
and XML, in other words, a XML expression of an AQL query.
An AQL query can be instantiated and executed over any database, while XQuery 
is already an instance of a query (because it uses XPaths not ADL paths) and 
can be executed only in XML databases (and relational that support XML 
columns). The EHRServer database is relational, without any XML columns.
Also, what I need is a bidirectional transformation AQL <-> XML. I guess it 
would be difficult to generate AQL from an XQuery expression.

-- 
Kind regards,
Eng. Pablo Pazos Guti?rrez
http://cabolabs.com

Date: Tue, 16 Dec 2014 07:34:13 +0100
Subject: Re: Does anyone implemented a transformation between AQL and XML?
From: bert.verh...@rosa.nl
To: openehr-technical at lists.openehr.org

Depending on how your XML is constructed, it is very easy to convert AQL to 
XQuery, or ADL-path to XPath.
Bert

Op dinsdag 16 december 2014 heeft pablo pazos  het 
volgende geschreven:



Just curious :)
I'm adding version control features to EHRServer 
(https://github.com/ppazos/cabolabs-ehrserver) and I want to add some kind of 
AQL support in the future. Right now we have an internal querying model that 
abstracts from the physical database and allows the creation of queries for 
openEHR data from a UI.My idea is to have some kind of transformation between 
the EHRServer query model and AQL, and instead of struggle with AQL parsers I 
would like to do some XML transformations to import and export AQL (I do not 
need to actually execute AQL, the execution of the internal query model is 
working ok).
Comments and ideas are very welcome!
-- 
Kind regards,
Eng. Pablo Pazos Guti?rrez
http://cabolabs.com   


-- 
This e-mail message is intended exclusively for the addressee(s). 
Please inform us immediately if you are not the addressee.


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

Does anyone implemented a transformation between AQL and XML?

2014-12-16 Thread Bert Verhees
sorry, I misunderstood.

I cannot help you any further

Bert



Op dinsdag 16 december 2014 heeft pablo pazos  het
volgende geschreven:

> Hi Bert,
>
> I don't have any XML :D My question is about ADL, not it's
> interpretation/execution, that is already handled by the current querying
> component of the EHRServer.
>
> What I'm curious about is if someone has a transformation between AQL
> syntax and XML, in other words, a XML expression of an AQL query.
>
> An AQL query can be instantiated and executed over any database, while
> XQuery is already an instance of a query (because it uses XPaths not ADL
> paths) and can be executed only in XML databases (and relational that
> support XML columns). The EHRServer database is relational, without any XML
> columns.
>
> Also, what I need is a bidirectional transformation AQL <-> XML. I guess
> it would be difficult to generate AQL from an XQuery expression.
>
> --
> Kind regards,
> Eng. Pablo Pazos Guti?rrez
> http://cabolabs.com <http://cabolabs.com/es/home>
> <http://twitter.com/ppazos>
>
> --------------
> Date: Tue, 16 Dec 2014 07:34:13 +0100
> Subject: Re: Does anyone implemented a transformation between AQL and XML?
> From: bert.verhees at rosa.nl
> 
> To: openehr-technical at lists.openehr.org
> 
>
> Depending on how your XML is constructed, it is very easy to convert AQL
> to XQuery, or ADL-path to XPath.
>
> Bert
>
> Op dinsdag 16 december 2014 heeft pablo pazos  > het volgende
> geschreven:
>
> Just curious :)
>
> I'm adding version control features to EHRServer (
> https://github.com/ppazos/cabolabs-ehrserver) and I want to add some kind
> of AQL support in the future. Right now we have an internal querying model
> that abstracts from the physical database and allows the creation of
> queries for openEHR data from a UI.
> My idea is to have some kind of transformation between the EHRServer query
> model and AQL, and instead of struggle with AQL parsers I would like to do
> some XML transformations to import and export AQL (I do not need to
> actually execute AQL, the execution of the internal query model is working
> ok).
>
> Comments and ideas are very welcome!
>
> --
> Kind regards,
> Eng. Pablo Pazos Guti?rrez
> http://cabolabs.com <http://cabolabs.com/es/home>
> <http://twitter.com/ppazos>
>
>
>
> --
>
> *This e-mail message is intended exclusively for the addressee(s). Please
> inform us immediately if you are not the addressee.*
>
>
> ___ openEHR-technical mailing
> list openEHR-technical at lists.openehr.org
> 
> http://lists.openehr.org/mailman/listinfo/openehr-technical_lists.openehr.org
>


-- 

*This e-mail message is intended exclusively for the addressee(s). Please
inform us immediately if you are not the addressee.*
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.openehr.org/pipermail/openehr-technical_lists.openehr.org/attachments/20141216/3300a9f8/attachment-0001.html>


Does anyone implemented a transformation between AQL and XML?

2014-12-16 Thread Seref Arikan
Hi Pablo,
I'm a bit confused. What are you asking for? AQL does not have an object
model that has been published, it has a grammar, so an XML representation
of AQL would at best be AQL in XML syntax. If that is what you're after, I
can't see how that could help? The point of AQL is sending the same query
to multiple implementations, so its use means that you'd have to deal with
an AQL parser.

If you want to develop an XML syntax for AQL, you'd still have to use an
AQL parser to import AQL as you've described in your OP. It sounds like
you're trying to develop a mapping from AQL to your internal query
execution, which is fine, but the XML syntax for AQL sounds redundant in
that scenario.

Care to explain a bit more?

Regards
Seref


On Tue, Dec 16, 2014 at 5:34 PM, pablo pazos  wrote:
>
> Hi Bert,
>
> I don't have any XML :D My question is about ADL, not it's
> interpretation/execution, that is already handled by the current querying
> component of the EHRServer.
>
> What I'm curious about is if someone has a transformation between AQL
> syntax and XML, in other words, a XML expression of an AQL query.
>
> An AQL query can be instantiated and executed over any database, while
> XQuery is already an instance of a query (because it uses XPaths not ADL
> paths) and can be executed only in XML databases (and relational that
> support XML columns). The EHRServer database is relational, without any XML
> columns.
>
> Also, what I need is a bidirectional transformation AQL <-> XML. I guess
> it would be difficult to generate AQL from an XQuery expression.
>
> --
> Kind regards,
> Eng. Pablo Pazos Guti?rrez
> http://cabolabs.com <http://cabolabs.com/es/home>
> <http://twitter.com/ppazos>
>
> --
> Date: Tue, 16 Dec 2014 07:34:13 +0100
> Subject: Re: Does anyone implemented a transformation between AQL and XML?
> From: bert.verhees at rosa.nl
> To: openehr-technical at lists.openehr.org
>
>
> Depending on how your XML is constructed, it is very easy to convert AQL
> to XQuery, or ADL-path to XPath.
>
> Bert
>
> Op dinsdag 16 december 2014 heeft pablo pazos 
> het volgende geschreven:
>
> Just curious :)
>
> I'm adding version control features to EHRServer (
> https://github.com/ppazos/cabolabs-ehrserver) and I want to add some kind
> of AQL support in the future. Right now we have an internal querying model
> that abstracts from the physical database and allows the creation of
> queries for openEHR data from a UI.
> My idea is to have some kind of transformation between the EHRServer query
> model and AQL, and instead of struggle with AQL parsers I would like to do
> some XML transformations to import and export AQL (I do not need to
> actually execute AQL, the execution of the internal query model is working
> ok).
>
> Comments and ideas are very welcome!
>
> --
> Kind regards,
> Eng. Pablo Pazos Guti?rrez
> http://cabolabs.com <http://cabolabs.com/es/home>
> <http://twitter.com/ppazos>
>
>
>
> --
>
> *This e-mail message is intended exclusively for the addressee(s). Please
> inform us immediately if you are not the addressee.*
>
>
> ___ openEHR-technical mailing
> list openEHR-technical at lists.openehr.org
> http://lists.openehr.org/mailman/listinfo/openehr-technical_lists.openehr.org
>
> ___
> openEHR-technical mailing list
> openEHR-technical at lists.openehr.org
>
> http://lists.openehr.org/mailman/listinfo/openehr-technical_lists.openehr.org
>
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.openehr.org/pipermail/openehr-technical_lists.openehr.org/attachments/20141216/3c62e0a8/attachment.html>


Does anyone implemented a transformation between AQL and XML?

2014-12-16 Thread pablo pazos
Hi Bert,
I don't have any XML :D My question is about ADL, not it's 
interpretation/execution, that is already handled by the current querying 
component of the EHRServer.
What I'm curious about is if someone has a transformation between AQL syntax 
and XML, in other words, a XML expression of an AQL query.
An AQL query can be instantiated and executed over any database, while XQuery 
is already an instance of a query (because it uses XPaths not ADL paths) and 
can be executed only in XML databases (and relational that support XML 
columns). The EHRServer database is relational, without any XML columns.
Also, what I need is a bidirectional transformation AQL <-> XML. I guess it 
would be difficult to generate AQL from an XQuery expression.

-- 
Kind regards,
Eng. Pablo Pazos Guti?rrez
http://cabolabs.com

Date: Tue, 16 Dec 2014 07:34:13 +0100
Subject: Re: Does anyone implemented a transformation between AQL and XML?
From: bert.verh...@rosa.nl
To: openehr-technical at lists.openehr.org

Depending on how your XML is constructed, it is very easy to convert AQL to 
XQuery, or ADL-path to XPath.
Bert

Op dinsdag 16 december 2014 heeft pablo pazos  het 
volgende geschreven:



Just curious :)
I'm adding version control features to EHRServer 
(https://github.com/ppazos/cabolabs-ehrserver) and I want to add some kind of 
AQL support in the future. Right now we have an internal querying model that 
abstracts from the physical database and allows the creation of queries for 
openEHR data from a UI.My idea is to have some kind of transformation between 
the EHRServer query model and AQL, and instead of struggle with AQL parsers I 
would like to do some XML transformations to import and export AQL (I do not 
need to actually execute AQL, the execution of the internal query model is 
working ok).
Comments and ideas are very welcome!
-- 
Kind regards,
Eng. Pablo Pazos Guti?rrez
http://cabolabs.com   


-- 
This e-mail message is intended exclusively for the addressee(s). 
Please inform us immediately if you are not the addressee.


___
openEHR-technical mailing list
openEHR-technical at lists.openehr.org
http://lists.openehr.org/mailman/listinfo/openehr-technical_lists.openehr.org   
  
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.openehr.org/pipermail/openehr-technical_lists.openehr.org/attachments/20141216/9e174c47/attachment.html>


Does anyone implemented a transformation between AQL and XML?

2014-12-16 Thread Bert Verhees
Depending on how your XML is constructed, it is very easy to convert AQL to
XQuery, or ADL-path to XPath.

Bert

Op dinsdag 16 december 2014 heeft pablo pazos  het
volgende geschreven:

> Just curious :)
>
> I'm adding version control features to EHRServer (
> https://github.com/ppazos/cabolabs-ehrserver) and I want to add some kind
> of AQL support in the future. Right now we have an internal querying model
> that abstracts from the physical database and allows the creation of
> queries for openEHR data from a UI.
> My idea is to have some kind of transformation between the EHRServer query
> model and AQL, and instead of struggle with AQL parsers I would like to do
> some XML transformations to import and export AQL (I do not need to
> actually execute AQL, the execution of the internal query model is working
> ok).
>
> Comments and ideas are very welcome!
>
> --
> Kind regards,
> Eng. Pablo Pazos Guti?rrez
> http://cabolabs.com 
> 
>


-- 

*This e-mail message is intended exclusively for the addressee(s). Please
inform us immediately if you are not the addressee.*
-- next part --
An HTML attachment was scrubbed...
URL: 



Does anyone implemented a transformation between AQL and XML?

2014-12-16 Thread pablo pazos
Just curious :)
I'm adding version control features to EHRServer 
(https://github.com/ppazos/cabolabs-ehrserver) and I want to add some kind of 
AQL support in the future. Right now we have an internal querying model that 
abstracts from the physical database and allows the creation of queries for 
openEHR data from a UI.My idea is to have some kind of transformation between 
the EHRServer query model and AQL, and instead of struggle with AQL parsers I 
would like to do some XML transformations to import and export AQL (I do not 
need to actually execute AQL, the execution of the internal query model is 
working ok).
Comments and ideas are very welcome!
-- 
Kind regards,
Eng. Pablo Pazos Guti?rrez
http://cabolabs.com   
-- next part --
An HTML attachment was scrubbed...
URL: