From e8518528a77edf6a28449a57bd96048a6232a5db Mon Sep 17 00:00:00 2001 From: Federico Igne Date: Tue, 4 Aug 2020 11:11:57 +0100 Subject: Adapt LP conversion to RSA check Part of the process involves the search of unsafe roles in the input ontology. This is still to be implemented and for now the set of unsafe roles for the testing example is hardcoded. --- src/main/scala/rsacomb/RSAComb.scala | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/main/scala/rsacomb/RSAComb.scala') diff --git a/src/main/scala/rsacomb/RSAComb.scala b/src/main/scala/rsacomb/RSAComb.scala index a6f237f..62414e9 100644 --- a/src/main/scala/rsacomb/RSAComb.scala +++ b/src/main/scala/rsacomb/RSAComb.scala @@ -10,7 +10,9 @@ import org.semanticweb.owlapi.model.{OWLAxiom, OWLSubClassOfAxiom, OWLEquivalent import org.semanticweb.owlapi.model.OWLClassExpression import org.semanticweb.owlapi.model.OWLOntology import org.semanticweb.owlapi.model.OWLOntologyManager +import org.semanticweb.owlapi.model.IRI import org.semanticweb.owlapi.model.parameters.Imports +import uk.ac.manchester.cs.owl.owlapi.OWLObjectPropertyImpl import tech.oxfordsemantic.jrdfox.Prefixes import tech.oxfordsemantic.jrdfox.client.{ConnectionFactory, ServerConnection, DataStoreConnection} @@ -55,6 +57,11 @@ object RSA { val renderer = new DLSyntaxObjectRenderer() + // Here we need to compute the unsafe roles. This is hardcoded for now. + val unsafe = List( + new OWLObjectPropertyImpl(IRI.create("http://example.com/rsa_example.owl#S")).getInverseProperty() + ) + /* Print TBox axioms */ println("TBox/RBox:") for { @@ -68,12 +75,12 @@ object RSA { println("Logic rules:") for { axiom <- onto.tboxAxioms(Imports.EXCLUDED).collect(Collectors.toList()).asScala - visitor = new RDFoxAxiomConverter(Variable.create("x"), SkolemStrategy.Constant(axiom.toString)) + visitor = new RDFoxAxiomConverter(Variable.create("x"), SkolemStrategy.ConstantRSA(axiom.toString), unsafe) rule <- axiom.accept(visitor) } yield println(rule) for { axiom <- onto.rboxAxioms(Imports.EXCLUDED).collect(Collectors.toList()).asScala - visitor = new RDFoxAxiomConverter(Variable.create("x"), SkolemStrategy.Constant(axiom.toString)) + visitor = new RDFoxAxiomConverter(Variable.create("x"), SkolemStrategy.ConstantRSA(axiom.toString), unsafe) rule <- axiom.accept(visitor) } yield println(rule) -- cgit v1.2.3