Q:

Import ontology with same IRI

I have one ontology which consists on two separate files:

tbox.owl
abox.owl

(The latter contains only the instances)
My idea is to use the Manchester OWL API 5 to read the Abox and get all the object properties in signature (for example).
The Abox uses owl:imports to include the Tbox. But -from my understanding- first I have to map the remote IRI of the Tbox (e.g., http://mywebsite.com/ontology/artists.owl) to the local file in my system.
This is what I tried:
// Create an ontology manager
OWLOntologyManager manager = OWLManager.createOWLOntologyManager();

// Manually map imports
IRI remoteIRI = IRI.create("http://mywebsite.com/ontology/tbox.owl");
IRI localIRI = IRI.create(new File("tbox.owl"));

SimpleIRIMapper mapper = new SimpleIRIMapper(remoteIRI, localIRI);
manager.getIRIMappers().add(mapper);

// Read individuals (i.e. ABox)
File file = new File("abox.owl");
OWLOntology ABox = manager.loadOntologyFromOntologyDocument(file);

And this is the exception it raises:
Exception in thread "main" org.semanticweb.owlapi.model.OWLOntologyAlreadyExistsException: Ontology already exists. OntologyID(OntologyIRI(<http://mywebsite.com/ontology/tbox.owl>) VersionIRI(<null>))
    at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.load(OWLOntologyManagerImpl.java:1122)
    at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:1057)
    at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntologyFromOntologyDocument(OWLOntologyManagerImpl.java:1007)
    at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntologyFromOntologyDocument(OWLOntologyManagerImpl.java:1020)
    at examples.PopulateDatabaseWithPropIndividuals.main(PopulateDatabaseWithPropIndividuals.java:71)
Caused by: org.semanticweb.owlapi.model.OWLOntologyRenameException: Could not rename ontology. An ontology with this ID already exists: OntologyID(OntologyIRI(<http://mywebsite.com/ontology/tbox.owl>) VersionIRI(<null>))

Any ideas?

A:

The two ontologies cannot have the same IRI, because this creates ambiguity both in the manager holding them and, more in general, from a reuse viewpoint. It would not be possible for another ontology to univocally identify which of your ontologies it imports, if your ontologies were to be made public or even if they were kept private but you wished to use them in some other project.
My recommended workaround would be to modify the abox ontology IRI and add an owl:imports statement to it, importing the tbox ontology. It could be done in the other direction (the tbox could import the abox), although this is not the most common pattern; you could also add a third ontology whose purpose is only to aggregate the two ontologies, and containing only two imports statements, towards your abox and tbox.

