A standardized browser-based spreadsheet editor and validator that can be run offline and locally, and which includes templates for SARS-CoV-2 and Monkeypox sampling data. This project, created by the Centre for Infectious Disease Genomics and One Health (CIDGOH), at Simon Fraser University, is now an open-source collaboration with contributions from the National Microbiome Data Collaborative (NMDC), the LinkML development team, and others.
MIT License
91
stars
23
forks
source link
Loading a template modifies root slot definitions #382
When DataHarmonizer first loads the template for C1, the C1:s1 column will be required as expected. However if the template is changed to C2, then the resulting column C2:s1 will also be marked as required, which is incorrect.
When a template is loaded, this code merges together the root-level slot definition with the corresponding slot definition in a class's attribute list: https://github.com/cidgoh/DataHarmonizer/blob/c0010697950b82beb55b8770f393c2344dce46c7/lib/DataHarmonizer.js#L141-L149
The issue is that
Object.assign
modifies the "target" object (in this caseself.schema.slots[name]
).To see the effect of this, consider this schema:
When DataHarmonizer first loads the template for
C1
, theC1:s1
column will be required as expected. However if the template is changed toC2
, then the resulting columnC2:s1
will also be marked as required, which is incorrect.