public void exportOntology(OutputStream out, IRI documentIRI) throws Exception {
    OWLOntologyManager m = OWLManager.createOWLOntologyManager();
    OWLOntologyLoaderConfiguration config = new OWLOntologyLoaderConfiguration();
    config.setMissingImportHandlingStrategy(MissingImportHandlingStrategy.SILENT);

    List<OWLOntology> loadedOntologies = loadOntologyFiles(m, config, null);
    OWLOntology o = findOntology(loadedOntologies, documentIRI);
    if (o == null) {
      throw new LumifyException("Could not find ontology with iri " + documentIRI);
    }

    Writer fileWriter = new OutputStreamWriter(out);

    new RDFXMLRenderer(o, fileWriter).render();
  }
 public OWLOntologyManager createOwlOntologyManager(
     OWLOntologyLoaderConfiguration config, IRI excludeDocumentIRI) throws Exception {
   OWLOntologyManager m = OWLManager.createOWLOntologyManager();
   config.setMissingImportHandlingStrategy(MissingImportHandlingStrategy.SILENT);
   loadOntologyFiles(m, config, excludeDocumentIRI);
   return m;
 }