only show the view active grants link on academic department pages if the department has any active grants

This commit is contained in:
tworrall 2013-06-25 11:07:16 -04:00
parent 883cbea941
commit d9de65e4c8
4 changed files with 42 additions and 4 deletions

View file

@ -107,9 +107,39 @@ display:getResearchAreaDataGetter
"deptResearchAreas" .
#### n3 for grants ####
## associate the classes with the datagetter ##
<http://vivoweb.org/ontology/core#AcademicDepartment> display:hasDataGetter display:getGrantsDataGetter .
## data getter to see if the department has any grants ##
display:getGrantsDataGetter
a <java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter>;
display:saveToVar "getGrantResults";
display:query
"""
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX vivo: <http://vivoweb.org/ontology/core#>
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
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 ##
<http://vitro.mannlib.cornell.edu/ns/default#n1697>
a <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#Page> ;
<http://vitro.mannlib.cornell.edu/ontologies/display/1.1#hasDataGetter> <http://vitro.mannlib.cornell.edu/ns/default#n4170> ;