From 482992f837f49e5aa989bb0bfc1c73767fb84dc1 Mon Sep 17 00:00:00 2001 From: ryounes Date: Mon, 20 Jun 2011 17:04:12 +0000 Subject: [PATCH] NIHVIVO-2605 Initial version of list view for core:hasPresenterRole --- .../WEB-INF/ontologies/app/listViewConfig.owl | 8 +- .../listViewConfig-hasEditReviewRole.xml | 8 +- .../listViewConfig-hasPresenterRole.xml | 150 ++++++++++++++++++ productMods/config/listViewConfig-hasRole.xml | 13 +- .../propStatement-hasPresenterRole.ftl | 32 ++++ .../individual/propStatement-hasRole.ftl | 9 +- 6 files changed, 196 insertions(+), 24 deletions(-) create mode 100644 productMods/config/listViewConfig-hasPresenterRole.xml create mode 100644 productMods/templates/freemarker/body/partials/individual/propStatement-hasPresenterRole.ftl diff --git a/productMods/WEB-INF/ontologies/app/listViewConfig.owl b/productMods/WEB-INF/ontologies/app/listViewConfig.owl index 1d24d0cb..6c73b821 100644 --- a/productMods/WEB-INF/ontologies/app/listViewConfig.owl +++ b/productMods/WEB-INF/ontologies/app/listViewConfig.owl @@ -90,10 +90,6 @@ listViewConfig-hasRole.xml - - - listViewConfig-hasRole.xml - listViewConfig-hasRole.xml @@ -110,6 +106,10 @@ + + listViewConfig-hasPresenterRole.xml + + + + + + + + PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX owl: <http://www.w3.org/2002/07/owl#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> + + SELECT DISTINCT ?subclass + ?role ?roleLabel + ?presentation ?presentationName ?presentationLabel + ?conference ?conferenceName ?conferenceLabel + + WHERE { + + ?subject ?property ?role + + OPTIONAL { ?role core:roleIn ?presentation + LET (?presentationName := afn:localname(?presentation)) + + OPTIONAL { ?presentation rdfs:label ?presentationLabel } + + OPTIONAL { ?conference a core:Conference . + LET (?conferenceName := afn:localname(?conference)) + OPTIONAL { ?conference rdfs:label ?conferenceLabel } + + { ?presentation core:eventWithin ?conference } + UNION + { ?conference core:includesEvent ?presentation } + + } + + + ?presentation vitro:mostSpecificType ?subclass . + { ?subclass rdfs:subClassOf core:Presentation } + UNION + { ?subclass owl:equivalentClass core:Presentation } + + + } + + OPTIONAL { ?role rdfs:label ?roleLabel } + OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval + OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + } + + + FILTER ( bound(?presentation) ) + + + } ORDER BY ?subclass DESC(?dateTimeEnd) ?presentationName + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX owl: <http://www.w3.org/2002/07/owl#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> + + CONSTRUCT { + ?subject ?property ?role . + ?role core:roleIn ?presentation . + ?presentation vitro:mostSpecificType ?subclass . + } WHERE { + ?subject ?property ?role . + ?role core:roleIn ?presentation . + ?presentation vitro:mostSpecificType ?subclass . + { ?subclass rdfs:subClassOf core:Presentation } + UNION + { ?subclass owl:equivalentClass core:Presentation } + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + CONSTRUCT { + ?subject ?property ?role . + ?role ?roleProperty ?roleValue . + ?presentation rdfs:label ?presentationLabel + } WHERE { + { + ?subject ?property ?role + } UNION { + ?subject ?property ?role . + ?role ?roleProperty ?roleValue + } UNION { + ?subject ?property ?role . + ?role core:roleIn ?presentation . + ?presentation rdfs:label ?presentationLabel + } + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + + CONSTRUCT { + ?subject ?property ?role . + ?conference a core:Conference . + ?presentation core:eventWithin ?conference . + ?conference core:includesEvent ?presentation . + ?conference rdfs:label ?conferenceLabel + } WHERE { + ?subject ?property ?presentation . + ?role core:roleIn ?presentation . + ?conference a core:Conference . + + { + ?presentation core:eventWithin ?conference + } UNION { + ?presentation core:eventWithin ?conference . + ?conference rdfs:label ?conferenceLabel + } UNION { + ?conference core:includesEvent ?presentation + } UNION { + ?conference core:includesEvent ?presentation . + ?conference rdfs:label ?conferenceLabel + } + } + + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subject ?property ?role . + ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } WHERE { + ?subject ?property ?role . + ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + + + + + + \ No newline at end of file diff --git a/productMods/config/listViewConfig-hasRole.xml b/productMods/config/listViewConfig-hasRole.xml index 65cc61bd..2929068d 100644 --- a/productMods/config/listViewConfig-hasRole.xml +++ b/productMods/config/listViewConfig-hasRole.xml @@ -24,13 +24,12 @@ OPTIONAL { ?role core:roleIn ?activity LET (?activityName := afn:localname(?activity)) OPTIONAL { ?activity rdfs:label ?activityLabel } + + + ?activity vitro:mostSpecificType ?subclass + } - - OPTIONAL { - # ?activity a ?subclass - ?activity vitro:mostSpecificType ?subclass - } - + OPTIONAL { ?role rdfs:label ?roleLabel } OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue . @@ -54,12 +53,10 @@ CONSTRUCT { ?subject ?property ?role . ?role core:roleIn ?activity . - # ?activity a ?subclass . ?activity vitro:mostSpecificType ?subclass . } WHERE { ?subject ?property ?role . ?role core:roleIn ?activity . - # ?activity a ?subclass . ?activity vitro:mostSpecificType ?subclass } diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-hasPresenterRole.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-hasPresenterRole.ftl new file mode 100644 index 00000000..1ec9cdad --- /dev/null +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-hasPresenterRole.ftl @@ -0,0 +1,32 @@ +<#-- $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#hasPresenterRole. + + This template must be self-contained and not rely on other variables set for the individual page, because it + is also used to generate the property statement during a deletion. + --> + +<#import "lib-sequence.ftl" as s> +<#import "lib-datetime.ftl" as dt> + +<@showRole statement /> + +<#-- Use a macro to keep variable assignments local; otherwise the values carry over to the + next statement --> +<#macro showRole statement> + <#local linkedIndividual> + <#if statement.activity??> + ${statement.activityLabel!statement.activityName} + <#else> + <#-- This shouldn't happen, but we must provide for it --> + missing activity + + + + <#local dateTime> + <@dt.yearSpan statement.dateTimeStart! /> + + + ${linkedIndividual} ${statement.roleLabel!} ${dateTime!} + + \ No newline at end of file diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-hasRole.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-hasRole.ftl index d654aa91..7b4f386a 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-hasRole.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-hasRole.ftl @@ -23,15 +23,10 @@ - <#local core = "http://vivoweb.org/ontology/core#"> <#local dateTime> - <#if statement.property == "${core}hasPresenterRole"> - <@dt.yearSpan statement.dateTimeStart! /> - <#else> - <@dt.yearIntervalSpan "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" /> - + <@dt.yearIntervalSpan "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" /> - + ${linkedIndividual} ${statement.roleLabel!} ${dateTime!} \ No newline at end of file