From 31cb81dec6edd8ead49b4f698384071da0d28646 Mon Sep 17 00:00:00 2001 From: rjy7 Date: Tue, 18 Jan 2011 00:25:43 +0000 Subject: [PATCH] NIHVIVO-1665 Handle display core:DateTimeValue with core:dateTime data prop but no precision, and with neither precision nor dateTime data prop. DateTimeValues as part of DateTimeIntervals not handled yet. --- productMods/config/listViewConfig-dateTimeValue.xml | 7 ++++--- productMods/config/listViewConfig-relatedRole.xml | 3 ++- .../partials/individual/propStatement-dateTimeValue.ftl | 7 ++++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/productMods/config/listViewConfig-dateTimeValue.xml b/productMods/config/listViewConfig-dateTimeValue.xml index 653ea916..2d53aff3 100644 --- a/productMods/config/listViewConfig-dateTimeValue.xml +++ b/productMods/config/listViewConfig-dateTimeValue.xml @@ -9,10 +9,11 @@ PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> - SELECT DISTINCT ?dateTime (afn:localname(?dateTimePrecision) AS ?precision) WHERE { + SELECT DISTINCT ?dateTimeValue (afn:localname(?dateTimeValue) AS ?dateTimeValueName) + (afn:localname(?dateTimePrecision) AS ?precision) ?dateTime WHERE { GRAPH ?g1 { ?subject ?property ?dateTimeValue } - GRAPH ?g2 { ?dateTimeValue core:dateTime ?dateTime ; - core:dateTimePrecision ?dateTimePrecision . } + OPTIONAL { GRAPH ?g2 { ?dateTimeValue core:dateTime ?dateTime } } + OPTIONAL { GRAPH ?g3 { ?dateTimeValue core:dateTimePrecision ?dateTimePrecision } } } diff --git a/productMods/config/listViewConfig-relatedRole.xml b/productMods/config/listViewConfig-relatedRole.xml index 73dd16e9..d4f32cb4 100644 --- a/productMods/config/listViewConfig-relatedRole.xml +++ b/productMods/config/listViewConfig-relatedRole.xml @@ -10,7 +10,8 @@ PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> SELECT DISTINCT ?role (afn:localname(?role) AS ?roleName) - ?roleLabel ?roleTypeLabel ?indivInRole ?indivName ?dateTimeInterval ?dateTimeStart ?dateTimeEnd WHERE { + ?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 } diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-dateTimeValue.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-dateTimeValue.ftl index 4fb04f6a..036363d6 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-dateTimeValue.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-dateTimeValue.ftl @@ -4,4 +4,9 @@ <#import "lib-datetime.ftl" as dt> -${dt.formatXsdDateTimeLong(statement.dateTime, statement.precision)} +<#-- No core:dateTime data property assigned. Display a link to the core:DateTimeValue object --> +<#if ! statement.dateTime??> + ${localName(statement.dateTimeValue)} (incomplete data) +<#else> + ${dt.formatXsdDateTimeLong(statement.dateTime, statement.precision!)} + \ No newline at end of file