From 4d69f9574bc03939d2b69981118ad9805ea2fc45 Mon Sep 17 00:00:00 2001 From: rjy7 Date: Sat, 8 Jan 2011 00:11:26 +0000 Subject: [PATCH] NIHVIVO-1590 dateTimeValue custom list view finished; dateTimeInterval custom list view in progress. --- .../WEB-INF/ontologies/app/listViewConfig.owl | 8 ++++++ .../listViewConfig-authorInAuthorship.xml | 2 +- .../listViewConfig-dateTimeInterval.xml | 28 +++++++++++++++++++ .../config/listViewConfig-dateTimeValue.xml | 21 ++++++++++++++ .../propStatement-dateTimeInterval.ftl | 11 ++++++++ .../propStatement-dateTimeValue.ftl | 14 ++++++++++ 6 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 productMods/config/listViewConfig-dateTimeInterval.xml create mode 100644 productMods/config/listViewConfig-dateTimeValue.xml create mode 100644 productMods/templates/freemarker/body/partials/individual/propStatement-dateTimeInterval.ftl create mode 100644 productMods/templates/freemarker/body/partials/individual/propStatement-dateTimeValue.ftl diff --git a/productMods/WEB-INF/ontologies/app/listViewConfig.owl b/productMods/WEB-INF/ontologies/app/listViewConfig.owl index b9741f12..69717b7b 100644 --- a/productMods/WEB-INF/ontologies/app/listViewConfig.owl +++ b/productMods/WEB-INF/ontologies/app/listViewConfig.owl @@ -103,4 +103,12 @@ listViewConfig-relatedRole.xml + + + listViewConfig-dateTimeInterval.xml + + + + listViewConfig-dateTimeValue.xml + \ No newline at end of file diff --git a/productMods/config/listViewConfig-authorInAuthorship.xml b/productMods/config/listViewConfig-authorInAuthorship.xml index 94bd87cf..87c115e4 100644 --- a/productMods/config/listViewConfig-authorInAuthorship.xml +++ b/productMods/config/listViewConfig-authorInAuthorship.xml @@ -20,7 +20,7 @@ ?g5 != <http://vitro.mannlib.cornell.edu/default/vitro-kb-inf> ) } OPTIONAL { GRAPH ?g6 { ?infoResource core:dateTimeValue ?dateTimeValue . - ?dateTimeValue core:dateTime ?dateTime . } + ?dateTimeValue core:dateTime ?dateTime . } } } } ORDER BY ?subclass DESC(?dateTime) ?infoResourceName diff --git a/productMods/config/listViewConfig-dateTimeInterval.xml b/productMods/config/listViewConfig-dateTimeInterval.xml new file mode 100644 index 00000000..384ffefd --- /dev/null +++ b/productMods/config/listViewConfig-dateTimeInterval.xml @@ -0,0 +1,28 @@ + + + + + + + + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> + + SELECT DISTINCT ?dateTimeStart ?precisionStart ?dateTimeEnd ?precisionEnd WHERE { + GRAPH ?g1 { ?subject ?property ?dateTimeInterval } + OPTIONAL { GRAPH ?g2 { ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart ; + core:dateTimePrecision ?dateTimePrecisionStart . } + GRAPH ?g3 { ?dateTimePrecisionStart rdfs:label ?precisionStart } + } + OPTIONAL { GRAPH ?g4 { ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd ; + core:dateTimePrecision ?dateTimePrecisionEnd . } + GRAPH ?g5 { ?dateTimePrecisionEnd rdfs:label ?precisionEnd } + } + } + + + + \ No newline at end of file diff --git a/productMods/config/listViewConfig-dateTimeValue.xml b/productMods/config/listViewConfig-dateTimeValue.xml new file mode 100644 index 00000000..2325ca16 --- /dev/null +++ b/productMods/config/listViewConfig-dateTimeValue.xml @@ -0,0 +1,21 @@ + + + + + + + + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> + + SELECT DISTINCT ?dateTime ?precision WHERE { + GRAPH ?g1 { ?subject ?property ?dateTimeValue } + GRAPH ?g2 { ?dateTimeValue core:dateTime ?dateTime ; + core:dateTimePrecision ?dateTimePrecision . } + GRAPH ?g3 { ?dateTimePrecision rdfs:label ?precision } + } + + + + \ No newline at end of file diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-dateTimeInterval.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-dateTimeInterval.ftl new file mode 100644 index 00000000..c053f45d --- /dev/null +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-dateTimeInterval.ftl @@ -0,0 +1,11 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#-- Custom object property statement view for http://vivoweb.org/ontology/core#dateTimeInterval --> + +<#if statement.dateTimeStart??> + ${dateTimeStart} ${precisionStart} + + - +<#if statement.dateTimeEnd??> + ${dateTimeEnd} ${precisionEnd} + \ No newline at end of file diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-dateTimeValue.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-dateTimeValue.ftl new file mode 100644 index 00000000..bfdc687b --- /dev/null +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-dateTimeValue.ftl @@ -0,0 +1,14 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#-- Custom object property statement view for http://vivoweb.org/ontology/core#dateTimeValue --> + +<#import "lib-datetime.ftl" as dt> + +<#-- +${statement.dateTime} ${statement.precision}
+ +<#assign dateTime = statement.dateTime?replace("T", " ")> +${dateTime?datetime("yyyy-MM-dd HH:mm:ss")?string("h:mm a")} --> + + +${dt.formatXsdDateTime(statement.dateTime, statement.precision, "long")} \ No newline at end of file