Ontology does not load when using IRI

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Ontology does not load when using IRI

primoz
I wanted to load an existing ontology from my computer by passing IRI to get_ontology and then calling load. It didn't load and when I checked the source code I realized that the problem is that filename does not match the last part of IRI. Example:

ontho_path.append('/path/to/the/dir/with/ontology/inside')
get_ontology('http://abc.example/ontology.owl').load()

Loading fails with the error that ontology cannot be found online. By debugging I found out that owlready first checked for this ontology locally. Then I found out that when checking locally owlready only matches last part of IRI with a filename. In my case, it was checking if ontology.owl is in the path directory. It was not because I have an ontology with the name ont.owl which contained the correct IRI and should be matched.

I can help with fixing it but the fix would need to open every ontology in the dir to check IRI. Here is the question do we want it. It would be also helpful in case when one ontology imports another by IRI.
Reply | Threaded
Open this post in threaded view
|

Re: Ontology does not load when using IRI

Jiba
Administrator
Yes, in such cases, you need to rename the ontology file so as it matches the last part of the IRI.

Opening all local files can be problematic in terms of performance, if there are many such files.

I think there is no perfect solution to this problem -- and I still wonder why some ontologies are named http://abc.example/ontology.owl and have a different filename...

Jiba