Skip to content
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

test: improve coverage of curie validation #284

Merged
merged 4 commits into from
Nov 8, 2023
Merged

test: improve coverage of curie validation #284

merged 4 commits into from
Nov 8, 2023

Conversation

Silvanoc
Copy link
Contributor

@Silvanoc Silvanoc commented Nov 7, 2023

According issue linkml/linkml#1701 apparently legal CURIEs like WIKIDATA_PROPERTY:P854 and WIKIDATA.PROPERTY:P854 are being rejected by the validation module.

This PR provides:

  1. Tests to reproduce the issue and avoid regressions, once fixed.
  2. A fix for the issue.

Closes linkml/linkml#1701.

Issue linkml/linkml#1701 has discovered an erroneous validation of CURIE
prefixes, since apparently it doesn't accept characters '_' and '.'.

This patch extends the tests to provide test coverage for the expected
values to work, avoiding future regressions.

Signed-off-by: Silvano Cirujano Cuesta <[email protected]>
@Silvanoc Silvanoc marked this pull request as draft November 7, 2023 23:29
Signed-off-by: Silvano Cirujano Cuesta <[email protected]>
For whatever strange reasons, the regular expressions being used for
CURIE validation were using UTF-8 non-breaking spaces (hex C2A0) instead
of normal whitespaces. This patch fixes it.

Signed-off-by: Silvano Cirujano Cuesta <[email protected]>
Copy link

codecov bot commented Nov 8, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0be3c4a) 62.09% compared to head (d45970a) 62.09%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #284   +/-   ##
=======================================
  Coverage   62.09%   62.09%           
=======================================
  Files          63       63           
  Lines        8461     8461           
  Branches     2170     2170           
=======================================
  Hits         5254     5254           
  Misses       2599     2599           
  Partials      608      608           
Files Coverage Δ
linkml_runtime/utils/uri_validator.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Silvano Cirujano Cuesta <[email protected]>
@Silvanoc Silvanoc marked this pull request as ready for review November 8, 2023 00:41
@Silvanoc
Copy link
Contributor Author

Silvanoc commented Nov 8, 2023

Commit 38c4be2 explains the issue. The regular expressions were right! Only some strange UTF-8 non-breaking spaces instead of whitespaces had appeared in the code and were breaking the regexs.

Copy link
Member

@sierra-moxon sierra-moxon left a comment

Choose a reason for hiding this comment

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

Thank you @Silvanoc !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

linkml-runtime 1.6.1 causes too-strict curie validation to break common biomedical CURIE syntax
2 participants