diff options
| author | Federico Igne <federico.igne@cs.ox.ac.uk> | 2022-05-18 15:09:37 +0100 |
|---|---|---|
| committer | Federico Igne <federico.igne@cs.ox.ac.uk> | 2022-05-18 15:38:25 +0100 |
| commit | 537277d9ce3ba2aff1d66d1b19dbb77e17be0d48 (patch) | |
| tree | d82884a5a72c7a8741084f7f324770d6b2e3489e /src/main/java/uk/ac/ox/cs/pagoda/reasoner | |
| parent | 52bba67e640fb1e30817fd1114a54e1d38ad5a74 (diff) | |
| download | ACQuA-537277d9ce3ba2aff1d66d1b19dbb77e17be0d48.tar.gz ACQuA-537277d9ce3ba2aff1d66d1b19dbb77e17be0d48.zip | |
build(hermit): bump HermiT v1.3.8.1 -> v1.4.5.519
This commit contains a "hacky" fix for KARMA2 to access some (now
private) field in the OWLAxioms class. The code is now using Java
Reflections to turn a private field public and gain access to internal
resources.
Diffstat (limited to 'src/main/java/uk/ac/ox/cs/pagoda/reasoner')
| -rw-r--r-- | src/main/java/uk/ac/ox/cs/pagoda/reasoner/HermiTReasoner.java | 3 | ||||
| -rw-r--r-- | src/main/java/uk/ac/ox/cs/pagoda/reasoner/full/HermitChecker.java | 9 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/uk/ac/ox/cs/pagoda/reasoner/HermiTReasoner.java b/src/main/java/uk/ac/ox/cs/pagoda/reasoner/HermiTReasoner.java index ac62488..ebf1960 100644 --- a/src/main/java/uk/ac/ox/cs/pagoda/reasoner/HermiTReasoner.java +++ b/src/main/java/uk/ac/ox/cs/pagoda/reasoner/HermiTReasoner.java | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | package uk.ac.ox.cs.pagoda.reasoner; | 1 | package uk.ac.ox.cs.pagoda.reasoner; |
| 2 | 2 | ||
| 3 | import org.semanticweb.HermiT.Configuration; | ||
| 3 | import org.semanticweb.HermiT.Reasoner; | 4 | import org.semanticweb.HermiT.Reasoner; |
| 4 | import org.semanticweb.owlapi.model.*; | 5 | import org.semanticweb.owlapi.model.*; |
| 5 | import uk.ac.ox.cs.JRDFox.model.Individual; | 6 | import uk.ac.ox.cs.JRDFox.model.Individual; |
| @@ -63,7 +64,7 @@ class HermiTReasoner extends QueryReasoner { | |||
| 63 | factory = onto.getOWLOntologyManager().getOWLDataFactory(); | 64 | factory = onto.getOWLOntologyManager().getOWLDataFactory(); |
| 64 | roller = new QueryRoller(factory); | 65 | roller = new QueryRoller(factory); |
| 65 | 66 | ||
| 66 | hermit = new Reasoner(onto); | 67 | hermit = new Reasoner(new Configuration(), onto); |
| 67 | return isConsistent(); | 68 | return isConsistent(); |
| 68 | } | 69 | } |
| 69 | 70 | ||
diff --git a/src/main/java/uk/ac/ox/cs/pagoda/reasoner/full/HermitChecker.java b/src/main/java/uk/ac/ox/cs/pagoda/reasoner/full/HermitChecker.java index 3f3c22d..fb7e062 100644 --- a/src/main/java/uk/ac/ox/cs/pagoda/reasoner/full/HermitChecker.java +++ b/src/main/java/uk/ac/ox/cs/pagoda/reasoner/full/HermitChecker.java | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | package uk.ac.ox.cs.pagoda.reasoner.full; | 1 | package uk.ac.ox.cs.pagoda.reasoner.full; |
| 2 | 2 | ||
| 3 | import org.semanticweb.HermiT.Configuration; | ||
| 3 | import org.semanticweb.HermiT.Reasoner; | 4 | import org.semanticweb.HermiT.Reasoner; |
| 4 | import org.semanticweb.HermiT.model.DLClause; | 5 | import org.semanticweb.HermiT.model.DLClause; |
| 5 | import org.semanticweb.HermiT.model.Term; | 6 | import org.semanticweb.HermiT.model.Term; |
| @@ -57,7 +58,7 @@ public class HermitChecker extends Checker { | |||
| 57 | // record = other.record; | 58 | // record = other.record; |
| 58 | } | 59 | } |
| 59 | 60 | ||
| 60 | hermit = new Reasoner(ontology); | 61 | hermit = new Reasoner(new Configuration(), ontology); |
| 61 | } | 62 | } |
| 62 | 63 | ||
| 63 | public HermitChecker(OWLOntology ontology, QueryRecord record, boolean toCheck) { | 64 | public HermitChecker(OWLOntology ontology, QueryRecord record, boolean toCheck) { |
| @@ -174,12 +175,12 @@ public class HermitChecker extends Checker { | |||
| 174 | addTopAndBotTuple(topAxioms, botAxioms); | 175 | addTopAndBotTuple(topAxioms, botAxioms); |
| 175 | manager.addAxioms(ontology, topAxioms); | 176 | manager.addAxioms(ontology, topAxioms); |
| 176 | manager.addAxioms(ontology, botAxioms); | 177 | manager.addAxioms(ontology, botAxioms); |
| 177 | hermit = new Reasoner(ontology); | 178 | hermit = new Reasoner(new Configuration(), ontology); |
| 178 | boolean topValid = true; | 179 | boolean topValid = true; |
| 179 | if(!hermit.isConsistent() || topAnswerTuple != null && (topValid = check(topAnswerTuple))) { | 180 | if(!hermit.isConsistent() || topAnswerTuple != null && (topValid = check(topAnswerTuple))) { |
| 180 | hermit.dispose(); | 181 | hermit.dispose(); |
| 181 | manager.removeAxioms(ontology, topAxioms); | 182 | manager.removeAxioms(ontology, topAxioms); |
| 182 | hermit = new Reasoner(ontology); | 183 | hermit = new Reasoner(new Configuration(), ontology); |
| 183 | } | 184 | } |
| 184 | else { | 185 | else { |
| 185 | if(!topValid) tag = -1; | 186 | if(!topValid) tag = -1; |
| @@ -187,7 +188,7 @@ public class HermitChecker extends Checker { | |||
| 187 | } | 188 | } |
| 188 | } | 189 | } |
| 189 | else | 190 | else |
| 190 | hermit = new Reasoner(ontology); | 191 | hermit = new Reasoner(new Configuration(), ontology); |
| 191 | } | 192 | } |
| 192 | 193 | ||
| 193 | private void addTopAndBotTuple(Set<OWLAxiom> topAxioms, Set<OWLAxiom> botAxioms) { | 194 | private void addTopAndBotTuple(Set<OWLAxiom> topAxioms, Set<OWLAxiom> botAxioms) { |
