From 95e336d862f723e9c5804f793ef6ea9309b1937e Mon Sep 17 00:00:00 2001 From: Graham Triggs Date: Thu, 19 Oct 2017 11:21:37 +0100 Subject: [PATCH] List view improvements for Vitro --- .../FoafNameToRdfsLabelPreprocessor.java | 5 ++- .../config/listViewConfig-dataDefault.xml | 8 ---- .../webapp/config/listViewConfig-default.xml | 44 +++++-------------- .../config/listViewConfig-hasElement.xml | 28 +++++------- 4 files changed, 26 insertions(+), 59 deletions(-) diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/FoafNameToRdfsLabelPreprocessor.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/FoafNameToRdfsLabelPreprocessor.java index 04f4da2a7..6df463d72 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/FoafNameToRdfsLabelPreprocessor.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/FoafNameToRdfsLabelPreprocessor.java @@ -39,7 +39,10 @@ public class FoafNameToRdfsLabelPreprocessor implements ModelChangePreprocessor "?individualVcard ?fullName ." + "?fullName ?firstName ." + "?fullName ?lastName ." + - "OPTIONAL {?subject ?middleName .}" + + "OPTIONAL {" + + "?subject ?individualVcard ." + + "?individualVcard ?fullName ." + + "?fullName ?middleName .}" + "}"; return queryStr; } diff --git a/webapp/src/main/webapp/config/listViewConfig-dataDefault.xml b/webapp/src/main/webapp/config/listViewConfig-dataDefault.xml index 0cbd35396..87f324c26 100644 --- a/webapp/src/main/webapp/config/listViewConfig-dataDefault.xml +++ b/webapp/src/main/webapp/config/listViewConfig-dataDefault.xml @@ -15,13 +15,5 @@ } ORDER BY ?value - - CONSTRUCT { - ?subject ?property ?value - } WHERE { - ?subject ?property ?value - } - - diff --git a/webapp/src/main/webapp/config/listViewConfig-default.xml b/webapp/src/main/webapp/config/listViewConfig-default.xml index c23d9dea1..53862de20 100644 --- a/webapp/src/main/webapp/config/listViewConfig-default.xml +++ b/webapp/src/main/webapp/config/listViewConfig-default.xml @@ -14,16 +14,20 @@ SELECT ?subclass ?object ?label - ?localName WHERE { - - ?subject ?property ?object - LET (?localName := afn:localname(?object)) + ?localName + WHERE { + ?subject ?property ?object . + LET (?localName := afn:localname(?object)) - OPTIONAL { ?object rdfs:label ?label } + OPTIONAL { + ?subject ?property ?object . + ?object rdfs:label ?label . + } - OPTIONAL { - ?object a ?subclass. + OPTIONAL { + ?subject ?property ?object . + ?object a ?subclass . # Require the subclasses retrieved to be in a classgroup, since others are not generally # for display. See vivo-dev-all thread titled "Internal Entity and mostSpecificType," # Aug 9-10, 2011. @@ -35,31 +39,5 @@ } ORDER BY ?subclass ASC( ?label ) ASC( ?label ) ASC( ?localName ) - - PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> - PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> - - CONSTRUCT { - ?subject ?property ?object . - ?object a ?subclass . - ?subclass vitro:inClassGroup ?classgroup . - ?object rdfs:label ?label . - } WHERE { - { - ?subject ?property ?object - } UNION { - ?subject ?property ?object . - ?object a ?subclass . - } UNION { - ?subject ?property ?object . - ?object a ?subclass . - ?subclass vitro:inClassGroup ?classgroup - } UNION { - ?subject ?property ?object . - ?object rdfs:label ?label . - } - } - - diff --git a/webapp/src/main/webapp/config/listViewConfig-hasElement.xml b/webapp/src/main/webapp/config/listViewConfig-hasElement.xml index bb2f1fca3..e566427a5 100644 --- a/webapp/src/main/webapp/config/listViewConfig-hasElement.xml +++ b/webapp/src/main/webapp/config/listViewConfig-hasElement.xml @@ -13,25 +13,19 @@ SELECT ?menuItem (afn:localname(?menuItem) AS ?menuItemName) ?linkText - ?menuPosition WHERE { - ?subject ?property ?menuItem - OPTIONAL { ?menuItem display:linkText ?linkText } - OPTIONAL { ?menuItem display:menuPosition ?menuPosition } + ?menuPosition + WHERE { + ?subject ?property ?menuItem . + OPTIONAL { + ?subject ?property ?menuItem . + ?menuItem display:linkText ?linkText . + } + OPTIONAL { + ?subject ?property ?menuItem . + ?menuItem display:menuPosition ?menuPosition . + } } ORDER BY ?menuPosition - - CONSTRUCT { - ?subject ?property ?menuItem . - ?menuItem ?menuItemProp ?menuItemObj - } WHERE { - { ?subject ?property ?menuItem } - UNION { - ?subject ?property ?menuItem . - ?menuItem ?menuItemProp ?menuItemObj - } - } - -