Debian Codegraph @

FaCT++.Java/src/main/java/uk/ac/manchester/cs/factplusplus/owlapiv3/FaCTPlusPlusReasonerFactory.java

raw symbols SCIP
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 * Copyright (C) 2009, University of Manchester
13 *
14 * Modifications to the initial code base are copyright of their
15 * respective authors, or their employers as appropriate. Authorship
16 * of the modifications may be determined from the ChangeLog placed at
17 * the end of this file.
18 *
19 * This library is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU Lesser General Public
21 * License as published by the Free Software Foundation; either
22 * version 2.1 of the License, or (at your option) any later version.
23
24 * This library is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27 * Lesser General Public License for more details.
28
29 * You should have received a copy of the GNU Lesser General Public
30 * License along with this library; if not, write to the Free Software
31 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
32 */
33 /**
34 * Author: Matthew Horridge<br>
35 * The University of Manchester<br>
36 * Information Management Group<br>
37 * Date: 13-Jan-2010
38 */
39 public class FaCTPlusPlusReasonerFactory implements OWLReasonerFactory {
40
41 @Override
42 public String getReasonerName() {
43 return "FaCT++";
44 }
45
46 /**
47 * real implementation of the createReasoner method
48 *
49 * @param ontology
50 * ontology to reason on
51 * @param config
52 * reasoner configuration
53 * @param buffering
54 * buffering
55 * @return configured reasoner
56 * @throws IllegalConfigurationException
57 * if the configuration is illegal
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 }