From 8511073240657108c4ce243f1a4c32e5fb74a78e Mon Sep 17 00:00:00 2001 From: alessandroGalasso <45561775+alessandroGalasso@users.noreply.github.com> Date: Wed, 20 Mar 2019 18:22:35 +0100 Subject: [PATCH] [VIVO-1641] Replace afn:localname / afn:namespace with cross-platform equivalent (#96) * Update listViewConfig-default.xml * 1641 repalce localname * [VIVO-1641] REPLACE jena afn with cross-platform regex Resolves https://jira.duraspace.org/browse/VIVO-1641 --- .../webapp/controller/ajax/GeoFocusMapLocations.java | 3 +-- .../ManageGrantsForIndividualController.java | 1 - .../ManagePeopleForOrganizationController.java | 1 - .../ManagePublicationsForIndividualController.java | 1 - .../AddAuthorsToInformationResourceGenerator.java | 4 +--- .../AddEditorsToInformationResourceGenerator.java | 4 +--- .../webapp/visualization/constants/QueryConstants.java | 1 - .../main/webapp/config/listViewConfig-adviseeIn.xml | 4 ++-- .../main/webapp/config/listViewConfig-advisorIn.xml | 3 +-- .../webapp/config/listViewConfig-dateTimeInterval.xml | 10 +++++----- .../webapp/config/listViewConfig-dateTimeValue.xml | 4 ++-- .../src/main/webapp/config/listViewConfig-default.xml | 6 +++--- .../config/listViewConfig-fauxPropertyDefault.xml | 6 +++--- .../config/listViewConfig-hasAssociatedConcept.xml | 4 ++-- .../webapp/config/listViewConfig-hasAttendeeRole.xml | 4 ++-- .../listViewConfig-hasCoPrincipalInvestigatorRole.xml | 6 +++--- .../webapp/config/listViewConfig-hasEditorRole.xml | 4 ++-- .../config/listViewConfig-hasInvestigatorRole.xml | 6 +++--- .../webapp/config/listViewConfig-hasPresenterRole.xml | 4 ++-- .../listViewConfig-hasPrincipalInvestigatorRole.xml | 6 +++--- .../webapp/config/listViewConfig-hasReviewerRole.xml | 4 ++-- .../webapp/config/listViewConfig-issuedCredential.xml | 6 +++--- .../main/webapp/config/listViewConfig-rangeUnion.xml | 6 +++--- .../main/webapp/config/listViewConfig-relatedRole.xml | 4 ++-- .../src/main/webapp/config/listViewConfig-webpage.xml | 4 ++-- 25 files changed, 48 insertions(+), 58 deletions(-) diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/ajax/GeoFocusMapLocations.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/ajax/GeoFocusMapLocations.java index 7b9f6c36..ea5d56dd 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/ajax/GeoFocusMapLocations.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/ajax/GeoFocusMapLocations.java @@ -31,8 +31,7 @@ public class GeoFocusMapLocations extends AbstractAjaxResponder { + "PREFIX core: \n" + "PREFIX foaf: \n" + "PREFIX vivoc: \n" - + "PREFIX afn: " - + "SELECT DISTINCT ?label ?location (afn:localname(?location) AS ?localName) (COUNT(DISTINCT ?person) AS ?count) \n" + + "SELECT DISTINCT ?label ?location (REPLACE(STR(?location),\"^.*(#)(.*)$\", \"$2\") AS ?localName) (COUNT(DISTINCT ?person) AS ?count) \n" + "WHERE { { \n" + " ?location rdf:type core:GeographicRegion . \n" + " ?location rdfs:label ?label . \n" diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/freemarker/ManageGrantsForIndividualController.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/freemarker/ManageGrantsForIndividualController.java index 37da3f2b..6a5024b0 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/freemarker/ManageGrantsForIndividualController.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/freemarker/ManageGrantsForIndividualController.java @@ -69,7 +69,6 @@ public class ManageGrantsForIndividualController extends FreemarkerHttpServlet { + "PREFIX core: \n" + "PREFIX rdfs: \n" + "PREFIX vitro: \n" - + "PREFIX afn: \n" + "SELECT DISTINCT ?subclass ?role (str(?label2) as ?label) ?activity ?hideThis WHERE { \n" + " ?subject ?role . \n" + " ?role a core:ResearcherRole . \n" diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/freemarker/ManagePeopleForOrganizationController.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/freemarker/ManagePeopleForOrganizationController.java index 2029d788..dc68d76d 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/freemarker/ManagePeopleForOrganizationController.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/freemarker/ManagePeopleForOrganizationController.java @@ -69,7 +69,6 @@ public class ManagePeopleForOrganizationController extends FreemarkerHttpServlet + "PREFIX core: \n" + "PREFIX rdfs: \n" + "PREFIX vitro: \n" - + "PREFIX afn: \n" + "PREFIX foaf: \n" + "SELECT DISTINCT ?subclass ?position ?positionLabel (str(?label) as ?name) ?person ?hideThis WHERE { \n" + " ?subject core:relatedBy ?position . \n" diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/freemarker/ManagePublicationsForIndividualController.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/freemarker/ManagePublicationsForIndividualController.java index dd4f339d..6e003852 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/freemarker/ManagePublicationsForIndividualController.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/freemarker/ManagePublicationsForIndividualController.java @@ -69,7 +69,6 @@ public class ManagePublicationsForIndividualController extends FreemarkerHttpSer + "PREFIX core: \n" + "PREFIX rdfs: \n" + "PREFIX vitro: \n" - + "PREFIX afn: \n" + "SELECT DISTINCT ?subclass ?authorship (str(?label) as ?title) ?pub ?hideThis WHERE { \n" + " ?subject core:relatedBy ?authorship . \n" + " ?authorship a core:Authorship . \n" diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddAuthorsToInformationResourceGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddAuthorsToInformationResourceGenerator.java index 52ca4d18..baf0b552 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddAuthorsToInformationResourceGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddAuthorsToInformationResourceGenerator.java @@ -346,7 +346,6 @@ public class AddAuthorsToInformationResourceGenerator extends VivoBaseGenerator private static String AUTHORSHIPS_MODEL = " \n" + "PREFIX core: \n" - + "PREFIX afn: \n" + "PREFIX rdfs: \n" + "PREFIX foaf: \n" + "PREFIX vcard: \n" @@ -412,11 +411,10 @@ public class AddAuthorsToInformationResourceGenerator extends VivoBaseGenerator private static String AUTHORSHIPS_QUERY = " \n" + "PREFIX core: \n" - + "PREFIX afn: \n" + "PREFIX rdfs: \n" + "PREFIX foaf: \n" + "PREFIX vcard: \n" - + "SELECT ?authorshipURI (afn:localname(?authorshipURI) AS ?authorshipName) ?authorURI ?authorName ?rank \n" + + "SELECT ?authorshipURI (REPLACE(STR(?authorshipURI),\"^.*(#)(.*)$\", \"$2\") AS ?authorshipName) ?authorURI ?authorName ?rank \n" + "WHERE { { \n" + " ?subject core:relatedBy ?authorshipURI . \n" + " ?authorshipURI a core:Authorship . \n" diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddEditorsToInformationResourceGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddEditorsToInformationResourceGenerator.java index 56835612..dad9147f 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddEditorsToInformationResourceGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddEditorsToInformationResourceGenerator.java @@ -309,7 +309,6 @@ public class AddEditorsToInformationResourceGenerator extends VivoBaseGenerator private static String EDITORSHIPS_MODEL = "" + "PREFIX core: \n" - + "PREFIX afn: \n" + "PREFIX rdfs: \n" + "PREFIX foaf: \n" + "CONSTRUCT\n" @@ -347,10 +346,9 @@ public class AddEditorsToInformationResourceGenerator extends VivoBaseGenerator private static String EDITORSHIPS_QUERY = "" + "PREFIX core: \n" - + "PREFIX afn: \n" + "PREFIX rdfs: \n" + "PREFIX foaf: \n" - + "SELECT ?editorshipURI (afn:localname(?editorshipURI) AS ?editorshipName) ?editorURI ?editorName ?rank \n" + + "SELECT ?editorshipURI (REPLACE(STR(?editorshipURI),\"^.*(#)(.*)$\", \"$2\") AS ?editorshipName) ?editorURI ?editorName ?rank \n" + "WHERE { \n" + "?subject core:relatedBy ?editorshipURI . \n" + "?editorshipURI a core:Editorship . \n" diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/constants/QueryConstants.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/constants/QueryConstants.java index b6103813..6ff33808 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/constants/QueryConstants.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/constants/QueryConstants.java @@ -41,7 +41,6 @@ public class QueryConstants { put("vivo", "http://vivo.library.cornell.edu/ns/0.1#"); put("geo", "http://aims.fao.org/aos/geopolitical.owl#"); put("public", "http://vitro.mannlib.cornell.edu/ns/vitro/public#"); - put("afn", "http://jena.apache.org/ARQ/function#"); put("vivosocnet", "http://vivo.cns.iu.edu/ns/#"); put("obo", "http://purl.obolibrary.org/obo/"); put("vcard", "http://www.w3.org/2006/vcard/ns#"); diff --git a/webapp/src/main/webapp/config/listViewConfig-adviseeIn.xml b/webapp/src/main/webapp/config/listViewConfig-adviseeIn.xml index d8331a7a..57320ed9 100644 --- a/webapp/src/main/webapp/config/listViewConfig-adviseeIn.xml +++ b/webapp/src/main/webapp/config/listViewConfig-adviseeIn.xml @@ -6,7 +6,7 @@ PREFIX foaf: <http://xmlns.com/foaf/0.1/> - PREFIX afn: <http://jena.apache.org/ARQ/function#> + PREFIX bibo: <http://purl.org/ontology/bibo/> PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX owl: <http://www.w3.org/2002/07/owl#> @@ -31,7 +31,7 @@ ?adviseeRole a core:AdviseeRole . ?adviseeRole core:relatedBy ?advisingRel . ?advisingRel a core:AdvisingRelationship . - LET ( ?localName := afn:localname(?advisingRel) ) + LET ( ?localName := REPLACE(STR(?advisingRel),"^.*(#)(.*)$", "$2") ) OPTIONAL { ?subject ?property ?adviseeRole . ?adviseeRole a core:AdviseeRole . diff --git a/webapp/src/main/webapp/config/listViewConfig-advisorIn.xml b/webapp/src/main/webapp/config/listViewConfig-advisorIn.xml index 03e0c8d4..689f8ab8 100644 --- a/webapp/src/main/webapp/config/listViewConfig-advisorIn.xml +++ b/webapp/src/main/webapp/config/listViewConfig-advisorIn.xml @@ -6,7 +6,6 @@ PREFIX foaf: <http://xmlns.com/foaf/0.1/> - PREFIX afn: <http://jena.apache.org/ARQ/function#> PREFIX bibo: <http://purl.org/ontology/bibo/> PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX owl: <http://www.w3.org/2002/07/owl#> @@ -31,7 +30,7 @@ ?advisorRole a core:AdvisorRole . ?advisorRole core:relatedBy ?advisingRel . ?advisingRel a core:AdvisingRelationship . - LET ( ?localName := afn:localname(?advisingRel) ) + LET ( ?localName := REPLACE(STR(?advisingRel),"^.*(#)(.*)$", "$2") ) OPTIONAL { ?subject ?property ?advisorRole . ?advisorRole a core:AdvisorRole . diff --git a/webapp/src/main/webapp/config/listViewConfig-dateTimeInterval.xml b/webapp/src/main/webapp/config/listViewConfig-dateTimeInterval.xml index 65fecfbe..cc614d4c 100644 --- a/webapp/src/main/webapp/config/listViewConfig-dateTimeInterval.xml +++ b/webapp/src/main/webapp/config/listViewConfig-dateTimeInterval.xml @@ -7,7 +7,7 @@ PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX core: <http://vivoweb.org/ontology/core#> - PREFIX afn: <http://jena.apache.org/ARQ/function#> + SELECT DISTINCT ?dateTimeInterval ?label ?valueStart ?valueStartName @@ -24,7 +24,7 @@ OPTIONAL { ?subject ?property ?dateTimeInterval . ?dateTimeInterval core:start ?valueStart . - LET (?valueStartName := afn:localname(?valueStart)) + LET (?valueStartName := REPLACE(STR(?valueStart),"^.*(#)(.*)$", "$2")) OPTIONAL { ?subject ?property ?dateTimeInterval . @@ -35,13 +35,13 @@ ?subject ?property ?dateTimeInterval . ?dateTimeInterval core:start ?valueStart . ?valueStart core:dateTimePrecision ?dateTimePrecisionStart . - LET (?precisionStart := afn:localname(?dateTimePrecisionStart)) + LET (?precisionStart := REPLACE(STR(?dateTimePrecisionStart),"^.*(#)(.*)$", "$2")) } } OPTIONAL { ?subject ?property ?dateTimeInterval . ?dateTimeInterval core:end ?valueEnd . - LET (?valueEndName := afn:localname(?valueEnd)) + LET (?valueEndName := REPLACE(STR(?valueEnd),"^.*(#)(.*)$", "$2")) OPTIONAL { ?subject ?property ?dateTimeInterval . ?dateTimeInterval core:end ?valueEnd . @@ -51,7 +51,7 @@ ?subject ?property ?dateTimeInterval . ?dateTimeInterval core:end ?valueEnd . ?valueEnd core:dateTimePrecision ?dateTimePrecisionEnd . - LET (?precisionEnd := afn:localname(?dateTimePrecisionEnd)) + LET (?precisionEnd := REPLACE(STR(?dateTimePrecisionEnd),"^.*(#)(.*)$", "$2")) } } OPTIONAL { diff --git a/webapp/src/main/webapp/config/listViewConfig-dateTimeValue.xml b/webapp/src/main/webapp/config/listViewConfig-dateTimeValue.xml index 249836ee..59c77030 100644 --- a/webapp/src/main/webapp/config/listViewConfig-dateTimeValue.xml +++ b/webapp/src/main/webapp/config/listViewConfig-dateTimeValue.xml @@ -7,10 +7,10 @@ PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX core: <http://vivoweb.org/ontology/core#> - PREFIX afn: <http://jena.apache.org/ARQ/function#> + SELECT DISTINCT ?dateTimeValue - (afn:localname(?dateTimePrecision) AS ?precision) + (REPLACE(STR(?dateTimePrecision),"^.*(#)(.*)$", "$2") AS ?precision) ?dateTime WHERE { ?subject ?property ?dateTimeValue . diff --git a/webapp/src/main/webapp/config/listViewConfig-default.xml b/webapp/src/main/webapp/config/listViewConfig-default.xml index ac2128c8..46d9825f 100644 --- a/webapp/src/main/webapp/config/listViewConfig-default.xml +++ b/webapp/src/main/webapp/config/listViewConfig-default.xml @@ -7,7 +7,7 @@ - PREFIX afn: <http://jena.apache.org/ARQ/function#> + PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> @@ -25,7 +25,7 @@ WHERE { ?subject ?property ?object . - LET (?localName := afn:localname(?object)) + LET (?localName := REPLACE(STR(?object), "^.*(#)(.*)$", "$2")) OPTIONAL { ?subject ?property ?object . @@ -57,7 +57,7 @@ } - FILTER ( afn:namespace(?subclass) != "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#" ) + FILTER ( REPLACE(STR(?subclass),"^(.*)(#)(.*)$", "$1$2") != "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#" ) # Order by ?type is important, because if the object has more than one mostSpecificType, diff --git a/webapp/src/main/webapp/config/listViewConfig-fauxPropertyDefault.xml b/webapp/src/main/webapp/config/listViewConfig-fauxPropertyDefault.xml index 2ac5658d..c7ede94f 100644 --- a/webapp/src/main/webapp/config/listViewConfig-fauxPropertyDefault.xml +++ b/webapp/src/main/webapp/config/listViewConfig-fauxPropertyDefault.xml @@ -7,7 +7,7 @@ - PREFIX afn: <http://jena.apache.org/ARQ/function#> + PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> @@ -26,7 +26,7 @@ { ?subject ?property ?object . ?object a ?objectType . - LET (?localName := afn:localname(?object)) + LET (?localName := REPLACE(STR(?object),"^.*(#)(.*)$", "$2")) OPTIONAL { ?subject ?property ?object . @@ -63,7 +63,7 @@ ?object a ?objectType . ?object a ?subclass . } - FILTER ( afn:namespace(?subclass) != "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#" ) + FILTER ( REPLACE(STR(?subclass),"^(.*)(#)(.*)$", "$1$2") != "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#" ) # Order by ?type is important, because if the object has more than one mostSpecificType, diff --git a/webapp/src/main/webapp/config/listViewConfig-hasAssociatedConcept.xml b/webapp/src/main/webapp/config/listViewConfig-hasAssociatedConcept.xml index 5dc30ebe..c7c036f2 100644 --- a/webapp/src/main/webapp/config/listViewConfig-hasAssociatedConcept.xml +++ b/webapp/src/main/webapp/config/listViewConfig-hasAssociatedConcept.xml @@ -8,12 +8,12 @@ PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX vivo: <http://vivoweb.org/ontology/core#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> - PREFIX afn: <http://jena.apache.org/ARQ/function#> + SELECT ?concept ?conceptLabel ?conceptName ?vocabularySource ?vocabularySourceName WHERE { ?subject ?property ?concept . - LET (?conceptName := afn:localname(?concept)) + LET (?conceptName := REPLACE(STR(?concept),"^.*(#)(.*)$", "$2")) OPTIONAL { ?subject ?property ?concept . ?concept rdfs:label ?conceptLabel . diff --git a/webapp/src/main/webapp/config/listViewConfig-hasAttendeeRole.xml b/webapp/src/main/webapp/config/listViewConfig-hasAttendeeRole.xml index 70bb38b2..4bc8616f 100644 --- a/webapp/src/main/webapp/config/listViewConfig-hasAttendeeRole.xml +++ b/webapp/src/main/webapp/config/listViewConfig-hasAttendeeRole.xml @@ -5,7 +5,7 @@ - PREFIX afn: <http://jena.apache.org/ARQ/function#> + PREFIX bibo: <http://purl.org/ontology/bibo/> PREFIX vivo: <http://vivoweb.org/ontology/core#> PREFIX owl: <http://www.w3.org/2002/07/owl#> @@ -55,7 +55,7 @@ } - LET (?event1Name := afn:localname(?event1)) + LET (?event1Name := REPLACE(STR(?event1),"^.*(#)(.*)$", "$2")) OPTIONAL { diff --git a/webapp/src/main/webapp/config/listViewConfig-hasCoPrincipalInvestigatorRole.xml b/webapp/src/main/webapp/config/listViewConfig-hasCoPrincipalInvestigatorRole.xml index 720a3879..5c53b029 100644 --- a/webapp/src/main/webapp/config/listViewConfig-hasCoPrincipalInvestigatorRole.xml +++ b/webapp/src/main/webapp/config/listViewConfig-hasCoPrincipalInvestigatorRole.xml @@ -5,7 +5,7 @@ - PREFIX afn: <http://jena.apache.org/ARQ/function#> + PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> @@ -32,7 +32,7 @@ ?role core:relatedBy ?activity . ?activity a core:Contract . ?activity rdfs:label ?activityLabel . - LET (?activityName := afn:localname(?activity)) . + LET (?activityName := REPLACE(STR(?activity),"^.*(#)(.*)$", "$2")) . } OPTIONAL { ?subject ?property ?role . @@ -40,7 +40,7 @@ ?role core:relatedBy ?activity . ?activity a core:Grant . ?activity rdfs:label ?activityLabel . - LET (?activityName := afn:localname(?activity)) . + LET (?activityName := REPLACE(STR(?activity),"^.*(#)(.*)$", "$2")) . } OPTIONAL { ?subject ?property ?role . diff --git a/webapp/src/main/webapp/config/listViewConfig-hasEditorRole.xml b/webapp/src/main/webapp/config/listViewConfig-hasEditorRole.xml index 0586eab0..f5a204df 100644 --- a/webapp/src/main/webapp/config/listViewConfig-hasEditorRole.xml +++ b/webapp/src/main/webapp/config/listViewConfig-hasEditorRole.xml @@ -5,7 +5,7 @@ - PREFIX afn: <http://jena.apache.org/ARQ/function#> + PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> @@ -14,7 +14,7 @@ ?role ?subclassLabel ?activity - (afn:localname(?activity) AS ?activityLocal) + (REPLACE(STR(?activity),"^.*(#)(.*)$", "$2") AS ?activityLocal) ?activityName ?dateTimeStart ?dateTimeEnd diff --git a/webapp/src/main/webapp/config/listViewConfig-hasInvestigatorRole.xml b/webapp/src/main/webapp/config/listViewConfig-hasInvestigatorRole.xml index f4549c46..e6e6eac4 100644 --- a/webapp/src/main/webapp/config/listViewConfig-hasInvestigatorRole.xml +++ b/webapp/src/main/webapp/config/listViewConfig-hasInvestigatorRole.xml @@ -5,7 +5,7 @@ - PREFIX afn: <http://jena.apache.org/ARQ/function#> + PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> @@ -32,7 +32,7 @@ ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . ?activity a core:Contract . ?activity rdfs:label ?activityLabel . - LET (?activityName := afn:localname(?activity)) + LET (?activityName := REPLACE(STR(?activity),"^.*(#)(.*)$", "$2")) } OPTIONAL { ?subject ?property ?role . @@ -57,7 +57,7 @@ ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . ?activity a core:Grant . ?activity rdfs:label ?activityLabel . - LET (?activityName := afn:localname(?activity)) + LET (?activityName := REPLACE(STR(?activity),"^.*(#)(.*)$", "$2")) } OPTIONAL { ?subject ?property ?role . diff --git a/webapp/src/main/webapp/config/listViewConfig-hasPresenterRole.xml b/webapp/src/main/webapp/config/listViewConfig-hasPresenterRole.xml index d83fb462..c14ca951 100644 --- a/webapp/src/main/webapp/config/listViewConfig-hasPresenterRole.xml +++ b/webapp/src/main/webapp/config/listViewConfig-hasPresenterRole.xml @@ -8,7 +8,7 @@ - PREFIX afn: <http://jena.apache.org/ARQ/function#> + PREFIX bibo: <http://purl.org/ontology/bibo/> PREFIX vivo: <http://vivoweb.org/ontology/core#> PREFIX owl: <http://www.w3.org/2002/07/owl#> @@ -38,7 +38,7 @@ ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . ?presentation a vivo:Presentation . ?presentation rdfs:label ?presentationLabel . - LET (?presentationName := afn:localname(?presentation)) + LET (?presentationName := REPLACE(STR(?presentation),"^.*(#)(.*)$", "$2")) } OPTIONAL { ?subject ?property ?role . diff --git a/webapp/src/main/webapp/config/listViewConfig-hasPrincipalInvestigatorRole.xml b/webapp/src/main/webapp/config/listViewConfig-hasPrincipalInvestigatorRole.xml index c120ea34..d7742082 100644 --- a/webapp/src/main/webapp/config/listViewConfig-hasPrincipalInvestigatorRole.xml +++ b/webapp/src/main/webapp/config/listViewConfig-hasPrincipalInvestigatorRole.xml @@ -5,7 +5,7 @@ - PREFIX afn: <http://jena.apache.org/ARQ/function#> + PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> @@ -34,7 +34,7 @@ ?role core:relatedBy ?activity . ?activity a core:Contract . ?activity rdfs:label ?activityLabel . - LET (?activityName := afn:localname(?activity)) . + LET (?activityName := REPLACE(STR(?activity),"^.*(#)(.*)$", "$2")) . } OPTIONAL { ?subject ?property ?role . @@ -59,7 +59,7 @@ ?role core:relatedBy ?activity . ?activity a core:Grant . ?activity rdfs:label ?activityLabel . - LET (?activityName := afn:localname(?activity)) . + LET (?activityName := REPLACE(STR(?activity),"^.*(#)(.*)$", "$2")) . } OPTIONAL { ?subject ?property ?role . diff --git a/webapp/src/main/webapp/config/listViewConfig-hasReviewerRole.xml b/webapp/src/main/webapp/config/listViewConfig-hasReviewerRole.xml index 76642ecc..81e587c2 100644 --- a/webapp/src/main/webapp/config/listViewConfig-hasReviewerRole.xml +++ b/webapp/src/main/webapp/config/listViewConfig-hasReviewerRole.xml @@ -5,7 +5,7 @@ - PREFIX afn: <http://jena.apache.org/ARQ/function#> + PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> @@ -14,7 +14,7 @@ ?role ?subclassLabel ?activity - (afn:localname(?activity) AS ?activityLocal) + (REPLACE(STR(?activity),"^.*(#)(.*)$", "$2") AS ?activityLocal) ?activityName ?dateTimeStart ?dateTimeEnd diff --git a/webapp/src/main/webapp/config/listViewConfig-issuedCredential.xml b/webapp/src/main/webapp/config/listViewConfig-issuedCredential.xml index d4d93eb0..0cc27b44 100644 --- a/webapp/src/main/webapp/config/listViewConfig-issuedCredential.xml +++ b/webapp/src/main/webapp/config/listViewConfig-issuedCredential.xml @@ -6,7 +6,7 @@ PREFIX foaf: <http://xmlns.com/foaf/0.1/> - PREFIX afn: <http://jena.apache.org/ARQ/function#> + PREFIX bibo: <http://purl.org/ontology/bibo/> PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX owl: <http://www.w3.org/2002/07/owl#> @@ -26,7 +26,7 @@ WHERE { ?subject ?property ?issuedCredential . ?issuedCredential a core:IssuedCredential . - LET (?issuedCredentialLocal := afn:localname(?issuedCredential)) + LET (?issuedCredentialLocal := REPLACE(STR(?issuedCredential),"^.*(#)(.*)$", "$2")) OPTIONAL { ?subject ?property ?issuedCredential . ?issuedCredential a core:IssuedCredential . @@ -39,7 +39,7 @@ ?credential a core:Credential . ?credential core:relatedBy ?issuedCredential . ?credential rdfs:label ?credentialLabel . - LET (?credentialLocal := afn:localname(?credential)) + LET (?credentialLocal := REPLACE(STR(?credential),"^.*(#)(.*)$", "$2")) } OPTIONAL { ?subject ?property ?issuedCredential . diff --git a/webapp/src/main/webapp/config/listViewConfig-rangeUnion.xml b/webapp/src/main/webapp/config/listViewConfig-rangeUnion.xml index 969bcb8f..236fde80 100644 --- a/webapp/src/main/webapp/config/listViewConfig-rangeUnion.xml +++ b/webapp/src/main/webapp/config/listViewConfig-rangeUnion.xml @@ -7,7 +7,7 @@ - PREFIX afn: <http://jena.apache.org/ARQ/function#> + PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> @@ -24,7 +24,7 @@ WHERE { ?subject ?property ?object . - LET (?localName := afn:localname(?object)) + LET (?localName := REPLACE(STR(?object),"^.*(#)(.*)$", "$2")) OPTIONAL { ?subject ?property ?object . @@ -50,7 +50,7 @@ } - FILTER ( afn:namespace(?subclass) != "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#" ) + FILTER ( REPLACE(STR(?subclass),"^(.*)(#)(.*)$", "$1$2") != "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#" ) # Order by ?type is important, because if the object has more than one mostSpecificType, diff --git a/webapp/src/main/webapp/config/listViewConfig-relatedRole.xml b/webapp/src/main/webapp/config/listViewConfig-relatedRole.xml index 9d3a7df8..55bbe9b7 100644 --- a/webapp/src/main/webapp/config/listViewConfig-relatedRole.xml +++ b/webapp/src/main/webapp/config/listViewConfig-relatedRole.xml @@ -8,7 +8,7 @@ PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX core: <http://vivoweb.org/ontology/core#> - PREFIX afn: <http://jena.apache.org/ARQ/function#> + PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> @@ -18,7 +18,7 @@ ?property ?role ?roleLabel ?roleTypeLabel - ?indivInRole (afn:localname(?indivInRole) AS ?indivName) + ?indivInRole (REPLACE(STR(?indivInRole),"^.*(#)(.*)$", "$2") AS ?indivName) ?indivLabel ?dateTimeInterval ?dateTimeStart ?dateTimeEnd ?objectType WHERE { diff --git a/webapp/src/main/webapp/config/listViewConfig-webpage.xml b/webapp/src/main/webapp/config/listViewConfig-webpage.xml index 31db7f01..9fb75901 100644 --- a/webapp/src/main/webapp/config/listViewConfig-webpage.xml +++ b/webapp/src/main/webapp/config/listViewConfig-webpage.xml @@ -7,13 +7,13 @@ - PREFIX afn: <http://jena.apache.org/ARQ/function#> + PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> SELECT ?vcard ?link - (afn:localname(?link) AS ?linkName) + (REPLACE(STR(?link),"^.*(#)(.*)$", "$2") AS ?linkName) (group_concat(distinct ?linkLabel;separator="/") as ?label) ?url ?rank