diff --git a/productMods/config/listViewConfig-hasEditReviewRole.xml b/productMods/config/listViewConfig-hasEditReviewRole.xml index f11161b7..078171b2 100644 --- a/productMods/config/listViewConfig-hasEditReviewRole.xml +++ b/productMods/config/listViewConfig-hasEditReviewRole.xml @@ -14,11 +14,10 @@ PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> - SELECT DISTINCT ?subclass + SELECT DISTINCT ?subclass ?subclassLabel # send the property to the template, since this view supports multiple role properties ?property ?role - ?roleLabel ?activity ?activityName ?activityLabel ?infoResource ?infoResourceName @@ -35,18 +34,22 @@ OPTIONAL { ?role core:forInformationResource ?infoResource LET (?infoResourceName := afn:localname(?infoResource)) OPTIONAL { ?infoResource rdfs:label ?infoResourceLabel } - - + # NB Currently we can only retrieve subclass for either the # infoResource or the activity, but not both. Later, we could have # the query retrieve both and write a custom preprocessor to merge # the results into a single subclass column. ?infoResource vitro:mostSpecificType ?subclass . - ?subclass rdfs:subClassOf bibo:Collection - + + ?subclass rdfs:subClassOf ?superclass + FILTER ( ( ?property = core:hasEditorRole && ?superclass = bibo:Collection ) || + ( ?property = core:hasReviewerRole && ?superclass = core:InformationResource ) + ) + + # Get subclass label for display in uncollated view + ?subclass rdfs:label ?subclassLabel } - OPTIONAL { ?role rdfs:label ?roleLabel } OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue . ?dateTimeStartValue core:dateTime ?dateTimeStart @@ -71,12 +74,15 @@ ?subject ?property ?role . ?role core:forInformationResource ?infoResource . ?infoResource vitro:mostSpecificType ?subclass . - ?subclass rdfs:subClassOf bibo:Collection + ?subclass rdfs:subClassOf ?superclass . + ?subclass rdfs:label ?subclassLabel } WHERE { ?subject ?property ?role . ?role core:forInformationResource ?infoResource . ?infoResource vitro:mostSpecificType ?subclass . - ?subclass rdfs:subClassOf bibo:Collection + ?subclass rdfs:subClassOf ?superclass . + ?subclass rdfs:label ?subclassLabel + FILTER ( ?superclass = bibo:Collection || ?superclass = core:InformationResource ) } diff --git a/productMods/config/listViewConfig-relatedRole.xml b/productMods/config/listViewConfig-relatedRole.xml index 64185fa0..ae24dbb4 100644 --- a/productMods/config/listViewConfig-relatedRole.xml +++ b/productMods/config/listViewConfig-relatedRole.xml @@ -13,6 +13,7 @@ PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> SELECT DISTINCT ?subclass + # send the property to the template, since this view supports multiple role properties ?property ?role ?roleLabel ?roleTypeLabel diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-hasEditReviewRole.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-hasEditReviewRole.ftl index c003fd20..b5587b8c 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-hasEditReviewRole.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-hasEditReviewRole.ftl @@ -9,11 +9,11 @@ <#import "lib-sequence.ftl" as s> <#import "lib-datetime.ftl" as dt> -<@showRole statement /> +<@showRole statement property /> <#-- Use a macro to keep variable assignments local; otherwise the values carry over to the next statement --> -<#macro showRole statement> +<#macro showRole statement property> <#local linkedIndividual> <#if statement.infoResource??> <#if statement.activity??> @@ -23,16 +23,14 @@ <#elseif statement.activity??> ${statement.activityLabel!statement.activityName} - <#else> - ${statement.roleLabel!} - - <#local core = "http://vivoweb.org/ontology/core#"> + <#local dateTime> <@dt.yearIntervalSpan "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" /> - ${linkedIndividual} ${statement.roleLabel!} ${dateTime!} + <#-- If property is collated, then subclass label is redundant information --> + ${linkedIndividual} <#if ! property.collatedBySubclass>${statement.subclassLabel!} ${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 439cafbc..8bbd6cc6 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-hasRole.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-hasRole.ftl @@ -26,6 +26,6 @@ <@dt.yearIntervalSpan "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" /> - ${linkedIndividual} ${statement.roleLabel!} ${dateTime!} + ${linkedIndividual} ${statement.roleLabel!} ${dateTime!} property: ${statement.property!} \ No newline at end of file diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-relatedRole.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-relatedRole.ftl index 8b063e99..224ce8c4 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-relatedRole.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-relatedRole.ftl @@ -10,11 +10,11 @@ <#import "lib-sequence.ftl" as s> <#import "lib-datetime.ftl" as dt> -<@showRole statement /> +<@showRole statement property /> <#-- Use a macro to keep variable assignments local; otherwise the values carry over to the next statement --> -<#macro showRole statement> +<#macro showRole statement property> <#local linkedIndividual> <#if statement.indivInRole??> @@ -29,8 +29,10 @@ so use the type label instead. --> <#local roleLabel> <#if statement.roleLabel?has_content>${statement.roleLabel} - <#-- Display, e.g., "Principal Investigator" for "Principal Investigator Role" --> - <#elseif statement.roleTypeLabel?has_content>${statement.roleTypeLabel?replace(" Role", "")} + <#-- Display, e.g., "Principal Investigator" for "Principal Investigator Role", + "Editor" for "Editor Role". + This information is redundant if the property is collated, since it appears in the subclass label. --> + <#elseif (! property.collatedBySubclass ) && statement.roleTypeLabel?has_content>${statement.roleTypeLabel?replace(" Role", "")}