NIHVIVO-3823 SimpleReasoner exception when computing type inferences

This commit is contained in:
stellamit 2012-06-27 14:14:50 +00:00
parent 99815c3cbb
commit 1a92e0e28b

View file

@ -427,9 +427,13 @@ public class SimpleReasoner extends StatementListener {
addInference(stmt,inferenceModel,true); addInference(stmt,inferenceModel,true);
} }
List<OntClass> parents = null; List<OntClass> parents = null;
parents = (cls.listSuperClasses(false)).toList(); try {
parents.addAll((cls.listEquivalentClasses()).toList()); parents = (cls.listSuperClasses(false)).toList();
parents.addAll((cls.listEquivalentClasses()).toList());
} catch (ConversionException ce) {
parents = getParents(cls,tboxModel);
}
Iterator<OntClass> parentIt = parents.iterator(); Iterator<OntClass> parentIt = parents.iterator();
@ -1260,7 +1264,6 @@ public class SimpleReasoner extends StatementListener {
return; return;
} }
protected List<OntClass> getParents(OntClass cls, OntModel tboxModel) { protected List<OntClass> getParents(OntClass cls, OntModel tboxModel) {
List<OntClass> parents = new ArrayList<OntClass>(); List<OntClass> parents = new ArrayList<OntClass>();