Closed pkalita-lbl closed 1 year ago
cc: @turbomam
cc: @turbomam
Great. Is there anything I can do to review, since I'm not a JS developer? I'm not even sure what the tests do.
Ok, I'll have a chance to review tomorrow! Thanks for getting this going!
So I can't quite follow the algorithm (my brain limitation). I see there's a check for duplicate values within a column. I can't quite see how duplicate row keycolumn values are checked for. An index of each keycolumn's value -> rows it appears in is made? Then in 2nd pass each row's key combo is checked somehow?
The alternative would be to create an index composed of each row's a single key string as a tab-delimited merged string of the keycolumn values present in that row? Then as each new row is being processed, collisions with past row can be detected in one pass, and error info for colliding cells that are part of the collision can be marked?
Functionality and performance look great!
All set to merge?
Sorry for not saying so yesterday, but yes, I was ready to merge 😁 Thanks
These changes add support for the unique_keys slot on ClassDefinition in the LinkML metamodel during validation. The core logic is implemented in a new
validateUniqueValues
function invalidation.js
with corresponding unit tests invalidation.test.js
. This utility function is also now being used to validate the uniqueness of identifier columns.Fixes #369