NIHVIVO-2605 core:hasPresenterRole custom list view, temporarily without construct queries

This commit is contained in:
ryounes 2011-06-20 23:24:47 +00:00
parent 4b641d5dc7
commit cf82810a5e
3 changed files with 30 additions and 106 deletions

View file

@ -6,6 +6,7 @@
<list-view-config> <list-view-config>
<query-select> <query-select>
PREFIX afn: &lt;http://jena.hpl.hp.com/ARQ/function#&gt; PREFIX afn: &lt;http://jena.hpl.hp.com/ARQ/function#&gt;
PREFIX bibo: &lt;http://purl.org/ontology/bibo/&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt; PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX owl: &lt;http://www.w3.org/2002/07/owl#&gt; PREFIX owl: &lt;http://www.w3.org/2002/07/owl#&gt;
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
@ -14,40 +15,43 @@
SELECT DISTINCT <collated>?subclass</collated> SELECT DISTINCT <collated>?subclass</collated>
?role ?roleLabel ?role ?roleLabel
?presentation ?presentationName ?presentationLabel ?presentation ?presentationName ?presentationLabel
?conference ?conferenceName ?conferenceLabel ?conference ?conferenceLabel
?dateTime
WHERE { WHERE {
?subject ?property ?role ?subject ?property ?role
OPTIONAL { ?role rdfs:label ?roleLabel }
OPTIONAL { ?role core:roleIn ?presentation OPTIONAL { ?role core:roleIn ?presentation
LET (?presentationName := afn:localname(?presentation)) LET (?presentationName := afn:localname(?presentation))
OPTIONAL { ?presentation rdfs:label ?presentationLabel } OPTIONAL { ?presentation rdfs:label ?presentationLabel }
OPTIONAL { ?conference a core:Conference . OPTIONAL { ?conference a bibo:Conference .
LET (?conferenceName := afn:localname(?conference)) OPTIONAL { ?conference rdfs:label ?conferenceLabel }
OPTIONAL { ?conference rdfs:label ?conferenceLabel }
{ ?presentation core:eventWithin ?conference } {
UNION ?presentation core:eventWithin ?conference } UNION {
{ ?conference core:includesEvent ?presentation } ?conference core:includesEvent ?presentation
}
} }
<collated> <collated>
?presentation vitro:mostSpecificType ?subclass . ?presentation vitro:mostSpecificType ?subclass .
{ ?subclass rdfs:subClassOf core:Presentation }
UNION {
{ ?subclass owl:equivalentClass core:Presentation } ?subclass rdfs:subClassOf core:Presentation } UNION {
?subclass owl:equivalentClass core:Presentation
}
</collated> </collated>
} }
OPTIONAL { ?role rdfs:label ?roleLabel }
OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval
OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue . OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue .
?dateTimeStartValue core:dateTime ?dateTimeStart ?dateTimeStartValue core:dateTime ?dateTime
} }
} }
@ -55,94 +59,9 @@
FILTER ( bound(?presentation) ) FILTER ( bound(?presentation) )
</critical-data-required> </critical-data-required>
} ORDER BY <collated>?subclass</collated> DESC(?dateTimeEnd) ?presentationName } ORDER BY <collated>?subclass</collated> DESC(?dateTimeEnd) ?presentationLabel ?presentationName
</query-select> </query-select>
<query-construct>
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX owl: &lt;http://www.w3.org/2002/07/owl#&gt;
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
PREFIX vitro: &lt;http://vitro.mannlib.cornell.edu/ns/vitro/0.7#&gt;
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: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
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: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
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: &lt;http://vivoweb.org/ontology/core#&gt;
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>

View file

@ -15,18 +15,24 @@
next statement --> next statement -->
<#macro showRole statement> <#macro showRole statement>
<#local linkedIndividual> <#local linkedIndividual>
<#if statement.activity??> <#if statement.presentation??>
<a href="${profileUrl(statement.activity)}">${statement.activityLabel!statement.activityName}</a> <a href="${profileUrl(statement.presentation)}">${statement.presentationLabel!statement.presentationName}</a>
<#else> <#else>
<#-- This shouldn't happen, but we must provide for it --> <#-- This shouldn't happen, but we must provide for it -->
<a href="${profileUrl(statement.role)}">missing activity</a> <a href="${profileUrl(statement.role)}">missing presentation</a>
</#if> </#if>
</#local> </#local>
<#local dateTime> <#local dateTime>
<@dt.yearSpan statement.dateTimeStart! /> <@dt.yearSpan statement.dateTime! />
</#local>
<#local conference>
<#if statement.conference?has_content && statement.conferenceLabel?has_content>
<a href="${profileUrl(statement.conference)}">${statement.conferenceLabel}</a>
</#if>
</#local> </#local>
${linkedIndividual} ${statement.roleLabel!} ${dateTime!} <@s.join [ linkedIndividual, statement.roleLabel!, conference! ] /> ${dateTime!}
</#macro> </#macro>

View file

@ -6,7 +6,6 @@
is also used to generate the property statement during a deletion. is also used to generate the property statement during a deletion.
--> -->
<#import "lib-sequence.ftl" as s>
<#import "lib-datetime.ftl" as dt> <#import "lib-datetime.ftl" as dt>
<@showRole statement /> <@showRole statement />