fix: status's range is string instead of uriorcurie - #263
Conversation
The slot `status` declares it's range to be `string`, but in fact bare strings like `testing` or `unstable` are being used in the metamodel itself. This patch aligns the specification with its current use. Fixing it to remain `uriorcurie` would require multiple changes with bigger impact than this change. They might get implemented in the future. Signed-off-by: Silvano Cirujano Cuesta <silvano.cirujano-cuesta@siemens.com>
349ff31 to
6235d1f
Compare
matentzn
left a comment
There was a problem hiding this comment.
@Silvanoc can you redo the PR with just the model changes? I will do the generation of files on a slightly different cadance (it also makes it clearer which files have actially changed other than linkml_model/model/schema/meta.yaml)
@matentzn sure! Guess why I have two commits with exactly that split 😉 I'll drop the 2nd one and done. |
6235d1f to
3722be5
Compare
| - workflow status | ||
| domain: element | ||
| range: uriorcurie | ||
| range: string |
There was a problem hiding this comment.
Could we test this change against OWL generator?
While investigating linkml/linkml#3803 I tried this patch but found OwlSchemaGenerator.add_metadata() is silently dropping status annotation from OWL output due to this owlgen.py conditional
if metaslot_curie.startswith("linkml:"):
# only mapped properties
continue
This skips metaslots whose URI falls back to the native linkml: namespace - and after deleting slot_uri: bibo:status, the slot's URI becomes linkml:status, and every element's status value vanishes from the generated OWL.
There was a problem hiding this comment.
@noelmcloughlin it might be related with issue linkml/linkml#3752. Please give the attached PR a try.
There was a problem hiding this comment.
Seems different bug... let me clarify
this PR alone is problematic. After removing slot_uri: bibo:status, slot's URI becomes linkml:status, and every element (ArrayExpression, apply_to, range_expression, etc.) status value vanishes from generated OWL (on my branch, I confirmed zero "testing" occurrences in my output, versus ~32 bibo:testing triples using alternative uriocurie approach). So a sibling PR forowlgen.py is needed to address fallout
There was a problem hiding this comment.
Hmm, this PR is not changing status itself, only its range. Since you have tried it out, I assume that the explanation is not precise, but the problematic effect exists.
I'll switch this PR to draft until I've clarified the situation and, it needed, provided the required sibling PR for owlgen.py.
There was a problem hiding this comment.
@noelmcloughlin I've realized this issue trying to make SchemaView.expand_curie strict (trying to expand something that is neither a URI -no expansion needed- nor a CURIE -can be expanded) on PR linkml/linkml#3805 (specifically commit linkml/linkml@85fb0c9). Apparently this and that PRs are somehow coupled together.
There was a problem hiding this comment.
yes, three lines in owlgen.py are coupled to this PR
if metaslot_curie.startswith("linkml:"):
# only mapped properties
continue
The slot
statusdeclares it's range to beuriorcurie, but in fact bare strings liketestingorunstableare being used in the metamodel itself (more details in the below linked issue). This patch aligns the specification with its current use.Fixing it to remain
uriorcuriewould require multiple changes with bigger impact than this change. They might get implemented in the future.Fixes: linkml/linkml#3760