Resource queryOrTemplateCall = ontClass.getPropertyResourceValue(property);
org.topbraid.spin.model.Query query = SPINFactory.asQuery(queryOrTemplateCall);
if (query != null) return getQuery(query.toString(), getRealURI(), qsm);
TemplateCall templateCall = SPINFactory.asTemplateCall(queryOrTemplateCall);
if (templateCall != null) return getQuery(templateCall.getQueryString(), getRealURI(), qsm);
return null;
}