diff --git a/productMods/WEB-INF/ontologies/app/loadedAtStartup/vivoOrganizationDataGetters.n3 b/productMods/WEB-INF/ontologies/app/loadedAtStartup/vivoOrganizationDataGetters.n3 index 107ca53c..a8f21006 100644 --- a/productMods/WEB-INF/ontologies/app/loadedAtStartup/vivoOrganizationDataGetters.n3 +++ b/productMods/WEB-INF/ontologies/app/loadedAtStartup/vivoOrganizationDataGetters.n3 @@ -107,9 +107,39 @@ display:getResearchAreaDataGetter "deptResearchAreas" . - #### n3 for grants #### +## associate the classes with the datagetter ## + + display:hasDataGetter display:getGrantsDataGetter . + +## data getter to see if the department has any grants ## + +display:getGrantsDataGetter + a ; + display:saveToVar "getGrantResults"; + display:query + """ + PREFIX rdfs: + PREFIX vivo: + PREFIX afn: + SELECT DISTINCT ?activity + WHERE { + ?individualURI vivo:organizationForPosition ?posn . + ?posn vivo:positionForPerson ?person . + ?person ?roleProperty ?role . + ?roleProperty rdfs:subPropertyOf vivo:hasResearcherRole . + ?role vivo:roleContributesTo ?activity . + ?activity vivo:dateTimeInterval ?dti . + ?dti vivo:end ?end. + ?end vivo:dateTime ?dt + FILTER (?dt > afn:now()) + } + LIMIT 1 + """ . + +## data getter for the grants detail page ## + a ; ; diff --git a/productMods/templates/freemarker/body/individual/individual--foaf-organization.ftl b/productMods/templates/freemarker/body/individual/individual--foaf-organization.ftl index b1f7b6e5..8120bc46 100644 --- a/productMods/templates/freemarker/body/individual/individual--foaf-organization.ftl +++ b/productMods/templates/freemarker/body/individual/individual--foaf-organization.ftl @@ -17,7 +17,7 @@ <#include "individual-affiliated-research-areas.ftl"> -<#if individual.mostSpecificTypes?seq_contains("Academic Department")> +<#if individual.mostSpecificTypes?seq_contains("Academic Department") && getGrantResults?has_content> <#assign departmentalGrantsExtension>