From 2eb332c74cb4509b9919c08471c584bc00875ea7 Mon Sep 17 00:00:00 2001 From: Tim Worrall Date: Wed, 17 Jun 2015 15:26:50 -0400 Subject: [PATCH] No Jira issue. Fixed an issue caused by webpages having multiple labels. --- productMods/config/listViewConfig-webpage.xml | 11 ++++++----- .../ManageWebpagesForIndividualGenerator.java | 7 ++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/productMods/config/listViewConfig-webpage.xml b/productMods/config/listViewConfig-webpage.xml index 9c97cad7..5cc3ee28 100644 --- a/productMods/config/listViewConfig-webpage.xml +++ b/productMods/config/listViewConfig-webpage.xml @@ -14,18 +14,19 @@ SELECT ?vcard ?link (afn:localname(?link) AS ?linkName) - ?label + (group_concat(distinct ?linkLabel;separator="/") as ?label) ?url ?rank WHERE { ?subject ?property ?vcard . ?vcard vcard:hasURL ?link - OPTIONAL { ?link rdfs:label ?label } + OPTIONAL { ?link rdfs:label ?linkLabel } OPTIONAL { ?link vcard:url ?url } OPTIONAL { ?link core:rank ?rank } FILTER ( bound(?link) ) - } ORDER BY ?rank ?label + } GROUP BY ?vcard ?link ?url ?rank + ORDER BY ?rank ?linkLabel @@ -37,7 +38,7 @@ ?vcard vcard:hasURL ?link . ?link vcard:url ?url . ?link core:rank ?rank . - ?link rdfs:label ?label + ?link rdfs:label ?linkLabel } WHERE { { ?subject ?property ?vcard . @@ -53,7 +54,7 @@ } UNION { ?subject ?property ?vcard . ?vcard vcard:hasURL ?link . - ?link rdfs:label ?label + ?link rdfs:label ?linkLabel } } diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ManageWebpagesForIndividualGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ManageWebpagesForIndividualGenerator.java index b05f9fe3..169b9c1e 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ManageWebpagesForIndividualGenerator.java +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ManageWebpagesForIndividualGenerator.java @@ -95,16 +95,17 @@ public class ManageWebpagesForIndividualGenerator extends BaseEditConfigurationG + "PREFIX vcard: \n" + "PREFIX rdfs: \n" + "PREFIX vitro: \n" - + "SELECT DISTINCT ?vcard ?link ?url ?label ?rank ?typeLabel WHERE { \n" + + "SELECT DISTINCT ?vcard ?link ?url ?rank ?typeLabel (group_concat(distinct ?linkLabel;separator=\"/\") as ?label) WHERE { \n" + " ?subject ?vcard . \n" + " ?vcard vcard:hasURL ?link . \n" + " ?link a vcard:URL \n" + " OPTIONAL { ?link vcard:url ?url } \n" - + " OPTIONAL { ?link rdfs:label ?label } \n" + + " OPTIONAL { ?link rdfs:label ?linkLabel } \n" + " OPTIONAL { ?link core:rank ?rank } \n" + " OPTIONAL { ?link vitro:mostSpecificType ?type } \n" + " OPTIONAL { ?type rdfs:label ?typeLabel } \n" - + "} ORDER BY ?rank"; + + "} GROUP BY ?rank ?vcard ?link ?url ?typeLabel \n" + + " ORDER BY ?rank"; private List> getWebpages(String subjectUri, VitroRequest vreq) {