diff --git a/productMods/WEB-INF/ontologies/app/listViewConfig.owl b/productMods/WEB-INF/ontologies/app/listViewConfig.owl index efc5dc95..5c4a4624 100644 --- a/productMods/WEB-INF/ontologies/app/listViewConfig.owl +++ b/productMods/WEB-INF/ontologies/app/listViewConfig.owl @@ -34,5 +34,69 @@ listViewConfig-organizationForPosition.xml - - + + + + listViewConfig-hasRole.xml + + + + listViewConfig-hasRole.xml + + + + listViewConfig-hasRole.xml + + + + listViewConfig-hasRole.xml + + + + listViewConfig-hasRole.xml + + + + listViewConfig-hasRole.xml + + + + listViewConfig-hasRole.xml + + + + listViewConfig-hasRole.xml + + + + listViewConfig-hasRole.xml + + + + listViewConfig-hasRole.xml + + + + listViewConfig-hasRole.xml + + + \ No newline at end of file diff --git a/productMods/config/listViewConfig-hasRole.xml b/productMods/config/listViewConfig-hasRole.xml new file mode 100644 index 00000000..7aac0c99 --- /dev/null +++ b/productMods/config/listViewConfig-hasRole.xml @@ -0,0 +1,31 @@ + + + + + + + + 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 ?role (afn:localname(?role) AS ?roleName) + ?specificRole ?activity ?activityName ?dateTimeInterval ?dateTimeStart ?dateTimeEnd WHERE { + GRAPH ?g1 { ?subject ?property ?role } + OPTIONAL { GRAPH ?g2 { ?role core:roleIn ?activity } + GRAPH ?g3 { ?activity rdfs:label ?activityName } + } + OPTIONAL { GRAPH ?g4 { ?role rdfs:label ?specificRole } } + OPTIONAL { GRAPH ?g5 { ?role core:dateTimeInterval ?dateTimeInterval } + OPTIONAL { GRAPH ?g6 { ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart } + } + OPTIONAL { GRAPH ?g7 { ?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-hasRole.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-hasRole.ftl new file mode 100644 index 00000000..9fadc30f --- /dev/null +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-hasRole.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#hasRole and its child properties --> + +<#import "lib-sequence.ftl" as s> +<#import "lib-datetime.ftl" as dt> + +<@showRole statement /> + +<#-- Use a macro to keep variable assignments local; otherwise the values get passed to the next + statement --> +<#macro showRole statement> + + <#local linkedIndividual> + <#if statement.activity??> + ${statement.activityName} + <#else> + <#-- This shouldn't happen, but we must provide for it --> + ${statement.roleName} (no linked activity) + + + + <#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 dateInRole> + <#if dateTimeInterval?has_content> + ${dateTimeInterval} + + + + ${linkedIndividual} ${statement.specificRole} ${dateInRole!} + + \ No newline at end of file