added departments to concept page based on researcher selecting concept as research area

* 4 new files for handling the new linkage (individual--skos-concept.ftl, individual-affiliated-departments.ftl, individual-affiliated-dept-details.ftl, vivoConceptDataGetters.n3)
 * added invdividual--skos-concept.ftl to the skos:Concept definition in vivo-core-1.5-annotations.rdf
 * added i18n entries for the new ftl pages
This commit is contained in:
Stephen V. Williams 2013-08-21 16:48:01 -06:00
parent 5f7bbc6799
commit 76238887b1
6 changed files with 157 additions and 0 deletions

View file

@ -0,0 +1,12 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- Individual profile page template for skos:Concept individuals (extends individual.ftl in vivo)-->
<#-- Do not show the link for temporal visualization unless it's enabled -->
<#assign affiliatedResearchAreas>
<#include "individual-affiliated-departments.ftl">
</#assign>
<#include "individual.ftl">

View file

@ -0,0 +1,35 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#if departmentsResults?has_content>
<#-- is strictly a usability issue so we can refer accurately to "faculty members" within the dept. -->
<#assign urlForDetailsPage = "affiliatedDepartments" />
<#assign headingText = "${i18n().affiliated_departments}" />
<h2 id="facultyResearchAreas" class="mainPropGroup">
${headingText}
</h2>
<ul id="individual-hasResearchArea" role="list">
<#assign moreDisplayed = false>
<#list departmentsResults as resultRow>
<li class="raLink">
<a class="raLink" href="${urls.base}/${urlForDetailsPage}?orgURI=${resultRow["dept"]}&raURI=${individual.uri}" title="${i18n().research_area}">
${resultRow["deptLabel"]}
</a>
</li>
</#list>
</ul>
</#if>
<script>
$('a#raMore').click(function() {
$('li.raLinkMore').each(function() {
$(this).show();
});
$('li#raMoreContainer').hide();
$('li#raLessContainer').show();
});
$('a#raLess').click(function() {
$('li.raLinkMore').each(function() {
$(this).hide();
});
$('li#raMoreContainer').show();
$('li#raLessContainer').hide();
});
</script>

View file

@ -0,0 +1,24 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#if deptResearchAreas?has_content>
<section id="pageList">
<#list deptResearchAreas as firstRow>
<div class="tab">
<h2>${firstRow["orgLabel"]}</h2>
<p>${i18n().individuals_with_dept(firstRow['raLabel'])} <a href="${urls.base}/individual?uri=${firstRow["orgURI"]}">${i18n().view_all_individuals_in_dept}</a></p>
</div>
<#break>
</#list>
</section>
<section id="deptResearchAreas">
<ul role="list" class="deptDetailsList">
<#list deptResearchAreas as resultRow>
<li class="deptDetailsListItem">
<a href="${urls.base}/individual${resultRow["person"]?substring(resultRow["person"]?last_index_of("/"))}" title="${i18n().person_name}">${resultRow["personLabel"]}</a>
</li>
</#list>
</ul>
</section>
</#if>

View file

@ -0,0 +1,82 @@
# $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#> .
@prefix afn: <http://jena.hpl.hp.com/ARQ/function#> .
#### n3 for research areas ####
## associate the classes with the datagetter ##
<http://www.w3.org/2004/02/skos/core#Concept> display:hasDataGetter display:getDepartmentDataGetter .
## define the datagetter ##
display:getDepartmentDataGetter
a <java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter>;
display:saveToVar "departmentsResults";
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 (str(?departmentLabel) AS ?deptLabel) ?dept
WHERE {
?individualURI vivo:researchAreaOf ?person .
?person vivo:personInPosition ?posn .
?posn vivo:positionInOrganization ?dept .
?dept rdfs:label ?departmentLabel
OPTIONAL { ?posn vivo:dateTimeInterval ?dti
OPTIONAL { ?dti vivo:end ?end .
?end vivo:dateTime ?endDate
}
}
FILTER ( !bound(?endDate) ||
afn:substring(str(?endDate), 0, 4) >= afn:substring(str(afn:now()), 0, 4) )
}
ORDER BY ?deptLabel
""" .
## detail page for dept research areas ##
<http://vitro.mannlib.cornell.edu/ns/default#n55553333>
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#n55552222> ;
<http://vitro.mannlib.cornell.edu/ontologies/display/1.1#requiresBodyTemplate> "individual-affiliated-dept-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> "/affiliatedDepartments" .
<http://vitro.mannlib.cornell.edu/ns/default#n55552222>
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 ?orgLabel)
?raURI
?orgURI
WHERE {
?orgURI vivo:organizationForPosition ?posn .
?orgURI rdfs:label ?orgLabel .
?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" .

View file

@ -2953,6 +2953,7 @@
<vitro:hiddenFromDisplayBelowRoleLevelAnnot rdf:resource="http://vitro.mannlib.cornell.edu/ns/vitro/role#public"/>
<vitro:prohibitedFromUpdateBelowRoleLevelAnnot rdf:resource="http://vitro.mannlib.cornell.edu/ns/vitro/role#public"/>
<vitro:inClassGroup rdf:resource="http://vivoweb.org/ontology#vitroClassGrouppublications"/>
<vitro:customDisplayViewAnnot rdf:datatype="http://www.w3.org/2001/XMLSchema#string">individual--skos-concept.ftl</vitro:customDisplayViewAnnot>
<vitro:displayLimitAnnot rdf:datatype="http://www.w3.org/2001/XMLSchema#int"
>-1</vitro:displayLimitAnnot>
<vitro:displayRankAnnot rdf:datatype="http://www.w3.org/2001/XMLSchema#int"

View file

@ -63,11 +63,14 @@ faculty_memberships = Faculty Memberships
individuals_with_researh_area_one = Here are the individuals in {0} who have an interest in this research area.
individuals_with_researh_area_two = Here are the individuals in the {0} who have an interest in this research area.
individuals_with_dept = Here are the individuals with an interest in {0} who are in this organization.
faculty_with_researh_area = Here are the faculty members in the {0} department who have an interest in this research area.
view_all_individuals_in_area = View all individuals with an interest in this area.
view_all_individuals_in_dept = View all individuals in this organization.
view_all_faculty_in_area = View all faculty with an interest in this area.
faculty_research_areas = Faculty Research Areas
affiliated_research_areas = Affiliated Research Areas
affiliated_departments = Associated Departments
research_area = research area
display_more = more
display_less = less