Conversation
gen-owl renders every annotation and every string-ranged metadata slot as a literal. For properties whose value is a resource by their own specification that is wrong: an ontology's owl:priorVersion, owl:versionIRI, prov:wasDerivedFrom, dcterms:license or dcterms:conformsTo comes out as "https://..." instead of an IRI, so it can be neither dereferenced nor followed by tools that read the ontology header. There was no way to express these header terms at all. A value of one of those properties is now emitted as an IRI when it is an absolute IRI or a CURIE with a declared prefix; every other value, and every other property, keeps its literal. The properties are the OWL 2 ontology properties and owl:versionIRI, rdfs:seeAlso and rdfs:isDefinedBy, the DCMI terms relating a resource to another resource, and prov:wasDerivedFrom, prov:wasRevisionOf and prov:hadPrimarySource. dcterms:identifier is left out: DCMI gives it the range rdfs:Literal. Refs: linkml#3546 Signed-off-by: jdsika <carlo.van-driesten@vdl.digital>
jdsika
force-pushed
the
feat/owlgen-iri-valued-metadata
branch
from
October 2, 2026 15:03
d674fbc to
6ac1208
Compare
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 # — implements the proposal of linkml#3546 ("gen-owl emits rdfs:isDefinedBy and dcterms:license as string literals instead of URIs") and extends it to the ontology header.
gen-owlrenders everyannotationsentry and every string-ranged metadata slot as a literal. For properties whose value is a resource by their own specification that is wrong: an ontology'sowl:priorVersion,owl:versionIRI,prov:wasDerivedFrom,dcterms:licenseordcterms:conformsTocomes out as"https://...", which tools reading the header can neither dereference nor follow. Before this change there was no way to express these header terms as IRIs at all.A value of one of the properties below is now emitted as an IRI when it is an absolute IRI or a CURIE with a declared prefix. Every other value, and every other property, keeps its literal.
owl:versionIRI,owl:priorVersion,owl:backwardCompatibleWith,owl:incompatibleWithrdfs:seeAlso,rdfs:isDefinedByrdfs:range rdfs:Resource(RDF Schema 1.1 §5.4)dcterms:license,conformsTo,relation,references,isReferencedBy,hasVersion,isVersionOf,replaces,isReplacedBy,requires,isRequiredBy,sourceprov:wasDerivedFrom,prov:wasRevisionOf,prov:hadPrimarySourcerdfs:range prov:Entity(PROV-O)licenseandconforms_to) and from the annotation loop.dcterms:identifieris not listed: DCMI gives it the rangerdfs:Literal.How was this tested?
test_iri_valued_metadata_is_emitted_as_iris: absolute IRI, expanded CURIE, PROV, DCMI as annotations, andlicense/conforms_to/see_alsoas metamodel slots.test_literal_valued_metadata_stays_literal:owl:versionInfo,dcterms:identifierwith an IRI-looking value,dcterms:creator, and an IRI-valued property with plain text all keep their literals.pytest tests/linkml/test_generators -m "not kroki"— 1774 passed, 41 skipped, 3 xfailed.--with-slow --with-biolink --generate-snapshots. The diff is the intended change only, three lines:meta.owlgetsdcterms:license <https://creativecommons.org/publicdomain/zero/1.0/>anddcterms:conformsTo <https://www.rfc-editor.org/rfc/bcp/bcp47.txt>,biolink.owl.ttlgetsdct:license <https://creativecommons.org/publicdomain/zero/1.0/>, each previously a string literal.ruff checkandruff format --check(0.11.13) clean.Areas of uncertainty
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.