-
Notifications
You must be signed in to change notification settings - Fork 22
Adding "excluded" property to "OntologyFilter" #264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
gsfk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems sensible, although with lots of comments: my first reaction was to be offended that alphanumeric filters were left out, although any filter that can point to fields in the model can also point to excluded, eg:
{
"filters": [
{"id": "phenotypicFeatures.featureType.label", "operator": "=", "value": "Diabetes mellitus"},
{"id": "phenotypicFeatures.excluded", "operator": "=", "value": true}
]
}Although this presumes a fixed way to point to fields in the model, which we don't really have. This also won't work well if your implementation allows you to search multiple phenotypic features at the same time (you won't know which one to exclude) although this could be fixed with AND/OR filters.
So I think the pr makes sense, at least for ontology filters, since they don't really point anywhere, although you could presumably do this:
{
"filters": [
{"id": "HP:0000819"},
{"id": "phenotypicFeatures.excluded", "operator": "=", "value": true}
]
}... but this has similar problems, which will get worse when we add more excluded fields to the model.
I'm not sure adding excluded makes sense for alphanumerics or custom filters. Custom filters in particular are supposed to be open, so presumably don't need fields prescribed for them. (You could write a custom filter autoimmune_diseases_excluded, which makes an extra excluded field confusing.)
From what I what I can tell the pr only affects POST requests, when ontologies are commonly used with GET. Is this a POST-only feature?
|
@gsfk Thanks for the comments!
O.k.; I agree w/ the sentiment. I'll remove the property from custom too.
How would you do GET per filter? As mentioned in the call, and written ... previously, we need a definition of "what & how to stringify in filters". This IMO includes:
I thought I'd made an issue for that but maybe it was only a talking point? Happy if anybody writes this up (e.g. |
... following @gsfk 's comments.
|
I want to doublecheck if we have considered properly the actual scenario: |
myFilter, excluded:
So a match requires a positive assertion of an |
refinement of description for `OntologyFilter.excluded`
|
I was meaning that if you apply a filter on a term, w/o any mention to "excluded", and in your phenotype you have the term BUT excluded, a typical filter request WILL return such record as having the phenotype, while actually it has not. A request filtering by "HP:0002006" in a MongoDB search, e.g. will return that record as a match, given that the "excluded" flag is not part of the request. Therefore, I believe we should include a clear warning in the documentation to ALWAYS (?) include a check on the presence of a "excluded: true" flag in the phenotype before returning the results. |
|
@jrambla Well, the definition's
However, it is difficult to avoid misuse/-interpretation by implementers, especially given varying schema interpretations in networked queries etc. I have changed the description - which is getting a bit lengthy, not a good sign - and also fixed a logical bug. WDYT, before pushing it, ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- There is a sentence in the description that I don't understand: "field in the is set to
true" - I don't understand or agree in "
excluded: falseis equivalent to omitting the filter" - I don't agree either in
AlphanumericFiltercan implement the functionality via operators (!)
|
One aspect to consider: In the last DevScout meeting, we agreed that we could make GET & POST diverge. |
|
I disagree in that alphanumeric or custom doesn't require "excluded". than Similarly with the custom filter, which purpose was to fill the gap for non-existing ontologies or terms. All of them are applicable to phenotypicFeatures, hence under the "excluded" area of influence. |
|
Hi all, We had a discussion within our group (including Tony) regarding the "excluded" flag. We also agree with Jordi’s point that the "excluded" flag is mainly required for ontology-based filters, and that it is not necessary for alphanumeric or numeric filters. We are okay with this approach and support using the "excluded" flag for ontology terms. Thanks & regards, |
This PR adds an "excluded" property to "OntologyFilter" and "CustomFilter". See discussion at #63