From ea747439aec2a846446f6ab8fb1419595e159634 Mon Sep 17 00:00:00 2001 From: tworrall Date: Tue, 11 Oct 2011 19:55:17 +0000 Subject: [PATCH] NIHVIVO-542: files for new award or honor list view --- .../loadedAtStartup/vivoListViewConfig.rdf | 4 + .../config/listViewConfig-awardOrHonor.xml | 150 ++++++++++++++++++ .../individual/propStatement-awardOrHonor.ftl | 37 +++++ 3 files changed, 191 insertions(+) create mode 100644 productMods/config/listViewConfig-awardOrHonor.xml create mode 100644 productMods/templates/freemarker/body/partials/individual/propStatement-awardOrHonor.ftl diff --git a/productMods/WEB-INF/ontologies/app/loadedAtStartup/vivoListViewConfig.rdf b/productMods/WEB-INF/ontologies/app/loadedAtStartup/vivoListViewConfig.rdf index eba4f0c4..07f256d9 100644 --- a/productMods/WEB-INF/ontologies/app/loadedAtStartup/vivoListViewConfig.rdf +++ b/productMods/WEB-INF/ontologies/app/loadedAtStartup/vivoListViewConfig.rdf @@ -38,6 +38,10 @@ listViewConfig-mailingAddress.xml + + + listViewConfig-awardOrHonor.xml + + + + + + + PREFIX foaf: <http://xmlns.com/foaf/0.1/> + PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> + PREFIX bibo: <http://purl.org/ontology/bibo/> + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX owl: <http://www.w3.org/2002/07/owl#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> + + SELECT DISTINCT ?award + ?localName + ?awardLabel + ?conferredBy + ?conferredByLabel + ?dateTimeStart + ?dateTimeEnd + ?dateTime + + WHERE { + ?subject ?property ?award + LET ( ?localName := afn:localname(?award) ) + OPTIONAL { ?award rdfs:label ?awardLabel } + OPTIONAL { ?conferredBy a foaf:Organization . + OPTIONAL { ?conferredBy rdfs:label ?conferredByLabel } + { + ?award core:awardConferredBy ?conferredBy + } UNION + { + ?conferredBy core:awardConferred ?award + } + + } + OPTIONAL { ?award core:dateTimeInterval ?dateTimeInterval + OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + } + OPTIONAL { ?award core:dateTimeInterval ?dateTimeInterval + OPTIONAL { ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } + } + OPTIONAL { ?award core:dateTimeValue ?dateTimeValue + OPTIONAL { ?dateTimeValue core:dateTime ?dateTime + + } + } + + } ORDER BY ?label + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + CONSTRUCT { + ?subject ?property ?award . + ?award ?awardProperty ?awardValue . + ?award rdfs:label ?awardLabel + } WHERE { + { + ?subject ?property ?award + } UNION { + ?subject ?property ?award . + ?award ?awardProperty ?awardValue . + ?award rdfs:label ?awardLabel + } + } + + + + PREFIX bibo: <http://purl.org/ontology/bibo/> + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX foaf: <http://xmlns.com/foaf/0.1/> + + CONSTRUCT { + ?subject ?property ?award . + ?award core:awardConferredBy ?conferredBy . + ?conferredBy a foaf:Organization . + ?conferredBy core:awardConferred ?award . + ?conferredBy rdfs:label ?conferredByLabel + } WHERE { + { + ?subject ?property ?award . + ?conferredBy a foaf:Organization . + ?award core:awardConferredBy ?conferredBy . + ?conferredBy core:awardConferred ?award + } UNION { + ?subject ?property ?award . + ?conferredBy a foaf:Organization . + ?award core:awardConferredBy ?conferredBy . + ?conferredBy core:awardConferred ?award . + ?conferredBy rdfs:label ?conferredByLabel + } + } + + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subject ?property ?award . + ?award core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } WHERE { + ?subject ?property ?award . + ?award core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subject ?property ?award . + ?award core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } WHERE { + ?subject ?property ?award . + ?award core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + CONSTRUCT { + ?subject ?property ?award . + ?award core:dateTimeValue ?dateTimeValue . + ?dateTimeValue core:dateTime ?dateTime + } WHERE { + ?subject ?property ?award . + ?award core:dateTimeValue ?dateTimeValue . + ?dateTimeValue core:dateTime ?dateTime + } + + + + diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-awardOrHonor.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-awardOrHonor.ftl new file mode 100644 index 00000000..aa1933ce --- /dev/null +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-awardOrHonor.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#mailingAddress. + + 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> +<@showAward statement /> + +<#-- Use a macro to keep variable assignments local; otherwise the values carry over to the + next statement --> +<#macro showAward statement> + + <#local linkedIndividual> + <#if statement.award??> + ${statement.awardLabel!statement.localName} + + + + <#local dateTimeVal> + <#if statement.dateTime??> + <@dt.yearSpan statement.dateTime! /> + <#else> + <@dt.yearIntervalSpan "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" /> + + + + <#local conferredByOrg> + <#if statement.conferredBy?has_content && statement.conferredByLabel?has_content> + conferred by ${statement.conferredByLabel} + + + + <@s.join [ linkedIndividual, conferredByOrg!, dateTimeVal! ] /> + \ No newline at end of file