diff options
author | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-10-10 12:59:32 +0200 |
---|---|---|
committer | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-10-10 12:59:32 +0200 |
commit | dbc4499bbf1ee21441158f4028fba330f18e0b3d (patch) | |
tree | 6095326adbb695448244ae8c50ac3f0b8b1d756b /src/main/scala | |
parent | 34d18836c5a59c73a672328e65c842fc75ddb5e1 (diff) | |
download | RSAComb-dbc4499bbf1ee21441158f4028fba330f18e0b3d.tar.gz RSAComb-dbc4499bbf1ee21441158f4028fba330f18e0b3d.zip |
Fix bug with conflict set computation
Conflicting roles w.r.t. to an input role where initially searched among
the roles named in the ontology. This excludes all those roles that are
only implicitly part of an ontology (e.g., inverse of named roles).
Diffstat (limited to 'src/main/scala')
-rw-r--r-- | src/main/scala/rsacomb/RSAOntology.scala | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/main/scala/rsacomb/RSAOntology.scala b/src/main/scala/rsacomb/RSAOntology.scala index 05b6218..aa84308 100644 --- a/src/main/scala/rsacomb/RSAOntology.scala +++ b/src/main/scala/rsacomb/RSAOntology.scala | |||
@@ -12,6 +12,8 @@ import org.semanticweb.owlapi.model.{ | |||
12 | } | 12 | } |
13 | import org.semanticweb.owlapi.model.parameters.Imports | 13 | import org.semanticweb.owlapi.model.parameters.Imports |
14 | import org.semanticweb.owlapi.reasoner.structural.StructuralReasonerFactory | 14 | import org.semanticweb.owlapi.reasoner.structural.StructuralReasonerFactory |
15 | import org.semanticweb.owlapi.model.{IRI => OWLIRI} | ||
16 | import uk.ac.manchester.cs.owl.owlapi.OWLObjectPropertyImpl | ||
15 | 17 | ||
16 | import tech.oxfordsemantic.jrdfox.client.{UpdateType, DataStoreConnection} | 18 | import tech.oxfordsemantic.jrdfox.client.{UpdateType, DataStoreConnection} |
17 | import tech.oxfordsemantic.jrdfox.logic.{Resource, Rule, Atom, Variable, IRI} | 19 | import tech.oxfordsemantic.jrdfox.logic.{Resource, Rule, Atom, Variable, IRI} |
@@ -261,14 +263,11 @@ trait RSAOntology { | |||
261 | .addOne(role) | 263 | .addOne(role) |
262 | .map(_.getInverseProperty) | 264 | .map(_.getInverseProperty) |
263 | 265 | ||
264 | roles.filter( | 266 | invSuperRoles |
265 | reasoner | 267 | .flatMap( |
266 | .superObjectProperties(_) | 268 | reasoner.subObjectProperties(_).collect(Collectors.toSet()).asScala |
267 | .collect(Collectors.toSet()) | 269 | ) |
268 | .asScala | 270 | .filterNot(_.isOWLBottomObjectProperty()) |
269 | .intersect(invSuperRoles) | ||
270 | .nonEmpty | ||
271 | ) | ||
272 | } | 271 | } |
273 | 272 | ||
274 | private def self(axiom: OWLSubClassOfAxiom): Set[Term] = { | 273 | private def self(axiom: OWLSubClassOfAxiom): Set[Term] = { |