linkml / linkml-runtime

Runtime support for linkml generated models
https://linkml.io/linkml/
Creative Commons Zero v1.0 Universal
22 stars 21 forks source link

test: improve coverage of curie validation #284

Closed Silvanoc closed 8 months ago

Silvanoc commented 8 months ago

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.

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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 ```diff @@ 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](https://app.codecov.io/gh/linkml/linkml-runtime/pull/284?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=linkml) | Coverage Δ | | |---|---|---| | [linkml\_runtime/utils/uri\_validator.py](https://app.codecov.io/gh/linkml/linkml-runtime/pull/284?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=linkml#diff-bGlua21sX3J1bnRpbWUvdXRpbHMvdXJpX3ZhbGlkYXRvci5weQ==) | `100.00% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Silvanoc commented 8 months ago

Commit 38c4be2c89de3176da1ecda8e8155921693336d8 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.