From 76238887b15ca66574d77076f8db143fb02db370 Mon Sep 17 00:00:00 2001 From: "Stephen V. Williams" Date: Wed, 21 Aug 2013 16:48:01 -0600 Subject: [PATCH 1/3] 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 --- .../individual/individual--skos-concept.ftl | 12 +++ .../individual-affiliated-departments.ftl | 35 ++++++++ .../individual-affiliated-dept-details.ftl | 24 ++++++ .../everytime/vivoConceptDataGetters.n3 | 82 +++++++++++++++++++ .../firsttime/vivo-core-1.5-annotations.rdf | 1 + themes/wilma/i18n/all.properties | 3 + 6 files changed, 157 insertions(+) create mode 100644 productMods/templates/freemarker/body/individual/individual--skos-concept.ftl create mode 100644 productMods/templates/freemarker/body/partials/individual/individual-affiliated-departments.ftl create mode 100644 productMods/templates/freemarker/body/partials/individual/individual-affiliated-dept-details.ftl create mode 100644 rdf/display/everytime/vivoConceptDataGetters.n3 diff --git a/productMods/templates/freemarker/body/individual/individual--skos-concept.ftl b/productMods/templates/freemarker/body/individual/individual--skos-concept.ftl new file mode 100644 index 00000000..628b1780 --- /dev/null +++ b/productMods/templates/freemarker/body/individual/individual--skos-concept.ftl @@ -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"> + + +<#include "individual.ftl"> + diff --git a/productMods/templates/freemarker/body/partials/individual/individual-affiliated-departments.ftl b/productMods/templates/freemarker/body/partials/individual/individual-affiliated-departments.ftl new file mode 100644 index 00000000..4cc78952 --- /dev/null +++ b/productMods/templates/freemarker/body/partials/individual/individual-affiliated-departments.ftl @@ -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}" /> +

+ ${headingText} +

+ + + diff --git a/productMods/templates/freemarker/body/partials/individual/individual-affiliated-dept-details.ftl b/productMods/templates/freemarker/body/partials/individual/individual-affiliated-dept-details.ftl new file mode 100644 index 00000000..2bf4f7c7 --- /dev/null +++ b/productMods/templates/freemarker/body/partials/individual/individual-affiliated-dept-details.ftl @@ -0,0 +1,24 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> +<#if deptResearchAreas?has_content> +
+ <#list deptResearchAreas as firstRow> +
+

${firstRow["orgLabel"]}

+

${i18n().individuals_with_dept(firstRow['raLabel'])} ${i18n().view_all_individuals_in_dept}

+
+ <#break> + +
+ +
+ + +
+ + diff --git a/rdf/display/everytime/vivoConceptDataGetters.n3 b/rdf/display/everytime/vivoConceptDataGetters.n3 new file mode 100644 index 00000000..1d22cfa8 --- /dev/null +++ b/rdf/display/everytime/vivoConceptDataGetters.n3 @@ -0,0 +1,82 @@ +# $This file is distributed under the terms of the license in /doc/license.txt$ + +@prefix owl: . +@prefix display: . +@prefix rdf: . +@prefix rdfs: . +@prefix core: . +@prefix vivoweb: . +@prefix afn: . + + +#### n3 for research areas #### + +## associate the classes with the datagetter ## + + display:hasDataGetter display:getDepartmentDataGetter . + +## define the datagetter ## + +display:getDepartmentDataGetter + a ; + display:saveToVar "departmentsResults"; + display:query + """ + PREFIX rdfs: + PREFIX vivo: + PREFIX afn: + 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 ## + + + a ; + ; + "individual-affiliated-dept-details.ftl" ; + "Departmental Research Areas" ; + "/affiliatedDepartments" . + + + a ; + + """ + PREFIX rdfs: + PREFIX vivo: + 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 + """ ; + + "deptResearchAreas" . + + + + diff --git a/rdf/tbox/firsttime/vivo-core-1.5-annotations.rdf b/rdf/tbox/firsttime/vivo-core-1.5-annotations.rdf index 88df4862..d203cf88 100644 --- a/rdf/tbox/firsttime/vivo-core-1.5-annotations.rdf +++ b/rdf/tbox/firsttime/vivo-core-1.5-annotations.rdf @@ -2953,6 +2953,7 @@ + individual--skos-concept.ftl -1 Date: Wed, 21 Aug 2013 20:47:21 -0600 Subject: [PATCH 2/3] add reverse links to on the details pages for dept-subjArea and subjArea-dept --- .../individual/individual-affiliated-dept-details.ftl | 3 ++- .../individual/individual-affiliated-res-area-details.ftl | 5 +++-- rdf/display/everytime/vivoOrganizationDataGetters.n3 | 2 ++ themes/wilma/i18n/all.properties | 6 +++--- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/productMods/templates/freemarker/body/partials/individual/individual-affiliated-dept-details.ftl b/productMods/templates/freemarker/body/partials/individual/individual-affiliated-dept-details.ftl index 2bf4f7c7..3cb68d26 100644 --- a/productMods/templates/freemarker/body/partials/individual/individual-affiliated-dept-details.ftl +++ b/productMods/templates/freemarker/body/partials/individual/individual-affiliated-dept-details.ftl @@ -2,9 +2,10 @@ <#if deptResearchAreas?has_content>
<#list deptResearchAreas as firstRow> + <#assign raLink = "${urls.base}/individual?uri=${firstRow['raURI']}" />

