diff --git a/productMods/WEB-INF/ontologies/app/listViewConfig.owl b/productMods/WEB-INF/ontologies/app/listViewConfig.owl index 0d81559c..efc5dc95 100644 --- a/productMods/WEB-INF/ontologies/app/listViewConfig.owl +++ b/productMods/WEB-INF/ontologies/app/listViewConfig.owl @@ -30,5 +30,9 @@ listViewConfig-personInPosition.xml + + + listViewConfig-organizationForPosition.xml + diff --git a/productMods/config/listViewConfig-organizationForPosition.xml b/productMods/config/listViewConfig-organizationForPosition.xml new file mode 100644 index 00000000..7fa34459 --- /dev/null +++ b/productMods/config/listViewConfig-organizationForPosition.xml @@ -0,0 +1,29 @@ + + + + + + + + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> + + SELECT DISTINCT ?position (afn:localname(?position) AS ?positionName) + ?positionTitle ?person ?personName ?dateTimeInterval ?dateTimeStart ?dateTimeEnd WHERE { + GRAPH ?g1 { ?subject ?property ?position } + OPTIONAL { GRAPH ?g2 { ?position core:positionForPerson ?person } + GRAPH ?g3 { ?person rdfs:label ?personName } + } + OPTIONAL { GRAPH ?g4 { ?position rdfs:label ?positionTitle } } + OPTIONAL { GRAPH ?g5 { ?position core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart } } + OPTIONAL { GRAPH ?g5 { ?position core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd } } + } ORDER BY DESC(?dateTimeStart) DESC(?dateTimeEnd) ?personName + + + + \ No newline at end of file diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-organizationForPosition.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-organizationForPosition.ftl new file mode 100644 index 00000000..4363037a --- /dev/null +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-organizationForPosition.ftl @@ -0,0 +1,47 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#-- Custom object property statement view for http://vivoweb.org/ontology/core#organizationForPosition --> + +<#import "lib-sequence.ftl" as s> +<#import "lib-datetime.ftl" as dt> + +<@showPosition statement /> + +<#-- Use a macro to keep variable assignments local; otherwise the values get passed to the next + statement --> +<#macro showPosition statement> + + <#local linkedIndividual> + <#if statement.person??> + ${statement.personName} + <#else> + <#-- This shouldn't happen, but we must provide for it --> + ${statement.positionName} (no linked person) + + + + <#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} + + + + <#local dateInPosition> + <#if dateTimeInterval?has_content> + ${dateTimeInterval} + + + + <@s.join [ linkedIndividual, statement.positionTitle! ] /> ${dateInPosition!} + + \ No newline at end of file