use of org.semanticweb.owlapi.formats.RioRDFXMLDocumentFormatFactory in project minerva by geneontology.
the class CoreMolecularModelManager method loadOWLOntologyDocumentSource.
private static OWLOntology loadOWLOntologyDocumentSource(final OWLOntologyDocumentSource source, final OWLOntologyManager manager) throws OWLOntologyCreationException {
final OWLOntology ontology;
if (source instanceof RioMemoryTripleSource) {
RioParserImpl parser = new RioParserImpl(new RioRDFXMLDocumentFormatFactory());
ontology = manager.createOntology();
OWLOntologyLoaderConfiguration config = new OWLOntologyLoaderConfiguration();
try {
parser.parse(source, ontology, config);
} catch (IOException e) {
throw new OWLOntologyCreationException(e);
}
} else {
ontology = manager.loadOntologyFromOntologyDocument(source);
}
return ontology;
}
Aggregations