From dbc4499bbf1ee21441158f4028fba330f18e0b3d Mon Sep 17 00:00:00 2001 From: Federico Igne Date: Sat, 10 Oct 2020 12:59:32 +0200 Subject: 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). --- src/main/scala/rsacomb/RSAOntology.scala | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/main/scala/rsacomb') 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.{ } import org.semanticweb.owlapi.model.parameters.Imports import org.semanticweb.owlapi.reasoner.structural.StructuralReasonerFactory +import org.semanticweb.owlapi.model.{IRI => OWLIRI} +import uk.ac.manchester.cs.owl.owlapi.OWLObjectPropertyImpl import tech.oxfordsemantic.jrdfox.client.{UpdateType, DataStoreConnection} import tech.oxfordsemantic.jrdfox.logic.{Resource, Rule, Atom, Variable, IRI} @@ -261,14 +263,11 @@ trait RSAOntology { .addOne(role) .map(_.getInverseProperty) - roles.filter( - reasoner - .superObjectProperties(_) - .collect(Collectors.toSet()) - .asScala - .intersect(invSuperRoles) - .nonEmpty - ) + invSuperRoles + .flatMap( + reasoner.subObjectProperties(_).collect(Collectors.toSet()).asScala + ) + .filterNot(_.isOWLBottomObjectProperty()) } private def self(axiom: OWLSubClassOfAxiom): Set[Term] = { -- cgit v1.2.3