edmcouncil / ontology-publisher

The owl-builder "builds" publishable / deployable versions (and derived products) of a given set of ontologies (such as FIBO)
MIT License
7 stars 6 forks source link

Resolution of owl:versionIRI values #117

Closed mereolog closed 1 year ago

mereolog commented 1 year ago

3.3 Versioning of OWL 2 Ontologies requires that:

An ontology series is identified using an ontology IRI, and each version in the series is assigned a different version IRI. The ontology document of the ontology representing the current version of the series should be accessible via the ontology IRI and, if present, via its version IRI as well; the ontology documents of the previous versions should be accessible solely via their respective version IRIs.

Currently, we do not support these features, e.g., https://spec.edmcouncil.org/fibo/ontology/BE/20210101/Corporations/Corporations/ does not resolve despite that it is a value of owl:versionIRI in: https://github.com/edmcouncil/fibo/blob/705f0d8fd0920563844a5cbfa05f2487be39a930/BE/Corporations/Corporations.rdf#L69

Similarly, https://spec.edmcouncil.org/fibo/ontology/BE/20220801/Corporations/Corporations/ does not resolve as well it is specified as a versionIRI in: https://github.com/edmcouncil/fibo/blob/7d326d31c5060c39508a40bff2ebead232ccc308/BE/Corporations/Corporations.rdf#L72

To make the matters worse, ontology-publisher, without any good reason known to me, seems to overwrite these version IRIs, e.g., https://spec.edmcouncil.org/fibo/ontology/BE/Corporations/Corporations.rdf has:

instead of:

This divergence is noted in https://github.com/edmcouncil/fibo/discussions/1404#discussioncomment-422088.

We should probably resolve https://spec.edmcouncil.org/fibo/ontology/master/latest/BE/Corporations/Corporations/ redirecting it to the latest version of https://spec.edmcouncil.org/fibo/ontology/BE/Corporations/Corporations/ from GitHub without changing the contents of this ontology. Note that 3.3 Versioning of OWL 2 Ontologies does not require that an ontology document is accessible only through the ontology IRI or a owl:versionIRI, so accessing the latest version of https://spec.edmcouncil.org/fibo/ontology/BE/Corporations/Corporations/ also from https://spec.edmcouncil.org/fibo/ontology/master/latest/BE/Corporations/Corporations/ should satisfy these requirements.

Btw., we sort of created this problem when we decided to control versions both using versionIRI and GitHub tags - usually such double versioning is confusing. Personally I would recommend dropping the former, i.e., not using owl:versionIRI or using it right, i.e., resolving all values of this property or at least the value from a given GitHub tag.

przemekgradzki commented 1 year ago

.. ontology-publisher, without any good reason known to me, seems to overwrite these version IRIs ...

see lines 374-379 in: https://github.com/edmcouncil/ontology-publisher/blob/eddec493e7786b791fca6c80e21729ee08c76a0d/publisher/product/ontology/build.sh#L365-L379

it was first introduced here:

commit 98065ab054aaa853e8dd3f36687007ed7ba9d244
Author: Jacobus Geluk <jacobus.geluk@agnos.ai>
Date:   Thu Dec 13 14:34:26 2018 +0000

    INFRA-327 Draft version of ontology-publisher

https://github.com/edmcouncil/ontology-publisher/blob/98065ab054aaa853e8dd3f36687007ed7ba9d244/publisher/publish.sh#L217-L227