From 9f62e70e81a6ab130c647289a0c799d1ca8532a4 Mon Sep 17 00:00:00 2001 From: rjy7 Date: Thu, 6 Jan 2011 17:02:01 +0000 Subject: [PATCH] NIHVIVO-1336 Modifications to educational training query and template due to core:EducationalTraining being associated with a core:DateTimeInterval rather than a core:DateTimeValue --- .../listViewConfig-educationalTraining.xml | 13 +++++++--- .../propStatement-educationalTraining.ftl | 26 ++++++++++++++++--- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/productMods/config/listViewConfig-educationalTraining.xml b/productMods/config/listViewConfig-educationalTraining.xml index 06050abf..e8806ae2 100644 --- a/productMods/config/listViewConfig-educationalTraining.xml +++ b/productMods/config/listViewConfig-educationalTraining.xml @@ -10,7 +10,7 @@ PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> SELECT DISTINCT ?edTraining (afn:localname(?edTraining) AS ?edTrainingName) ?org ?orgName - ?degreeName ?degreeAbbr ?majorField ?deptOrSchool ?info ?dateTime + ?degreeName ?degreeAbbr ?majorField ?deptOrSchool ?info ?dateTimeStart ?dateTimeEnd WHERE { GRAPH ?g1 { ?subject ?property ?edTraining } OPTIONAL { GRAPH ?g2 { ?edTraining core:trainingAtOrganization ?org . @@ -23,10 +23,15 @@ OPTIONAL { GRAPH ?g6 { ?edTraining core:majorField ?majorField } } OPTIONAL { GRAPH ?g7 { ?edTraining core:departmentOrSchool ?deptOrSchool } } OPTIONAL { GRAPH ?g8 { ?edTraining core:supplementalInformation ?info } } - OPTIONAL { GRAPH ?g9 { ?edTraining core:dateTimeInterval ?dateTimeInterval . - ?dateTimeInterval core:dateTime ?dateTime } + OPTIONAL { GRAPH ?g9 { ?edTraining core:dateTimeInterval ?dateTimeInterval } + OPTIONAL { GRAPH ?g10 { ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart } + } + OPTIONAL { GRAPH ?g11 { ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd } + } } - } ORDER BY DESC(?dateTime) + } ORDER BY DESC(?dateTimeEnd) DESC(?dateTimeStart) diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-educationalTraining.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-educationalTraining.ftl index 90dbd0c1..d8dabead 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-educationalTraining.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-educationalTraining.ftl @@ -26,10 +26,28 @@ - <#if statement.dateTime??> - <#local year = dt.xsdDateTimeToYear(statement.dateTime)> - + <#local dateTimeInterval> + <#if statement.dateTimeStart??> + <#local startYear = dt.xsdDateTimeToYear(statement.dateTimeStart)> + + <#if statement.dateTimeEnd??> + <#local endYear = dt.xsdDateTimeToYear(statement.dateTimeEnd)> + + <#if startYear?? && endYear??> + ${startYear} - ${endYear} + <#elseif startYear??> + ${startYear} - + <#elseif endYear ??> + ${endYear} <#-- no hyphen, so doesn't display as a range with missing start date --> + + - <@s.join [ degree, linkedIndividual, statement.deptOrSchool!, statement.info!, year! ] /> + <#local date> + <#if dateTimeInterval?has_content> + ${dateTimeInterval} + + + + <@s.join [ degree, linkedIndividual, statement.deptOrSchool!, statement.info! ] /> ${date} \ No newline at end of file