From 6ce1e4be338141c44923fce697486618b1e0c529 Mon Sep 17 00:00:00 2001 From: tworrall Date: Wed, 21 May 2014 13:03:39 -0400 Subject: [PATCH] new list view for grants and contracts awarded by organizations --- ...listViewConfig-organizationAwardsGrant.xml | 48 +++++++++++++++++++ .../propStatement-organizationAwardsGrant.ftl | 22 +++++++++ rdf/display/everytime/PropertyConfig.n3 | 2 +- 3 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 productMods/config/listViewConfig-organizationAwardsGrant.xml create mode 100644 productMods/templates/freemarker/body/partials/individual/propStatement-organizationAwardsGrant.ftl diff --git a/productMods/config/listViewConfig-organizationAwardsGrant.xml b/productMods/config/listViewConfig-organizationAwardsGrant.xml new file mode 100644 index 00000000..24d98362 --- /dev/null +++ b/productMods/config/listViewConfig-organizationAwardsGrant.xml @@ -0,0 +1,48 @@ + + + + + + + + PREFIX foaf: <http://xmlns.com/foaf/0.1/> + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX obo: <http://purl.obolibrary.org/obo/> + + SELECT DISTINCT ?grantOrContract + ?label + + WHERE { + ?subject ?property ?grantOrContract . + OPTIONAL { ?grantOrContract rdfs:label ?label . + } + } ORDER BY ?label + + + + PREFIX foaf: <http://xmlns.com/foaf/0.1/> + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX obo: <http://purl.obolibrary.org/obo/> + + CONSTRUCT { + ?subject ?property ?grantOrContract . + ?grantOrContract rdfs:label ?label . + } WHERE { + { + ?subject ?property ?grantOrContract . + } UNION { + ?subject ?property ?grantOrContract . + ?grantOrContract a core:Grant . + ?grantOrContract rdfs:label ?label . + } UNION { + ?subject ?property ?grantOrContract . + ?grantOrContract a core:Contract . + ?grantOrContract rdfs:label ?label . + } + } + + + + diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-organizationAwardsGrant.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-organizationAwardsGrant.ftl new file mode 100644 index 00000000..ea43f9a9 --- /dev/null +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-organizationAwardsGrant.ftl @@ -0,0 +1,22 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#-- + + 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. + --> +<@showAwardsGrant statement /> + +<#-- Use a macro to keep variable assignments local; otherwise the values carry over to the + next statement --> +<#macro showAwardsGrant statement> + + <#local linkedIndividual> + <#if statement.grantOrContract??> + ${statement.label!""} + + + + ${linkedIndividual!} + + diff --git a/rdf/display/everytime/PropertyConfig.n3 b/rdf/display/everytime/PropertyConfig.n3 index 1b0cc716..8c3295e9 100644 --- a/rdf/display/everytime/PropertyConfig.n3 +++ b/rdf/display/everytime/PropertyConfig.n3 @@ -1635,7 +1635,7 @@ local:orgAwardsGrantContext a :ConfigContext ; :qualifiedBy . local:orgAwardsGrantConfig a :ObjectPropertyDisplayConfig ; - :listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ; + :listViewConfigFile "listViewConfig-organizationAwardsGrant.xml"^^xsd:string ; :displayName "awards grant" ; vitro:displayRankAnnot 60; vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;