// Named ontology with a provided absolute prefix. Use name and prefix
// for creating an new import statement.
if (!oChild.isAnonymous() && rewritePrefix != null
/* && rewritePrefix.isAbsolute() */) {
IRI impIri = IRI.create(rewritePrefix + "/" + oChild.getOntologyID().getOntologyIRI());
OWLImportsDeclaration imp = factory.getOWLImportsDeclaration(impIri);
ontologyManager.applyChange(new AddImport(oParent, imp));
}
// Anonymous, with physicalIRI. A plain import statement is added.
else if (childSrc.hasPhysicalIRI()) {
OWLImportsDeclaration imp = factory.getOWLImportsDeclaration(childSrc.getPhysicalIRI());
ontologyManager.applyChange(new AddImport(oParent, imp));
}
// Anonymous and no physical IRI (e.g. in memory). Copy all axioms and
// import statements.
else {
ontologyManager.addAxioms(oParent, oChild.getAxioms());
for (OWLImportsDeclaration imp : oChild.getImportsDeclarations())
ontologyManager.applyChange(new AddImport(oParent, factory.getOWLImportsDeclaration(imp
.getIRI())));
}
return oParent;
}