Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4171 +/- ##
==========================================
+ Coverage 81.62% 84.86% +3.24%
==========================================
Files 162 162
Lines 20518 20535 +17
Branches 4366 4371 +5
==========================================
+ Hits 16748 17428 +680
+ Misses 2876 2169 -707
- Partials 894 938 +44
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Translate explicit instantiates declarations to rdf:type on the emitted schema resource through one shared helper. Apply the mapping consistently to schemas, classes, slots, types, enums, and non-literal permissible values. Literal permissible values cannot be RDF subjects and produce a warning. Membership types the schema element itself, not its ordinary data instances, and does not become subclass inheritance. Existing enum representation and OWL class/individual punning remain intact. No additional flag is needed because the schema already declares the relationship. Cover CURIEs, absolute and minted IRIs, literal values, representation modes, and the distinction between gen-rdf metamodel serialization and gen-owl ontology assertions. Document the LinkML and OWL specification references. A resource in the OWL 2 reserved vocabulary (Structural Specification section 2.4), such as a type emitted as xsd:integer without type objects, cannot be an OWL 2 DL individual; its instantiates is not asserted, with a warning. A value that is neither a CURIE nor an IRI would become a relative IRI and is skipped with a warning too. The instantiated class is declared as owl:Class, since OWL 2 DL requires a declaration for every class a class assertion uses (section 5.8.1). Signed-off-by: jdsika <carlo.van-driesten@vdl.digital>
jdsika
force-pushed
the
feat/owlgen-permissible-value-instantiates
branch
from
October 23, 2026 14:24
1aca117 to
d612aea
Compare
This branch has not been deployed
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
gen-owl ignored
instantiates. It now asserts each declared membership asrdf:typeon the emitted resource of the schema, a class, a slot, a locally emitted type, an enum or a non-literal permissible value.rdfs:subClassOf, no inherited slots (instantiation guide). An enum of named individuals keeps its ownowl:oneOf; the external class stays open.xsd:integer, which can't be an individual (Structural Specification §2.4); and a value that is neither a CURIE nor an IRI, which would become a relative IRI.use_native_uris=Falsethe assertion goes on theclass_uriresource, like every other axiom about the element.owl:Class, since OWL 2 DL requires a declaration for every class a class assertion uses (§5.8.1). An OWLAPI 5.5.0 profile check of the output flagged the missing declaration.Why
The specification (
05validation.md, annotation validation) definesinstantiatesas auriorcurie"that references a class that serves as a metamodel extension class". #153 asked for a way to make "instances of linkml classes … OWL classes" and was closed with "The metamodel now hasinstantiates". In OWL's RDF mapping a class assertion isrdf:type(OWL 2 Mapping to RDF). No new option: the schema already states the relationship.Other generators
gen-rdf and gen-jsonld serialize the schema as metamodel data and keep
linkml:instantiates, as anxsd:anyURIliteral holding the CURIE, as for everyuriorcuriemetaslot. JSON Schema and SHACL describe data instances, which the element's metaclass doesn't type.How was this tested?
test_owlgen.py: several memberships, minted and explicit IRIs, permissible values as individuals and as classes, every element kind with bothmetaclassesandtype_objectsvalues, both URI modes, the three skip cases, and gen-rdf versus gen-owl. 123 passed locally; CI on the head.Areas of uncertainty
--no-metaclasses:rdf:typeon a class, slot or type puns the IRI as an individual even with--no-metaclasses, the default, which keeps LinkML's own metamodel types out. OWL 2 DL permits this punning (Metamodeling), andinstantiatesis the author's own statement, so it is honoured regardless. Is that the reading you want, or should explicit memberships follow--metaclassestoo?Fork review: ASCS-eV#31.
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.