NIHVIVO-3507 fix to prevent ConversionExceptions when attempting to retrieve equivalent classes for classes not typed as owl:Class

This commit is contained in:
brianjlowe 2011-12-14 19:47:10 +00:00
parent 951dfe9d2c
commit 7e6ea50d63

View file

@ -286,6 +286,14 @@ public class VClassDaoJena extends JenaBaseDao implements VClassDao {
} catch (ProfileException pe) {
// Current language profile does not support equivalent classes.
// We'd prefer to return an empty list instead of throwing an exception
} catch (Exception e) {
// we'll try this again using a different method that
// doesn't try to convert to OntClass
List<Resource> supList = this.listDirectObjectPropertyValues(
getOntModel().getResource(classURI), OWL.equivalentClass);
for (Resource res : supList) {
equivalentClassURIs.add(getClassURIStr(res));
}
} finally {
getOntModel().leaveCriticalSection();
}