diff options
| author | Federico Igne <federico.igne@cs.ox.ac.uk> | 2021-01-23 12:43:06 +0000 |
|---|---|---|
| committer | Federico Igne <federico.igne@cs.ox.ac.uk> | 2021-01-23 12:43:06 +0000 |
| commit | 84a5f8405afd4c471c96e64ee991d2b920fd04e7 (patch) | |
| tree | 700c19e9594d27b69c9d38fb8ff1170e2b8489b7 /src/main/scala | |
| parent | 58435546aec92af87bf37255b0646c66a1218df6 (diff) | |
| download | RSAComb-84a5f8405afd4c471c96e64ee991d2b920fd04e7.tar.gz RSAComb-84a5f8405afd4c471c96e64ee991d2b920fd04e7.zip | |
Add OWLSymmetricObjectPropertyAxiom and OWLSubDataPropertyOfAxiom support
Diffstat (limited to 'src/main/scala')
| -rw-r--r-- | src/main/scala/uk/ac/ox/cs/rsacomb/converter/RDFoxConverter.scala | 22 |
1 files changed, 17 insertions, 5 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 761cc83..a65fdae 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 | |||
| @@ -107,9 +107,7 @@ trait RDFoxConverter { | |||
| 107 | * - [[org.semanticweb.owlapi.model.OWLNegativeObjectPropertyAssertionAxiom OWLNegativeObjectPropertyAssertionAxiom]] | 107 | * - [[org.semanticweb.owlapi.model.OWLNegativeObjectPropertyAssertionAxiom OWLNegativeObjectPropertyAssertionAxiom]] |
| 108 | * - [[org.semanticweb.owlapi.model.OWLReflexiveObjectPropertyAxiom OWLReflexiveObjectPropertyAxiom]] | 108 | * - [[org.semanticweb.owlapi.model.OWLReflexiveObjectPropertyAxiom OWLReflexiveObjectPropertyAxiom]] |
| 109 | * - [[org.semanticweb.owlapi.model.OWLSameIndividualAxiom OWLSameIndividualAxiom]] | 109 | * - [[org.semanticweb.owlapi.model.OWLSameIndividualAxiom OWLSameIndividualAxiom]] |
| 110 | * - [[org.semanticweb.owlapi.model.OWLSubDataPropertyOfAxiom OWLSubDataPropertyOfAxiom]] | ||
| 111 | * - [[org.semanticweb.owlapi.model.OWLSubPropertyChainOfAxiom OWLSubPropertyChainOfAxiom]] | 110 | * - [[org.semanticweb.owlapi.model.OWLSubPropertyChainOfAxiom OWLSubPropertyChainOfAxiom]] |
| 112 | * - [[org.semanticweb.owlapi.model.OWLSymmetricObjectPropertyAxiom OWLSymmetricObjectPropertyAxiom]] | ||
| 113 | * - [[org.semanticweb.owlapi.model.OWLTransitiveObjectPropertyAxiom OWLTransitiveObjectPropertyAxiom]] | 111 | * - [[org.semanticweb.owlapi.model.OWLTransitiveObjectPropertyAxiom OWLTransitiveObjectPropertyAxiom]] |
| 114 | * - [[org.semanticweb.owlapi.model.SWRLRule SWRLRule]] | 112 | * - [[org.semanticweb.owlapi.model.SWRLRule SWRLRule]] |
| 115 | */ | 113 | */ |
| @@ -156,6 +154,13 @@ trait RDFoxConverter { | |||
| 156 | ResultR(List(Rule.create(head, body))) | 154 | ResultR(List(Rule.create(head, body))) |
| 157 | } | 155 | } |
| 158 | 156 | ||
| 157 | case a: OWLSubDataPropertyOfAxiom => { | ||
| 158 | val term1 = RSAOntology.genFreshVariable() | ||
| 159 | val body = convert(a.getSubProperty, term, term1, suffix) | ||
| 160 | val head = convert(a.getSuperProperty, term, term1, suffix) | ||
| 161 | ResultR(List(Rule.create(head, body))) | ||
| 162 | } | ||
| 163 | |||
| 159 | case a: OWLObjectPropertyDomainAxiom => | 164 | case a: OWLObjectPropertyDomainAxiom => |
| 160 | convert(a.asOWLSubClassOfAxiom, term, unsafe, skolem, suffix) | 165 | convert(a.asOWLSubClassOfAxiom, term, unsafe, skolem, suffix) |
| 161 | 166 | ||
| @@ -169,9 +174,6 @@ trait RDFoxConverter { | |||
| 169 | case a: OWLDataPropertyDomainAxiom => | 174 | case a: OWLDataPropertyDomainAxiom => |
| 170 | convert(a.asOWLSubClassOfAxiom, term, unsafe, skolem, suffix) | 175 | convert(a.asOWLSubClassOfAxiom, term, unsafe, skolem, suffix) |
| 171 | 176 | ||
| 172 | case a: OWLDataPropertyRangeAxiom => | ||
| 173 | Result() // ignored | ||
| 174 | |||
| 175 | case a: OWLDisjointClassesAxiom => { | 177 | case a: OWLDisjointClassesAxiom => { |
| 176 | val body = a.getOperandsAsList.asScala.toSeq | 178 | val body = a.getOperandsAsList.asScala.toSeq |
| 177 | .flatMap((cls) => convert(cls, term, unsafe, NoSkolem, suffix)._1) | 179 | .flatMap((cls) => convert(cls, term, unsafe, NoSkolem, suffix)._1) |
| @@ -192,6 +194,13 @@ trait RDFoxConverter { | |||
| 192 | case a: OWLInverseFunctionalObjectPropertyAxiom => | 194 | case a: OWLInverseFunctionalObjectPropertyAxiom => |
| 193 | convert(a.asOWLSubClassOfAxiom, term, unsafe, skolem, suffix) | 195 | convert(a.asOWLSubClassOfAxiom, term, unsafe, skolem, suffix) |
| 194 | 196 | ||
| 197 | case a: OWLSymmetricObjectPropertyAxiom => { | ||
| 198 | val (atoms, rules) = a.asSubPropertyAxioms | ||
| 199 | .map(a => convert(a, term, unsafe, skolem dup a, suffix)) | ||
| 200 | .unzip | ||
| 201 | (atoms.flatten, rules.flatten) | ||
| 202 | } | ||
| 203 | |||
| 195 | case a: OWLClassAssertionAxiom => { | 204 | case a: OWLClassAssertionAxiom => { |
| 196 | val ind = a.getIndividual | 205 | val ind = a.getIndividual |
| 197 | ind match { | 206 | ind match { |
| @@ -229,6 +238,9 @@ trait RDFoxConverter { | |||
| 229 | ResultF(List(prop)) | 238 | ResultF(List(prop)) |
| 230 | } | 239 | } |
| 231 | 240 | ||
| 241 | case a: OWLDataPropertyRangeAxiom => | ||
| 242 | Result() // ignored | ||
| 243 | |||
| 232 | /** Catch-all case for all unhandled axiom types. */ | 244 | /** Catch-all case for all unhandled axiom types. */ |
| 233 | case a => | 245 | case a => |
| 234 | throw new RuntimeException( | 246 | throw new RuntimeException( |
