linkml-runtime icon indicating copy to clipboard operation
linkml-runtime copied to clipboard

Improve curie validation

Open Silvanoc opened this issue 2 years ago • 4 comments

Removing wrong expectations on CURIEs and adding new expectations. Also fixing validation according the specification.

Silvanoc avatar Nov 08 '23 01:11 Silvanoc

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #285      +/-   ##
==========================================
- Coverage   62.09%   62.08%   -0.01%     
==========================================
  Files          63       63              
  Lines        8461     8459       -2     
  Branches     2170     2169       -1     
==========================================
- Hits         5254     5252       -2     
  Misses       2599     2599              
  Partials      608      608              
Files Coverage Δ
linkml_runtime/utils/metamodelcore.py 78.26% <50.00%> (-0.18%) :arrow_down:

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

codecov[bot] avatar Nov 08 '23 01:11 codecov[bot]

You you still working on this PR @Silvanoc ?

cmungall avatar Jan 26 '24 20:01 cmungall

You you still working on this PR @Silvanoc ?

Sorry, I completely forgot this PR. Ich had a private discussion on Slack with @sierra-moxon, where she was raising her concern about the convenience of the changes implying that something like 17 would become an accepted CURIE (see the tests).

I'm quoting here her concern and my answer:

By @sierra-moxon:

Hi again - I see you opened another draft PR on this -- and are currently validating that 17 is a valid curie? I don't think that is a valid curie (I don't claim to be an expert here, but if I had data that used 17 as an identifier, I would want a validation exception generated).

By @Silvanoc:

If I've read the spec right, 17 is a valid CURIE as abc. If LinkML should only support a subset of the spec-conform CURIEs, then it probably should be specified within the project. My feeling is that you expect at least the colon : and possibly also the prefix. We can of course have validation rules for the LinkML CURIE subset. But as I've said, we should first have a clear specification. We could have something like "LinkML CURIEs are all valid CURIEs according the W3C specification providing both a prefix and the separation colon".

After that I simply forgot about it.

@cmungall what's your opinion about it? Could you formulate it with comments on the tests? Something like "I wouldn't expect this to be accepted" or otherwise.

Silvanoc avatar Jan 29 '24 08:01 Silvanoc

According this issue on curies from @cmungall, you don't seem to be that happy with the W3C CURIEs standard. Still other people interested on LinkML (like the W3C Web of Things project) probably want to conform to the W3C standard. I wonder if we should make LinkML somehow capable of coping with both (using a flag like --strict-curies or similar).

Silvanoc avatar Feb 07 '25 16:02 Silvanoc