| 1 |
package uk.ac.manchester.cs.factplusplus.owlapiv3; |
| 2 |
|
| 3 |
import org.semanticweb.owlapi.model.OWLOntology; |
| 4 |
import org.semanticweb.owlapi.reasoner.BufferingMode; |
| 5 |
import org.semanticweb.owlapi.reasoner.IllegalConfigurationException; |
| 6 |
import org.semanticweb.owlapi.reasoner.OWLReasoner; |
| 7 |
import org.semanticweb.owlapi.reasoner.OWLReasonerConfiguration; |
| 8 |
import org.semanticweb.owlapi.reasoner.OWLReasonerFactory; |
| 9 |
import org.semanticweb.owlapi.reasoner.SimpleConfiguration; |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
public class FaCTPlusPlusReasonerFactory implements OWLReasonerFactory { |
| 40 |
|
| 41 |
@Override |
| 42 |
public String getReasonerName() { |
| 43 |
return "FaCT++"; |
| 44 |
} |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
protected OWLReasoner createReasoner(OWLOntology ontology, |
| 60 |
OWLReasonerConfiguration config, boolean buffering) |
| 61 |
throws IllegalConfigurationException { |
| 62 |
BufferingMode bufferingMode = buffering ? BufferingMode.BUFFERING |
| 63 |
: BufferingMode.NON_BUFFERING; |
| 64 |
final FaCTPlusPlusReasoner reasoner = new FaCTPlusPlusReasoner( |
| 65 |
ontology, config, bufferingMode); |
| 66 |
ontology.getOWLOntologyManager().addOntologyChangeListener(reasoner); |
| 67 |
return reasoner; |
| 68 |
} |
| 69 |
|
| 70 |
@Override |
| 71 |
public OWLReasoner createReasoner(OWLOntology ontology) { |
| 72 |
return createReasoner(ontology, new SimpleConfiguration(), true); |
| 73 |
} |
| 74 |
|
| 75 |
@Override |
| 76 |
public OWLReasoner createNonBufferingReasoner(OWLOntology ontology) { |
| 77 |
return createReasoner(ontology, new SimpleConfiguration(), false); |
| 78 |
} |
| 79 |
|
| 80 |
@Override |
| 81 |
public OWLReasoner createReasoner(OWLOntology ontology, |
| 82 |
OWLReasonerConfiguration config) |
| 83 |
throws IllegalConfigurationException { |
| 84 |
return createReasoner(ontology, config, true); |
| 85 |
} |
| 86 |
|
| 87 |
@Override |
| 88 |
public OWLReasoner createNonBufferingReasoner(OWLOntology ontology, |
| 89 |
OWLReasonerConfiguration config) |
| 90 |
throws IllegalConfigurationException { |
| 91 |
return createReasoner(ontology, config, false); |
| 92 |
} |
| 93 |
} |