HELP : Add elements from one ontology to another

Posted by jlbellier on
URL: http://owlready.306.s1.nabble.com/HELP-Add-elements-from-one-ontology-to-another-tp2128.html

Hello

I am turning around on my problem and I do not know how to solve it. I am using Owlready2 with Python.

I have two ontologies onto_A and onto_B that are stored in local files (let's say fileA and fileB). The structure is the same for both, only the individuals are different.

I would like to copy the individuals from fileB to fileA. I tried to do an import :

onto_A.imported_ontologies.append(onto_B) and then call save, but when I open fileA in Protege, I get an error.

I also tried to build the list of individuals of onto_B, let's call it list_indiv , and then do a instruction like this :

with_onto_A:
    for indiv in list_indiv:
       ...

    onto_A.save(fileA)

But fileA is still unchanged.

Is there an easy way to do that (a kind of append mode on the save method) ??

I am really stucked.

Thnak you in advance for your help.

Best regards,
Jean-luc.