From 8241a535a55508b6c504f4f0b426612fe95d15a5 Mon Sep 17 00:00:00 2001 From: RncLsn Date: Wed, 8 Jul 2015 18:53:00 +0100 Subject: Internalisation: added condition for existential variables (classes HermitChecker and QueryGraph). Answer dependencies: found bug, trying to solve; excluding dependency analysis solve the problem. --- .../ox/cs/pagoda/reasoner/full/HermitChecker.java | 30 ++++++++++++---------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'src/uk/ac/ox/cs/pagoda/reasoner') 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 9574845..0362fc2 100644 --- a/src/uk/ac/ox/cs/pagoda/reasoner/full/HermitChecker.java +++ b/src/uk/ac/ox/cs/pagoda/reasoner/full/HermitChecker.java @@ -106,19 +106,23 @@ public class HermitChecker extends Checker { Map sub = answerTuple.getAssignment(answerVariable[1]); Set toCheckAxioms = qGraph.getAssertions(sub); -// // TODO complete -// Set toCheckExistentialAxioms = qGraph.getExistentialAxioms(sub); -// -// // TODO possibly inefficient -// for(OWLAxiom subclassAxiom : toCheckExistentialAxioms) { -// Utility.logInfo("Checking consistency of ontology union " + subclassAxiom); -// ontology.getOWLOntologyManager().addAxiom(ontology, subclassAxiom); -// if(hermit.isConsistent()) { -// Utility.logDebug("@TIME to check one tuple: " + t.duration()); -// return false; -// } -// ontology.getOWLOntologyManager().removeAxiom(ontology, subclassAxiom); -// } + // TODO complete + Set toCheckExistentialAxioms = qGraph.getExistentialAxioms(sub); + + // TODO possibly inefficient + for(OWLAxiom subclassAxiom : toCheckExistentialAxioms) { + Utility.logDebug("Checking consistency of ontology union " + subclassAxiom); + ontology.getOWLOntologyManager().addAxiom(ontology, subclassAxiom); + hermit.flush(); + if(hermit.isConsistent()) { + ontology.getOWLOntologyManager().removeAxiom(ontology, subclassAxiom); + hermit.flush(); + Utility.logDebug("@TIME to check one tuple: " + t.duration()); + return false; + } + ontology.getOWLOntologyManager().removeAxiom(ontology, subclassAxiom); + hermit.flush(); + } // for (OWLAxiom axiom: toCheckAxioms) System.out.println(axiom.toString()); -- cgit v1.2.3