From 230fb27df4215949f5f197c64d73f9ff0c36a8e0 Mon Sep 17 00:00:00 2001 From: tworrall Date: Tue, 25 Oct 2011 15:03:12 +0000 Subject: [PATCH] NIHVIVO-1246: hasInvestigatorRole and subclasses now have own list view showing either grantAwardedBy or administeredBy --- .../loadedAtStartup/vivoListViewConfig.rdf | 41 +++-- .../listViewConfig-hasInvestigatorRole.xml | 145 ++++++++++++++++++ .../propStatement-hasInvestigatorRole.ftl | 39 +++++ 3 files changed, 202 insertions(+), 23 deletions(-) create mode 100644 productMods/config/listViewConfig-hasInvestigatorRole.xml create mode 100644 productMods/templates/freemarker/body/partials/individual/propStatement-hasInvestigatorRole.ftl diff --git a/productMods/WEB-INF/ontologies/app/loadedAtStartup/vivoListViewConfig.rdf b/productMods/WEB-INF/ontologies/app/loadedAtStartup/vivoListViewConfig.rdf index e5e034ee..85349946 100644 --- a/productMods/WEB-INF/ontologies/app/loadedAtStartup/vivoListViewConfig.rdf +++ b/productMods/WEB-INF/ontologies/app/loadedAtStartup/vivoListViewConfig.rdf @@ -46,31 +46,26 @@ listViewConfig-awardOrHonor.xml - listViewConfig-advisorIn.xml - - listViewConfig-hasRole.xml - - listViewConfig-hasRole.xml @@ -94,19 +89,7 @@ listViewConfig-hasRole.xml - - - listViewConfig-hasRole.xml - - - - listViewConfig-hasRole.xml - - - - listViewConfig-hasRole.xml - - + listViewConfig-hasRole.xml @@ -124,12 +107,24 @@ listViewConfig-hasEditReviewRole.xml - - + listViewConfig-hasPresenterRole.xml + + + listViewConfig-hasInvestigatorRole.xml + + + + listViewConfig-hasInvestigatorRole.xml + + + + listViewConfig-hasInvestigatorRole.xml + + + + + + + + PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> + + SELECT DISTINCT ?subclass + ?role + ?activity ?activityName + ?activityLabel + ?awardedBy + ?adminedBy + ?awardedByLabel + ?adminedByLabel + ?dateTimeStart ?dateTimeEnd WHERE { + + ?subject ?property ?role + + OPTIONAL { ?role core:roleIn ?activity + LET (?activityName := afn:localname(?activity)) + OPTIONAL { ?activity rdfs:label ?activityLabel } + + + ?activity vitro:mostSpecificType ?subclass + + } + OPTIONAL { ?activity core:grantAwardedBy ?awardedBy . + ?awardedBy rdfs:label ?awardedByLabel + } + OPTIONAL { ?activity core:administeredBy ?adminedBy . + ?adminedBy rdfs:label ?adminedByLabel + } + + OPTIONAL { ?role rdfs:label ?roleLabel } + OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval + OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + OPTIONAL { ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } + } + + FILTER ( bound(?activity) ) + + } ORDER BY ?subclass DESC(?dateTimeEnd) DESC(?dateTimeStart) ?activityLabel ?activityName + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> + + CONSTRUCT { + ?subject ?property ?role . + ?role core:roleIn ?activity . + ?activity vitro:mostSpecificType ?subclass . + } WHERE { + ?subject ?property ?role . + ?role core:roleIn ?activity . + ?activity vitro:mostSpecificType ?subclass + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + CONSTRUCT { + ?subject ?property ?role . + ?role ?roleProperty ?roleValue . + ?activity rdfs:label ?activityName . + ?activity core:grantAwardedBy ?awardedBy . + ?awardedBy rdfs:label ?awardedByLabel . + ?activity core:administeredBy ?adminedBy . + ?adminedBy rdfs:label ?adminedByLabel + } WHERE { + { + ?subject ?property ?role + } UNION { + ?subject ?property ?role . + ?role ?roleProperty ?roleValue + } UNION { + ?subject ?property ?role . + ?role core:roleIn ?activity . + ?activity rdfs:label ?activityName + } UNION { + ?subject ?property ?role . + ?role core:roleIn ?activity . + ?activity core:grantAwardedBy ?awardedBy + } UNION { + ?subject ?property ?role . + ?role core:roleIn ?activity . + ?activity core:grantAwardedBy ?awardedBy . + ?awardedBy rdfs:label ?awardedByLabel + } UNION { + ?subject ?property ?role . + ?role core:roleIn ?activity . + ?activity core:administeredBy ?adminedBy + } UNION { + ?subject ?property ?role . + ?role core:roleIn ?activity . + ?activity core:administeredBy ?adminedBy . + ?adminedBy rdfs:label ?adminedByLabel + } + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subject ?property ?role . + ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } WHERE { + ?subject ?property ?role . + ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subject ?property ?role . + ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } WHERE { + ?subject ?property ?role . + ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } + + + + \ No newline at end of file diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-hasInvestigatorRole.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-hasInvestigatorRole.ftl new file mode 100644 index 00000000..1e876d44 --- /dev/null +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-hasInvestigatorRole.ftl @@ -0,0 +1,39 @@ +<#-- $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. + + 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-datetime.ftl" as dt> + +<@showRole statement /> + +<#-- Use a macro to keep variable assignments local; otherwise the values carry over to the + next statement --> +<#macro showRole statement> + <#local linkedIndividual> + <#if statement.activity??> + ${statement.activityLabel!statement.activityName} + <#else> + <#-- This shouldn't happen, but we must provide for it --> + missing activity + + + + <#local awardOrAdminBy> + <#if statement.awardedByLabel??> +  awarded by ${statement.awardedByLabel!} + <#elseif statement.adminedByLabel??> +  administered by ${statement.adminedByLabel!} + + + + <#local dateTime> + <@dt.yearIntervalSpan "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" /> + + + ${linkedIndividual} ${awardOrAdminBy} ${dateTime!} + + \ No newline at end of file