Skip to content
This repository has been archived by the owner on Jul 18, 2022. It is now read-only.

Expansion of beacon.yaml to include specification for the query filters. #72

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

Tom-Shorter
Copy link

The /filtering_terms endpoint has been expanded to include the infoResponse wrapper to conform with all other endpoints.

Query filters are now of three types:

  • ontologyFilters
  • alphaNumericFilters
  • customFilters

An OntologyResource object has been included in this specification. This object is included as a way of providing information about an ontology which is described externally to the beacon and/or dataset, such as HPO or MeSH. The OntologyResource is based off of the Phenopackets resource object specifications.

A new endpoint, un-related to filters has been proposed for completeness - /datasets/{id}, this is due to /datasets/{id}/filtering_terms being created as a new filters related endpoint which describes filters used by datasets identified by {id}. The contents of /datasets/{id} has been set as a subset of the contents of /datasets where only information relating to the dataset as identified by {id} is displayed.

The existence of /datasets/{id} is not required for the rest of the specification to function correctly and the contents of the endpoint can be freely modified as desired, what is detailed below is a suggestion only as having /datasets and /datasets/{id}/filtering_terms but not including a definition of /datasets/{id} seems incomplete and could cause confusion when implementing.

expansion of beacon.yaml to include the first implementation of the filters scout group suggestion for how to handle filters
@Tom-Shorter
Copy link
Author

With cohorts being an area of interest for beaco it might be worth considering the need for an endpoint such as /cohorts/{id}/filtering_terms as well.

Copy link
Contributor

@sdelatorrep sdelatorrep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, @Tom-Shorter, I've just done some small comments :)

beacon.yaml Outdated Show resolved Hide resolved
beacon.yaml Show resolved Hide resolved
beacon.yaml Show resolved Hide resolved
beacon.yaml Show resolved Hide resolved
beacon.yaml Outdated Show resolved Hide resolved
beacon.yaml Outdated Show resolved Hide resolved
beacon.yaml Show resolved Hide resolved
sdelatorrep
sdelatorrep previously approved these changes Jun 4, 2021
mbaudis
mbaudis previously approved these changes Jun 4, 2021
Copy link
Member

@mbaudis mbaudis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK good. Adds complexity, but most is optional. Adds implementation work :-)

Copy link
Contributor

@sdelatorrep sdelatorrep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Tom-Shorter! I think everything is fine, but there are conflicts with branch develop. I tried to solve them, but I'm a bit confused with some, so I think it's better if you do it yourself. Thanks!

@Tom-Shorter
Copy link
Author

Hi @Tom-Shorter! I think everything is fine, but there are conflicts with branch develop. I tried to solve them, but I'm a bit confused with some, so I think it's better if you do it yourself. Thanks!

Sorry @sdelatorrep, I must have missed the notification email about your comment, I believe I've fixed all of the conflicts now.

@jrambla
Copy link
Collaborator

jrambla commented Jun 18, 2021

@Tom-Shorter
Hi!
I could be mistaken, but I've spotted 3 potential errors in the resulting YAML.

  • Line 138 is an incorrect reference. "DatasetResponse" doesn't exist
  • Line 2830 is an unfinished entry "filteringTerms:"
  • Line 2878 is incorrectly indented

Also.
Line 1254 should be "anyOf" instead of "oneOf". The latter requires that only 1 schema matches the tested document, and, in the current models, "OntologyFilter" and "CustomFilter" are having the same schema, based on "required". Therefore the validator is unable to discriminate and it throws an error.

@Tom-Shorter
Copy link
Author

Thanks @jrambla, I believe those problems should now be fixed (swagger hub doesn't seem to be working ATM but other online validators show no problems)

I'll have to speak with Tim about the two filter types, I don't think there is a way to update the required parameters without enforcing either similarity or descendant term matching, both of which should be optional

@Tom-Shorter
Copy link
Author

Hi @jrambla

Those problems should be resolved, includeDescendantTerms is now a required parameter, along with id, for the ontology filter

fixed ontologyResource + ontologyTerm objects
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants