aboutsummaryrefslogtreecommitdiff
path: root/src/uk/ac/ox/cs/pagoda/reasoner/ConsistencyManager2.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/uk/ac/ox/cs/pagoda/reasoner/ConsistencyManager2.java')
-rw-r--r--src/uk/ac/ox/cs/pagoda/reasoner/ConsistencyManager2.java78
1 files changed, 0 insertions, 78 deletions
diff --git a/src/uk/ac/ox/cs/pagoda/reasoner/ConsistencyManager2.java b/src/uk/ac/ox/cs/pagoda/reasoner/ConsistencyManager2.java
deleted file mode 100644
index 9191067..0000000
--- a/src/uk/ac/ox/cs/pagoda/reasoner/ConsistencyManager2.java
+++ /dev/null
@@ -1,78 +0,0 @@
1package uk.ac.ox.cs.pagoda.reasoner;
2
3import org.semanticweb.owlapi.model.OWLOntologyCreationException;
4import org.semanticweb.owlapi.model.OWLOntologyManager;
5import uk.ac.ox.cs.pagoda.query.AnswerTuples;
6import uk.ac.ox.cs.pagoda.query.QueryRecord;
7import uk.ac.ox.cs.pagoda.reasoner.full.Checker;
8import uk.ac.ox.cs.pagoda.summary.HermitSummaryFilter;
9import uk.ac.ox.cs.pagoda.tracking.QueryTracker;
10import uk.ac.ox.cs.pagoda.util.Utility;
11
12@Deprecated
13public class ConsistencyManager2 extends ConsistencyManager {
14
15 public ConsistencyManager2(MyQueryReasoner reasoner) {
16 super(reasoner);
17 fragmentExtracted = true;
18 }
19
20 protected boolean unsatisfiability(double duration) {
21 Utility.logDebug("The ontology and dataset is unsatisfiable.");
22 return false;
23 }
24
25 protected boolean satisfiability(double duration) {
26 Utility.logDebug("The ontology and dataset is satisfiable.");
27 return true;
28 }
29
30 @Override
31 boolean check() {
32// if (!checkRLLowerBound()) return false;
33// if (!checkELLowerBound()) return false;
34 // TODO test
35 if (checkUpper(m_reasoner.lazyUpperStore) && checkUpper(m_reasoner.limitedSkolemUpperStore)) return true;
36 AnswerTuples iter = null;
37
38 try {
39 iter = m_reasoner.trackingStore.evaluate(fullQueryRecord.getQueryText(), fullQueryRecord.getAnswerVariables());
40 fullQueryRecord.updateUpperBoundAnswers(iter);
41 } finally {
42 if (iter != null) iter.dispose();
43 }
44
45 if (fullQueryRecord.getNoOfCompleteAnswers() == 0)
46 return satisfiability(t.duration());
47
48 try {
49 extractAxioms();
50 } catch (OWLOntologyCreationException e) {
51 e.printStackTrace();
52 }
53
54 Checker checker = new HermitSummaryFilter(fullQueryRecord, true); // m_reasoner.factory.getSummarisedReasoner(fullQueryRecord);
55// fullQueryRecord.saveRelevantOntology("fragment_bottom.owl");
56 boolean satisfiable = checker.isConsistent();
57 checker.dispose();
58 if (!satisfiable) return unsatisfiability(t.duration());
59
60 return satisfiability(t.duration());
61 }
62
63 private void extractAxioms() throws OWLOntologyCreationException {
64 OWLOntologyManager manager = m_reasoner.encoder.getProgram().getOntology().getOWLOntologyManager();
65 fullQueryRecord.setRelevantOntology(manager.createOntology());
66 QueryTracker tracker = new QueryTracker(m_reasoner.encoder, m_reasoner.rlLowerStore, fullQueryRecord);
67 m_reasoner.encoder.setCurrentQuery(fullQueryRecord);
68 tracker.extract(m_reasoner.trackingStore, null, true);
69 }
70
71 @Override
72 public QueryRecord[] getQueryRecords() {
73 if (botQueryRecords == null)
74 botQueryRecords = new QueryRecord[] {fullQueryRecord};
75 return botQueryRecords;
76 }
77
78}