On 26/03/2022 15:46, Martynas Jusevičius wrote:
Hi,

Using the ontology API, if one owl:imports an ontology URI such as
<http://www.w3.org/ns/org#> into ontology model, the imported model
gets cached under the "http://www.w3.org/ns/org#"; key.

However, given

     <http://www.w3.org/ns/org#> a owl:Ontology

one can argue that this URI is of the ontology resource, but what gets
loaded and cached is more than that -- it is the ontology *document*.
This relates to the old debate whether ontology instances should
contain the trailing # in their URIs, i.e. whether ontology and its
document is the same resource or distinct resources.

The problem is that despite the ontology being cached, code that
attempts to dereference its document URI will not be able to make use
of it as "http://www.w3.org/ns/org"; will not match the
"http://www.w3.org/ns/org#"; cache key.

This seems inconsistent of imports.

You started with
> one owl:imports an ontology URI such as
> <http://www.w3.org/ns/org#>

so I don't understand where http://www.w3.org/ns/org comes in. At worse, things are cached twice, under two different names. There needs to be consistency in nmaing - same if http://www.w3.org/ns/org# and http://example/myCopy/org

Your description says that http://www.w3.org/ns/org# is the import name.

There is the LocationMapper that may help your application.

    Andy


My questions are:
1. How can I work around this? Using some kind of post-loadImports()
hook to make cache entries for both URIs?
2. Shouldn't the OWL import code be aware of this and cache the
document URI while using it as a base for all relative URIs (of
ontology terms)?

The base has the same effect. Fragments are stripped on relative URI resolution.


Martynas
atomgraph.com

Reply via email to