Date & Time
20:00 UTC Wednesday 22nd November 2017
Teleconference Details
To join the meeting please go to https://snomed.zoom.us/j/471420169.
Further information can be found at SLPG meeting information
Goals
- Review proposed Query language examples
Attendees
- Chair: Linda Bird
- Project Group: Michael Lawley, Anne Randorff Højen, Ed Cheetham, Daniel Karlsson, Rob Hausam
Apologies
Agenda and Meeting Notes
Description | Owner | Notes |
---|---|---|
Welcome and apologies | ||
Query Language |
| |
Confirm next meeting date/time | Next meeting to be held at 20:00 UTC on Wednesday 20th December 2017 |
10 Comments
Ed Cheetham
Linda, all
Looking through the examples I wonder if we should consider some of the following:
Ed
Daniel Karlsson
Dear All,
I support Ed's no 1 in that I also would prefer explicit references to tables rather than having to assume (or rely on defaults) which component the effectiveTime applies to.
I also have another issue about having multiple filters applying to components of the same kind. When querying translations it is sometimes needed to query for EN terms and SV terms simultaneously to check consistency of translations. E.g. concepts with EN terms "*substance*" and SE terms "*medel*" (I actually needed to do exactly this yesterday!). Do we allow stacking of filters, like * {{ languageCode = EN, term = "*substance*" }} {{ languageCode = SV, term = "*medel*" }}. The formal semantics of filters need to be defined as well, here I have asumed that filters evaulate to sets of concept IDs and that filter application evaluate to the intersection of the filter set and the preceding result set, either a result of ECL evaluation or another filter.
/Daniel
Linda Bird
Thanks for your thoughts on this Ed and Daniel. Here are some ramblings in response:
<< 64572001 |Disease| {{ C: module = core }} {{ D: term = “*heart*”, typeId = synonym, active=0, module='UKClinicalModule' }}<< 64572001 |Disease| {{ D: term = “*substance*”, languageCode = "EN"}}, {{ D: term = "*medel*", languageCode = "SE" }}<< 64572001 |Disease| {{ D1: term = “*substance*”, languageCode = "EN"}}, {{ D2: term = "*medel*", languageCode = "SE" }}Apologies for the long reply, but thanks again for your thoughts ... we can discuss this further at this week's SLPG meeting.
Linda Bird
A short additional note -
... but I thought I'd mention the alternative, for the benefit of the discussion.
Thanks!
Linda.
Michael Lawley
Indeed filters on relationships are tricky. As I see it, there are four general expression forms for ECL to consider:
It seems to me that a filter that immediately follows any of A, B, or C above has a clear single concept in scope (bound to 'C' inside the filter). However, when and where do we get a relationship binding?
Furthermore, are relationships always bound via either sourceId or destinationId, or is it possible to have unbound relationships, or are they never bound and always require explicit binding?
No answers from me yet - just trying to frame my thinking & assumptions.
Michael Lawley
There's also the issue of when filters get applied in the evaluation process. This most obviously impact on cardinality constraints. Consider:
< 64572001|Disease| : [1..1] 363698007 |Finding site| = < 39607008 |Lung structure| {{ C.moduleId = 'AU Core' }}
Does this match all Diseases that have exactly one Finding site which is a descendant of Lung structure and then further restrict/filter that to those where the relationship is in the 'AU Core' module, or does it instead match all descendants of Disease that have exactly one Finding site that is a descendant of Lung structure AND is also in the 'AU Core' module. In short, does the cardinality constraint apply before or after the filter?
Linda Bird
My interpretation is that the complete ECL is evaluated, and then the filter applies to the results of that evaluation. To achieve other results, you would need to next a query (with brackets) inside the spots in the ECL that can accept a subexpression.
So, with the example that you've shown, it would first find the diseases that have exactly one finding site that is a descendant of lung structure. And then it would further restrict this result to those where the concept is in the AU core - so that implies the "AND" logic of your second option.
I'm not sure why you think it might restrict to those where the relationship is in the 'AU Core', when the filter refers to the attribute "C.moduleId". To filter the results based on the Relationship's module, we would need to use R.moduleId ... and exactly where a relationship filter should be placed in the query is the topic of further discussion ... but the current proposal (from Ed) is to put relationship filters after the attribute in the refinement that matches the relationships the you want to filter. So, for example:
< 64572001|Disease| : [1..1] 363698007 |Finding site| {{ R.moduleId = 'AU Core' }} = < 39607008 |Lung structure|
I would interpret this as matching the diseases with exactly one finding site that (a) is in the AU core module, and (b) has a value that is a type of lung structure.
Kind regards,
Linda.
Michael Lawley
You're right my natural language translation was inaccurate. What I meant to say was that the Lung structure descendant concept was in the 'AU Core' module. I was interpreting the expression based on the following bracketing:
< 64572001|Disease| : [1..1] 363698007 |Finding site| = ( < 39607008 |Lung structure| {{ C.moduleId = 'AU Core' }} )
That is, I've been assuming that filters bind to the closest thing. But your interpretation suggests the following:
(< 64572001|Disease| : [1..1] 363698007 |Finding site| = < 39607008 |Lung structure|) {{ C.moduleId = 'AU Core' }}
which I would have instead expressed as:
< 64572001|Disease| {{ C.moduleId = 'AU Core' }} : [1..1] 363698007 |Finding site| = < 39607008 |Lung structure|
On brief reflection, I suspect that filters on Relationships are likely to be rare, and thus I'd be very open to requiring explicit bracketing to indicate that's what is intended. For example:
< 64572001|Disease| : [1..1] ( 363698007 |Finding site| = < 39607008 |Lung structure| ) {{ R.moduleId = 'AU Core' }}
"exactly one relationship that is in AU Core (but zero or more may be in other modules)"
< 64572001|Disease| : ( [1..1] 363698007 |Finding site| = < 39607008 |Lung structure| ) {{ R.moduleId = 'AU Core' }}
"exactly one relationship in any module, then restrict to AU Core relationships"
< 64572001|Disease| : [2..2] ( 363698007 |Finding site| = < 39607008 |Lung structure| ) {{ R.moduleId = 'AU Core' }}
"exactly two relationships that are in AU Core (but zero or more may be in other modules)"
< 64572001|Disease| : ( [2..2] 363698007 |Finding site| = < 39607008 |Lung structure| ) {{ R.moduleId = 'AU Core' }}
"exactly two relationships in any module, then require at least one to be in AU Core"
To write the query that there must be 2 or more relationships but all must be in AU Core means that you need to use the "zero cardinality trick":
< 64572001|Disease| :
[2..*] 363698007 |Finding site| = < 39607008 |Lung structure|,
[0..0] ( 363698007 |Finding site| = < 39607008 |Lung structure| ) {{ R.moduleId != 'AU Core' }}
For the dotted notation I think it's okay to bind the relationship to the one matching the closest dot:
Any . 246090004 | Associated finding| . 363698007 |Finding site| {{ R.moduleId != 'AU Core' }}
R binds to the Finding site relationships, not the Associated finding relationships. For the latter you'd write:
Any . 246090004 | Associated finding| {{ R.moduleId != 'AU Core' }} . 363698007 |Finding site|
Daniel Karlsson
I would like to see some use cases before we go further down the relationship filtering path, particularly with the DL update and the deprecation of the stated relationship tabular RF2 representation. In the new scheme, relationships would be added axiom-wise rather than at the individual relationship level. While it would be possible to "extract" stated relationship information from the OWL axioms, the questions why and how would need to be answered (in that order).
That leaves the concept and description filters which could be given a much simpler and "ECL-like" interpretation "any concept having properties X, Y, Z" and "any concept with a description having properties X, Y, Z", e.g. << 105590001 | Substance (substance) | AND {{ C.module=900000000000207008 }} AND {{ D.languageCode = EN, D.term = "*substance*" }} AND {{ D.languageCode = SV, D.term = "*medel*" }}
Linda Bird
Thanks Michael and Daniel! Let's come back to these points in this week's meeting.