Add elements from one ontology to another

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

Add elements from one ontology to another


I am new to OWL and OWLReady2. My problem is the following :
I defined a OWL containing all the elements of my ontology, lets call project_ontology.owl, with IRI IRI1
I built another OWL file containing other items like individuals, based on the items of project_ontology.
I stored them in a file called graph.owl. The IRI is IRI2.

I want to aggregate data from graph.owl to project_ontology.owl. I tried to use :

and then save the result to the project_ontology.owl file with the .save function.
In my new project_ontology.owl, I can just see :

<?xml version="1.0"?>
<rdf:RDF xmlns:rdf=""

<owl:Ontology rdf:about="IRI1">
  <owl:imports rdf:resource="IRI2"/>


whereas I expected to see all the objects of graph.owl imported, and defined as NameIndividuals.
As a consequence, all the classes from project_ontology.owl that were not instantiated have disappeared from the new project_ontology.owl file. Furthermore, I cannot see the indiviuals in the OntoGraf tab, and I am not sure this solution is portable.

SO I wonder how it works.
What is the best way to aggregate the content of two OWL file without loosing the original content ?

Thank gou in advance for your help.

Best regards,
Reply | Threaded
Open this post in threaded view

Re: Add elements from one ontology to another


Importing ontologies allows the reuse of the content of other ontologies (it is similar to the reuse of classes defined in other Python modules when you import the modules).

It is probably the best solution here, unless you want to copy-paste the content of the ontology (but Owlready does not have such a copy paste functionality yet).