${firstRow["orgLabel"]}

-

${i18n().individuals_with_dept(firstRow['raLabel'])} ${i18n().view_all_individuals_in_dept}

+

${i18n().individuals_with_dept(firstRow['raLabel'],raLink)} ${i18n().view_all_individuals_in_dept}

<#break> diff --git a/productMods/templates/freemarker/body/partials/individual/individual-affiliated-res-area-details.ftl b/productMods/templates/freemarker/body/partials/individual/individual-affiliated-res-area-details.ftl index bf62c621..f3c6e1d9 100644 --- a/productMods/templates/freemarker/body/partials/individual/individual-affiliated-res-area-details.ftl +++ b/productMods/templates/freemarker/body/partials/individual/individual-affiliated-res-area-details.ftl @@ -3,11 +3,12 @@
<#list affiliatedResearchAreas as firstRow> <#assign firstOrgLabel = firstRow["orgLabel"]?upper_case /> + <#assign deptLink = "${urls.base}/individual?uri=${firstRow['orgURI']}" /> <#assign i18TextString1 = "" /> <#if ( firstOrgLabel?index_of("THE") == 0 ) > - <#assign i18TextString1 = "${i18n().individuals_with_researh_area_one(firstRow['orgLabel'])}" /> + <#assign i18TextString1 = "${i18n().individuals_with_researh_area_one(firstRow['orgLabel'],deptLink)}" /> <#else> - <#assign i18TextString1 = "${i18n().individuals_with_researh_area_two(firstRow['orgLabel'])}" /> + <#assign i18TextString1 = "${i18n().individuals_with_researh_area_two(firstRow['orgLabel'],deptLink)}" />

${firstRow["raLabel"]}

diff --git a/rdf/display/everytime/vivoOrganizationDataGetters.n3 b/rdf/display/everytime/vivoOrganizationDataGetters.n3 index b1ece312..7e3c301f 100644 --- a/rdf/display/everytime/vivoOrganizationDataGetters.n3 +++ b/rdf/display/everytime/vivoOrganizationDataGetters.n3 @@ -69,6 +69,7 @@ display:getResearchAreaDataGetter (str(?researchAreaLabel) AS ?raLabel) (str(?organizationLabel) AS ?orgLabel) ?raURI + ?orgURI WHERE { ?orgURI vivo:organizationForPosition ?posn . ?orgURI rdfs:label ?organizationLabel . @@ -101,6 +102,7 @@ display:getResearchAreaDataGetter (Str(?researchAreaLabel) AS ?raLabel) (str(?departmentLabel) AS ?orgLabel) ?raURI + ?orgURI WHERE { ?orgURI vivo:organizationForPosition ?posn . ?orgURI rdfs:label ?orgLabel . diff --git a/themes/wilma/i18n/all.properties b/themes/wilma/i18n/all.properties index 6cf3c941..09637a11 100644 --- a/themes/wilma/i18n/all.properties +++ b/themes/wilma/i18n/all.properties @@ -61,9 +61,9 @@ view_all_faculty = view all faculty view_all_members_of_org = View all the members of this organization. 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. +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. From 2e9e64ebe901e00ecfdc1fef18b26b5ad61fc12b Mon Sep 17 00:00:00 2001 From: "Stephen V. Williams" Date: Mon, 26 Aug 2013 09:40:44 -0600 Subject: [PATCH 3/3] fix links to use context appropriate title instead of 'research area' and 'organization' --- .../partials/individual/individual-affiliated-departments.ftl | 2 +- rdf/display/everytime/vivoConceptDataGetters.n3 | 2 +- themes/wilma/i18n/all.properties | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/productMods/templates/freemarker/body/partials/individual/individual-affiliated-departments.ftl b/productMods/templates/freemarker/body/partials/individual/individual-affiliated-departments.ftl index 4cc78952..59a6f9b8 100644 --- a/productMods/templates/freemarker/body/partials/individual/individual-affiliated-departments.ftl +++ b/productMods/templates/freemarker/body/partials/individual/individual-affiliated-departments.ftl @@ -10,7 +10,7 @@ <#assign moreDisplayed = false> <#list departmentsResults as resultRow> diff --git a/rdf/display/everytime/vivoConceptDataGetters.n3 b/rdf/display/everytime/vivoConceptDataGetters.n3 index 1d22cfa8..47157443 100644 --- a/rdf/display/everytime/vivoConceptDataGetters.n3 +++ b/rdf/display/everytime/vivoConceptDataGetters.n3 @@ -48,7 +48,7 @@ display:getDepartmentDataGetter a ; ; "individual-affiliated-dept-details.ftl" ; - "Departmental Research Areas" ; + "Affiliated Departments" ; "/affiliatedDepartments" . diff --git a/themes/wilma/i18n/all.properties b/themes/wilma/i18n/all.properties index 09637a11..38583523 100644 --- a/themes/wilma/i18n/all.properties +++ b/themes/wilma/i18n/all.properties @@ -71,7 +71,8 @@ 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 +research_area = individuals in the department with this research area +organization = individuals with the research area in this organization display_more = more display_less = less