protected void storeOntology(OWLOntologyManager manager, OWLOntology ontology, Writer writer, OWLOntologyFormat format) throws
OWLOntologyStorageException {
try {
OWLObjectRenderer ren = new OWLObjectRenderer(manager, ontology, writer);
if(format instanceof PrefixOWLOntologyFormat) {
PrefixOWLOntologyFormat prefixFormat = (PrefixOWLOntologyFormat) format;
DefaultPrefixManager man = new DefaultPrefixManager();
Map<String, String> map = prefixFormat.getPrefixName2PrefixMap();
for(String pn : map.keySet()) {
prefixFormat.setPrefix(pn, map.get(pn));
}
ren.setPrefixManager(man);
}
ontology.accept(ren);
writer.flush();