Search in sources :

Example 1 with RioRDFXMLDocumentFormatFactory

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;
}
Also used : RioParserImpl(org.semanticweb.owlapi.rio.RioParserImpl) RioMemoryTripleSource(org.semanticweb.owlapi.rio.RioMemoryTripleSource) RioRDFXMLDocumentFormatFactory(org.semanticweb.owlapi.formats.RioRDFXMLDocumentFormatFactory) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 RioRDFXMLDocumentFormatFactory (org.semanticweb.owlapi.formats.RioRDFXMLDocumentFormatFactory)1 RioMemoryTripleSource (org.semanticweb.owlapi.rio.RioMemoryTripleSource)1 RioParserImpl (org.semanticweb.owlapi.rio.RioParserImpl)1