OWLOntology o = session.getOntology(OntologyUtils.decode(ontologyId), OWLOntology.class, false,
prefix);
if (o == null) rb = Response.status(NOT_FOUND);
else try {
ByteArrayOutputStream out = new ByteArrayOutputStream();
o.getOWLOntologyManager().saveOntology(o, new ManchesterOWLSyntaxOntologyFormat(), out);
rb = Response.ok(new Viewable("ontology", new OntologyPrettyPrintResource(servletContext,
uriInfo, out, session)));
} catch (OWLOntologyStorageException e) {
throw new WebApplicationException(e, INTERNAL_SERVER_ERROR);
}