Skip to content

Package: NoOpReasoner

NoOpReasoner

nameinstructionbranchcomplexitylinemethod
NoOpReasoner(OWLOntology)
M: 0 C: 7
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
createReasoner(OWLOntology)
M: 0 C: 8
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
dispose()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
flush()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
getBottomClassNode()
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getBottomDataPropertyNode()
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getBottomObjectPropertyNode()
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getBufferingMode()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getDataPropertyDomains(OWLDataProperty, boolean)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getDataPropertyValues(OWLNamedIndividual, OWLDataProperty)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getDifferentIndividuals(OWLNamedIndividual)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getDisjointClasses(OWLClassExpression)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getDisjointDataProperties(OWLDataPropertyExpression)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getDisjointObjectProperties(OWLObjectPropertyExpression)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getEquivalentClasses(OWLClassExpression)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getEquivalentDataProperties(OWLDataProperty)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getEquivalentObjectProperties(OWLObjectPropertyExpression)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getFreshEntityPolicy()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getIndividualNodeSetPolicy()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getInstances(OWLClassExpression, boolean)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getInverseObjectProperties(OWLObjectPropertyExpression)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getObjectPropertyDomains(OWLObjectPropertyExpression, boolean)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getObjectPropertyRanges(OWLObjectPropertyExpression, boolean)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getObjectPropertyValues(OWLNamedIndividual, OWLObjectPropertyExpression)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getPendingAxiomAdditions()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getPendingAxiomRemovals()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getPendingChanges()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getPrecomputableInferenceTypes()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getReasonerName()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getReasonerVersion()
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getRootOntology()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getSameIndividuals(OWLNamedIndividual)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getSubClasses(OWLClassExpression, boolean)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getSubDataProperties(OWLDataProperty, boolean)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getSubObjectProperties(OWLObjectPropertyExpression, boolean)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getSuperClasses(OWLClassExpression, boolean)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getSuperDataProperties(OWLDataProperty, boolean)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getSuperObjectProperties(OWLObjectPropertyExpression, boolean)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getTimeOut()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getTopClassNode()
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getTopDataPropertyNode()
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getTopObjectPropertyNode()
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getTypes(OWLNamedIndividual, boolean)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getUnsatisfiableClasses()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
interrupt()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
isConsistent()
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
isEntailed(OWLAxiom)
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
isEntailed(Set)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
isEntailmentCheckingSupported(AxiomType)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
isPrecomputed(InferenceType)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
isSatisfiable(OWLClassExpression)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
precomputeInferences(InferenceType[])
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*
2: * JOPA
3: * Copyright (C) 2023 Czech Technical University in Prague
4: *
5: * This library is free software; you can redistribute it and/or
6: * modify it under the terms of the GNU Lesser General Public
7: * License as published by the Free Software Foundation; either
8: * version 3.0 of the License, or (at your option) any later version.
9: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library.
17: */
18: package cz.cvut.kbss.ontodriver.owlapi.query;
19:
20: import org.semanticweb.owlapi.model.*;
21: import org.semanticweb.owlapi.reasoner.*;
22: import org.semanticweb.owlapi.reasoner.impl.OWLClassNode;
23: import org.semanticweb.owlapi.reasoner.impl.OWLDataPropertyNode;
24: import org.semanticweb.owlapi.reasoner.impl.OWLObjectPropertyNode;
25: import org.semanticweb.owlapi.reasoner.structural.StructuralReasonerFactory;
26: import org.semanticweb.owlapi.util.Version;
27:
28: import javax.annotation.Nonnull;
29: import java.util.List;
30: import java.util.Set;
31:
32: import static uk.ac.manchester.cs.owl.owlapi.InternalizedEntities.*;
33:
34: /**
35: * A naive implementation of a no-op reasoner that just returns axioms asserted in the underlying ontology.
36: * <p>
37: * This implementation wraps a {@link org.semanticweb.owlapi.reasoner.structural.StructuralReasoner} and passes {@code
38: * true} for direct whenever the called method allows it. All other calls are just forwarded to the underlying
39: * reasoner.
40: */
41: class NoOpReasoner implements OWLReasoner {
42:
43: private final OWLReasoner wrapped;
44:
45: public NoOpReasoner(OWLOntology rootOntology) {
46: this.wrapped = createReasoner(rootOntology);
47: }
48:
49: private static OWLReasoner createReasoner(OWLOntology rootOntology) {
50: final StructuralReasonerFactory factory = new StructuralReasonerFactory();
51: return factory.createReasoner(rootOntology);
52: }
53:
54: @Nonnull
55: public OWLOntology getRootOntology() {
56: return wrapped.getRootOntology();
57: }
58:
59: @Nonnull
60: public Set<OWLAxiom> getPendingAxiomAdditions() {
61: return wrapped.getPendingAxiomAdditions();
62: }
63:
64: @Nonnull
65: public Set<OWLAxiom> getPendingAxiomRemovals() {
66: return wrapped.getPendingAxiomRemovals();
67: }
68:
69: @Nonnull
70: public List<OWLOntologyChange> getPendingChanges() {
71: return wrapped.getPendingChanges();
72: }
73:
74: @Nonnull
75: public BufferingMode getBufferingMode() {
76: return wrapped.getBufferingMode();
77: }
78:
79: public long getTimeOut() {
80: return wrapped.getTimeOut();
81: }
82:
83: @Nonnull
84: public Set<InferenceType> getPrecomputableInferenceTypes() {
85: return wrapped.getPrecomputableInferenceTypes();
86: }
87:
88: public boolean isPrecomputed(@Nonnull InferenceType inferenceType) {
89: return wrapped.isPrecomputed(inferenceType);
90: }
91:
92: public void precomputeInferences(
93: @Nonnull InferenceType... inferenceTypes) throws ReasonerInterruptedException, TimeOutException, InconsistentOntologyException {
94: wrapped.precomputeInferences(inferenceTypes);
95: }
96:
97: public void interrupt() {
98: wrapped.interrupt();
99: }
100:
101: public void dispose() {
102: wrapped.dispose();
103: }
104:
105: public void flush() {
106: wrapped.flush();
107: }
108:
109: public boolean isConsistent() throws ReasonerInterruptedException, TimeOutException {
110: return wrapped.isConsistent();
111: }
112:
113: @Nonnull
114: public NodeSet<OWLClass> getDataPropertyDomains(@Nonnull OWLDataProperty pe,
115: boolean direct) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
116: return wrapped.getDataPropertyDomains(pe, true);
117: }
118:
119: @Nonnull
120: public Set<OWLLiteral> getDataPropertyValues(@Nonnull OWLNamedIndividual ind,
121: @Nonnull OWLDataProperty pe) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
122: return wrapped.getDataPropertyValues(ind, pe);
123: }
124:
125: @Nonnull
126: public Node<OWLClass> getEquivalentClasses(
127: @Nonnull OWLClassExpression ce) throws InconsistentOntologyException, ClassExpressionNotInProfileException, ReasonerInterruptedException, TimeOutException {
128: return wrapped.getEquivalentClasses(ce);
129: }
130:
131: @Nonnull
132: public Node<OWLDataProperty> getEquivalentDataProperties(
133: @Nonnull OWLDataProperty pe) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
134: return wrapped.getEquivalentDataProperties(pe);
135: }
136:
137: @Nonnull
138: public Node<OWLObjectPropertyExpression> getEquivalentObjectProperties(
139: @Nonnull OWLObjectPropertyExpression pe) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
140: return wrapped.getEquivalentObjectProperties(pe);
141: }
142:
143: @Nonnull
144: public NodeSet<OWLNamedIndividual> getInstances(@Nonnull OWLClassExpression ce,
145: boolean direct) throws InconsistentOntologyException, ClassExpressionNotInProfileException, ReasonerInterruptedException, TimeOutException {
146: return wrapped.getInstances(ce, true);
147: }
148:
149: @Nonnull
150: public Node<OWLObjectPropertyExpression> getInverseObjectProperties(
151: @Nonnull OWLObjectPropertyExpression pe) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
152: return wrapped.getInverseObjectProperties(pe);
153: }
154:
155: @Nonnull
156: public NodeSet<OWLClass> getObjectPropertyDomains(@Nonnull OWLObjectPropertyExpression pe,
157: boolean direct) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
158: return wrapped.getObjectPropertyDomains(pe, true);
159: }
160:
161: @Nonnull
162: public NodeSet<OWLClass> getObjectPropertyRanges(@Nonnull OWLObjectPropertyExpression pe,
163: boolean direct) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
164: return wrapped.getObjectPropertyRanges(pe, true);
165: }
166:
167: @Nonnull
168: public NodeSet<OWLNamedIndividual> getObjectPropertyValues(@Nonnull OWLNamedIndividual ind,
169: @Nonnull OWLObjectPropertyExpression pe) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
170: return wrapped.getObjectPropertyValues(ind, pe);
171: }
172:
173:
174: @Nonnull
175: public Node<OWLNamedIndividual> getSameIndividuals(
176: @Nonnull OWLNamedIndividual ind) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
177: return wrapped.getSameIndividuals(ind);
178: }
179:
180: @Nonnull
181: public NodeSet<OWLClass> getSubClasses(@Nonnull OWLClassExpression ce,
182: boolean direct) throws InconsistentOntologyException, ClassExpressionNotInProfileException, ReasonerInterruptedException, TimeOutException {
183: return wrapped.getSubClasses(ce, true);
184: }
185:
186: @Nonnull
187: public NodeSet<OWLDataProperty> getSubDataProperties(@Nonnull OWLDataProperty pe,
188: boolean direct) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
189: return wrapped.getSubDataProperties(pe, true);
190: }
191:
192: @Nonnull
193: public NodeSet<OWLObjectPropertyExpression> getSubObjectProperties(@Nonnull OWLObjectPropertyExpression pe,
194: boolean direct) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
195: return wrapped.getSubObjectProperties(pe, true);
196: }
197:
198: @Nonnull
199: public NodeSet<OWLClass> getSuperClasses(@Nonnull OWLClassExpression ce,
200: boolean direct) throws InconsistentOntologyException, ClassExpressionNotInProfileException, ReasonerInterruptedException, TimeOutException {
201: return wrapped.getSuperClasses(ce, true);
202: }
203:
204: @Nonnull
205: public NodeSet<OWLDataProperty> getSuperDataProperties(@Nonnull OWLDataProperty pe,
206: boolean direct) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
207: return wrapped.getSuperDataProperties(pe, true);
208: }
209:
210: @Nonnull
211: public NodeSet<OWLObjectPropertyExpression> getSuperObjectProperties(@Nonnull OWLObjectPropertyExpression pe,
212: boolean direct) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
213: return wrapped.getSuperObjectProperties(pe, true);
214: }
215:
216: @Nonnull
217: public NodeSet<OWLClass> getTypes(@Nonnull OWLNamedIndividual ind,
218: boolean direct) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
219: return wrapped.getTypes(ind, true);
220: }
221:
222: @Nonnull
223: public Node<OWLClass> getUnsatisfiableClasses() throws ReasonerInterruptedException, TimeOutException {
224: return wrapped.getUnsatisfiableClasses();
225: }
226:
227: public boolean isEntailed(
228: @Nonnull OWLAxiom axiom) throws ReasonerInterruptedException, UnsupportedEntailmentTypeException, TimeOutException, AxiomNotInProfileException, InconsistentOntologyException {
229: return wrapped.isEntailed(axiom);
230: }
231:
232: public boolean isEntailed(
233: @Nonnull Set<? extends OWLAxiom> axioms) throws ReasonerInterruptedException, UnsupportedEntailmentTypeException, TimeOutException, AxiomNotInProfileException, InconsistentOntologyException {
234: return wrapped.isEntailed(axioms);
235: }
236:
237: public boolean isEntailmentCheckingSupported(@Nonnull AxiomType<?> axiomType) {
238: return wrapped.isEntailmentCheckingSupported(axiomType);
239: }
240:
241: public boolean isSatisfiable(
242: @Nonnull OWLClassExpression ce) throws ReasonerInterruptedException, TimeOutException, ClassExpressionNotInProfileException, InconsistentOntologyException {
243: return wrapped.isSatisfiable(ce);
244: }
245:
246: @Nonnull
247: public Node<OWLClass> getBottomClassNode() {
248: return new OWLClassNode(OWL_NOTHING);
249: }
250:
251: @Nonnull
252: public Node<OWLDataProperty> getBottomDataPropertyNode() {
253: return new OWLDataPropertyNode(OWL_BOTTOM_DATA_PROPERTY);
254: }
255:
256: @Nonnull
257: public Node<OWLObjectPropertyExpression> getBottomObjectPropertyNode() {
258: return new OWLObjectPropertyNode(OWL_BOTTOM_OBJECT_PROPERTY);
259: }
260:
261: @Nonnull
262: public NodeSet<OWLNamedIndividual> getDifferentIndividuals(
263: @Nonnull OWLNamedIndividual ind) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
264: return wrapped.getDifferentIndividuals(ind);
265: }
266:
267: @Nonnull
268: public NodeSet<OWLClass> getDisjointClasses(@Nonnull OWLClassExpression ce) {
269: return wrapped.getDisjointClasses(ce);
270: }
271:
272: @Nonnull
273: public NodeSet<OWLDataProperty> getDisjointDataProperties(
274: @Nonnull OWLDataPropertyExpression pe) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
275: return wrapped.getDisjointDataProperties(pe);
276: }
277:
278: @Nonnull
279: public NodeSet<OWLObjectPropertyExpression> getDisjointObjectProperties(
280: @Nonnull OWLObjectPropertyExpression pe) throws InconsistentOntologyException, ReasonerInterruptedException, TimeOutException {
281: return wrapped.getDisjointObjectProperties(pe);
282: }
283:
284: @Nonnull
285: public IndividualNodeSetPolicy getIndividualNodeSetPolicy() {
286: return wrapped.getIndividualNodeSetPolicy();
287: }
288:
289: @Nonnull
290: public String getReasonerName() {
291: return "Owlapi Driver No-op Reasoner";
292: }
293:
294: @Nonnull
295: public Version getReasonerVersion() {
296: return new Version(1, 0, 0, 0);
297: }
298:
299: @Nonnull
300: public Node<OWLClass> getTopClassNode() {
301: return new OWLClassNode(OWL_THING);
302: }
303:
304: @Nonnull
305: public Node<OWLDataProperty> getTopDataPropertyNode() {
306: return new OWLDataPropertyNode(OWL_TOP_DATA_PROPERTY);
307: }
308:
309: @Nonnull
310: public Node<OWLObjectPropertyExpression> getTopObjectPropertyNode() {
311: return new OWLObjectPropertyNode(OWL_TOP_OBJECT_PROPERTY);
312: }
313:
314: @Nonnull
315: public FreshEntityPolicy getFreshEntityPolicy() {
316: return wrapped.getFreshEntityPolicy();
317: }
318: }