From 7edc978038c75025c10db8c1e4f5ecd06100bcb9 Mon Sep 17 00:00:00 2001 From: rjy7 Date: Fri, 7 Jan 2011 20:34:30 +0000 Subject: [PATCH] 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. --- productMods/config/listViewConfig-hasRole.xml | 4 ++-- ...listViewConfig-organizationForPosition.xml | 2 +- .../listViewConfig-personInPosition.xml | 2 +- .../config/listViewConfig-relatedRole.xml | 22 +++++++++---------- .../individual/propStatement-hasRole.ftl | 2 +- .../individual/propStatement-relatedRole.ftl | 4 +++- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/productMods/config/listViewConfig-hasRole.xml b/productMods/config/listViewConfig-hasRole.xml index 43a57b98..7792cbe8 100644 --- a/productMods/config/listViewConfig-hasRole.xml +++ b/productMods/config/listViewConfig-hasRole.xml @@ -10,12 +10,12 @@ PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> 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 } OPTIONAL { GRAPH ?g2 { ?role core:roleIn ?activity } 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 ?g6 { ?dateTimeInterval core:start ?dateTimeStartValue . ?dateTimeStartValue core:dateTime ?dateTimeStart } diff --git a/productMods/config/listViewConfig-organizationForPosition.xml b/productMods/config/listViewConfig-organizationForPosition.xml index e6131ee6..aeccd837 100644 --- a/productMods/config/listViewConfig-organizationForPosition.xml +++ b/productMods/config/listViewConfig-organizationForPosition.xml @@ -10,7 +10,7 @@ PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> 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 } OPTIONAL { GRAPH ?g2 { ?position core:positionForPerson ?person } GRAPH ?g3 { ?person rdfs:label ?personName } diff --git a/productMods/config/listViewConfig-personInPosition.xml b/productMods/config/listViewConfig-personInPosition.xml index 6f3344f3..e07bd05d 100644 --- a/productMods/config/listViewConfig-personInPosition.xml +++ b/productMods/config/listViewConfig-personInPosition.xml @@ -10,7 +10,7 @@ PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> 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 } OPTIONAL { GRAPH ?g2 { ?position core:positionInOrganization ?org } GRAPH ?g3 { ?org rdfs:label ?orgName } diff --git a/productMods/config/listViewConfig-relatedRole.xml b/productMods/config/listViewConfig-relatedRole.xml index 1cbbc53b..73dd16e9 100644 --- a/productMods/config/listViewConfig-relatedRole.xml +++ b/productMods/config/listViewConfig-relatedRole.xml @@ -9,8 +9,8 @@ PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> - SELECT DISTINCT ?subclass ?role (afn:localname(?role) AS ?roleName) - ?specificRole ?indivInRole ?indivName ?dateTimeInterval ?dateTimeStart ?dateTimeEnd WHERE { + SELECT DISTINCT ?role (afn:localname(?role) AS ?roleName) + ?roleLabel ?roleTypeLabel ?indivInRole ?indivName ?dateTimeInterval ?dateTimeStart ?dateTimeEnd WHERE { GRAPH ?g1 { ?subject ?property ?role } OPTIONAL { GRAPH ?g2 { ?roleProp rdfs:subPropertyOf core:roleOf } GRAPH ?g3 { ?role ?roleProp ?indivInRole } @@ -18,21 +18,19 @@ ?g3 != <http://vitro.mannlib.cornell.edu/default/vitro-kb-inf> ) GRAPH ?g4 { ?indivInRole rdfs:label ?indivName } } - OPTIONAL { GRAPH ?g5 { ?subclass rdfs:subClassOf core:Role } - GRAPH ?g6 { ?role a ?subclass } - FILTER (?g6 != <http://vitro.mannlib.cornell.edu/default/inferred-tbox> && - ?g6 != <http://vitro.mannlib.cornell.edu/default/vitro-kb-inf> ) + OPTIONAL { GRAPH ?g7 { ?role rdfs:label ?roleLabel } } + OPTIONAL { GRAPH ?g8 { ?role a ?roleType } + GRAPH ?g9 { ?roleType rdfs:label ?roleTypeLabel } } - OPTIONAL { GRAPH ?g7 { ?role rdfs:label ?specificRole } } - OPTIONAL { GRAPH ?g8 { ?role core:dateTimeInterval ?dateTimeInterval } - OPTIONAL { GRAPH ?g9 { ?dateTimeInterval core:start ?dateTimeStartValue . - ?dateTimeStartValue core:dateTime ?dateTimeStart } + OPTIONAL { GRAPH ?g9 { ?role core:dateTimeInterval ?dateTimeInterval } + OPTIONAL { GRAPH ?g10 { ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart } } - OPTIONAL { GRAPH ?g10 { ?dateTimeInterval core:end ?dateTimeEndValue . + OPTIONAL { GRAPH ?g11 { ?dateTimeInterval core:end ?dateTimeEndValue . ?dateTimeEndValue core:dateTime ?dateTimeEnd } } } - } ORDER BY ?subclass DESC(?dateTimeEnd) DESC(?dateTimeStart) ?indivName + } ORDER BY ?indivName ?roleLabel ?roleTypeLabel diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-hasRole.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-hasRole.ftl index 796ee09c..2484e302 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-hasRole.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-hasRole.ftl @@ -20,6 +20,6 @@ - ${linkedIndividual} ${statement.specificRole!} <@dt.yearInterval "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" /> + ${linkedIndividual} ${statement.roleLabel!} <@dt.yearInterval "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" /> \ No newline at end of file diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-relatedRole.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-relatedRole.ftl index 766f2557..0b8c4c89 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-relatedRole.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-relatedRole.ftl @@ -20,6 +20,8 @@ - ${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!}" /> \ No newline at end of file