diff options
| author | Federico Igne <federico.igne@cs.ox.ac.uk> | 2021-01-21 11:01:02 +0000 |
|---|---|---|
| committer | Federico Igne <federico.igne@cs.ox.ac.uk> | 2021-01-21 17:03:59 +0000 |
| commit | 5a7c5b14a825d940956040541e127bc62f22fe6f (patch) | |
| tree | b4e0d636d5ee35b49d1f37622215d76459ed0c33 | |
| parent | 35f41c0529f65c4b3ee941e087d497a931d17d9e (diff) | |
| download | RSAComb-5a7c5b14a825d940956040541e127bc62f22fe6f.tar.gz RSAComb-5a7c5b14a825d940956040541e127bc62f22fe6f.zip | |
Fix support for a few axiom types.
Namely:
+ OWLEquivalentClassesAxiom
+ OWLFunctionalObjectPropertyAxiom
+ OWLInverseFunctionalObjectPropertyAxiom
| -rw-r--r-- | src/main/scala/uk/ac/ox/cs/rsacomb/converter/RDFoxConverter.scala | 41 | ||||
| -rw-r--r-- | src/main/scala/uk/ac/ox/cs/rsacomb/implicits/RSAAxiom.scala | 17 |
2 files changed, 22 insertions, 36 deletions
diff --git a/src/main/scala/uk/ac/ox/cs/rsacomb/converter/RDFoxConverter.scala b/src/main/scala/uk/ac/ox/cs/rsacomb/converter/RDFoxConverter.scala index 845ec1f..e3c44c6 100644 --- a/src/main/scala/uk/ac/ox/cs/rsacomb/converter/RDFoxConverter.scala +++ b/src/main/scala/uk/ac/ox/cs/rsacomb/converter/RDFoxConverter.scala | |||
| @@ -1,35 +1,7 @@ | |||
| 1 | package uk.ac.ox.cs.rsacomb.converter | 1 | package uk.ac.ox.cs.rsacomb.converter |
| 2 | 2 | ||
| 3 | import java.util.stream.Collectors | 3 | import java.util.stream.Collectors |
| 4 | import org.semanticweb.owlapi.model.{ | 4 | import org.semanticweb.owlapi.model._ |
| 5 | OWLAnnotationProperty, | ||
| 6 | OWLLogicalAxiom, | ||
| 7 | OWLClass, | ||
| 8 | OWLClassAssertionAxiom, | ||
| 9 | OWLClassExpression, | ||
| 10 | OWLDataProperty, | ||
| 11 | OWLDataPropertyAssertionAxiom, | ||
| 12 | OWLDataPropertyDomainAxiom, | ||
| 13 | OWLDataPropertyExpression, | ||
| 14 | OWLDataSomeValuesFrom, | ||
| 15 | OWLEquivalentClassesAxiom, | ||
| 16 | OWLEquivalentObjectPropertiesAxiom, | ||
| 17 | OWLInverseObjectPropertiesAxiom, | ||
| 18 | OWLNamedIndividual, | ||
| 19 | OWLObjectIntersectionOf, | ||
| 20 | OWLObjectInverseOf, | ||
| 21 | OWLObjectMaxCardinality, | ||
| 22 | OWLObjectOneOf, | ||
| 23 | OWLObjectProperty, | ||
| 24 | OWLObjectPropertyAssertionAxiom, | ||
| 25 | OWLObjectPropertyDomainAxiom, | ||
| 26 | OWLObjectPropertyExpression, | ||
| 27 | OWLObjectPropertyRangeAxiom, | ||
| 28 | OWLObjectSomeValuesFrom, | ||
| 29 | OWLPropertyExpression, | ||
| 30 | OWLSubClassOfAxiom, | ||
| 31 | OWLSubObjectPropertyOfAxiom | ||
| 32 | } | ||
| 33 | import scala.collection.JavaConverters._ | 5 | import scala.collection.JavaConverters._ |
| 34 | import tech.oxfordsemantic.jrdfox.logic.datalog.{ | 6 | import tech.oxfordsemantic.jrdfox.logic.datalog.{ |
| 35 | BindAtom, | 7 | BindAtom, |
| @@ -120,9 +92,7 @@ trait RDFoxConverter { | |||
| 120 | * - [[org.semanticweb.owlapi.model.OWLDisjointUnionAxiom OWLDisjointUnionAxiom]] | 92 | * - [[org.semanticweb.owlapi.model.OWLDisjointUnionAxiom OWLDisjointUnionAxiom]] |
| 121 | * - [[org.semanticweb.owlapi.model.OWLEquivalentDataPropertiesAxiom OWLEquivalentDataPropertiesAxiom]] | 93 | * - [[org.semanticweb.owlapi.model.OWLEquivalentDataPropertiesAxiom OWLEquivalentDataPropertiesAxiom]] |
| 122 | * - [[org.semanticweb.owlapi.model.OWLFunctionalDataPropertyAxiom OWLFunctionalDataPropertyAxiom]] | 94 | * - [[org.semanticweb.owlapi.model.OWLFunctionalDataPropertyAxiom OWLFunctionalDataPropertyAxiom]] |
| 123 | * - [[org.semanticweb.owlapi.model.OWLFunctionalObjectPropertyAxiom OWLFunctionalObjectPropertyAxiom]] | ||
| 124 | * - [[org.semanticweb.owlapi.model.OWLHasKeyAxiom OWLHasKeyAxiom]] | 95 | * - [[org.semanticweb.owlapi.model.OWLHasKeyAxiom OWLHasKeyAxiom]] |
| 125 | * - [[org.semanticweb.owlapi.model.OWLInverseFunctionalObjectPropertyAxiom OWLInverseFunctionalObjectPropertyAxiom]] | ||
| 126 | * - [[org.semanticweb.owlapi.model.OWLIrreflexiveObjectPropertyAxiom OWLIrreflexiveObjectPropertyAxiom]] | 96 | * - [[org.semanticweb.owlapi.model.OWLIrreflexiveObjectPropertyAxiom OWLIrreflexiveObjectPropertyAxiom]] |
| 127 | * - [[org.semanticweb.owlapi.model.OWLNegativeDataPropertyAssertionAxiom OWLNegativeDataPropertyAssertionAxiom]] | 97 | * - [[org.semanticweb.owlapi.model.OWLNegativeDataPropertyAssertionAxiom OWLNegativeDataPropertyAssertionAxiom]] |
| 128 | * - [[org.semanticweb.owlapi.model.OWLNegativeObjectPropertyAssertionAxiom OWLNegativeObjectPropertyAssertionAxiom]] | 98 | * - [[org.semanticweb.owlapi.model.OWLNegativeObjectPropertyAssertionAxiom OWLNegativeObjectPropertyAssertionAxiom]] |
| @@ -190,6 +160,9 @@ trait RDFoxConverter { | |||
| 190 | case a: OWLDataPropertyDomainAxiom => | 160 | case a: OWLDataPropertyDomainAxiom => |
| 191 | convert(a.asOWLSubClassOfAxiom, term, unsafe, skolem, suffix) | 161 | convert(a.asOWLSubClassOfAxiom, term, unsafe, skolem, suffix) |
| 192 | 162 | ||
| 163 | case a: OWLDataPropertyRangeAxiom => | ||
| 164 | Result() // ignored | ||
| 165 | |||
| 193 | case a: OWLInverseObjectPropertiesAxiom => { | 166 | case a: OWLInverseObjectPropertiesAxiom => { |
| 194 | val (atoms, rules) = a.asSubObjectPropertyOfAxioms | 167 | val (atoms, rules) = a.asSubObjectPropertyOfAxioms |
| 195 | .map(a => convert(a, term, unsafe, skolem dup a, suffix)) | 168 | .map(a => convert(a, term, unsafe, skolem dup a, suffix)) |
| @@ -197,6 +170,12 @@ trait RDFoxConverter { | |||
| 197 | (atoms.flatten, rules.flatten) | 170 | (atoms.flatten, rules.flatten) |
| 198 | } | 171 | } |
| 199 | 172 | ||
| 173 | case a: OWLFunctionalObjectPropertyAxiom => | ||
| 174 | convert(a.asOWLSubClassOfAxiom, term, unsafe, skolem, suffix) | ||
| 175 | |||
| 176 | case a: OWLInverseFunctionalObjectPropertyAxiom => | ||
| 177 | convert(a.asOWLSubClassOfAxiom, term, unsafe, skolem, suffix) | ||
| 178 | |||
| 200 | case a: OWLClassAssertionAxiom => { | 179 | case a: OWLClassAssertionAxiom => { |
| 201 | val ind = a.getIndividual | 180 | val ind = a.getIndividual |
| 202 | ind match { | 181 | ind match { |
diff --git a/src/main/scala/uk/ac/ox/cs/rsacomb/implicits/RSAAxiom.scala b/src/main/scala/uk/ac/ox/cs/rsacomb/implicits/RSAAxiom.scala index 39d9d66..36db391 100644 --- a/src/main/scala/uk/ac/ox/cs/rsacomb/implicits/RSAAxiom.scala +++ b/src/main/scala/uk/ac/ox/cs/rsacomb/implicits/RSAAxiom.scala | |||
| @@ -7,12 +7,13 @@ import org.semanticweb.owlapi.model.{ | |||
| 7 | OWLEquivalentClassesAxiom | 7 | OWLEquivalentClassesAxiom |
| 8 | } | 8 | } |
| 9 | import org.semanticweb.owlapi.model.{ | 9 | import org.semanticweb.owlapi.model.{ |
| 10 | OWLObjectPropertyExpression, | ||
| 11 | OWLSubObjectPropertyOfAxiom, | ||
| 12 | OWLClass, | 10 | OWLClass, |
| 13 | OWLClassExpression, | 11 | OWLClassExpression, |
| 12 | OWLFunctionalObjectPropertyAxiom, | ||
| 13 | OWLObjectMaxCardinality, | ||
| 14 | OWLObjectPropertyExpression, | ||
| 14 | OWLObjectSomeValuesFrom, | 15 | OWLObjectSomeValuesFrom, |
| 15 | OWLObjectMaxCardinality | 16 | OWLSubObjectPropertyOfAxiom |
| 16 | } | 17 | } |
| 17 | import org.semanticweb.owlapi.model.ClassExpressionType | 18 | import org.semanticweb.owlapi.model.ClassExpressionType |
| 18 | import org.semanticweb.owlapi.model.{ | 19 | import org.semanticweb.owlapi.model.{ |
| @@ -85,10 +86,16 @@ object RSAAxiom { | |||
| 85 | } | 86 | } |
| 86 | 87 | ||
| 87 | override def visit(axiom: OWLEquivalentClassesAxiom): Boolean = { | 88 | override def visit(axiom: OWLEquivalentClassesAxiom): Boolean = { |
| 88 | // TODO | 89 | axiom |
| 89 | false | 90 | .asOWLSubClassOfAxioms() |
| 91 | .asScala | ||
| 92 | .map(_.accept(this)) | ||
| 93 | .exists(identity) | ||
| 90 | } | 94 | } |
| 91 | 95 | ||
| 96 | override def visit(axiom: OWLFunctionalObjectPropertyAxiom): Boolean = | ||
| 97 | t == RSAAxiomType.T4 | ||
| 98 | |||
| 92 | def doDefault(axiom: OWLAxiom): Boolean = false | 99 | def doDefault(axiom: OWLAxiom): Boolean = false |
| 93 | } | 100 | } |
| 94 | 101 | ||
