This wiki has undergone a migration to Confluence found Here
<meta name="googlebot" content="noindex">

Difference between revisions of "Query Expression and Execution Technology"

From HL7Wiki
Jump to navigation Jump to search
(New page: CATEGORY:RIMBAA Issue *Rik: I want to query in a RIM graph (memory or file) for pre-defined clinical criteria. Codes, values, ages, dates, AND, OR - the usual sort of things. *Ideally...)
 
Line 1: Line 1:
 
[[CATEGORY:RIMBAA Issue]]
 
[[CATEGORY:RIMBAA Issue]]
 
+
How does one query a RIM graph (memory or file) for pre-defined clinical criteria. Codes, values, ages, dates, AND, OR - the usual sort of things. There is a need for a query representation format, and then a tool to run those queries.  
*Rik: I want to query in a RIM graph (memory or file) for pre-defined clinical criteria. Codes, values, ages, dates, AND, OR - the usual sort of things.
 
 
*Ideally it would be:
 
*Ideally it would be:
**Understandable by a non-developer or non-RIM expert
+
**Understandable by a non-developer or non-RIM expert. Some sort of query builder or parameter modifier may be needed that sits on top of one of the other query expression formats.
 
**A standard of some sort
 
**A standard of some sort
 
**Possible get it working quickly, days rather than weeks
 
**Possible get it working quickly, days rather than weeks
 
I’d like the queries to be readable to end users, but realise that this isn’t easy. Some sort of query builder or parameter modifier may be needed that sits on top of one of the other query expression formats.
 
 
There is obviously a need for a query representation format, and then a tool to run those queries. Although an off the shelf implementation would be nice, that is not really HL7’s department. I can see that I’m not likely to find an easy implementation of the main contenders, so that actually levels the playing field a little.
 
  
 
==Options==  
 
==Options==  
  
 
===OCL===
 
