-
Notifications
You must be signed in to change notification settings - Fork 23
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
Filtering terms in model: Confusing /__entryType__/filteringTerms.json
files
#93
Comments
I would rather add "scope": {
"type": "array",
"items": {
"type": "string"
}
} property to the beaconFilteringTermsResults.json. so we would define {
"id": "LOINC:3141-9",
"label": "Weight",
"type": "alphanumeric",
"scope": ["individual", "biosamples", ...]
} I think this would simplify both, implementation and usage. Best, Dmitry |
@redmitry Yes, IMO also a good option (actually my preferred one). But the form in which to do this is not clear because there are some open questions:
For me in summary I'd rather see a flexible use where the terms in the beaconFilteringTermsResults have some (optional) information about the scope they apply to, potentially w/ parameter (e.g. There had also been some discussion at #79 (comment) (w/o final resolution). |
I also like the approach that @redmitry has done with filtering terms. I think it would fit better the idea of filters we are applying in beacon and would help the user to quicker find what can he filter and where. Just one observation, wouldn't the scope be defined better as an object than an array?, like this: "scope": {
"type": "object",
"items": {
"type": "string"
}
} On the other hand, on @mbaudis observations, I agree that giving a scope hint can be problematic if we think in alternative models, but as you said we can add it to be optional, not required. But I can think of some examples (in fact we have them in our reference implementation) where an ontology applies to two different scopes, like ethnicities/diseases/sex ontologies in individuals and cohorts. |
@costero-e The
...is correct if you reference the entity names. If you reference ontologies for the entities you'd use
|
Good note about the examples (sex, ethnicities...). Another argument for having entities in the filteringTerms - but not for queries since you'd either query cohorts or individuals. I think the use of query aggregation here across entry types (variants for a certain diagnosis, biosamples from male subjects ...) does not interfere for these examples since there is a difference between collection schemas and data records. |
The filters are to be applied to particular entry types, so IMO it's reasonable to enumerate (limit) their scopes.
IMO, the scope defines the entry type it applies, not the parameter. The parameter in particular entry type may differ in different implementations (mongo, sql, omop, etc.). {
"id": "LOINC:3141-9",
"label": "Weight",
"type": "alphanumeric",
"query": "{'measures': {'$elemMatch': {'assayCode.id': '$$id', 'measurementValue.value': {$$operator: $$value}}}}}"
} Note, that "query" is filtered out when exposed by "filtering_terms" (we just use the same format for configuration).
Well, the idea that "scope" defined in the query corresponds to "scope"s defined in filtering_terms.
Parameters in the entry should be out of scope, IMO. Beacon implementation may generate beacons dynamically and use other query languages or whatever.
This could provide the choice in a case of complex query. Imagine we have say "age" filter which may be applied to two entities (e.g. biosamples and individuals). |
Sorry, I was thinking in the whole "individuals" response as the scope and not the type of scope inside the filtering terms. So yes, it is an array and items are the strings: "scope": ["individuals", "biosamples"] |
We are having several parallel discussions here, which, usually, ends up in some threads not being closed.
Makes sense? |
FilteringTerms and filters are still confusing. One of the areas is the existence of
filteringTerms.json
files (e.g. in biosamples) which are supposedly placeholders for information files about the available filtering terms for the entry type but do not constitute an endpoint. So it seems that they are for internal use only (and anyway most probably would be kept in a database or generated on the fly).Proposals:
/filtering_terms
endpoint toendpoints
, for each entity where filters apply, e.g./biosamples/filtering_terms/
, additionally to/filtering_terms
, to list all applying to the given scopeThe text was updated successfully, but these errors were encountered: