From c4f01e9cb01e5a40ed155c9bf6d0e20508afb661 Mon Sep 17 00:00:00 2001 From: Tim Worrall Date: Wed, 16 Jul 2014 16:07:59 -0400 Subject: [PATCH] VIVO-829: update editor of list view to use full citation. Just cause. --- .../config/listViewConfig-editorship.xml | 159 +++++++++++++++++- .../individual/propStatement-editorship.ftl | 67 +++++++- rdf/display/everytime/PropertyConfig.n3 | 2 + 3 files changed, 218 insertions(+), 10 deletions(-) diff --git a/productMods/config/listViewConfig-editorship.xml b/productMods/config/listViewConfig-editorship.xml index cda8e845..c61d8e5d 100644 --- a/productMods/config/listViewConfig-editorship.xml +++ b/productMods/config/listViewConfig-editorship.xml @@ -16,12 +16,36 @@ ?editorship ?infoResource ?infoResourceName ?dateTime + ?journal + ?volume + ?startPage + ?endPage + ?publisher + ?locale + ?appearsIn + ?partOf WHERE { ?subject ?property ?editorship . ?editorship core:relates ?infoResource . ?infoResource a <http://purl.obolibrary.org/obo/IAO_0000030> . ?infoResource rdfs:label ?infoResourceName . + OPTIONAL { ?infoResource bibo:volume ?volume } + OPTIONAL { ?infoResource bibo:pageStart ?startPage } + OPTIONAL { ?infoResource bibo:pageEnd ?endPage } + OPTIONAL { ?infoResource core:placeOfPublication ?locale } + OPTIONAL { ?infoResource bibo:reproducedIn ?appearsInObj . + ?appearsInObj rdfs:label ?appearsIn + } + OPTIONAL { ?infoResource core:publisher ?publisherObj . + ?publisherObj rdfs:label ?publisher + } + OPTIONAL { ?infoResource <http://purl.obolibrary.org/obo/BFO_0000050> ?partOfObj . + ?partOfObj rdfs:label ?partOf + } + OPTIONAL { ?infoResource core:hasPublicationVenue ?publishedIn . + ?publishedIn rdfs:label ?journal + } OPTIONAL { ?infoResource vitro:mostSpecificType ?subclass } OPTIONAL { ?infoResource core:dateTimeValue ?dateTimeValue . ?dateTimeValue core:dateTime ?dateTime @@ -58,31 +82,148 @@ PREFIX bibo: <http://purl.org/ontology/bibo/> CONSTRUCT { ?subject ?property ?editorship . + ?editorship a core:Editorship . + ?editorship ?editorshipProperty ?editorshipValue . ?editorship core:relates ?infoResource . ?infoResource a <http://purl.obolibrary.org/obo/IAO_0000030> . ?infoResource rdfs:label ?infoResourceName . - ?infoResource core:dateTimeValue ?dateTimeValue . - ?dateTimeValue core:dateTime ?dateTime + ?infoResource core:hasPublicationVenue ?publishedIn . + ?publishedIn rdfs:label ?journal } WHERE { { ?subject ?property ?editorship . ?editorship a core:Editorship } UNION { + ?subject ?property ?editorship . + ?editorship a core:Editorship . + ?editorship ?editorshipProperty ?editorshipValue + } UNION { + ?subject ?property ?editorship . + ?editorship a core:Editorship . + ?editorship core:relates ?infoResource . + ?infoResource a <http://purl.obolibrary.org/obo/IAO_0000030> + } UNION { ?subject ?property ?editorship . ?editorship a core:Editorship . ?editorship core:relates ?infoResource . ?infoResource a <http://purl.obolibrary.org/obo/IAO_0000030> . ?infoResource rdfs:label ?infoResourceName } UNION { - ?subject ?property ?editorship . - ?editorship a core:Editorship . - ?editorship core:relates ?infoResource . - ?infoResource a <http://purl.obolibrary.org/obo/IAO_0000030> . - ?infoResource core:dateTimeValue ?dateTimeValue . - ?dateTimeValue core:dateTime ?dateTime + ?subject ?property ?editorship . + ?editorship a core:Editorship . + ?editorship core:relates ?infoResource . + ?infoResource a <http://purl.obolibrary.org/obo/IAO_0000030> . + ?infoResource core:hasPublicationVenue ?publishedIn + } UNION { + ?subject ?property ?editorship . + ?editorship a core:Editorship . + ?editorship core:relates ?infoResource . + ?infoResource a <http://purl.obolibrary.org/obo/IAO_0000030> . + ?infoResource core:hasPublicationVenue ?publishedIn . + ?publishedIn rdfs:label ?journal } - } + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX bibo: <http://purl.org/ontology/bibo/> + PREFIX foaf: <http://xmlns.com/foaf/0.1/> + CONSTRUCT { + ?subject ?property ?editorship . + ?editorship a core:Editorship . + ?editorship ?editorshipProperty ?editorshipValue . + ?editorship core:relates ?infoResource . + ?infoResource a <http://purl.obolibrary.org/obo/IAO_0000030> . + ?infoResource ?infoResourceProperty ?infoResourceValue . + ?infoResource bibo:reproducedIn ?appearsInObj . + ?infoResource core:publisher ?publisherObj . + ?infoResource core:relatedBy ?editorship . + ?editorship a core:Editorship . + ?editorship core:relates ?editorObj . + ?editorObj a foaf:Person . + ?infoResource <http://purl.obolibrary.org/obo/BFO_0000050> ?partOfObj . + ?appearsInObj rdfs:label ?appearsIn . + ?publisherObj rdfs:label ?publisher . + ?editorObj rdfs:label ?editor . + ?partOfObj rdfs:label ?partOf + } WHERE { + { + ?subject ?property ?editorship . + ?editorship a core:Editorship + } + UNION { + ?subject ?property ?editorship . + ?editorship a core:Editorship . + ?editorship ?editorshipProperty ?editorshipValue + } UNION { + ?subject ?property ?editorship . + ?editorship a core:Editorship . + ?editorship core:relates ?infoResource . + ?infoResource a <http://purl.obolibrary.org/obo/IAO_0000030> . + } UNION { + ?subject ?property ?editorship . + ?editorship a core:Editorship . + ?editorship core:relates ?infoResource . + ?infoResource a <http://purl.obolibrary.org/obo/IAO_0000030> . + ?infoResource ?infoResourceProperty ?infoResourceValue + } UNION { + ?subject ?property ?editorship . + ?editorship a core:Editorship . + ?editorship core:relates ?infoResource . + ?infoResource a <http://purl.obolibrary.org/obo/IAO_0000030> . + ?infoResource bibo:reproducedIn ?appearsInObj . + ?appearsInObj rdfs:label ?appearsIn + } UNION { + ?subject ?property ?editorship . + ?editorship a core:Editorship . + ?editorship core:relates ?infoResource . + ?infoResource a <http://purl.obolibrary.org/obo/IAO_0000030> . + ?infoResource core:publisher ?publisherObj . + ?publisherObj rdfs:label ?publisher + } UNION { + ?subject ?property ?editorship . + ?editorship a core:Editorship . + ?editorship core:relates ?infoResource . + ?infoResource a <http://purl.obolibrary.org/obo/IAO_0000030> . + ?infoResource core:relatedBy ?editorship . + ?editorship a core:Editorship . + ?editorship core:relates ?editorObj . + ?editorObj a foaf:Person . + ?editorObj rdfs:label ?editor + } UNION { + ?subject ?property ?editorship . + ?editorship a core:Editorship . + ?editorship core:relates ?infoResource . + ?infoResource a <http://purl.obolibrary.org/obo/IAO_0000030> . + ?infoResource <http://purl.obolibrary.org/obo/BFO_0000050> ?partOfObj . + ?partOfObj rdfs:label ?partOf + } + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX bibo: <http://purl.org/ontology/bibo/> + CONSTRUCT { + ?subject ?property ?editorship . + ?editorship core:relates ?infoResource . + ?infoResource a <http://purl.obolibrary.org/obo/IAO_0000030> . + ?infoResource rdfs:label ?infoResourceName . + ?infoResource core:dateTimeValue ?dateTimeValue . + ?dateTimeValue core:dateTime ?dateTime + } WHERE { + ?subject ?property ?editorship . + ?editorship a core:Editorship . + ?editorship core:relates ?infoResource . + ?infoResource a <http://purl.obolibrary.org/obo/IAO_0000030> . + ?infoResource rdfs:label ?infoResourceName . + ?infoResource core:dateTimeValue ?dateTimeValue . + ?dateTimeValue core:dateTime ?dateTime + } diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-editorship.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-editorship.ftl index 1e04bde5..322c025b 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-editorship.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-editorship.ftl @@ -14,6 +14,71 @@ <#-- Use a macro to keep variable assignments local; otherwise the values carry over to the next statement --> <#macro showEditorship statement> +<#local citationDetails> + <#if statement.subclass??> + <#if statement.subclass?contains("Article")> + <#if statement.journal??> + ${statement.journal!}.  + <#if statement.volume?? && statement.startPage?? && statement.endPage??> + ${statement.volume!}:${statement.startPage!}-${statement.endPage!}. + <#elseif statement.volume?? && statement.startPage??> + ${statement.volume!}:${statement.startPage!}. + <#elseif statement.volume??> + ${statement.volume!}. + <#elseif statement.startPage?? && statement.endPage??> + ${statement.startPage!}-${statement.endPage!}. + <#elseif statement.startPage??> + ${statement.startPage!}. + + + <#elseif statement.subclass?contains("Chapter")> + <#if statement.journal??> + ${statement.journal!}. + <#elseif statement.appearsIn??> + ${statement.appearsIn!}. + <#elseif statement.partOf??> + ${statement.partOf!}. + + <#if statement.locale?? && statement.publisher??> + ${statement.locale!}: ${statement.publisher!}. + <#elseif statement.locale??> + ${statement.locale!}. + <#elseif statement.publisher??> + ${statement.publisher!}. + + <#if statement.startPage?? && statement.endPage??> + ${statement.startPage!}-${statement.endPage!}. + <#elseif statement.startPage??> + ${statement.startPage!}. + + <#elseif statement.subclass?contains("Book")> + <#if statement.volume?? && (statement.volume!?length > 0 )> + ${i18n().volume_abbreviated} ${statement.volume!}.  + + <#if statement.locale?? && statement.publisher??> + ${statement.locale!}: ${statement.publisher!}. + <#elseif statement.locale??> + ${statement.locale!}. + <#elseif statement.publisher??> + ${statement.publisher!}. + + <#else> + <#if statement.journal??> + ${statement.journal!}. + <#elseif statement.appearsIn??> + ${statement.appearsIn!}. + <#elseif statement.partOf??> + ${statement.partOf!}. + + <#if statement.startPage?? && statement.endPage??> + ${statement.startPage!}-${statement.endPage!}. + <#elseif statement.startPage??> + ${statement.startPage!}. + + + + + <#local resourceTitle> <#if statement.infoResource??> <#if citationDetails?has_content> @@ -27,5 +92,5 @@ - ${resourceTitle} <@dt.yearSpan "${statement.dateTime!}" /> + ${resourceTitle} ${citationDetails} <@dt.yearSpan "${statement.dateTime!}" /> diff --git a/rdf/display/everytime/PropertyConfig.n3 b/rdf/display/everytime/PropertyConfig.n3 index f8bc0c66..1d408364 100644 --- a/rdf/display/everytime/PropertyConfig.n3 +++ b/rdf/display/everytime/PropertyConfig.n3 @@ -634,6 +634,8 @@ local:editorOfConfig a :ObjectPropertyDisplayConfig ; :listViewConfigFile "listViewConfig-editorship.xml"^^xsd:string ; :displayName "editor of" ; vitro:displayRankAnnot 20; + vitro:collateBySubclassAnnot + "true"^^xsd:boolean; vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddEditorshipToPersonGenerator"^^ ;