NIHVIVO-2605 Initial version of list view for core:hasPresenterRole
This commit is contained in:
parent
601838d2b8
commit
482992f837
6 changed files with 196 additions and 24 deletions
|
@ -91,10 +91,6 @@
|
|||
<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>
|
||||
|
||||
<rdf:Description rdf:about="http://vivoweb.org/ontology/core#hasOrganizerRole">
|
||||
<display:listViewConfigFile rdf:datatype="http://www.w3.org/2001/XMLSchema#string">listViewConfig-hasRole.xml</display:listViewConfigFile>
|
||||
</rdf:Description>
|
||||
|
@ -110,6 +106,10 @@
|
|||
</rdf:Description>
|
||||
|
||||
|
||||
<rdf:Description rdf:about="http://vivoweb.org/ontology/core#hasPresenterRole">
|
||||
<display:listViewConfigFile rdf:datatype="http://www.w3.org/2001/XMLSchema#string">listViewConfig-hasPresenterRole.xml</display:listViewConfigFile>
|
||||
</rdf:Description>
|
||||
|
||||
<!--
|
||||
******************************************************************
|
||||
end roles (from person) config
|
||||
|
|
|
@ -35,14 +35,14 @@
|
|||
OPTIONAL { ?role core:forInformationResource ?infoResource
|
||||
LET (?infoResourceName := afn:localname(?infoResource))
|
||||
OPTIONAL { ?infoResource rdfs:label ?infoResourceLabel }
|
||||
|
||||
<collated>
|
||||
# NB Currently we can only retrieve subclass for either the
|
||||
# infoResource or the activity, but not both. Later, we could have
|
||||
# the query retrieve both and write a custom preprocessor to merge
|
||||
# the results into a single subclass column.
|
||||
OPTIONAL { ?infoResource vitro:mostSpecificType ?subclass .
|
||||
?subclass rdfs:subClassOf bibo:Collection
|
||||
}
|
||||
?infoResource vitro:mostSpecificType ?subclass .
|
||||
?subclass rdfs:subClassOf bibo:Collection
|
||||
</collated>
|
||||
}
|
||||
|
||||
|
@ -70,13 +70,11 @@
|
|||
CONSTRUCT {
|
||||
?subject ?property ?role .
|
||||
?role core:forInformationResource ?infoResource .
|
||||
# ?infoResource a ?subclass .
|
||||
?infoResource vitro:mostSpecificType ?subclass .
|
||||
?subclass rdfs:subClassOf bibo:Collection
|
||||
} WHERE {
|
||||
?subject ?property ?role .
|
||||
?role core:forInformationResource ?infoResource .
|
||||
# ?infoResource a ?subclass .
|
||||
?infoResource vitro:mostSpecificType ?subclass .
|
||||
?subclass rdfs:subClassOf bibo:Collection
|
||||
}
|
||||
|
|
150
productMods/config/listViewConfig-hasPresenterRole.xml
Normal file
150
productMods/config/listViewConfig-hasPresenterRole.xml
Normal file
|
@ -0,0 +1,150 @@
|
|||
<?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-select>
|
||||
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
|
||||
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 <collated>?subclass</collated>
|
||||
?role ?roleLabel
|
||||
?presentation ?presentationName ?presentationLabel
|
||||
?conference ?conferenceName ?conferenceLabel
|
||||
|
||||
WHERE {
|
||||
|
||||
?subject ?property ?role
|
||||
|
||||
OPTIONAL { ?role core:roleIn ?presentation
|
||||
LET (?presentationName := afn:localname(?presentation))
|
||||
|
||||
OPTIONAL { ?presentation rdfs:label ?presentationLabel }
|
||||
|
||||
OPTIONAL { ?conference a core:Conference .
|
||||
LET (?conferenceName := afn:localname(?conference))
|
||||
OPTIONAL { ?conference rdfs:label ?conferenceLabel }
|
||||
|
||||
{ ?presentation core:eventWithin ?conference }
|
||||
UNION
|
||||
{ ?conference core:includesEvent ?presentation }
|
||||
|
||||
}
|
||||
|
||||
<collated>
|
||||
?presentation vitro:mostSpecificType ?subclass .
|
||||
{ ?subclass rdfs:subClassOf core:Presentation }
|
||||
UNION
|
||||
{ ?subclass owl:equivalentClass core:Presentation }
|
||||
</collated>
|
||||
|
||||
}
|
||||
|
||||
OPTIONAL { ?role rdfs:label ?roleLabel }
|
||||
OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval
|
||||
OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue .
|
||||
?dateTimeStartValue core:dateTime ?dateTimeStart
|
||||
}
|
||||
}
|
||||
|
||||
<critical-data-required>
|
||||
FILTER ( bound(?presentation) )
|
||||
</critical-data-required>
|
||||
|
||||
} ORDER BY <collated>?subclass</collated> DESC(?dateTimeEnd) ?presentationName
|
||||
</query-select>
|
||||
|
||||
<query-construct>
|
||||
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#>
|
||||
|
||||
CONSTRUCT {
|
||||
?subject ?property ?role .
|
||||
?role core:roleIn ?presentation .
|
||||
?presentation vitro:mostSpecificType ?subclass .
|
||||
} WHERE {
|
||||
?subject ?property ?role .
|
||||
?role core:roleIn ?presentation .
|
||||
?presentation vitro:mostSpecificType ?subclass .
|
||||
{ ?subclass rdfs:subClassOf core:Presentation }
|
||||
UNION
|
||||
{ ?subclass owl:equivalentClass core:Presentation }
|
||||
}
|
||||
</query-construct>
|
||||
|
||||
<query-construct>
|
||||
PREFIX core: <http://vivoweb.org/ontology/core#>
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
CONSTRUCT {
|
||||
?subject ?property ?role .
|
||||
?role ?roleProperty ?roleValue .
|
||||
?presentation rdfs:label ?presentationLabel
|
||||
} WHERE {
|
||||
{
|
||||
?subject ?property ?role
|
||||
} UNION {
|
||||
?subject ?property ?role .
|
||||
?role ?roleProperty ?roleValue
|
||||
} UNION {
|
||||
?subject ?property ?role .
|
||||
?role core:roleIn ?presentation .
|
||||
?presentation rdfs:label ?presentationLabel
|
||||
}
|
||||
}
|
||||
</query-construct>
|
||||
|
||||
<query-construct>
|
||||
PREFIX core: <http://vivoweb.org/ontology/core#>
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
|
||||
CONSTRUCT {
|
||||
?subject ?property ?role .
|
||||
?conference a core:Conference .
|
||||
?presentation core:eventWithin ?conference .
|
||||
?conference core:includesEvent ?presentation .
|
||||
?conference rdfs:label ?conferenceLabel
|
||||
} WHERE {
|
||||
?subject ?property ?presentation .
|
||||
?role core:roleIn ?presentation .
|
||||
?conference a core:Conference .
|
||||
|
||||
{
|
||||
?presentation core:eventWithin ?conference
|
||||
} UNION {
|
||||
?presentation core:eventWithin ?conference .
|
||||
?conference rdfs:label ?conferenceLabel
|
||||
} UNION {
|
||||
?conference core:includesEvent ?presentation
|
||||
} UNION {
|
||||
?conference core:includesEvent ?presentation .
|
||||
?conference rdfs:label ?conferenceLabel
|
||||
}
|
||||
}
|
||||
|
||||
</query-construct>
|
||||
|
||||
<query-construct>
|
||||
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
|
||||
}
|
||||
</query-construct>
|
||||
|
||||
|
||||
|
||||
<template>propStatement-hasPresenterRole.ftl</template>
|
||||
</list-view-config>
|
|
@ -24,13 +24,12 @@
|
|||
OPTIONAL { ?role core:roleIn ?activity
|
||||
LET (?activityName := afn:localname(?activity))
|
||||
OPTIONAL { ?activity rdfs:label ?activityLabel }
|
||||
|
||||
<collated>
|
||||
?activity vitro:mostSpecificType ?subclass
|
||||
</collated>
|
||||
}
|
||||
<collated>
|
||||
OPTIONAL {
|
||||
# ?activity a ?subclass
|
||||
?activity vitro:mostSpecificType ?subclass
|
||||
}
|
||||
</collated>
|
||||
|
||||
OPTIONAL { ?role rdfs:label ?roleLabel }
|
||||
OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval
|
||||
OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue .
|
||||
|
@ -54,12 +53,10 @@
|
|||
CONSTRUCT {
|
||||
?subject ?property ?role .
|
||||
?role core:roleIn ?activity .
|
||||
# ?activity a ?subclass .
|
||||
?activity vitro:mostSpecificType ?subclass .
|
||||
} WHERE {
|
||||
?subject ?property ?role .
|
||||
?role core:roleIn ?activity .
|
||||
# ?activity a ?subclass .
|
||||
?activity vitro:mostSpecificType ?subclass
|
||||
}
|
||||
</query-construct>
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
<#-- $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#hasPresenterRole.
|
||||
|
||||
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>
|
||||
|
||||
<@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??>
|
||||
<a href="${profileUrl(statement.activity)}">${statement.activityLabel!statement.activityName}</a>
|
||||
<#else>
|
||||
<#-- This shouldn't happen, but we must provide for it -->
|
||||
<a href="${profileUrl(statement.role)}">missing activity</a>
|
||||
</#if>
|
||||
</#local>
|
||||
|
||||
<#local dateTime>
|
||||
<@dt.yearSpan statement.dateTimeStart! />
|
||||
</#local>
|
||||
|
||||
${linkedIndividual} ${statement.roleLabel!} ${dateTime!}
|
||||
|
||||
</#macro>
|
|
@ -23,13 +23,8 @@
|
|||
</#if>
|
||||
</#local>
|
||||
|
||||
<#local core = "http://vivoweb.org/ontology/core#">
|
||||
<#local dateTime>
|
||||
<#if statement.property == "${core}hasPresenterRole">
|
||||
<@dt.yearSpan statement.dateTimeStart! />
|
||||
<#else>
|
||||
<@dt.yearIntervalSpan "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" />
|
||||
</#if>
|
||||
<@dt.yearIntervalSpan "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" />
|
||||
</#local>
|
||||
|
||||
${linkedIndividual} ${statement.roleLabel!} ${dateTime!}
|
||||
|
|
Loading…
Add table
Reference in a new issue