NIHVIVO-1339 NIHVIVO-1340 Completed hasRole custom list views:
** core:hasClinicalRole ** core:hasLeaderRole ** core:hasMemberRole ** core:hasOutreachProviderRole ** core:hasServiceProviderRole ** core:hasResearcherRole ** core:hasInvestigatorRole ** core:hasCo-PrincipalInvestigatorRole ** core:hasPrincipalInvestigatorRole ** core:hasTeacherRole ** core:hasPresenterRole
This commit is contained in:
parent
6e588300e6
commit
bbd51fca82
3 changed files with 144 additions and 2 deletions
|
@ -34,5 +34,69 @@
|
|||
<rdf:Description rdf:about="http://vivoweb.org/ontology/core#organizationForPosition">
|
||||
<display:listViewConfigFile rdf:datatype="http://www.w3.org/2001/XMLSchema#string">listViewConfig-organizationForPosition.xml</display:listViewConfigFile>
|
||||
</rdf:Description>
|
||||
</rdf:RDF>
|
||||
|
||||
<!--
|
||||
******************************************************************
|
||||
all roles use same config...is there a better way to specify this?
|
||||
** core:hasClinicalRole
|
||||
** core:hasLeaderRole
|
||||
** core:hasMemberRole
|
||||
** core:hasOutreachProviderRole
|
||||
** core:hasServiceProviderRole
|
||||
** core:hasResearcherRole
|
||||
** core:hasInvestigatorRole
|
||||
** core:hasCo-PrincipalInvestigatorRole
|
||||
** core:hasPrincipalInvestigatorRole
|
||||
** core:hasTeacherRole
|
||||
** core:hasPresenterRole
|
||||
******************************************************************
|
||||
-->
|
||||
<rdf:Description rdf:about="http://vivoweb.org/ontology/core#hasClinicalRole">
|
||||
<display:listViewConfigFile rdf:datatype="http://www.w3.org/2001/XMLSchema#string">listViewConfig-hasRole.xml</display:listViewConfigFile>
|
||||
</rdf:Description>
|
||||
|
||||
<rdf:Description rdf:about="http://vivoweb.org/ontology/core#hasLeaderRole">
|
||||
<display:listViewConfigFile rdf:datatype="http://www.w3.org/2001/XMLSchema#string">listViewConfig-hasRole.xml</display:listViewConfigFile>
|
||||
</rdf:Description>
|
||||
|
||||
<rdf:Description rdf:about="http://vivoweb.org/ontology/core#hasMemberRole">
|
||||
<display:listViewConfigFile rdf:datatype="http://www.w3.org/2001/XMLSchema#string">listViewConfig-hasRole.xml</display:listViewConfigFile>
|
||||
</rdf:Description>
|
||||
|
||||
<rdf:Description rdf:about="http://vivoweb.org/ontology/core#hasOutreachProviderRole">
|
||||
<display:listViewConfigFile rdf:datatype="http://www.w3.org/2001/XMLSchema#string">listViewConfig-hasRole.xml</display:listViewConfigFile>
|
||||
</rdf:Description>
|
||||
|
||||
<rdf:Description rdf:about="http://vivoweb.org/ontology/core#hasServiceProviderRole">
|
||||
<display:listViewConfigFile rdf:datatype="http://www.w3.org/2001/XMLSchema#string">listViewConfig-hasRole.xml</display:listViewConfigFile>
|
||||
</rdf:Description>
|
||||
|
||||
<rdf:Description rdf:about="http://vivoweb.org/ontology/core#hasResearcherRole">
|
||||
<display:listViewConfigFile rdf:datatype="http://www.w3.org/2001/XMLSchema#string">listViewConfig-hasRole.xml</display:listViewConfigFile>
|
||||
</rdf:Description>
|
||||
|
||||
<rdf:Description rdf:about="http://vivoweb.org/ontology/core#hasInvestigatorRole">
|
||||
<display:listViewConfigFile rdf:datatype="http://www.w3.org/2001/XMLSchema#string">listViewConfig-hasRole.xml</display:listViewConfigFile>
|
||||
</rdf:Description>
|
||||
|
||||
<rdf:Description rdf:about="http://vivoweb.org/ontology/core#hasCo-PrincipalInvestigatorRole">
|
||||
<display:listViewConfigFile rdf:datatype="http://www.w3.org/2001/XMLSchema#string">listViewConfig-hasRole.xml</display:listViewConfigFile>
|
||||
</rdf:Description>
|
||||
|
||||
<rdf:Description rdf:about="http://vivoweb.org/ontology/core#hasPrincipalInvestigatorRole">
|
||||
<display:listViewConfigFile rdf:datatype="http://www.w3.org/2001/XMLSchema#string">listViewConfig-hasRole.xml</display:listViewConfigFile>
|
||||
</rdf:Description>
|
||||
|
||||
<rdf:Description rdf:about="http://vivoweb.org/ontology/core#hasTeacherRole">
|
||||
<display:listViewConfigFile rdf:datatype="http://www.w3.org/2001/XMLSchema#string">listViewConfig-hasRole.xml</display:listViewConfigFile>
|
||||
</rdf:Description>
|
||||
|
||||
<rdf:Description rdf:about="http://vivoweb.org/ontology/core#hasPresenterRole">
|
||||
<display:listViewConfigFile rdf:datatype="http://www.w3.org/2001/XMLSchema#string">listViewConfig-hasRole.xml</display:listViewConfigFile>
|
||||
</rdf:Description>
|
||||
<!--
|
||||
******************************************************************
|
||||
end roles (from person) config
|
||||
******************************************************************
|
||||
-->
|
||||
</rdf:RDF>
|
31
productMods/config/listViewConfig-hasRole.xml
Normal file
31
productMods/config/listViewConfig-hasRole.xml
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||
|
||||
<!-- See guidelines in vitro/doc/list_view_configuration_guidelines.txt -->
|
||||
|
||||
<list-view-config>
|
||||
<query>
|
||||
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
|
||||
</query>
|
||||
|
||||
<template>propStatement-hasRole.ftl</template>
|
||||
</list-view-config>
|
|
@ -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??>
|
||||
<a href="${profileUrl(statement.activity)}">${statement.activityName}</a>
|
||||
<#else>
|
||||
<#-- This shouldn't happen, but we must provide for it -->
|
||||
<a href="${profileUrl(statement.role)}">${statement.roleName}</a> (no linked activity)
|
||||
</#if>
|
||||
</#local>
|
||||
|
||||
<#local dateTimeInterval>
|
||||
<#if statement.dateTimeStart??>
|
||||
<#local startYear = dt.xsdDateTimeToYear(statement.dateTimeStart)>
|
||||
</#if>
|
||||
<#if statement.dateTimeEnd??>
|
||||
<#local endYear = dt.xsdDateTimeToYear(statement.dateTimeEnd)>
|
||||
</#if>
|
||||
<#if startYear?? && endYear??>
|
||||
${startYear} - ${endYear}
|
||||
<#elseif startYear??>
|
||||
${startYear} -
|
||||
<#elseif endYear ??>
|
||||
- ${endYear}
|
||||
</#if>
|
||||
</#local>
|
||||
|
||||
<#local dateInRole>
|
||||
<#if dateTimeInterval?has_content>
|
||||
<span class="listDateTime">${dateTimeInterval}</span>
|
||||
</#if>
|
||||
</#local>
|
||||
|
||||
${linkedIndividual} ${statement.specificRole} ${dateInRole!}
|
||||
|
||||
</#macro>
|
Loading…
Add table
Reference in a new issue