diff options
| author | yzhou <yujiao.zhou@gmail.com> | 2015-04-21 22:45:35 +0100 |
|---|---|---|
| committer | yzhou <yujiao.zhou@gmail.com> | 2015-04-21 22:45:35 +0100 |
| commit | c0f5bdcdb29608532656c71c219680eccd4aad09 (patch) | |
| tree | 5f599adfe2e3f15a1d2b3f1cb8d0bf9ace59badd /src/uk/ac/ox/cs/pagoda/reasoner/ConsistencyManager.java | |
| parent | c8a9fc67a3f6ed201d7c917e36128268587eabe5 (diff) | |
| download | ACQuA-c0f5bdcdb29608532656c71c219680eccd4aad09.tar.gz ACQuA-c0f5bdcdb29608532656c71c219680eccd4aad09.zip | |
fixed some bugs in windows server
Diffstat (limited to 'src/uk/ac/ox/cs/pagoda/reasoner/ConsistencyManager.java')
| -rw-r--r-- | src/uk/ac/ox/cs/pagoda/reasoner/ConsistencyManager.java | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/src/uk/ac/ox/cs/pagoda/reasoner/ConsistencyManager.java b/src/uk/ac/ox/cs/pagoda/reasoner/ConsistencyManager.java index a222645..7d3e40c 100644 --- a/src/uk/ac/ox/cs/pagoda/reasoner/ConsistencyManager.java +++ b/src/uk/ac/ox/cs/pagoda/reasoner/ConsistencyManager.java | |||
| @@ -43,7 +43,15 @@ public class ConsistencyManager { | |||
| 43 | 43 | ||
| 44 | boolean checkRLLowerBound() { | 44 | boolean checkRLLowerBound() { |
| 45 | fullQueryRecord = m_queryManager.create(QueryRecord.botQueryText, 0); | 45 | fullQueryRecord = m_queryManager.create(QueryRecord.botQueryText, 0); |
| 46 | fullQueryRecord.updateLowerBoundAnswers(m_reasoner.rlLowerStore.evaluate(fullQueryRecord.getQueryText(), fullQueryRecord.getAnswerVariables())); | 46 | AnswerTuples iter = null; |
| 47 | |||
| 48 | try { | ||
| 49 | iter = m_reasoner.rlLowerStore.evaluate(fullQueryRecord.getQueryText(), fullQueryRecord.getAnswerVariables()); | ||
| 50 | fullQueryRecord.updateLowerBoundAnswers(iter); | ||
| 51 | } finally { | ||
| 52 | iter.dispose(); | ||
| 53 | } | ||
| 54 | |||
| 47 | if (fullQueryRecord.getNoOfSoundAnswers() > 0) { | 55 | if (fullQueryRecord.getNoOfSoundAnswers() > 0) { |
| 48 | Utility.logInfo("Answers to bottom in the lower bound: ", fullQueryRecord.outputSoundAnswerTuple()); | 56 | Utility.logInfo("Answers to bottom in the lower bound: ", fullQueryRecord.outputSoundAnswerTuple()); |
| 49 | return unsatisfiability(t.duration()); | 57 | return unsatisfiability(t.duration()); |
| @@ -81,8 +89,15 @@ public class ConsistencyManager { | |||
| 81 | // if (!checkRLLowerBound()) return false; | 89 | // if (!checkRLLowerBound()) return false; |
| 82 | // if (!checkELLowerBound()) return false; | 90 | // if (!checkELLowerBound()) return false; |
| 83 | // if (checkLazyUpper()) return true; | 91 | // if (checkLazyUpper()) return true; |
| 92 | AnswerTuples iter = null; | ||
| 93 | |||
| 94 | try { | ||
| 95 | iter = m_reasoner.trackingStore.evaluate(fullQueryRecord.getQueryText(), fullQueryRecord.getAnswerVariables()); | ||
| 96 | fullQueryRecord.updateUpperBoundAnswers(iter); | ||
| 97 | } finally { | ||
| 98 | if (iter != null) iter.dispose(); | ||
| 99 | } | ||
| 84 | 100 | ||
| 85 | fullQueryRecord.updateUpperBoundAnswers(m_reasoner.trackingStore.evaluate(fullQueryRecord.getQueryText(), fullQueryRecord.getAnswerVariables())); | ||
| 86 | if (fullQueryRecord.getNoOfCompleteAnswers() == 0) | 101 | if (fullQueryRecord.getNoOfCompleteAnswers() == 0) |
| 87 | return satisfiability(t.duration()); | 102 | return satisfiability(t.duration()); |
| 88 | 103 | ||
| @@ -101,7 +116,7 @@ public class ConsistencyManager { | |||
| 101 | for (QueryRecord r: getQueryRecords()) { | 116 | for (QueryRecord r: getQueryRecords()) { |
| 102 | // TODO to be removed ... | 117 | // TODO to be removed ... |
| 103 | // r.saveRelevantOntology("bottom" + r.getQueryID() + ".owl"); | 118 | // r.saveRelevantOntology("bottom" + r.getQueryID() + ".owl"); |
| 104 | checker = new HermitSummaryFilter(r); // m_reasoner.factory.getSummarisedReasoner(r); | 119 | checker = new HermitSummaryFilter(r, true); // m_reasoner.factory.getSummarisedReasoner(r); |
| 105 | satisfiability = checker.isConsistent(); | 120 | satisfiability = checker.isConsistent(); |
| 106 | checker.dispose(); | 121 | checker.dispose(); |
| 107 | if (!satisfiability) return unsatisfiability(t.duration()); | 122 | if (!satisfiability) return unsatisfiability(t.duration()); |
| @@ -143,8 +158,15 @@ public class ConsistencyManager { | |||
| 143 | QueryRecord[] tempQueryRecords = new QueryRecord[number - 1]; | 158 | QueryRecord[] tempQueryRecords = new QueryRecord[number - 1]; |
| 144 | QueryRecord record; | 159 | QueryRecord record; |
| 145 | for (int i = 0; i < number - 1; ++i) { | 160 | for (int i = 0; i < number - 1; ++i) { |
| 146 | tempQueryRecords[i] = record = m_queryManager.create(QueryRecord.botQueryText.replace("Nothing", "Nothing" + (i + 1)), 0, i + 1); | 161 | tempQueryRecords[i] = record = m_queryManager.create(QueryRecord.botQueryText.replace("Nothing", "Nothing" + (i + 1)), 0, i + 1); |
| 147 | record.updateUpperBoundAnswers(m_reasoner.trackingStore.evaluate(record.getQueryText(), record.getAnswerVariables())); | 162 | AnswerTuples iter = null; |
| 163 | try { | ||
| 164 | iter = m_reasoner.trackingStore.evaluate(record.getQueryText(), record.getAnswerVariables()); | ||
| 165 | record.updateUpperBoundAnswers(iter); | ||
| 166 | } finally { | ||
| 167 | if (iter != null) iter.dispose(); | ||
| 168 | iter = null; | ||
| 169 | } | ||
| 148 | } | 170 | } |
| 149 | 171 | ||
| 150 | int bottomNumber = 0; | 172 | int bottomNumber = 0; |
