diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/IndividualController.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/IndividualController.java index e6487fcb8..838826f35 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/IndividualController.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/IndividualController.java @@ -51,6 +51,7 @@ import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditConfiguration; import edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditSubmission; import edu.cornell.mannlib.vitro.webapp.filestorage.model.FileInfo; +import edu.cornell.mannlib.vitro.webapp.reasoner.SimpleReasoner; import edu.cornell.mannlib.vitro.webapp.utils.NamespaceMapper; import edu.cornell.mannlib.vitro.webapp.utils.NamespaceMapperFactory; import edu.cornell.mannlib.vitro.webapp.web.ContentType; @@ -241,9 +242,9 @@ public class IndividualController extends FreemarkerHttpServlet { } } // If still no custom template defined, and inferencing is asynchronous (under RDB), check - // superclasses of the vclass. - // The method to check for asynchronous inferencing will be added later; see NIHVIVO-1834. - if (customTemplate == null) { //&& inferencing is asynchronous) { + // the superclasses of the vclass for a custom template specification. + if (customTemplate == null && SimpleReasoner.isABoxReasoningAsynchronous(getServletContext())) { + log.debug("Checking superclasses for custom template specification because ABox reasoning is asynchronous"); for (VClass directVClass : directClasses) { VClassDao vcDao = vreq.getWebappDaoFactory().getVClassDao(); List superClassUris = vcDao.getAllSuperClassURIs(directVClass.getURI()); diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/IndividualTemplateModel.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/IndividualTemplateModel.java index 795d46f0b..ea559de25 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/IndividualTemplateModel.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/IndividualTemplateModel.java @@ -20,6 +20,7 @@ import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.Route; import edu.cornell.mannlib.vitro.webapp.dao.VClassDao; import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.filters.VitroRequestPrep; +import edu.cornell.mannlib.vitro.webapp.reasoner.SimpleReasoner; import edu.cornell.mannlib.vitro.webapp.web.templatemodels.BaseTemplateModel; public class IndividualTemplateModel extends BaseTemplateModel { @@ -61,9 +62,10 @@ public class IndividualTemplateModel extends BaseTemplateModel { private boolean isVClass(String vClassUri) { boolean isVClass = individual.isVClass(vClassUri); - // If reasoning is asynchronous, this inference may not have been made yet. Check the superclasses - // of the individual's vclass. - if (!isVClass) { // & reasoning is asynchronous: method to be added later; see NIHVIVO-1834 + // If reasoning is asynchronous (under RDB), this inference may not have been made yet. + // Check the superclasses of the individual's vclass. + if (!isVClass && SimpleReasoner.isABoxReasoningAsynchronous(getServletContext())) { + log.debug("Checking superclasses to see if individual is a " + vClassUri + " because reasoning is asynchronous"); List directVClasses = individual.getVClasses(true); for (VClass directVClass : directVClasses) { VClassDao vcDao = vreq.getWebappDaoFactory().getVClassDao();