Skip to content

Commit

Permalink
Only handle upper OWL classes
Browse files Browse the repository at this point in the history
  • Loading branch information
egonw committed Oct 25, 2020
1 parent 86b4161 commit dbc62d5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/main/java/com/github/enanomapper/Slimmer.java
Original file line number Diff line number Diff line change
Expand Up @@ -466,11 +466,13 @@ private Set<String> allSuperClasses(OWLClass clazz,
Set<String> allSuperClasses = new HashSet<String>();
Stream<OWLClassExpression> superClasses = Searcher.sup(onto.subClassAxiomsForSubClass(clazz));
superClasses.forEach(superClass -> {
OWLClass superOwlClass = superClass.asOWLClass();
String superIri = superOwlClass.getIRI().toString();
allSuperClasses.add(superIri);
// recurse
allSuperClasses.addAll(allSuperClasses(superOwlClass, onto));
if (superClass.isOWLClass()) {
OWLClass superOwlClass = superClass.asOWLClass();
String superIri = superOwlClass.getIRI().toString();
allSuperClasses.add(superIri);
// recurse
allSuperClasses.addAll(allSuperClasses(superOwlClass, onto));
}
});
return allSuperClasses;
}
Expand Down Expand Up @@ -517,4 +519,4 @@ private void addMappings(OWLOntologyManager m, String root) {
}
}

}
}

0 comments on commit dbc62d5

Please sign in to comment.