===OCL===
Grahame: You can use OCL directly. See
+
Grahame: OCL can be used directly. See
[http://www.hl7.org/v3ballot/html/infrastructure/constraints/constraints.htm#rim_ocl]
+
[http://www.hl7.org/v3ballot/html/infrastructure/constraints/constraints.htm#rim_ocl] for discussion.
for discussion.
 
 
 
Constraint and the selection part of a query seem to be allied but different to me - I know I already lumped these together in the question but now I'm trying to tease out the differences. I imagine a set of OCL constraints annotating a model, but they could be too fragmented to constitute a query.
 
  
 +
*Rik: Constraint and the selection part of a query seem to be allied but different to me - I know I already lumped these together in the question but now I'm trying to tease out the differences. I imagine a set of OCL constraints annotating a model, but they could be too fragmented to constitute a query.
 
*Does anyone imagine firing off OCL queries and getting result sets/graphs back?
 
*Does anyone imagine firing off OCL queries and getting result sets/graphs back?
 
**Grahame: yes, an invariant is only a query that must have type boolean and is required to evaluate to true. In our own use we define a different binding called "query"
 
**Grahame: yes, an invariant is only a query that must have type boolean and is required to evaluate to true. In our own use we define a different binding called "query"
 
**so instead of ''context T inv: [expression which is of type boolean]'' it's ''context T query: [expression which returns OclAny]''. I have this working against CDA, but not in a general v3 context.
 
**so instead of ''context T inv: [expression which is of type boolean]'' it's ''context T query: [expression which returns OclAny]''. I have this working against CDA, but not in a general v3 context.
  
 +
===Gello===
 +
*Pros: on paper seems the ideal fit. A standard. Use cases shown recently on DSS list look similar to mine.
 +
*Cons: hard to implement, no off the shelf tools I can integrate with my own code, not widely adopted.
  
===Gello==
+
Rik: Doesn’t add much over OCL, not that that is any easier, but we could just use that instead of the Gello subset.
 
 
Pros: on paper seems the ideal fit. A standard. Use cases shown recently on DSS list look similar to mine.
 
 
 
Cons: hard to implement, no off the shelf tools I can integrate with my own code, not widely adopted.
 
 
 
Doesn’t add much over OCL, not that that is any easier, but we could just use that instead of the Gello subset.
 
 
 
 
 
 
Q’s: what’s the current Gello in the ballot “Gello R2: OCL-Like” or “V3 Gello R1: OCL-Based”?
 
 
 
 
   
 
   
 
===XPath/XQuery===
 
===XPath/XQuery===
 +
*Pros: runs on anything, implemented already, if I serialize the data (or DOM it).
 +
*Cons: Not RIM aware nor datatypes aware. Not ITS agnostic but that isn’t really an issue.
  
Pros: runs on anything, implemented already, if I serialize the data (or DOM it).
+
Rik: I see XQuery as a technology built mostly on XPath so would have some advantages if I was to
 
+
make a lot of use of XPath but the same weaknesses (lack of model awareness, datatypes integration etc). Normally I tend to "query" using XSL and XPath so have not really looked into XQuery much. I expect it is a better way to do XPath-like queries properly.
Cons: Not RIM aware or datatypes aware. Not ITS agnostic but that isn’t really an issue. Not integrated with any terminology (HL7 or otherwise, but then neither are any of the others, except maybe HPath for HL7 vocabs)
 
 
 
I see XQuery as a technology built mostly on XPath so would have some advantages if I was to
 
make a lot of use of XPath but the same weaknesses (lack of model awareness, datatypes integration etc).  
 
 
 
Normally I tend to "query" using XSL and XPath so have not really looked into XQuery much. I expect it is a better way to do XPath-like queries properly.
 
  
  
 
===HPath===
 
===HPath===
 
+
*Pros: a better XPath for HL7, an implementation exists (JavaSIG). HPath is a better language (than XPath), since it shares the same intent but is properly tied to v3 semantics.
Pros: a better XPath for HL7, an implementation exists (JavaSIG)
+
*Cons: not well documented, needs the JavaSIG code integrating, might be hard for a non-JavaSIG based project. The javasig implementation is not generally useable. No support for recent MIFs nor data types R2.
 
 
 
 
 
Cons: not well documented, needs the JavaSIG code integrating, might be hard for a non-JavaSIG based project.
 
 
 
 
While it's true that javasig has an implementation of HPath - which is a better language (than XPath), since it shares the same intent but is properly tied to v3 semantics - the javasig implementation is not generally useable.
 
 
 
 
Qs: Supports datatypes R2 and recent coremifs?
 
 
 
 
   
 
   
 
===QBE===
 
===QBE===
“Raw RIM” - express queries as Act etc with EVN.CRT (or the post harmonization version of that),  relationshipConjunction etc.
+
Query By example (QBE)  - express queries as Acts etc with isCriterionInd set to true.
 
+
*Pros: It’s HL7
Pros: It’s HL7
+
*Cons: Complicated to express queries. No way to execute queries without writing your own engine.
 
 
Cons: Complicated to express queries. Not clear that it is possible to express complex queries. No way to execute queries without writing your own engine.
 
 
 
Q’s: does anyone really express queries this way?
 
 
 
Bob: Another I would throw into the consideration mix is HQMF [http://www.hl7.org/v3ballot/html/domains/uvqm/uvqm.htm], which makes heavy use of criteria (previously known as criterion mood). It kinda works like a Query By Example. One of the topics we're exploring with DSS in Cambridge is whether we should enable GELLO, ARDEN, etc in the &lt;expression> field (e.g. where observation.value is data type EXPR_PQ).
 
  
Rene: Given the lack of constraint language tooling in SMD / Visio there is no way to predict what constraint language will prevail at some future point in time. My guess is that it'll be OCL. So right now the direction seems to be QBE + embedded OCL.
+
*NCI (Jean Duteau) are implementing QBE right now.
 +
*Bob: Another I would throw into the consideration mix is HQMF [http://www.hl7.org/v3ballot/html/domains/uvqm/uvqm.htm], which makes heavy use of criteria (previously known as criterion mood). It kinda works like a Query By Example. One of the topics we're exploring with DSS in Cambridge is whether we should enable GELLO, ARDEN, etc in the &lt;expression> field (e.g. where observation.value is data type EXPR_PQ).
 +
*Rene: Given the lack of constraint language tooling in SMD / Visio there is no way to predict what constraint language will prevail at some future point in time. My guess is that it'll be OCL. So right now the direction seems to be QBE + embedded OCL.

Revision as of 13:53, 4 October 2010

How does one query a RIM graph (memory or file) for pre-defined clinical criteria. Codes, values, ages, dates, AND, OR - the usual sort of things. There is a need for a query representation format, and then a tool to run those queries.

  • Ideally it would be:
    • Understandable by a non-developer or non-RIM expert. Some sort of query builder or parameter modifier may be needed that sits on top of one of the other query expression formats.
    • A standard of some sort
    • Possible get it working quickly, days rather than weeks

Options

OCL

Grahame: OCL can be used directly. See [1] for discussion.

  • Rik: Constraint and the selection part of a query seem to be allied but different to me - I know I already lumped these together in the question but now I'm trying to tease out the differences. I imagine a set of OCL constraints annotating a model, but they could be too fragmented to constitute a query.
  • Does anyone imagine firing off OCL queries and getting result sets/graphs back?
    • Grahame: yes, an invariant is only a query that must have type boolean and is required to evaluate to true. In our own use we define a different binding called "query"
    • so instead of context T inv: [expression which is of type boolean] it's context T query: [expression which returns OclAny]. I have this working against CDA, but not in a general v3 context.

Gello

  • Pros: on paper seems the ideal fit. A standard. Use cases shown recently on DSS list look similar to mine.
  • Cons: hard to implement, no off the shelf tools I can integrate with my own code, not widely adopted.

Rik: Doesn’t add much over OCL, not that that is any easier, but we could just use that instead of the Gello subset.

XPath/XQuery

  • Pros: runs on anything, implemented already, if I serialize the data (or DOM it).
  • Cons: Not RIM aware nor datatypes aware. Not ITS agnostic but that isn’t really an issue.

Rik: I see XQuery as a technology built mostly on XPath so would have some advantages if I was to make a lot of use of XPath but the same weaknesses (lack of model awareness, datatypes integration etc). Normally I tend to "query" using XSL and XPath so have not really looked into XQuery much. I expect it is a better way to do XPath-like queries properly.


HPath

  • Pros: a better XPath for HL7, an implementation exists (JavaSIG). HPath is a better language (than XPath), since it shares the same intent but is properly tied to v3 semantics.
  • Cons: not well documented, needs the JavaSIG code integrating, might be hard for a non-JavaSIG based project. The javasig implementation is not generally useable. No support for recent MIFs nor data types R2.

QBE

Query By example (QBE) - express queries as Acts etc with isCriterionInd set to true.

  • Pros: It’s HL7
  • Cons: Complicated to express queries. No way to execute queries without writing your own engine.
  • NCI (Jean Duteau) are implementing QBE right now.
  • Bob: Another I would throw into the consideration mix is HQMF [2], which makes heavy use of criteria (previously known as criterion mood). It kinda works like a Query By Example. One of the topics we're exploring with DSS in Cambridge is whether we should enable GELLO, ARDEN, etc in the <expression> field (e.g. where observation.value is data type EXPR_PQ).
  • Rene: Given the lack of constraint language tooling in SMD / Visio there is no way to predict what constraint language will prevail at some future point in time. My guess is that it'll be OCL. So right now the direction seems to be QBE + embedded OCL.