Search in sources :

Example 1 with ReasonerFactory

use of org.semanticweb.HermiT.Reasoner.ReasonerFactory in project stanbol by apache.

the class HermitReasoningService method getReasoner.

@Override
protected OWLReasoner getReasoner(OWLOntology ontology) {
    log.debug("Creating HermiT reasoner: {}", ontology);
    Configuration config = new Configuration();
    // This must be true!
    config.ignoreUnsupportedDatatypes = true;
    // This must be true!
    config.throwInconsistentOntologyException = true;
    //config.monitor = new Debugger(null, false);
    log.debug("Configuration: {}, debugger {}", config, config.monitor);
    ReasonerFactory risfactory = new ReasonerFactory();
    log.debug("factory: {}", risfactory);
    OWLReasoner reasoner = null;
    reasoner = risfactory.createReasoner(ontology, config);
    log.debug("Reasoner : {}", reasoner);
    if (reasoner == null) {
        log.error("Cannot create the reasner!!");
        throw new IllegalArgumentException("Cannot create the reasoner");
    }
    return reasoner;
}
Also used : Configuration(org.semanticweb.HermiT.Configuration) ReasonerFactory(org.semanticweb.HermiT.Reasoner.ReasonerFactory) OWLReasoner(org.semanticweb.owlapi.reasoner.OWLReasoner)

Aggregations

Configuration (org.semanticweb.HermiT.Configuration)1 ReasonerFactory (org.semanticweb.HermiT.Reasoner.ReasonerFactory)1 OWLReasoner (org.semanticweb.owlapi.reasoner.OWLReasoner)1