Skip to content

Rename ontology uri property to iri - #400

Open
jochenchrist wants to merge 2 commits into
apache:mainfrom
jochenchrist:rename-uri-to-iri
Open

jochenchrist wants to merge 2 commits into
apache:mainfrom
jochenchrist:rename-uri-to-iri

Conversation

@jochenchrist

@jochenchrist jochenchrist commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #332.

Renames the optional global identifier on concepts and relationships from uri to iri, as agreed in the discussion on #332 (IRI per RFC 3987). The prefixes map now uses the JSON Schema iri format, and the descriptions say IRI instead of URI.

Also documents the new fields in ontology.md: prefixes in the top-level table, iri in the concept and relationship tables, and a new "Global identifiers" section that explains IRIs, QName expansion against prefixes, and that IRIs do not change how local names are used in expressions and mappings. The example in that section validates against the updated schema.

Follow-up to apache#332. The global identifier on concepts and relationships
is now called iri instead of uri, as agreed in the PR discussion
(IRI per RFC 3987 covers both full IRIs and QNames). The prefixes map
uses the JSON Schema iri format accordingly.
Adds the prefixes field to the top-level table, the iri field to the
concept and relationship tables, and a Global identifiers section that
explains IRIs, QName expansion against prefixes, and how IRIs relate to
local names.
Comment thread ontology/ontology.md
The `iri` field accepts two forms:

- A full IRI, e.g. `http://xmlns.com/foaf/0.1/Agent`.
- A QName of the form `prefix:local`, e.g. `foaf:Agent`, where `prefix` is declared in the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not directly related to this PR, but... Please note that deciding which form to parse here is not really possible to do for all possible cases. For example urn:isbn:whatever is a valid IRI. What if you have a prefix urn:?

In LinkML there is the exact same issue with the uriorcurie datatype. See: linkml/linkml#3906

Should there be a follow-up to define a clear algorithm for how iri should be parsed and serialized?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

URNs are valid IRIs (from RDC 3987) so they should be allowed. @jochenchrist perhaps the md can reflect this:

The ‘irk’ field accepts two forms:

  • A full IRI, e.g. http://xmlns.com/foaf/0.1/Agent, urn:foaf:Agent
  • A QName …

I’m also curious about @Ostrzyciel’s statements that it’s not possible to implement all cases. RDF processors have been doing this for years. Do I misunderstand your statement?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I think @Ostrzyciel is pointing that how can we decide if a value is a QName (to lookup the prefix) vs. an URN, as both have the form schema:values.

However, URNs always start with urn:....

An idea might be to not allow a prefix urn.

I will update the PR accordingly to mention that URNs are alos allowed as IRI.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m also curious about @Ostrzyciel’s statements that it’s not possible to implement all cases. RDF processors have been doing this for years. Do I misunderstand your statement?

In Turtle, these two have different syntaxes. Full IRIs are: <urn:fullIri>. And CURIES/QNames are: urn:qname. They are interpreted differently.

An idea might be to not allow a prefix urn.

URNs are just one possible case where this will break :) IRIs have a ton of forms. You can get a sample here: https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Example_URIs

As for the solution to this conundrum: I would recommend a solution along the lines of this one proposed in LinkML: linkml/linkml#3906 (comment)

@kayemkim kayemkim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One data point for the QName versus full IRI thread: nothing in the repo enforces either form today. validation/validate.py builds Draft202012Validator(schema) without a format checker, so format: iri (like format: uri before it) is descriptive only, and jsonschema ships no iri checker anyway unless rfc3987 is installed. The same goes for the "a QName whose prefix is not declared in prefixes is invalid" sentence; the validator accepts any string. So whichever resolution rule comes out of that discussion, it would need a semantic check next to the reference and arity ones, not a schema keyword. Not a blocker for this rename. Checked on current main that no example, fixture or converter in the repo uses the uri field, so the rename is complete as is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants