Search in sources :

Example 1 with OWLXMLStorerFactory

use of org.semanticweb.owlapi.owlxml.renderer.OWLXMLStorerFactory in project webprotege by protegeproject.

the class RootOntologyLoader method loadRootOntology.

public OWLOntology loadRootOntology() {
    // The delegate - we use the concurrent ontology manager
    OWLOntologyManager delegateManager = WebProtegeOWLManager.createConcurrentOWLOntologyManager();
    // We only support the binary format for speed
    delegateManager.getOntologyStorers().add(new RDFXMLStorerFactory());
    delegateManager.getOntologyStorers().add(new OWLXMLStorerFactory());
    delegateManager.getOntologyStorers().add(new FunctionalSyntaxStorerFactory());
    delegateManager.getOntologyStorers().add(new ManchesterSyntaxStorerFactory());
    delegateManager.getOntologyParsers().add(new BinaryOWLOntologyDocumentParserFactory());
    // The wrapper manager
    ProjectOWLOntologyManager manager = new ProjectOWLOntologyManager();
    manager.setDelegate(delegateManager);
    int threadPriority = Thread.currentThread().getPriority();
    try {
        Thread.currentThread().setPriority(3);
        OWLOntology rootOntology = documentStore.initialiseOntologyManagerWithProject(manager.getDelegate());
        manager.sealDelegate();
        return rootOntology;
    } catch (OWLOntologyCreationException | OWLOntologyStorageException e) {
        throw new RuntimeException("Failed to load project: " + e.getMessage(), e);
    } finally {
        Thread.currentThread().setPriority(threadPriority);
    }
}
Also used : BinaryOWLOntologyDocumentParserFactory(org.semanticweb.binaryowl.owlapi.BinaryOWLOntologyDocumentParserFactory) ManchesterSyntaxStorerFactory(org.semanticweb.owlapi.manchestersyntax.renderer.ManchesterSyntaxStorerFactory) FunctionalSyntaxStorerFactory(org.semanticweb.owlapi.functional.renderer.FunctionalSyntaxStorerFactory) RDFXMLStorerFactory(org.semanticweb.owlapi.rdf.rdfxml.renderer.RDFXMLStorerFactory) OWLXMLStorerFactory(org.semanticweb.owlapi.owlxml.renderer.OWLXMLStorerFactory) OWLOntologyCreationException(org.semanticweb.owlapi.model.OWLOntologyCreationException) OWLOntology(org.semanticweb.owlapi.model.OWLOntology) OWLOntologyManager(org.semanticweb.owlapi.model.OWLOntologyManager) OWLOntologyStorageException(org.semanticweb.owlapi.model.OWLOntologyStorageException)

Aggregations

BinaryOWLOntologyDocumentParserFactory (org.semanticweb.binaryowl.owlapi.BinaryOWLOntologyDocumentParserFactory)1 FunctionalSyntaxStorerFactory (org.semanticweb.owlapi.functional.renderer.FunctionalSyntaxStorerFactory)1 ManchesterSyntaxStorerFactory (org.semanticweb.owlapi.manchestersyntax.renderer.ManchesterSyntaxStorerFactory)1 OWLOntology (org.semanticweb.owlapi.model.OWLOntology)1 OWLOntologyCreationException (org.semanticweb.owlapi.model.OWLOntologyCreationException)1 OWLOntologyManager (org.semanticweb.owlapi.model.OWLOntologyManager)1 OWLOntologyStorageException (org.semanticweb.owlapi.model.OWLOntologyStorageException)1 OWLXMLStorerFactory (org.semanticweb.owlapi.owlxml.renderer.OWLXMLStorerFactory)1 RDFXMLStorerFactory (org.semanticweb.owlapi.rdf.rdfxml.renderer.RDFXMLStorerFactory)1