diff options
| author | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-10-09 19:15:27 +0200 |
|---|---|---|
| committer | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-10-09 19:15:27 +0200 |
| commit | 733d962f27631cfb41de7b47d1fcec35b439537b (patch) | |
| tree | cc59768eab97e28a19ef1b30ad6d32f3a5266ef7 /src/main/scala/rsacomb/CanonicalModel.scala | |
| parent | 6d88de9bf58ddb499377a39b4d362e755fa379d2 (diff) | |
| download | RSAComb-733d962f27631cfb41de7b47d1fcec35b439537b.tar.gz RSAComb-733d962f27631cfb41de7b47d1fcec35b439537b.zip | |
Simplify ProgramGenerator constructor
If we pass the whole ontology there is no need to also provide the set
of unsafe roles.
Diffstat (limited to 'src/main/scala/rsacomb/CanonicalModel.scala')
| -rw-r--r-- | src/main/scala/rsacomb/CanonicalModel.scala | 25 |
1 files changed, 14 insertions, 11 deletions
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.{ | |||
| 18 | Variable | 18 | Variable |
| 19 | } | 19 | } |
| 20 | import scala.collection.JavaConverters._ | 20 | import scala.collection.JavaConverters._ |
| 21 | import rsacomb.RSA._ | ||
| 21 | 22 | ||
| 22 | object ProgramGenerator { | 23 | object ProgramGenerator { |
| 23 | 24 | ||
| 24 | def apply( | 25 | def apply( |
| 25 | ontology: OWLOntology, | 26 | ontology: OWLOntology, |
| 26 | term: Term, | 27 | term: Term |
| 27 | unsafe: List[OWLObjectPropertyExpression] = List() | ||
| 28 | ): RDFoxAxiomConverter = | 28 | ): RDFoxAxiomConverter = |
| 29 | new ProgramGenerator(ontology, term, unsafe) | 29 | new ProgramGenerator(ontology, term) |
| 30 | 30 | ||
| 31 | def generateRoleRules( | 31 | def generateRoleRules( |
| 32 | roles: Set[OWLObjectProperty] | 32 | roles: Set[OWLObjectProperty] |
| @@ -74,10 +74,13 @@ object ProgramGenerator { | |||
| 74 | 74 | ||
| 75 | class ProgramGenerator( | 75 | class ProgramGenerator( |
| 76 | ontology: OWLOntology, | 76 | ontology: OWLOntology, |
| 77 | term: Term, | 77 | term: Term |
| 78 | unsafe: List[OWLObjectPropertyExpression] | 78 | ) extends RDFoxAxiomConverter( |
| 79 | ) extends RDFoxAxiomConverter(term, unsafe, SkolemStrategy.None, RSASuffix.None) | 79 | term, |
| 80 | with RSAOntology | 80 | ontology.unsafeRoles, |
| 81 | SkolemStrategy.None, | ||
| 82 | RSASuffix.None | ||
| 83 | ) | ||
| 81 | with RSAAxiom { | 84 | with RSAAxiom { |
| 82 | 85 | ||
| 83 | import RDFoxUtil._ | 86 | import RDFoxUtil._ |
| @@ -206,11 +209,11 @@ class ProgramGenerator( | |||
| 206 | // TODO: get role in T5 axiom | 209 | // TODO: get role in T5 axiom |
| 207 | // Assuming one role here | 210 | // Assuming one role here |
| 208 | val role = axiom.objectPropertyExpressionsInSignature(0) | 211 | val role = axiom.objectPropertyExpressionsInSignature(0) |
| 209 | if (unsafe.contains(role)) { | 212 | if (ontology.unsafeRoles.contains(role)) { |
| 210 | val visitor = | 213 | val visitor = |
| 211 | new RDFoxAxiomConverter( | 214 | new RDFoxAxiomConverter( |
| 212 | term, | 215 | term, |
| 213 | unsafe, | 216 | ontology.unsafeRoles, |
| 214 | SkolemStrategy.Standard(axiom.toString), | 217 | SkolemStrategy.Standard(axiom.toString), |
| 215 | RSASuffix.Forward | 218 | RSASuffix.Forward |
| 216 | ) | 219 | ) |
| @@ -229,13 +232,13 @@ class ProgramGenerator( | |||
| 229 | val varY = Variable.create("Y") | 232 | val varY = Variable.create("Y") |
| 230 | val visitorF = new RDFoxAxiomConverter( | 233 | val visitorF = new RDFoxAxiomConverter( |
| 231 | term, | 234 | term, |
| 232 | unsafe, | 235 | ontology.unsafeRoles, |
| 233 | SkolemStrategy.None, | 236 | SkolemStrategy.None, |
| 234 | RSASuffix.Forward | 237 | RSASuffix.Forward |
| 235 | ) | 238 | ) |
| 236 | val visitorB = new RDFoxAxiomConverter( | 239 | val visitorB = new RDFoxAxiomConverter( |
| 237 | term, | 240 | term, |
| 238 | unsafe, | 241 | ontology.unsafeRoles, |
| 239 | SkolemStrategy.None, | 242 | SkolemStrategy.None, |
| 240 | RSASuffix.Backward | 243 | RSASuffix.Backward |
| 241 | ) | 244 | ) |
