From a0c88c859ca34140099322c782c91f63b60ead9e Mon Sep 17 00:00:00 2001 From: rjy7 Date: Wed, 22 Dec 2010 22:17:09 +0000 Subject: [PATCH] NIHVIVO-1335, NIHVIVO-1510 Working on authorship list view and collated object properties: some reorganization to handle collated properties, but not displaying as collated yet. --- .../listViewConfig-authorInAuthorship.xml | 18 +++++++++++------- .../listViewConfig-educationalTraining.xml | 10 +++++++--- .../propStatement-authorInAuthorship.ftl | 14 ++++++++++++++ .../propStatement-educationalTraining.ftl | 6 +++--- 4 files changed, 35 insertions(+), 13 deletions(-) diff --git a/productMods/config/listViewConfig-authorInAuthorship.xml b/productMods/config/listViewConfig-authorInAuthorship.xml index d03ab047..7fc20bd5 100644 --- a/productMods/config/listViewConfig-authorInAuthorship.xml +++ b/productMods/config/listViewConfig-authorInAuthorship.xml @@ -17,24 +17,28 @@ from the edit links. - If the linked individual may be missing, the query should select the object's localname using the ARQ localname function, so that the template can display the local name in the absence of - the linked individual. + the linked individual. + - Each assertion or set of optional assertions must reference a different graph variable, so that + we do not impose a requirement about which assertions are in the same graph. --> - + diff --git a/productMods/config/listViewConfig-educationalTraining.xml b/productMods/config/listViewConfig-educationalTraining.xml index e1ea3340..ed65a401 100644 --- a/productMods/config/listViewConfig-educationalTraining.xml +++ b/productMods/config/listViewConfig-educationalTraining.xml @@ -18,7 +18,9 @@ - If the linked individual may be missing, the query should select the object's localname using the ARQ localname function, so that the template can display the local name in the absence of the linked individual. An alternative is to use the localName() method provided to the template - instead. + instead. + - Each assertion or set of optional assertions must reference a different graph variable, so that + we do not impose a requirement about which assertions are in the same graph. --> @@ -30,9 +32,10 @@ SELECT DISTINCT ?edTraining (afn:localname(?edTraining) AS ?edTrainingName) ?org ?orgName ?degreeName ?degreeAbbr ?majorField ?deptOrSchool ?info ?dateTime WHERE { + GRAPH ?g1 { ?subject ?property ?edTraining } OPTIONAL { GRAPH ?g2 { ?edTraining core:trainingAtOrganization ?org . - ?org rdfs:label ?orgName . } } + ?org rdfs:label ?orgName . } } OPTIONAL { GRAPH ?g3 { ?edTraining core:degreeEarned ?degree } } OPTIONAL { GRAPH ?g4 { ?degree rdfs:label ?degreeName } } OPTIONAL { GRAPH ?g5 { ?degree core:abbreviation ?degreeAbbr } } @@ -40,7 +43,8 @@ OPTIONAL { GRAPH ?g7 { ?edTraining core:departmentOrSchool ?deptOrSchool } } OPTIONAL { GRAPH ?g8 { ?edTraining core:supplementalInformation ?info } } OPTIONAL { GRAPH ?g9 { ?edTraining core:hasDateTimeValue ?dateTimeValue . - ?dateTimeValue core:dateTime ?dateTime } } + ?dateTimeValue core:dateTime ?dateTime } } + } ORDER BY DESC(?dateTime) diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-authorInAuthorship.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-authorInAuthorship.ftl index 7ba33325..061a7717 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-authorInAuthorship.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-authorInAuthorship.ftl @@ -5,3 +5,17 @@ <#import "lib-sequence.ftl" as s> <#import "lib-datetime.ftl" as dt> +<#assign linkedIndividual> + <#if statement.infoResource??> + ${statement.infoResourceName} + <#else> + <#-- This shouldn't happen, but we must provide for it --> + (no linked publication) ${statement.authorshipName} + + + +<#if statement.dateTime??> + <#assign year = dt.xsdDateTimeToYear(statement.dateTime)> + + +<@s.join [ linkedIndividual, year! ] /> \ No newline at end of file diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-educationalTraining.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-educationalTraining.ftl index 3281bb24..d7f2a0be 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-educationalTraining.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-educationalTraining.ftl @@ -16,12 +16,12 @@ ${statement.orgName} <#else> <#-- This shouldn't happen, but we must provide for it --> - educational training ${statement.edTrainingName} + (no linked organization) ${statement.edTrainingName} <#if statement.dateTime??> - <#assign dateTime = dt.xsdDateTimeToYear(statement.dateTime)> + <#assign year = dt.xsdDateTimeToYear(statement.dateTime)> -<@s.join [ degree, linkedIndividual, statement.deptOrSchool!, statement.info!, dateTime! ] /> +<@s.join [ degree, linkedIndividual, statement.deptOrSchool!, statement.info!, year! ] />