aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Igne <federico.igne@cs.ox.ac.uk>2021-11-29 15:02:15 +0000
committerFederico Igne <federico.igne@cs.ox.ac.uk>2021-11-29 15:02:15 +0000
commit155f04db8138d62b3abc2eb777b8453560bbb594 (patch)
treed60d06821a882cb173fe4faa195398267ddb462a
parent9fc4643c2f7e0686364020e0d6f38b55c3cd3222 (diff)
downloadRSAComb-155f04db8138d62b3abc2eb777b8453560bbb594.tar.gz
RSAComb-155f04db8138d62b3abc2eb777b8453560bbb594.zip
Fix bug in normalisation
This would not produce a completely normalised ontology.
-rw-r--r--src/main/scala/uk/ac/ox/cs/rsacomb/approximation/Lowerbound.scala12
-rw-r--r--src/main/scala/uk/ac/ox/cs/rsacomb/converter/Normalizer.scala5
2 files changed, 6 insertions, 11 deletions
diff --git a/src/main/scala/uk/ac/ox/cs/rsacomb/approximation/Lowerbound.scala b/src/main/scala/uk/ac/ox/cs/rsacomb/approximation/Lowerbound.scala
index e261bce..3cc8fc3 100644
--- a/src/main/scala/uk/ac/ox/cs/rsacomb/approximation/Lowerbound.scala
+++ b/src/main/scala/uk/ac/ox/cs/rsacomb/approximation/Lowerbound.scala
@@ -48,14 +48,10 @@ class Lowerbound(implicit fresh: DataFactory)
48 import uk.ac.ox.cs.rsacomb.implicits.RDFox._ 48 import uk.ac.ox.cs.rsacomb.implicits.RDFox._
49 49
50 /** Main entry point for the approximation algorithm */ 50 /** Main entry point for the approximation algorithm */
51 def approximate(ontology: Ontology): RSAOntology = 51 def approximate(ontology: Ontology): RSAOntology = {
52 toRSA( 52 val axioms = ontology.axioms filter inALCHOIQ flatMap shift
53 new Ontology( 53 toRSA(new Ontology(ontology.origin, axioms, ontology.datafiles))
54 ontology.origin, 54 }
55 ontology.axioms filter inALCHOIQ flatMap shift,
56 ontology.datafiles
57 )
58 )
59 55
60 /** Discards all axioms outside ALCHOIQ */ 56 /** Discards all axioms outside ALCHOIQ */
61 private def inALCHOIQ(axiom: OWLLogicalAxiom): Boolean = 57 private def inALCHOIQ(axiom: OWLLogicalAxiom): Boolean =
diff --git a/src/main/scala/uk/ac/ox/cs/rsacomb/converter/Normalizer.scala b/src/main/scala/uk/ac/ox/cs/rsacomb/converter/Normalizer.scala
index 33cb715..98e4dd0 100644
--- a/src/main/scala/uk/ac/ox/cs/rsacomb/converter/Normalizer.scala
+++ b/src/main/scala/uk/ac/ox/cs/rsacomb/converter/Normalizer.scala
@@ -198,7 +198,7 @@ class Normalizer() {
198 * forall R . B c A 198 * forall R . B c A
199 * ¬ A c ¬∀forall R . B 199 * ¬ A c ¬∀forall R . B
200 * ¬ A c exists R . ¬ B 200 * ¬ A c exists R . ¬ B
201 * ¬ A c C, C c R . ¬ B 201 * ¬ A c C, C c exists R . ¬ B
202 * top c A u C, D c ¬ B, C c exists R . D 202 * top c A u C, D c ¬ B, C c exists R . D
203 * top c A u C, D n B c bot, C c exists R . D 203 * top c A u C, D n B c bot, C c exists R . D
204 */ 204 */
@@ -219,7 +219,7 @@ class Normalizer() {
219 c, 219 c,
220 factory.getOWLObjectSomeValuesFrom(role, d) 220 factory.getOWLObjectSomeValuesFrom(role, d)
221 ) 221 )
222 ) 222 ).flatMap(normalize(_)(fresh))
223 } 223 }
224 /** Object/Data universal quantification on the lhs */ 224 /** Object/Data universal quantification on the lhs */
225 case (sub: OWLDataAllValuesFrom, _) => notSupported(a) 225 case (sub: OWLDataAllValuesFrom, _) => notSupported(a)
@@ -468,7 +468,6 @@ class Normalizer() {
468 /** Self-restriction over an object property */ 468 /** Self-restriction over an object property */
469 case (sub: OWLObjectHasSelf, _) => notSupported(a) 469 case (sub: OWLObjectHasSelf, _) => notSupported(a)
470 case (_, sup: OWLObjectHasSelf) => notSupported(a) 470 case (_, sup: OWLObjectHasSelf) => notSupported(a)
471
472 /** Axiom is already normalized */ 471 /** Axiom is already normalized */
473 case _ => Seq(a) 472 case _ => Seq(a)
474 } 473 }