diff options
Diffstat (limited to 'src/uk/ac/ox/cs/pagoda/reasoner')
| -rw-r--r-- | src/uk/ac/ox/cs/pagoda/reasoner/MyQueryReasoner.java | 19 | ||||
| -rw-r--r-- | src/uk/ac/ox/cs/pagoda/reasoner/full/HermitChecker.java | 27 |
2 files changed, 25 insertions, 21 deletions
diff --git a/src/uk/ac/ox/cs/pagoda/reasoner/MyQueryReasoner.java b/src/uk/ac/ox/cs/pagoda/reasoner/MyQueryReasoner.java index e5074d5..b419289 100644 --- a/src/uk/ac/ox/cs/pagoda/reasoner/MyQueryReasoner.java +++ b/src/uk/ac/ox/cs/pagoda/reasoner/MyQueryReasoner.java | |||
| @@ -68,9 +68,9 @@ class MyQueryReasoner extends QueryReasoner { | |||
| 68 | 68 | ||
| 69 | ontology = o; | 69 | ontology = o; |
| 70 | program = new DatalogProgram(ontology, properties.getToClassify()); | 70 | program = new DatalogProgram(ontology, properties.getToClassify()); |
| 71 | program.getLower().save(); | 71 | // program.getLower().save(); |
| 72 | program.getUpper().save(); | 72 | // program.getUpper().save(); |
| 73 | program.getGeneral().save(); | 73 | // program.getGeneral().save(); |
| 74 | 74 | ||
| 75 | if(!program.getGeneral().isHorn()) | 75 | if(!program.getGeneral().isHorn()) |
| 76 | lazyUpperStore = new MultiStageQueryEngine("lazy-upper-bound", true); | 76 | lazyUpperStore = new MultiStageQueryEngine("lazy-upper-bound", true); |
| @@ -195,19 +195,24 @@ class MyQueryReasoner extends QueryReasoner { | |||
| 195 | 195 | ||
| 196 | Utility.logInfo("Summarisation..."); | 196 | Utility.logInfo("Summarisation..."); |
| 197 | HermitSummaryFilter summarisedChecker = new HermitSummaryFilter(queryRecord, properties.getToCallHermiT()); | 197 | HermitSummaryFilter summarisedChecker = new HermitSummaryFilter(queryRecord, properties.getToCallHermiT()); |
| 198 | if(summarisedChecker.check(queryRecord.getGapAnswers()) == 0) | 198 | if(summarisedChecker.check(queryRecord.getGapAnswers()) == 0) { |
| 199 | summarisedChecker.dispose(); | ||
| 199 | return; | 200 | return; |
| 201 | } | ||
| 200 | 202 | ||
| 201 | if(properties.getUseSkolemUpperBound() && | 203 | if(properties.getUseSkolemUpperBound() && |
| 202 | querySkolemisedRelevantSubset(relevantOntologySubset, queryRecord)) | 204 | querySkolemisedRelevantSubset(relevantOntologySubset, queryRecord)) { |
| 205 | summarisedChecker.dispose(); | ||
| 203 | return; | 206 | return; |
| 207 | } | ||
| 204 | 208 | ||
| 205 | Utility.logInfo("Full reasoning..."); | 209 | Utility.logInfo("Full reasoning..."); |
| 206 | Timer t = new Timer(); | 210 | Timer t = new Timer(); |
| 207 | summarisedChecker.checkByFullReasoner(queryRecord.getGapAnswers()); | 211 | summarisedChecker.checkByFullReasoner(queryRecord.getGapAnswers()); |
| 208 | Utility.logDebug("Total time for full reasoner: " + t.duration()); | 212 | Utility.logDebug("Total time for full reasoner: " + t.duration()); |
| 209 | 213 | ||
| 210 | queryRecord.markAsProcessed(); | 214 | if(properties.getToCallHermiT()) |
| 215 | queryRecord.markAsProcessed(); | ||
| 211 | summarisedChecker.dispose(); | 216 | summarisedChecker.dispose(); |
| 212 | } | 217 | } |
| 213 | 218 | ||
| @@ -377,7 +382,7 @@ class MyQueryReasoner extends QueryReasoner { | |||
| 377 | relevantStore.importDataFromABoxOf(relevantSubset); | 382 | relevantStore.importDataFromABoxOf(relevantSubset); |
| 378 | String relevantOriginalMarkProgram = OWLHelper.getOriginalMarkProgram(relevantSubset); | 383 | String relevantOriginalMarkProgram = OWLHelper.getOriginalMarkProgram(relevantSubset); |
| 379 | 384 | ||
| 380 | int queryDependentMaxTermDepth = 5; // TODO make it dynamic | 385 | int queryDependentMaxTermDepth = 1; // TODO make it dynamic |
| 381 | relevantStore.materialise("Mark original individuals", relevantOriginalMarkProgram); | 386 | relevantStore.materialise("Mark original individuals", relevantOriginalMarkProgram); |
| 382 | int materialisationTag = relevantStore.materialiseSkolemly(relevantProgram, null, | 387 | int materialisationTag = relevantStore.materialiseSkolemly(relevantProgram, null, |
| 383 | queryDependentMaxTermDepth); | 388 | queryDependentMaxTermDepth); |
diff --git a/src/uk/ac/ox/cs/pagoda/reasoner/full/HermitChecker.java b/src/uk/ac/ox/cs/pagoda/reasoner/full/HermitChecker.java index cfae88b..9574845 100644 --- a/src/uk/ac/ox/cs/pagoda/reasoner/full/HermitChecker.java +++ b/src/uk/ac/ox/cs/pagoda/reasoner/full/HermitChecker.java | |||
| @@ -99,7 +99,6 @@ public class HermitChecker extends Checker { | |||
| 99 | 99 | ||
| 100 | if(!toCheck) return false; | 100 | if(!toCheck) return false; |
| 101 | ++noOfCalls; | 101 | ++noOfCalls; |
| 102 | |||
| 103 | if(tag != 0) return tag == 1; | 102 | if(tag != 0) return tag == 1; |
| 104 | if(hermit == null) initialiseReasoner(); | 103 | if(hermit == null) initialiseReasoner(); |
| 105 | 104 | ||
| @@ -107,19 +106,19 @@ public class HermitChecker extends Checker { | |||
| 107 | Map<Variable, Term> sub = answerTuple.getAssignment(answerVariable[1]); | 106 | Map<Variable, Term> sub = answerTuple.getAssignment(answerVariable[1]); |
| 108 | Set<OWLAxiom> toCheckAxioms = qGraph.getAssertions(sub); | 107 | Set<OWLAxiom> toCheckAxioms = qGraph.getAssertions(sub); |
| 109 | 108 | ||
| 110 | // TODO complete | 109 | // // TODO complete |
| 111 | Set<OWLAxiom> toCheckExistentialAxioms = qGraph.getExistentialAxioms(); | 110 | // Set<OWLAxiom> toCheckExistentialAxioms = qGraph.getExistentialAxioms(sub); |
| 112 | 111 | // | |
| 113 | // TODO possibly inefficient | 112 | // // TODO possibly inefficient |
| 114 | for(OWLAxiom subclassAxiom : toCheckExistentialAxioms) { | 113 | // for(OWLAxiom subclassAxiom : toCheckExistentialAxioms) { |
| 115 | Utility.logDebug("Checking consistency of ontology union " + subclassAxiom); | 114 | // Utility.logInfo("Checking consistency of ontology union " + subclassAxiom); |
| 116 | ontology.getOWLOntologyManager().addAxiom(ontology, subclassAxiom); | 115 | // ontology.getOWLOntologyManager().addAxiom(ontology, subclassAxiom); |
| 117 | if(hermit.isConsistent()) { | 116 | // if(hermit.isConsistent()) { |
| 118 | Utility.logDebug("@TIME to check one tuple: " + t.duration()); | 117 | // Utility.logDebug("@TIME to check one tuple: " + t.duration()); |
| 119 | return false; | 118 | // return false; |
| 120 | } | 119 | // } |
| 121 | ontology.getOWLOntologyManager().removeAxiom(ontology, subclassAxiom); | 120 | // ontology.getOWLOntologyManager().removeAxiom(ontology, subclassAxiom); |
| 122 | } | 121 | // } |
| 123 | 122 | ||
| 124 | 123 | ||
| 125 | // for (OWLAxiom axiom: toCheckAxioms) System.out.println(axiom.toString()); | 124 | // for (OWLAxiom axiom: toCheckAxioms) System.out.println(axiom.toString()); |
