Login  Register

Reading ontolgy with imported ontology

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

Reading ontolgy with imported ontology

jlbellier
17 posts
Hello everybody,

I am trying to use imported ontologies and read ontologies with imports with OWLReady2.
I created 2 ontologies essai1.owl and essai2.owl using Protege (my version is 5.5)
I did two experiments :

1) Import using Protege
In essai1.owl, I use the import Ontology tool in Protege to import essai2.owl, and save the result in essai1_with_import.owl.
I used the option to import a local file.

When I read essai1_with_import.owl using get_ontology, I get the following mistake :

owlready2.base.OwlReadyOntologyParsingError: Cannot download 'http://www.semanticweb.org/anaya/ontologies/2022/5/untitled-ontology-547'!

(untitled-ontology-547 is the IRI of the imported ontology). Both ontologies are in the same folder (let's say F), and I extended my onto_path variable in Python to add F.

2) Import using OWLReady2

I created a new ontolgy using onto.imported_ontologies.append(onto2) syntax in Python and save the result to essai3.owl

When I read essai3.owl using get_ontology, it works.

When I open essai3.owl and compare it to essai1_with_import.owl (using Notepad++), I cannot see any difference. Same comparison using Protege.


So I wonder how it works. There are certainly subtelties in the behaviour of both but I cannot see them.

My end users are familiar with Protege, so I need to understand what failed in my way of doing.

Thank you in advance.

Best regards,
Jean-Luc.

Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Reading ontolgy with imported ontology

Jiba
Administrator
1186 posts
Hello,

In the Protégé method, Owlready need to be able to access the imported ontology for loading it. This can be done :
 * via Internet, if the ontology is available online using its IRI as an URL (this is not the case in your example)
 * in a local copy cached on disk. The directory containing the local copy must be added to the list "onto_path". I think you need to do that.

Jiba