I'm mapping a remote ontology to a local copy as following:
OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
IRI documentIRI = IRI.create(new File("ontologies/localOntology.owl"));
IRI remoteIRI=IRI.create("https://protege.stanford.edu/ontologies/pizza/pizza.owl");
SimpleIRIMapper mapper = new SimpleIRIMapper(remoteIRI, documentIRI);
manager.getIRIMappers().add(mapper);
OWLOntology ontology = manager.loadOntology(remoteIRI);
manager.saveOntology(ontology, new OWLXMLDocumentFormat());
Is this the correct way to use IRIMap? What if localOntology.owl contains something different from the remote ontology? It seems that I'm manipulating the local ontology regardless the content of the remote ontology, since, for example, if we use ontology.getAxiomCount() with localOntology.owl an empty ontology, we get "0", coherently with the content of localOntology but not with the remote ontology. Should "ontology" be aligned with the remote ontology but stored in localOntology.owl after the mapping? Thank you.