more refactoring for multiple profile view support

This commit is contained in:
tworrall 2013-02-08 16:18:01 -05:00
parent 0faa3630c2
commit 867370adb9
26 changed files with 542 additions and 184 deletions

View file

@ -0,0 +1,161 @@
# $This file is distributed under the terms of the license in /doc/license.txt$
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix display: <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix core: <http://vivoweb.org/ontology/core#> .
@prefix vivoweb: <http://vivoweb.org/ontology#> .
#### queries for departmental pages ####
<http://vivoweb.org/ontology/core#AcademicDepartment> display:hasDataGetter display:getResearchAreaDataGetter .
display:getResearchAreaDataGetter
a <java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter>;
display:saveToVar "researchAreaResults";
display:query """
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX vivo: <http://vivoweb.org/ontology/core#>
SELECT DISTINCT (str(?researchAreaLabel) AS ?raLabel) ?ra
WHERE {
?individualURI vivo:organizationForPosition ?posn .
?posn vivo:positionForPerson ?person .
?person vivo:hasResearchArea ?ra .
?ra rdfs:label ?researchAreaLabel
}
ORDER BY ?raLabel
""" .
## This is a working example of another type of data getter that can be used. This one retrieves ##
## the organizational memberships (vivo:hasMemberRole) of all the people in an academic department. ##
## You can use this or adapt it to your needs; for example, to display clinical activities of people ##
## in a department. The templates are available for this query and the appropriate freemarker code ##
## is commented out in the individual.ftl and individual--foaf-organization.ftl templates. ##
#<http://vivoweb.org/ontology/core#AcademicDepartment> display:hasDataGetter display:getMembershipsDataGetter .
#
#display:getMembershipsDataGetter
# a <java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter>;
# display:saveToVar "membershipResults";
# display:query """
# PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
# PREFIX vivo: <http://vivoweb.org/ontology/core#>
# SELECT DISTINCT (str(?organizationLabel) AS ?orgLabel) ?organization
# WHERE {
# ?individualURI vivo:organizationForPosition ?posn .
# ?posn vivo:positionForPerson ?person .
# ?person vivo:hasMemberRole ?mbrRole .
# ?mbrRole vivo:roleContributesTo ?organization.
# ?organization rdfs:label ?organizationLabel
# }
# ORDER BY ?organizationLabel
# """ .
#### detail pages for department links ####
<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> ;
<http://vitro.mannlib.cornell.edu/ontologies/display/1.1#requiresBodyTemplate>
"individual-dept-active-grants.ftl" ;
<http://vitro.mannlib.cornell.edu/ontologies/display/1.1#title>
"Departmental Grants" ;
<http://vitro.mannlib.cornell.edu/ontologies/display/1.1#urlMapping>
"/deptGrants" .
<http://vitro.mannlib.cornell.edu/ns/default#n4170>
a <java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter> ;
<http://vitro.mannlib.cornell.edu/ontologies/display/1.1#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 (str (?actLabel) AS ?activityLabel) ?dt (str(?departmentLabel) AS ?deptLabel) ?activity
WHERE {
?individualURI vivo:organizationForPosition ?posn .
?individualURI rdfs:label ?departmentLabel .
?posn vivo:positionForPerson ?person .
?person ?roleProperty ?role .
?roleProperty rdfs:subPropertyOf vivo:hasResearcherRole .
?role vivo:roleContributesTo ?activity .
?activity rdfs:label ?actLabel .
?activity vivo:dateTimeInterval ?dti .
?dti vivo:end ?end.
?end vivo:dateTime ?dt
FILTER (?dt > afn:now())
}
ORDER BY ?activityLabel
""" ;
<http://vitro.mannlib.cornell.edu/ontologies/display/1.1#saveToVar>
"deptGrants" .
<http://vitro.mannlib.cornell.edu/ns/default#n5100>
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#n3450> ;
<http://vitro.mannlib.cornell.edu/ontologies/display/1.1#requiresBodyTemplate>
"individual-dept-res-area-details.ftl" ;
<http://vitro.mannlib.cornell.edu/ontologies/display/1.1#title>
"Departmental Research Areas" ;
<http://vitro.mannlib.cornell.edu/ontologies/display/1.1#urlMapping>
"/deptResearchAreas" .
<http://vitro.mannlib.cornell.edu/ns/default#n3450>
a <java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter> ;
<http://vitro.mannlib.cornell.edu/ontologies/display/1.1#query>
"""
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX vivo: <http://vivoweb.org/ontology/core#>
SELECT DISTINCT (str (?prsnLabel) AS ?personLabel) ?person (Str(?researchAreaLabel) AS ?raLabel) (str(?departmentLabel) AS ?deptLabel) ?raURI
WHERE {
?deptURI vivo:organizationForPosition ?posn .
?deptURI rdfs:label ?departmentLabel .
?posn vivo:positionForPerson ?person .
?person rdfs:label ?prsnLabel .
?person vivo:hasResearchArea ?raURI .
?raURI rdfs:label ?researchAreaLabel
}
ORDER BY ?personLabel
""" ;
<http://vitro.mannlib.cornell.edu/ontologies/display/1.1#saveToVar>
"deptResearchAreas" .
## This is another part of the departmental memberships working example. This data getter gets called ##
## when a membership organization links is clicked on the academic department page. The template for ##
## this data getter (individual-dept-membership-details.ftl) is included in the VIVO source code. ##
#<http://vitro.mannlib.cornell.edu/ns/default#n1835>
# 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#n5312> ;
# <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#requiresBodyTemplate>
# "individual-dept-membership-details.ftl" ;
# <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#title>
# "Departmental Memberships" ;
# <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#urlMapping>
# "/deptMemberships" .
#<http://vitro.mannlib.cornell.edu/ns/default#n5312>
# a <java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter> ;
# <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#query>
# """PREFIX vivoc: <http://vivo.library.cornell.edu/ns/0.1#>
# PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
# PREFIX vivo: <http://vivoweb.org/ontology/core#>
# SELECT DISTINCT (str (?prsnLabel) AS ?personLabel) (str (?departmentLabel) AS ?deptLabel) ?person #(str(?organizationLabel) AS ?orgLabel) ?orgURI
# WHERE {
# ?deptURI vivo:organizationForPosition ?posn .
# ?deptURI rdfs:label ?departmentLabel .
# ?posn vivo:positionForPerson ?person .
# ?person rdfs:label ?prsnLabel .
# ?person vivo:hasMemberRole ?role .
# ?role vivo:roleContributesTo ?orgURI .
# ?orgURI rdfs:label ?organizationLabel
# }
# ORDER BY ?personLabel
# """ ;
# <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#saveToVar>
# "deptMemberships" .
#