@Override public OWLDocumentFormat parse(OWLOntologyDocumentSource documentSource, OWLOntology ontology, OWLOntologyLoaderConfiguration configuration) { try { OWLXMLDocumentFormat format = new OWLXMLDocumentFormat(); InputSource isrc = getInputSource(documentSource, configuration); OWLXMLPH handler = new OWLXMLPH(ontology, configuration); SAXParsers.initParserWithOWLAPIStandards(null, configuration.getEntityExpansionLimit()) .parse(isrc, handler); if (!handler.atLeastOneTagFound()) { throw new OWLXMLParserException(handler, "No known tags in the input: is the file an OWL/XML ontology?"); } format.copyPrefixesFrom(handler.getPrefixName2PrefixMap()); format.setDefaultPrefix(handler.getBase().toString()); return format; } catch (SAXException | IOException | OWLOntologyInputSourceException | IllegalStateException e) { // General exception throw new OWLParserException(e); } } }
@Override public OWLDocumentFormat parse(OWLOntologyDocumentSource documentSource, OWLOntology ontology, OWLOntologyLoaderConfiguration configuration) { try { OWLXMLDocumentFormat format = new OWLXMLDocumentFormat(); InputSource isrc = getInputSource(documentSource, configuration); OWLXMLPH handler = new OWLXMLPH(ontology, configuration); SAXParsers.initParserWithOWLAPIStandards(null, configuration.getEntityExpansionLimit()) .parse(isrc, handler); if (!handler.atLeastOneTagFound()) { throw new OWLXMLParserException(handler, "No known tags in the input: is the file an OWL/XML ontology?"); } format.copyPrefixesFrom(handler.getPrefixName2PrefixMap()); format.setDefaultPrefix(handler.getBase().toString()); return format; } catch (SAXException | IOException | OWLOntologyInputSourceException | IllegalStateException e) { // General exception throw new OWLParserException(e); } } }
@Override public OWLDocumentFormat parse(OWLOntologyDocumentSource documentSource, OWLOntology ontology, OWLOntologyLoaderConfiguration configuration) { try { OWLXMLDocumentFormat format = new OWLXMLDocumentFormat(); InputSource isrc = getInputSource(documentSource, configuration); OWLXMLPH handler = new OWLXMLPH(ontology, configuration); SAXParsers.initParserWithOWLAPIStandards(null, configuration.getEntityExpansionLimit()) .parse(isrc, handler); if (!handler.atLeastOneTagFound()) { throw new OWLXMLParserException(handler, "No known tags in the input: is the file an OWL/XML ontology?"); } format.copyPrefixesFrom(handler.getPrefixName2PrefixMap()); format.setDefaultPrefix(handler.getBase().toString()); return format; } catch (SAXException | IOException | OWLOntologyInputSourceException | IllegalStateException e) { // General exception throw new OWLParserException(e); } } }
@Override public OWLDocumentFormat parse(OWLOntologyDocumentSource documentSource, OWLOntology ontology, OWLOntologyLoaderConfiguration configuration) { try { OWLXMLDocumentFormat format = new OWLXMLDocumentFormat(); InputSource isrc = getInputSource(documentSource, configuration); OWLXMLPH handler = new OWLXMLPH(ontology, configuration); SAXParsers.initParserWithOWLAPIStandards(null, configuration.getEntityExpansionLimit()) .parse(isrc, handler); if (!handler.atLeastOneTagFound()) { throw new OWLXMLParserException(handler, "No known tags in the input: is the file an OWL/XML ontology?"); } format.copyPrefixesFrom(handler.getPrefixName2PrefixMap()); format.setDefaultPrefix(handler.getBase().toString()); return format; } catch (SAXException | IOException | OWLOntologyInputSourceException | IllegalStateException e) { // General exception throw new OWLParserException(e); } } }