ontology);
return ontology;
}
OWLOntology newOnt = null;
OWLOntologyDocumentTarget tgt = new StringDocumentTarget();
try {
ontology.getOWLOntologyManager().saveOntology(ontology, tgt);
newOnt = ontologyManager
.loadOntologyFromOntologyDocument(new StringDocumentSource(tgt.toString()));
} catch (OWLOntologyStorageException e) {
log.error("Failed to re-serialize ontology.", e);
} catch (OWLOntologyCreationException e) {
log.error("Failed to deserialize ontology.", e);
}