NIHVIVO-1727 Allow for optional activity label, using activity local name when no label exists.

This commit is contained in:
rjy7 2011-01-31 15:00:24 +00:00
parent a5acc986dd
commit c833e512e2
2 changed files with 5 additions and 4 deletions

View file

@ -11,11 +11,12 @@
SELECT DISTINCT ?role (afn:localname(?role) AS ?roleName) SELECT DISTINCT ?role (afn:localname(?role) AS ?roleName)
?roleLabel ?roleLabel
?activity ?activityName ?activity (afn:localname(?activity) AS ?activityName)
?activityLabel
?dateTimeStart ?dateTimeEnd WHERE { ?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 } OPTIONAL { GRAPH ?g3 { ?activity rdfs:label ?activityLabel } }
} }
OPTIONAL { GRAPH ?g4 { ?role rdfs:label ?roleLabel } } OPTIONAL { GRAPH ?g4 { ?role rdfs:label ?roleLabel } }
OPTIONAL { GRAPH ?g5 { ?role core:dateTimeInterval ?dateTimeInterval } OPTIONAL { GRAPH ?g5 { ?role core:dateTimeInterval ?dateTimeInterval }
@ -26,7 +27,7 @@
GRAPH ?g9 { ?dateTimeEndValue core:dateTime ?dateTimeEnd } GRAPH ?g9 { ?dateTimeEndValue core:dateTime ?dateTimeEnd }
} }
} }
} ORDER BY DESC(?dateTimeEnd) DESC(?dateTimeStart) ?personName } ORDER BY DESC(?dateTimeEnd) DESC(?dateTimeStart) ?activityLabel ?activityName
</query-base> </query-base>
<query-collated> <query-collated>

View file

@ -13,7 +13,7 @@
<#local linkedIndividual> <#local linkedIndividual>
<#if statement.activity??> <#if statement.activity??>
<a href="${profileUrl(statement.activity)}">${statement.activityName}</a> <a href="${profileUrl(statement.activity)}">${statement.activityLabel!statement.activityName}</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)}">${statement.roleName}</a> (no linked activity) <a href="${profileUrl(statement.role)}">${statement.roleName}</a> (no linked activity)