Conversation
A permissible value can be an instance of a class defined in another schema:
an open vocabulary declares the class, and an extension contributes named
individuals of it. The metamodel states this with `instantiates` on the
permissible value ("an element in another schema which this element
instantiates"), but gen-owl ignored it - its slot URI is linkml:instantiates,
which add_metadata skips - so the individual came out typed only with the
enum's own class. Validators checking `sh:class` against the open vocabulary
then rejected it.
Each `instantiates` value of a permissible value with an IRI now becomes an
rdf:type of that IRI. The enum still closes its own class with owl:oneOf; the
instantiated class stays open. On a permissible value rendered as a literal
there is nothing to type, so `instantiates` is ignored with a warning, as
`meaning` already is.
Signed-off-by: jdsika <carlo.van-driesten@vdl.digital>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes # — no issue covers this.
A permissible value can be an instance of a class defined in another schema: an open vocabulary declares the class (
Category), and an extension contributes named individuals of it. The metamodel states exactly this withinstantiateson the permissible value — "An element in another schema which this element instantiates" — butgen-owlignored it. Its slot URI islinkml:instantiates, whichadd_metadataskips, so the individual was typed only with the enum's own class. A validator checkingsh:class vocab:LicenseCategorythen rejects the value, although the schema says it is one.Each
instantiatesvalue of a permissible value with an IRI now becomes anrdf:typeof that IRI:ex:isLicense a owl:NamedIndividual, ex:LinkCategory, vocab:LicenseCategory . ex:LinkCategory owl:oneOf ( ex:isLicense ... ) .owl:oneOf; the instantiated class stays open, so other schemas can keep adding members.instantiatesis ignored with a warning, asmeaningalready is.Without this, the only ways to type such individuals are a global
--default-permissible-value-type(one class for every value of every enum) or an enumis_a, which must name another enum.How was this tested?
test_permissible_value_instantiates_types_the_value: single and multipleinstantiates, the value keepsowl:NamedIndividualand the enum class, the enum'sowl:oneOfis unchanged, a value withoutinstantiatesgets no extra type, and the instantiated class gets noowl:oneOf.test_permissible_value_instantiates_ignored_on_literal: no type triple and a warning.pytest tests/linkml/test_generators/test_owlgen.py -m "not kroki"— 99 passed, 3 skipped.ruff checkandruff format --check(0.11.13) clean.Areas of uncertainty
owl:Classpermissible values. A class value thatinstantiatesa class is typed by it too, which is metaclass punning — the same readinginstantiateshas for classes elsewhere in the metamodel. Not restricted to individuals, because the metamodel does not restrict it.Checklist
AI Assistance
If you used AI tools while preparing this PR, you are still the author and responsible for understanding, verifying, and defending your submission. Please engage with reviewers personally rather than through your agent during feedback and revisions. See our AI Covenant for details.