Closed LesterLyu closed 2 years ago
When creating a new ontology via owlready2 and set the imported ontologies:
owlready2
from owlready2 import * onto = default_world.get_ontology("http://test#") cwrc_onto = default_world.get_ontology("http://sparql.cwrc.ca/ontologies/cwrc.owl").load() onto.imported_ontologies.append(cwrc_onto) onto.save('./test.owl')
The import section in the owl file does not contain the ".owl" extension:
<owl:Ontology rdf:about="http://test"> <owl:imports rdf:resource="http://sparql.cwrc.ca/ontologies/cwrc"/> <b><-- missing .owl</b> </owl:Ontology>
This will make Protege unable to read the imported ontology file. Manually add the ".owl" makes it work.
<owl:Ontology rdf:about="http://test"> <owl:imports rdf:resource="http://sparql.cwrc.ca/ontologies/cwrc.owl"/> </owl:Ontology>
If I don't call load(), the ".owl" extension won't be removed.
load()
Fixed in https://github.com/csse-uoft/owlready2/commit/6df52c4520fe649c1abe0ab28f7a1ce51ee3152e
Link to owlready2 forum
Issue description:
When creating a new ontology via
owlready2
and set the imported ontologies:The import section in the owl file does not contain the ".owl" extension:
This will make Protege unable to read the imported ontology file. Manually add the ".owl" makes it work.
What's the expected result?
Additional Information:
If I don't call
load()
, the ".owl" extension won't be removed.