From 733d962f27631cfb41de7b47d1fcec35b439537b Mon Sep 17 00:00:00 2001 From: Federico Igne Date: Fri, 9 Oct 2020 19:15:27 +0200 Subject: Simplify ProgramGenerator constructor If we pass the whole ontology there is no need to also provide the set of unsafe roles. --- src/main/scala/rsacomb/CanonicalModel.scala | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'src/main/scala/rsacomb/CanonicalModel.scala') diff --git a/src/main/scala/rsacomb/CanonicalModel.scala b/src/main/scala/rsacomb/CanonicalModel.scala index 95eb556..a248d61 100644 --- a/src/main/scala/rsacomb/CanonicalModel.scala +++ b/src/main/scala/rsacomb/CanonicalModel.scala @@ -18,15 +18,15 @@ import tech.oxfordsemantic.jrdfox.logic.{ Variable } import scala.collection.JavaConverters._ +import rsacomb.RSA._ object ProgramGenerator { def apply( ontology: OWLOntology, - term: Term, - unsafe: List[OWLObjectPropertyExpression] = List() + term: Term ): RDFoxAxiomConverter = - new ProgramGenerator(ontology, term, unsafe) + new ProgramGenerator(ontology, term) def generateRoleRules( roles: Set[OWLObjectProperty] @@ -74,10 +74,13 @@ object ProgramGenerator { class ProgramGenerator( ontology: OWLOntology, - term: Term, - unsafe: List[OWLObjectPropertyExpression] -) extends RDFoxAxiomConverter(term, unsafe, SkolemStrategy.None, RSASuffix.None) - with RSAOntology + term: Term +) extends RDFoxAxiomConverter( + term, + ontology.unsafeRoles, + SkolemStrategy.None, + RSASuffix.None + ) with RSAAxiom { import RDFoxUtil._ @@ -206,11 +209,11 @@ class ProgramGenerator( // TODO: get role in T5 axiom // Assuming one role here val role = axiom.objectPropertyExpressionsInSignature(0) - if (unsafe.contains(role)) { + if (ontology.unsafeRoles.contains(role)) { val visitor = new RDFoxAxiomConverter( term, - unsafe, + ontology.unsafeRoles, SkolemStrategy.Standard(axiom.toString), RSASuffix.Forward ) @@ -229,13 +232,13 @@ class ProgramGenerator( val varY = Variable.create("Y") val visitorF = new RDFoxAxiomConverter( term, - unsafe, + ontology.unsafeRoles, SkolemStrategy.None, RSASuffix.Forward ) val visitorB = new RDFoxAxiomConverter( term, - unsafe, + ontology.unsafeRoles, SkolemStrategy.None, RSASuffix.Backward ) -- cgit v1.2.3