hubmapconsortium / entity-api

A set of web service calls to return information about HuBMAP entities
https://entity.api.hubmapconsortium.org
MIT License
3 stars 1 forks source link

Always set `Publication.dataset_type` to "Publication" #599

Closed yuanzhou closed 5 months ago

yuanzhou commented 5 months ago

Since we are making dataset_type required field on Dataset and Publication at entity creation time, the validator for Publication.dataset_type at both creation via POST call and update via PUT call should be updated to only allow one value publication (case-insensitive).

Currently the same validator of dataset_type is defined for both Dataset and Publication, and the ingest-ui only uses dataset_type == 'Publication' for Publication creation, which is rejected with the following error message:

400 Bad Request: Proposed Dataset dataset_type 'Publication' is not recognized in the existing ontology. Valid values are: ['Cell DIVE', 'CODEX', 'Light Sheet', 'MIBI', 'LC-MS', 'HiFi-Slide', 'Histology', 'PhenoCycler', 'CyCIF', 'MALDI', 'SIMS', 'DESI', 'Auto-fluorescence', 'Confocal', 'Thick section Multiphoton MxIF', 'Second Harmonic Generation (SHG)', 'Enhanced Stimulated Raman Spectroscopy (SRS)', '10X Multiome', 'Molecular Cartography', 'CosMx', 'Xenium', 'MERFISH', 'DBiT', 'SNARE-seq2', '2D Imaging Mass Cytometry', 'GeoMx (NGS)', 'Visium (no probes)', 'Visium (with probes)', 'ATACseq', 'RNAseq', 'RNAseq (with probes)', 'nanoSPLITS', 'GeoMx (nCounter)']."

The solution is for publication creation, we'll let the entity-api always use "Publication", so the ingest-ui code doesn't send over this dataset_type == 'Publication' (@BirdMachine needs to make the corresponding updates in UI code)

To implement:

kburke commented 5 months ago

https://github.com/hubmapconsortium/entity-api/pull/601