aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/uk/ac/ox/cs/rsacomb/OWLAxiomSpec.scala
diff options
context:
space:
mode:
authorFederico Igne <federico.igne@cs.ox.ac.uk>2020-12-04 14:00:21 +0000
committerFederico Igne <federico.igne@cs.ox.ac.uk>2020-12-04 16:51:38 +0000
commitec76d6cfbf5410fc90060667612461c1e8f3c111 (patch)
tree6d3268ba7116c2aad3c7238500e87bb990d31a27 /src/test/scala/uk/ac/ox/cs/rsacomb/OWLAxiomSpec.scala
parentd7fa665c289923c362c17ce16cda03588911a817 (diff)
downloadRSAComb-ec76d6cfbf5410fc90060667612461c1e8f3c111.tar.gz
RSAComb-ec76d6cfbf5410fc90060667612461c1e8f3c111.zip
Rework skolemization strategies
In particular `ConstantRSA` has been removed, since it was *not* a skolemization strategy. The case for extra atoms generation previously handled by `ConstantRSA` is not dealt with inside the RSA check.
Diffstat (limited to 'src/test/scala/uk/ac/ox/cs/rsacomb/OWLAxiomSpec.scala')
-rw-r--r--src/test/scala/uk/ac/ox/cs/rsacomb/OWLAxiomSpec.scala30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/test/scala/uk/ac/ox/cs/rsacomb/OWLAxiomSpec.scala b/src/test/scala/uk/ac/ox/cs/rsacomb/OWLAxiomSpec.scala
index 8aee03d..d39dec7 100644
--- a/src/test/scala/uk/ac/ox/cs/rsacomb/OWLAxiomSpec.scala
+++ b/src/test/scala/uk/ac/ox/cs/rsacomb/OWLAxiomSpec.scala
@@ -36,7 +36,13 @@ import tech.oxfordsemantic.jrdfox.logic.expression.{
36import org.semanticweb.owlapi.model.{IRI => OWLIRI} 36import org.semanticweb.owlapi.model.{IRI => OWLIRI}
37import tech.oxfordsemantic.jrdfox.logic.expression.{IRI => RDFIRI} 37import tech.oxfordsemantic.jrdfox.logic.expression.{IRI => RDFIRI}
38 38
39import uk.ac.ox.cs.rsacomb.converter.{RDFoxAxiomConverter, SkolemStrategy} 39import uk.ac.ox.cs.rsacomb.converter.{
40 RDFoxAxiomConverter,
41 SkolemStrategy,
42 NoSkolem,
43 Standard,
44 Constant
45}
40import uk.ac.ox.cs.rsacomb.util.RSA 46import uk.ac.ox.cs.rsacomb.util.RSA
41 47
42object OWLAxiomSpec { 48object OWLAxiomSpec {
@@ -172,7 +178,7 @@ object OWLAxiomSpec {
172 def convertAxiom( 178 def convertAxiom(
173 axiom: OWLAxiom, 179 axiom: OWLAxiom,
174 term: Term, 180 term: Term,
175 skolem: SkolemStrategy = SkolemStrategy.None 181 skolem: SkolemStrategy = NoSkolem
176 ): List[Rule] = { 182 ): List[Rule] = {
177 axiom.accept(RDFoxAxiomConverter(term, List())) 183 axiom.accept(RDFoxAxiomConverter(term, List()))
178 } 184 }
@@ -210,13 +216,13 @@ class OWLAxiomSpec extends AnyFlatSpec with Matchers with LoneElement {
210 // OWLSubClassOfAxiom #2 (w/ constant skolemization) 216 // OWLSubClassOfAxiom #2 (w/ constant skolemization)
211 (axiom_OWLSubClassOf2.toString + "\n(w/ constant skolemization)") should 217 (axiom_OWLSubClassOf2.toString + "\n(w/ constant skolemization)") should
212 "be converted into a singleton List[Rule]" in { 218 "be converted into a singleton List[Rule]" in {
213 val skolem = SkolemStrategy.Constant(axiom_OWLSubClassOf2.toString) 219 val skolem = Constant(axiom_OWLSubClassOf2.toString)
214 val result = convertAxiom(axiom_OWLSubClassOf2, term_x, skolem) 220 val result = convertAxiom(axiom_OWLSubClassOf2, term_x, skolem)
215 result.loneElement shouldBe a[Rule] 221 result.loneElement shouldBe a[Rule]
216 } 222 }
217 223
218 it should "contain a single atom (Student[?x]) in the body of the rule" in { 224 it should "contain a single atom (Student[?x]) in the body of the rule" in {
219 val skolem = SkolemStrategy.Constant(axiom_OWLSubClassOf2.toString) 225 val skolem = Constant(axiom_OWLSubClassOf2.toString)
220 val result = convertAxiom(axiom_OWLSubClassOf2, term_x, skolem) 226 val result = convertAxiom(axiom_OWLSubClassOf2, term_x, skolem)
221 val body = 227 val body =
222 TupleTableAtom.rdf(term_x, RDFIRI.RDF_TYPE, iri_Student.getIRIString) 228 TupleTableAtom.rdf(term_x, RDFIRI.RDF_TYPE, iri_Student.getIRIString)
@@ -237,13 +243,13 @@ class OWLAxiomSpec extends AnyFlatSpec with Matchers with LoneElement {
237 // OWLSubClassOfAxiom #2 (w/ skolemization) 243 // OWLSubClassOfAxiom #2 (w/ skolemization)
238 (axiom_OWLSubClassOf2.toString + "\n(w/ skolemization)") should 244 (axiom_OWLSubClassOf2.toString + "\n(w/ skolemization)") should
239 "be converted into a singleton List[Rule]" in { 245 "be converted into a singleton List[Rule]" in {
240 val skolem = SkolemStrategy.Standard(axiom_OWLSubClassOf2.toString) 246 val skolem = Standard(axiom_OWLSubClassOf2.toString)
241 val result = convertAxiom(axiom_OWLSubClassOf2, term_x, skolem) 247 val result = convertAxiom(axiom_OWLSubClassOf2, term_x, skolem)
242 result.loneElement shouldBe a[Rule] 248 result.loneElement shouldBe a[Rule]
243 } 249 }
244 250
245 it should "contain an atom (Student[?x]) in the body of the rule" in { 251 it should "contain an atom (Student[?x]) in the body of the rule" in {
246 val skolem = SkolemStrategy.Standard(axiom_OWLSubClassOf2.toString) 252 val skolem = Standard(axiom_OWLSubClassOf2.toString)
247 val result = convertAxiom(axiom_OWLSubClassOf2, term_x, skolem) 253 val result = convertAxiom(axiom_OWLSubClassOf2, term_x, skolem)
248 val body = 254 val body =
249 TupleTableAtom.rdf(term_x, RDFIRI.RDF_TYPE, iri_Student) 255 TupleTableAtom.rdf(term_x, RDFIRI.RDF_TYPE, iri_Student)