Hello,
I've tested it, but it seems to work as expected.
I created 2 ontologies with this script:
from owlready2 import *
onto_path.append("/tmp")
o1 = get_ontology("
http://www.test.org/o1.owl")
o2 = get_ontology("
http://www.test.org/o2.owl")
o1.imported_ontologies.append(o2)
with o1:
class C1(Thing): pass
with o2:
class C2(Thing): pass
o1.save()
o2.save()
And then I loaded o1.owl with the following script :
from owlready2 import *
onto_path.append("/tmp")
o1 = get_ontology("
http://www.test.org/o1.owl").load()
print(o1.imported_ontologies)
When run, it print the o2 ontology:
[get_ontology("
http://www.test.org/o2.owl#")]
Are you sure the problem is not somewhere else?
Best regards,
Jean-Baptiste Lamy
MCF, LIMICS, Université Paris 13
> Now the ontologies are added when I save from owlready2 to a file but aren't
> there when I import and print(onto.imported_ontologies). It just shows an
> empty list. I'm using the RDFXML format.
>
> Is there a different way to access them?
>
>
>
> _______________________________________________
> If you reply to this email, your message will be added to the discussion below:
>
http://owlready.8326.n8.nabble.com/Saving-New-Imported-Ontologies-tp224p235.html> To start a new topic under Owlready, email
[hidden email]
> To unsubscribe from Owlready, visit