Search code examples
javaowl-api

OWL API renamed entity from imported ontology


I have the ontology A which is imported in B. I would like to rename an entity, so I write:

OWLEntityRenamer renamer = new OWLEntityRenamer(manager, Collections.singleton(A));        
Map<OWLEntity, IRI> entity2IRIMap = new HashMap<>();             
entity2IRIMap.put(datafactory.getOWLNamedIndividual(iriBase+"Skyfos"), IRI.create(iriBase+"Skyphos"));       
manager.applyChanges(renamer.changeIRI(entity2IRIMap)); 
manager.save(A);
manager.save(B);

Now, the entity is correctly renamed in A, but in B I have both the entities. In particular in B, each object-property that uses "Skyfos" continues to use "Skyfos" instead of "Skyphos". Thank you.


Solution

  • The problem here is that OWLEntityRenamer requires all the ontology to be modified.