From 7e6ea50d63f07985b4e8520f11a93a861bcb8a08 Mon Sep 17 00:00:00 2001 From: brianjlowe Date: Wed, 14 Dec 2011 19:47:10 +0000 Subject: [PATCH] NIHVIVO-3507 fix to prevent ConversionExceptions when attempting to retrieve equivalent classes for classes not typed as owl:Class --- .../mannlib/vitro/webapp/dao/jena/VClassDaoJena.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/VClassDaoJena.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/VClassDaoJena.java index 76a65aa6f..2c953880e 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/VClassDaoJena.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/VClassDaoJena.java @@ -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 supList = this.listDirectObjectPropertyValues( + getOntModel().getResource(classURI), OWL.equivalentClass); + for (Resource res : supList) { + equivalentClassURIs.add(getClassURIStr(res)); + } } finally { getOntModel().leaveCriticalSection(); }