From 39b7d7bdfb5dc75a71ea923a50194817450fd152 Mon Sep 17 00:00:00 2001 From: Benjamin Gross Date: Wed, 23 Dec 2015 11:13:40 -0700 Subject: [PATCH] hide past positions in 'research area of' list view --- .../config/listViewConfig-researchAreaOf.xml | 18 ++++++++++++++++- .../propStatement-researchAreaOf.ftl | 20 ++++++++++--------- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/webapp/src/main/webapp/config/listViewConfig-researchAreaOf.xml b/webapp/src/main/webapp/config/listViewConfig-researchAreaOf.xml index b833abdf..b3a6d9b4 100644 --- a/webapp/src/main/webapp/config/listViewConfig-researchAreaOf.xml +++ b/webapp/src/main/webapp/config/listViewConfig-researchAreaOf.xml @@ -22,6 +22,7 @@ ?org ?orgLabel ?title + ?dateTimeEnd WHERE { ?subject ?property ?person . OPTIONAL { ?person core:relatedBy ?position . @@ -42,8 +43,13 @@ ?org a foaf:Organization . ?org rdfs:label ?orgLabel } + OPTIONAL { ?position core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd . + FILTER ( ?dateTimeEnd < now() ) + } } - ORDER BY (fn:lower-case(?personName)) + ORDER BY (fn:lower-case(?personName)) (bound(?dateTimeEnd)) desc(?dateTimeEnd) @@ -59,6 +65,9 @@ ?position core:relates ?org . ?org a foaf:Organization . ?org rdfs:label ?orgName . + ?position core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?endDate . + ?endDate core:dateTime ?endDateValue . } WHERE { { ?subject ?property ?person @@ -84,6 +93,13 @@ ?position core:relates ?org . ?org a foaf:Organization . ?org rdfs:label ?orgName + } UNION { + ?subject ?property ?person . + ?person core:relatedBy ?position . + ?position a core:Position . + ?position core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?endDate . + ?endDate core:dateTime ?endDateValue } } diff --git a/webapp/src/main/webapp/templates/freemarker/body/partials/individual/propStatement-researchAreaOf.ftl b/webapp/src/main/webapp/templates/freemarker/body/partials/individual/propStatement-researchAreaOf.ftl index 3059fd1b..8dc33bcc 100644 --- a/webapp/src/main/webapp/templates/freemarker/body/partials/individual/propStatement-researchAreaOf.ftl +++ b/webapp/src/main/webapp/templates/freemarker/body/partials/individual/propStatement-researchAreaOf.ftl @@ -14,15 +14,17 @@ <#local linkedIndividual> ${statement.personName!} - <#if statement.title?has_content > - <#local posnTitle = statement.title> - <#elseif statement.posnLabel?has_content> - <#local posnTitle = statement.posnLabel> - - <#if statement.org??> - <#local orgString> - ${statement.orgLabel!""} - + <#if !(statement.dateTimeEnd?has_content)> + <#if statement.title?has_content > + <#local posnTitle = statement.title> + <#elseif statement.posnLabel?has_content> + <#local posnTitle = statement.posnLabel> + + <#if statement.org??> + <#local orgString> + ${statement.orgLabel!""} + + <@s.join [ linkedIndividual, posnTitle!, orgString! ] />