From 1c04d7a05b733e9cb3eb235ba54058672ae5b13b Mon Sep 17 00:00:00 2001 From: tworrall Date: Thu, 13 Oct 2011 13:26:29 +0000 Subject: [PATCH] NIHVIVO-1470: new custom list view for core:organizationForTraining --- .../loadedAtStartup/vivoListViewConfig.rdf | 4 + ...listViewConfig-organizationForTraining.xml | 140 ++++++++++++++++++ .../propStatement-organizationForTraining.ftl | 37 +++++ 3 files changed, 181 insertions(+) create mode 100644 productMods/config/listViewConfig-organizationForTraining.xml create mode 100644 productMods/templates/freemarker/body/partials/individual/propStatement-organizationForTraining.ftl diff --git a/productMods/WEB-INF/ontologies/app/loadedAtStartup/vivoListViewConfig.rdf b/productMods/WEB-INF/ontologies/app/loadedAtStartup/vivoListViewConfig.rdf index 07f256d9..8dd20fb4 100644 --- a/productMods/WEB-INF/ontologies/app/loadedAtStartup/vivoListViewConfig.rdf +++ b/productMods/WEB-INF/ontologies/app/loadedAtStartup/vivoListViewConfig.rdf @@ -35,6 +35,10 @@ listViewConfig-organizationForPosition.xml + + listViewConfig-organizationForTraining.xml + + listViewConfig-mailingAddress.xml diff --git a/productMods/config/listViewConfig-organizationForTraining.xml b/productMods/config/listViewConfig-organizationForTraining.xml new file mode 100644 index 00000000..d69eb123 --- /dev/null +++ b/productMods/config/listViewConfig-organizationForTraining.xml @@ -0,0 +1,140 @@ + + + + + + + + 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 ?subclass + ?localName + ?training + ?person + ?personName + ?degree + ?degreeName + ?degreeAbbr + ?field + ?suppInfo + ?dateTimeStart ?dateTimeEnd + WHERE { + ?subject ?property ?training + LET ( ?localName := afn:localname(?training) ) + OPTIONAL { ?training core:educationalTrainingOf ?person + OPTIONAL { ?person rdfs:label ?personName } + } + OPTIONAL { ?training core:degreeEarned ?degree + OPTIONAL { ?degree rdfs:label ?degreeName } + OPTIONAL { ?degree core:abbreviation ?degreeAbbr } + } + + OPTIONAL { ?training a ?subclass . + ?subclass rdfs:subClassOf core:EducationalTraining + } + + + OPTIONAL { ?training rdfs:label ?trainingLabel } + OPTIONAL { ?training core:majorField ?field } + OPTIONAL { ?training core:supplementalInformation ?suppInfo } + OPTIONAL { ?training core:dateTimeInterval ?dateTimeInterval + OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + OPTIONAL { ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } + } + + FILTER ( bound(?person) ) + + } ORDER BY ?subclass ?personName + + + + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subclass rdfs:subClassOf core:EducationalTraining + } WHERE { + ?subclass rdfs:subClassOf core:EducationalTraining + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + CONSTRUCT { + ?subject ?property ?training . + ?training ?trainingProperty ?trainingValue . + ?person rdfs:label ?personName + } WHERE { + { + ?subject ?property ?training + } UNION { + ?subject ?property ?training . + ?training ?trainingProperty ?trainingValue + } UNION { + ?subject ?property ?training . + ?training core:educationalTrainingOf ?person . + ?person rdfs:label ?personName + } + } + + + + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX core: <http://vivoweb.org/ontology/core#> + + CONSTRUCT { + ?degree rdfs:label ?degreeName . + ?degree core:abbreviation ?degreeAbbr + } WHERE { + { + ?subject ?property ?training . + ?training core:degreeEarned ?degree . + ?degree rdfs:label ?degreeName + } UNION { + ?subject ?property ?training . + ?training core:degreeEarned ?degree . + ?degree core:abbreviation ?degreeAbbr + } + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subject ?property ?position . + ?position core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } WHERE { + ?subject ?property ?position . + ?position core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subject ?property ?position . + ?position core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } WHERE { + ?subject ?property ?position . + ?position core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } + + + + diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-organizationForTraining.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-organizationForTraining.ftl new file mode 100644 index 00000000..231810fe --- /dev/null +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-organizationForTraining.ftl @@ -0,0 +1,37 @@ +<#-- $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. + + This template must be self-contained and not rely on other variables set for the individual page, because it + is also used to generate the property statement during a deletion. + --> + +<#import "lib-sequence.ftl" as s> +<#import "lib-datetime.ftl" as dt> + +<@showTraining statement /> + +<#-- Use a macro to keep variable assignments local; otherwise the values carry over to the + next statement --> +<#macro showTraining statement> + + <#local linkedIndividual> + <#if statement.person??> + ${statement.personName} + <#else> + <#-- This shouldn't happen, but we must provide for it --> + missing person in this position + + + <#local detailedInfo> + <#if statement.degree??> + ${statement.degreeAbbr!} in ${statement.field!} + <#elseif statement.field??> + ${statement.field!}, ${statement.suppInfo!} + <#else> + ${statement.suppInfo!} + + + <@s.join [ linkedIndividual, detailedInfo ] /> <@dt.yearIntervalSpan "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" /> + + \ No newline at end of file