if (!(format instanceof RioRDFDocumentFormat)) {
throw new OWLOntologyStorageException(
"Unable to use RioOntologyStorer to store this format as it is not recognised as a RioRDFOntologyFormat: "
+ format);
}
final RioRDFDocumentFormat rioFormat = (RioRDFDocumentFormat) format;
if (format.isTextual()) {
try {
Writer writer = new BufferedWriter(new OutputStreamWriter(
outputStream, UTF_8));
rioHandler = getRDFHandlerForWriter(
rioFormat.getRioFormat(), writer);
} catch (IOException e) {
throw new OWLOntologyStorageException(e);
}
} else {
rioHandler = getRDFHandlerForOutputStream(
rioFormat.getRioFormat(), outputStream);
}
}
try {
final RioRenderer ren = new RioRenderer(ontology, rioHandler,
format, contexts);