Skip to content

Commit

Permalink
Fixes #328
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewhorridge committed Feb 17, 2016
1 parent 88157af commit 9405a91
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.semanticweb.owlapi.model.OWLObjectPropertyExpression;
import org.semanticweb.owlapi.reasoner.OWLReasoner;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

Expand Down Expand Up @@ -45,6 +46,9 @@ protected OWLReasoner getReasoner() {
}

public Set<OWLObjectProperty> getUnfilteredChildren(OWLObjectProperty objectProperty) {
if(!getReasoner().isConsistent()) {
return Collections.emptySet();
}
Set<OWLObjectPropertyExpression> subs = getReasoner().getSubObjectProperties(objectProperty, true).getFlattened();
subs.remove(objectProperty);
subs.remove(mngr.getOWLDataFactory().getOWLBottomObjectProperty());
Expand All @@ -59,6 +63,9 @@ public Set<OWLObjectProperty> getUnfilteredChildren(OWLObjectProperty objectProp


public Set<OWLObjectProperty> getParents(OWLObjectProperty objectProperty) {
if(!getReasoner().isConsistent()) {
return Collections.emptySet();
}
Set<OWLObjectPropertyExpression> supers = getReasoner().getSuperObjectProperties(objectProperty, true).getFlattened();
supers.remove(objectProperty);
Set<OWLObjectProperty> parents = new HashSet<>();
Expand All @@ -72,6 +79,9 @@ public Set<OWLObjectProperty> getParents(OWLObjectProperty objectProperty) {


public Set<OWLObjectProperty> getEquivalents(OWLObjectProperty objectProperty) {
if(!getReasoner().isConsistent()) {
return Collections.emptySet();
}
Set<OWLObjectPropertyExpression> equivs = getReasoner().getEquivalentObjectProperties(objectProperty).getEntities();
equivs.remove(objectProperty);
Set<OWLObjectProperty> ret = new HashSet<>();
Expand Down

0 comments on commit 9405a91

Please sign in to comment.