NIHVIVO-1339 In relatedRole view, display role type label if role has no label (for investigator roles and children).

NIHVIVO-1334 Remove terms from SELECT clause that don't get displayed (e.g., dateTimeInterval) but are used to get other terms.
This commit is contained in:
rjy7 2011-01-07 20:34:30 +00:00
parent 3aaed96705
commit 7edc978038
6 changed files with 18 additions and 18 deletions

View file

@ -10,12 +10,12 @@
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
SELECT DISTINCT ?role (afn:localname(?role) AS ?roleName) SELECT DISTINCT ?role (afn:localname(?role) AS ?roleName)
?specificRole ?activity ?activityName ?dateTimeInterval ?dateTimeStart ?dateTimeEnd WHERE { ?roleLabel ?activity ?activityName ?dateTimeStart ?dateTimeEnd WHERE {
GRAPH ?g1 { ?subject ?property ?role } GRAPH ?g1 { ?subject ?property ?role }
OPTIONAL { GRAPH ?g2 { ?role core:roleIn ?activity } OPTIONAL { GRAPH ?g2 { ?role core:roleIn ?activity }
GRAPH ?g3 { ?activity rdfs:label ?activityName } GRAPH ?g3 { ?activity rdfs:label ?activityName }
} }
OPTIONAL { GRAPH ?g4 { ?role rdfs:label ?specificRole } } OPTIONAL { GRAPH ?g4 { ?role rdfs:label ?roleLabel } }
OPTIONAL { GRAPH ?g5 { ?role core:dateTimeInterval ?dateTimeInterval } OPTIONAL { GRAPH ?g5 { ?role core:dateTimeInterval ?dateTimeInterval }
OPTIONAL { GRAPH ?g6 { ?dateTimeInterval core:start ?dateTimeStartValue . OPTIONAL { GRAPH ?g6 { ?dateTimeInterval core:start ?dateTimeStartValue .
?dateTimeStartValue core:dateTime ?dateTimeStart } ?dateTimeStartValue core:dateTime ?dateTimeStart }

View file

@ -10,7 +10,7 @@
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
SELECT DISTINCT ?subclass ?position (afn:localname(?position) AS ?positionName) SELECT DISTINCT ?subclass ?position (afn:localname(?position) AS ?positionName)
?positionTitle ?person ?personName ?dateTimeInterval ?dateTimeStart ?dateTimeEnd WHERE { ?positionTitle ?person ?personName ?dateTimeStart ?dateTimeEnd WHERE {
GRAPH ?g1 { ?subject ?property ?position } GRAPH ?g1 { ?subject ?property ?position }
OPTIONAL { GRAPH ?g2 { ?position core:positionForPerson ?person } OPTIONAL { GRAPH ?g2 { ?position core:positionForPerson ?person }
GRAPH ?g3 { ?person rdfs:label ?personName } GRAPH ?g3 { ?person rdfs:label ?personName }

View file

@ -10,7 +10,7 @@
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
SELECT DISTINCT ?position (afn:localname(?position) AS ?positionName) SELECT DISTINCT ?position (afn:localname(?position) AS ?positionName)
?positionTitle ?org ?orgName ?dateTimeInterval ?dateTimeStart ?dateTimeEnd WHERE { ?positionTitle ?org ?orgName ?dateTimeStart ?dateTimeEnd WHERE {
GRAPH ?g1 { ?subject ?property ?position } GRAPH ?g1 { ?subject ?property ?position }
OPTIONAL { GRAPH ?g2 { ?position core:positionInOrganization ?org } OPTIONAL { GRAPH ?g2 { ?position core:positionInOrganization ?org }
GRAPH ?g3 { ?org rdfs:label ?orgName } GRAPH ?g3 { ?org rdfs:label ?orgName }

View file

@ -9,8 +9,8 @@
PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX core: <http://vivoweb.org/ontology/core#>
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
SELECT DISTINCT ?subclass ?role (afn:localname(?role) AS ?roleName) SELECT DISTINCT ?role (afn:localname(?role) AS ?roleName)
?specificRole ?indivInRole ?indivName ?dateTimeInterval ?dateTimeStart ?dateTimeEnd WHERE { ?roleLabel ?roleTypeLabel ?indivInRole ?indivName ?dateTimeInterval ?dateTimeStart ?dateTimeEnd WHERE {
GRAPH ?g1 { ?subject ?property ?role } GRAPH ?g1 { ?subject ?property ?role }
OPTIONAL { GRAPH ?g2 { ?roleProp rdfs:subPropertyOf core:roleOf } OPTIONAL { GRAPH ?g2 { ?roleProp rdfs:subPropertyOf core:roleOf }
GRAPH ?g3 { ?role ?roleProp ?indivInRole } GRAPH ?g3 { ?role ?roleProp ?indivInRole }
@ -18,21 +18,19 @@
?g3 != <http://vitro.mannlib.cornell.edu/default/vitro-kb-inf> ) ?g3 != <http://vitro.mannlib.cornell.edu/default/vitro-kb-inf> )
GRAPH ?g4 { ?indivInRole rdfs:label ?indivName } GRAPH ?g4 { ?indivInRole rdfs:label ?indivName }
} }
OPTIONAL { GRAPH ?g5 { ?subclass rdfs:subClassOf core:Role } OPTIONAL { GRAPH ?g7 { ?role rdfs:label ?roleLabel } }
GRAPH ?g6 { ?role a ?subclass } OPTIONAL { GRAPH ?g8 { ?role a ?roleType }
FILTER (?g6 != <http://vitro.mannlib.cornell.edu/default/inferred-tbox> && GRAPH ?g9 { ?roleType rdfs:label ?roleTypeLabel }
?g6 != <http://vitro.mannlib.cornell.edu/default/vitro-kb-inf> )
} }
OPTIONAL { GRAPH ?g7 { ?role rdfs:label ?specificRole } } OPTIONAL { GRAPH ?g9 { ?role core:dateTimeInterval ?dateTimeInterval }
OPTIONAL { GRAPH ?g8 { ?role core:dateTimeInterval ?dateTimeInterval } OPTIONAL { GRAPH ?g10 { ?dateTimeInterval core:start ?dateTimeStartValue .
OPTIONAL { GRAPH ?g9 { ?dateTimeInterval core:start ?dateTimeStartValue .
?dateTimeStartValue core:dateTime ?dateTimeStart } ?dateTimeStartValue core:dateTime ?dateTimeStart }
} }
OPTIONAL { GRAPH ?g10 { ?dateTimeInterval core:end ?dateTimeEndValue . OPTIONAL { GRAPH ?g11 { ?dateTimeInterval core:end ?dateTimeEndValue .
?dateTimeEndValue core:dateTime ?dateTimeEnd } ?dateTimeEndValue core:dateTime ?dateTimeEnd }
} }
} }
} ORDER BY ?subclass DESC(?dateTimeEnd) DESC(?dateTimeStart) ?indivName } ORDER BY ?indivName ?roleLabel ?roleTypeLabel
</query> </query>
<template>propStatement-relatedRole.ftl</template> <template>propStatement-relatedRole.ftl</template>

View file

@ -20,6 +20,6 @@
</#if> </#if>
</#local> </#local>
${linkedIndividual} ${statement.specificRole!} <@dt.yearInterval "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" /> ${linkedIndividual} ${statement.roleLabel!} <@dt.yearInterval "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" />
</#macro> </#macro>

View file

@ -20,6 +20,8 @@
</#if> </#if>
</#local> </#local>
${linkedIndividual} ${statement.specificRole!} <@dt.yearInterval "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" /> <#-- Generally roles are assigned a label when entered through a custom form. Investigator and its subclasses do not,
so use the type label instead. -->
${linkedIndividual} ${statement.roleLabel!statement.roleTypeLabel!} <@dt.yearInterval "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" />
</#macro> </#macro>