public OWLOntologyFormat parse(OWLOntologyDocumentSource documentSource, OWLOntology ontology, OWLOntologyLoaderConfiguration configuration) throws OWLParserException, IOException, OWLOntologyChangeException, UnloadableImportException {
InputSource isrc = null;
try {
System.setProperty("entityExpansionLimit", "100000000");
OWLXMLOntologyFormat format = new OWLXMLOntologyFormat();
SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setNamespaceAware(true);
SAXParser parser = factory.newSAXParser();
isrc = getInputSource(documentSource);
OWLXMLParserHandler handler = new OWLXMLParserHandler(ontology, configuration);
parser.parse(isrc, handler);
Map<String, String> prefix2NamespaceMap = handler.getPrefixName2PrefixMap();
for(String prefix : prefix2NamespaceMap.keySet()) {
format.setPrefix(prefix, prefix2NamespaceMap.get(prefix));
}
return format;
}
catch (ParserConfigurationException e) {
// What the hell should be do here? In serious trouble if this happens