From 84a5f8405afd4c471c96e64ee991d2b920fd04e7 Mon Sep 17 00:00:00 2001 From: Federico Igne Date: Sat, 23 Jan 2021 12:43:06 +0000 Subject: Add OWLSymmetricObjectPropertyAxiom and OWLSubDataPropertyOfAxiom support --- .../ox/cs/rsacomb/converter/RDFoxConverter.scala | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'src/main/scala') 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 { * - [[org.semanticweb.owlapi.model.OWLNegativeObjectPropertyAssertionAxiom OWLNegativeObjectPropertyAssertionAxiom]] * - [[org.semanticweb.owlapi.model.OWLReflexiveObjectPropertyAxiom OWLReflexiveObjectPropertyAxiom]] * - [[org.semanticweb.owlapi.model.OWLSameIndividualAxiom OWLSameIndividualAxiom]] - * - [[org.semanticweb.owlapi.model.OWLSubDataPropertyOfAxiom OWLSubDataPropertyOfAxiom]] * - [[org.semanticweb.owlapi.model.OWLSubPropertyChainOfAxiom OWLSubPropertyChainOfAxiom]] - * - [[org.semanticweb.owlapi.model.OWLSymmetricObjectPropertyAxiom OWLSymmetricObjectPropertyAxiom]] * - [[org.semanticweb.owlapi.model.OWLTransitiveObjectPropertyAxiom OWLTransitiveObjectPropertyAxiom]] * - [[org.semanticweb.owlapi.model.SWRLRule SWRLRule]] */ @@ -156,6 +154,13 @@ trait RDFoxConverter { ResultR(List(Rule.create(head, body))) } + case a: OWLSubDataPropertyOfAxiom => { + val term1 = RSAOntology.genFreshVariable() + val body = convert(a.getSubProperty, term, term1, suffix) + val head = convert(a.getSuperProperty, term, term1, suffix) + ResultR(List(Rule.create(head, body))) + } + case a: OWLObjectPropertyDomainAxiom => convert(a.asOWLSubClassOfAxiom, term, unsafe, skolem, suffix) @@ -169,9 +174,6 @@ trait RDFoxConverter { case a: OWLDataPropertyDomainAxiom => convert(a.asOWLSubClassOfAxiom, term, unsafe, skolem, suffix) - case a: OWLDataPropertyRangeAxiom => - Result() // ignored - case a: OWLDisjointClassesAxiom => { val body = a.getOperandsAsList.asScala.toSeq .flatMap((cls) => convert(cls, term, unsafe, NoSkolem, suffix)._1) @@ -192,6 +194,13 @@ trait RDFoxConverter { case a: OWLInverseFunctionalObjectPropertyAxiom => convert(a.asOWLSubClassOfAxiom, term, unsafe, skolem, suffix) + case a: OWLSymmetricObjectPropertyAxiom => { + val (atoms, rules) = a.asSubPropertyAxioms + .map(a => convert(a, term, unsafe, skolem dup a, suffix)) + .unzip + (atoms.flatten, rules.flatten) + } + case a: OWLClassAssertionAxiom => { val ind = a.getIndividual ind match { @@ -229,6 +238,9 @@ trait RDFoxConverter { ResultF(List(prop)) } + case a: OWLDataPropertyRangeAxiom => + Result() // ignored + /** Catch-all case for all unhandled axiom types. */ case a => throw new RuntimeException( -- cgit v1.2.3