diff options
| author | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-10-23 13:24:52 +0200 |
|---|---|---|
| committer | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-10-23 13:24:52 +0200 |
| commit | 4ac28e74095c473e4ae0a44b0fb8db77a9ef3193 (patch) | |
| tree | 2a2ba6530ce19aa5caf9ab7401f1c86608cdd37b /src | |
| parent | 37e908b71354f76b9108aeb52182bad7f2f704e2 (diff) | |
| download | RSAComb-4ac28e74095c473e4ae0a44b0fb8db77a9ef3193.tar.gz RSAComb-4ac28e74095c473e4ae0a44b0fb8db77a9ef3193.zip | |
Add tests for 'subObjectPropertyOf' axioms
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/scala/rsacomb/CanonicalModelSpec.scala | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/src/test/scala/rsacomb/CanonicalModelSpec.scala b/src/test/scala/rsacomb/CanonicalModelSpec.scala index 783c149..5d633cc 100644 --- a/src/test/scala/rsacomb/CanonicalModelSpec.scala +++ b/src/test/scala/rsacomb/CanonicalModelSpec.scala | |||
| @@ -56,6 +56,21 @@ object Ontology1_CanonicalModelSpec { | |||
| 56 | Seq().asJava | 56 | Seq().asJava |
| 57 | ) | 57 | ) |
| 58 | 58 | ||
| 59 | val AsomeValuesFromSiC = new OWLSubClassOfAxiomImpl( | ||
| 60 | new OWLClassImpl(RSA.base("A")), | ||
| 61 | new OWLObjectSomeValuesFromImpl( | ||
| 62 | roleS_inv, | ||
| 63 | new OWLClassImpl(RSA.base("C")) | ||
| 64 | ), | ||
| 65 | Seq().asJava | ||
| 66 | ) | ||
| 67 | |||
| 68 | val SsubPropertyOfT = new OWLSubObjectPropertyOfAxiomImpl( | ||
| 69 | new OWLObjectPropertyImpl(RSA.base("S")), | ||
| 70 | new OWLObjectPropertyImpl(RSA.base("T")), | ||
| 71 | Seq().asJava | ||
| 72 | ) | ||
| 73 | |||
| 59 | } // object OWLAxiomSpec | 74 | } // object OWLAxiomSpec |
| 60 | 75 | ||
| 61 | class Ontology1_CanonicalModelSpec | 76 | class Ontology1_CanonicalModelSpec |
| @@ -126,14 +141,19 @@ class Ontology1_CanonicalModelSpec | |||
| 126 | ontology.confl(roleS) should contain(roleT_inv) | 141 | ontology.confl(roleS) should contain(roleT_inv) |
| 127 | } | 142 | } |
| 128 | 143 | ||
| 144 | // S⁻ | ||
| 145 | |||
| 129 | renderer.render(roleS_inv) should "be unsafe" in { | 146 | renderer.render(roleS_inv) should "be unsafe" in { |
| 130 | ontology.unsafeRoles should contain(roleS_inv) | 147 | ontology.unsafeRoles should contain(roleS_inv) |
| 131 | } | 148 | } |
| 132 | 149 | ||
| 133 | it should ("contain " + renderer.render( | 150 | renderer.render( |
| 134 | roleR_inv | 151 | AsomeValuesFromSiC |
| 135 | ) + " in its conflict set") in { | 152 | ) should "produce 1 rule" in { |
| 136 | ontology.confl(roleS_inv) should contain(roleR_inv) | 153 | val varX = Variable.create("X") |
| 154 | val visitor = ProgramGenerator(ontology, varX) | ||
| 155 | val rules = AsomeValuesFromSiC.accept(visitor) | ||
| 156 | rules should have length 1 | ||
| 137 | } | 157 | } |
| 138 | 158 | ||
| 139 | renderer.render( | 159 | renderer.render( |
| @@ -162,7 +182,7 @@ class Ontology1_CanonicalModelSpec | |||
| 162 | ontology.cycle(BsomeValuesFromSD).loneElement shouldBe ind | 182 | ontology.cycle(BsomeValuesFromSD).loneElement shouldBe ind |
| 163 | } | 183 | } |
| 164 | 184 | ||
| 165 | it should "produce 5 rules" ignore { | 185 | it should "produce 5 rules" in { |
| 166 | // Rule 1 provides 1 rule (split in 2) + 1 fact | 186 | // Rule 1 provides 1 rule (split in 2) + 1 fact |
| 167 | // Rule 2 provides 0 rules | 187 | // Rule 2 provides 0 rules |
| 168 | // Rule 3 provides 1 rule (split in 2) | 188 | // Rule 3 provides 1 rule (split in 2) |
| @@ -172,4 +192,13 @@ class Ontology1_CanonicalModelSpec | |||
| 172 | rules should have length 5 | 192 | rules should have length 5 |
| 173 | } | 193 | } |
| 174 | 194 | ||
| 195 | renderer.render( | ||
| 196 | SsubPropertyOfT | ||
| 197 | ) should "produce 2 rules" in { | ||
| 198 | val varX = Variable.create("X") | ||
| 199 | val visitor = ProgramGenerator(ontology, varX) | ||
| 200 | val rules = SsubPropertyOfT.accept(visitor) | ||
| 201 | rules should have length 2 | ||
| 202 | } | ||
| 203 | |||
| 175 | } // class OWLAxiomSpec | 204 | } // class OWLAxiomSpec |
