for (OWLImportsDeclaration oldImp : o.getImportsDeclarations()) {
changes.add(new RemoveImport(o, oldImp));
String s = oldImp.getIRI().toString();
if (s.contains("::")) s = s.substring(s.indexOf("::") + 2, s.length());
IRI target = IRI.create(base + "/" + s);
changes.add(new AddImport(o, df.getOWLImportsDeclaration(target)));
}
o.getOWLOntologyManager().applyChanges(changes);
ResponseBuilder rb = Response.ok(o);
addCORSOrigin(servletContext, rb, headers);