[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
This commit is contained in:
alessandroGalasso 2019-03-20 18:22:35 +01:00 committed by Andrew Woods
parent 5dfa919ec7
commit 8511073240
25 changed files with 48 additions and 58 deletions

View file

@ -6,7 +6,7 @@
<list-view-config>
<query-select>
PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/&gt;
PREFIX afn: &lt;http://jena.apache.org/ARQ/function#&gt;
PREFIX bibo: &lt;http://purl.org/ontology/bibo/&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX owl: &lt;http://www.w3.org/2002/07/owl#&gt;
@ -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 {
<precise-subquery>?subject ?property ?adviseeRole .
?adviseeRole a core:AdviseeRole .

View file

@ -6,7 +6,6 @@
<list-view-config>
<query-select>
PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/&gt;
PREFIX afn: &lt;http://jena.apache.org/ARQ/function#&gt;
PREFIX bibo: &lt;http://purl.org/ontology/bibo/&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX owl: &lt;http://www.w3.org/2002/07/owl#&gt;
@ -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 {
<precise-subquery>?subject ?property ?advisorRole .
?advisorRole a core:AdvisorRole .

View file

@ -7,7 +7,7 @@
<query-select>
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX afn: &lt;http://jena.apache.org/ARQ/function#&gt;
SELECT DISTINCT ?dateTimeInterval ?label
?valueStart ?valueStartName
@ -24,7 +24,7 @@
OPTIONAL {
<precise-subquery>?subject ?property ?dateTimeInterval .</precise-subquery>
?dateTimeInterval core:start ?valueStart .
LET (?valueStartName := afn:localname(?valueStart))
LET (?valueStartName := REPLACE(STR(?valueStart),"^.*(#)(.*)$", "$2"))
OPTIONAL {
<precise-subquery>?subject ?property ?dateTimeInterval .
@ -35,13 +35,13 @@
<precise-subquery>?subject ?property ?dateTimeInterval .
?dateTimeInterval core:start ?valueStart .</precise-subquery>
?valueStart core:dateTimePrecision ?dateTimePrecisionStart .
LET (?precisionStart := afn:localname(?dateTimePrecisionStart))
LET (?precisionStart := REPLACE(STR(?dateTimePrecisionStart),"^.*(#)(.*)$", "$2"))
}
}
OPTIONAL {
<precise-subquery>?subject ?property ?dateTimeInterval .</precise-subquery>
?dateTimeInterval core:end ?valueEnd .
LET (?valueEndName := afn:localname(?valueEnd))
LET (?valueEndName := REPLACE(STR(?valueEnd),"^.*(#)(.*)$", "$2"))
OPTIONAL {
<precise-subquery>?subject ?property ?dateTimeInterval .
?dateTimeInterval core:end ?valueEnd .</precise-subquery>
@ -51,7 +51,7 @@
<precise-subquery>?subject ?property ?dateTimeInterval .
?dateTimeInterval core:end ?valueEnd .</precise-subquery>
?valueEnd core:dateTimePrecision ?dateTimePrecisionEnd .
LET (?precisionEnd := afn:localname(?dateTimePrecisionEnd))
LET (?precisionEnd := REPLACE(STR(?dateTimePrecisionEnd),"^.*(#)(.*)$", "$2"))
}
}
OPTIONAL {

View file

@ -7,10 +7,10 @@
<query-select>
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX afn: &lt;http://jena.apache.org/ARQ/function#&gt;
SELECT DISTINCT ?dateTimeValue
(afn:localname(?dateTimePrecision) AS ?precision)
(REPLACE(STR(?dateTimePrecision),"^.*(#)(.*)$", "$2") AS ?precision)
?dateTime
WHERE {
?subject ?property ?dateTimeValue .

View file

@ -7,7 +7,7 @@
<list-view-config>
<query-select>
PREFIX afn: &lt;http://jena.apache.org/ARQ/function#&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/&gt;
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
@ -25,7 +25,7 @@
WHERE
{
?subject ?property ?object .
LET (?localName := afn:localname(?object))
LET (?localName := REPLACE(STR(?object), "^.*(#)(.*)$", "$2"))
OPTIONAL {
<precise-subquery>?subject ?property ?object .</precise-subquery>
@ -57,7 +57,7 @@
}
<collated>
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#" )
</collated>
# Order by ?type is important, because if the object has more than one mostSpecificType,

View file

@ -7,7 +7,7 @@
<list-view-config>
<query-select>
PREFIX afn: &lt;http://jena.apache.org/ARQ/function#&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/&gt;
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
@ -26,7 +26,7 @@
{
?subject ?property ?object .
?object a ?objectType .
LET (?localName := afn:localname(?object))
LET (?localName := REPLACE(STR(?object),"^.*(#)(.*)$", "$2"))
OPTIONAL {
<precise-subquery>?subject ?property ?object .
@ -63,7 +63,7 @@
?object a ?objectType .</precise-subquery>
?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#" )
</collated>
# Order by ?type is important, because if the object has more than one mostSpecificType,

View file

@ -8,12 +8,12 @@
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
PREFIX vivo: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX rdf: &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt;
PREFIX afn: &lt;http://jena.apache.org/ARQ/function#&gt;
SELECT ?concept ?conceptLabel ?conceptName ?vocabularySource ?vocabularySourceName
WHERE {
?subject ?property ?concept .
LET (?conceptName := afn:localname(?concept))
LET (?conceptName := REPLACE(STR(?concept),"^.*(#)(.*)$", "$2"))
OPTIONAL {
<precise-subquery>?subject ?property ?concept .</precise-subquery>
?concept rdfs:label ?conceptLabel .

View file

@ -5,7 +5,7 @@
<list-view-config>
<query-select>
PREFIX afn: &lt;http://jena.apache.org/ARQ/function#&gt;
PREFIX bibo: &lt;http://purl.org/ontology/bibo/&gt;
PREFIX vivo: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX owl: &lt;http://www.w3.org/2002/07/owl#&gt;
@ -55,7 +55,7 @@
}
</collated>
LET (?event1Name := afn:localname(?event1))
LET (?event1Name := REPLACE(STR(?event1),"^.*(#)(.*)$", "$2"))
OPTIONAL {
<precise-subquery>

View file

@ -5,7 +5,7 @@
<list-view-config>
<query-select>
PREFIX afn: &lt;http://jena.apache.org/ARQ/function#&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/&gt;
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
@ -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 {
<precise-subquery>?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 {
<precise-subquery>?subject ?property ?role .

View file

@ -5,7 +5,7 @@
<list-view-config>
<query-select>
PREFIX afn: &lt;http://jena.apache.org/ARQ/function#&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
PREFIX vitro: &lt;http://vitro.mannlib.cornell.edu/ns/vitro/0.7#&gt;
@ -14,7 +14,7 @@
?role
?subclassLabel
?activity
(afn:localname(?activity) AS ?activityLocal)
(REPLACE(STR(?activity),"^.*(#)(.*)$", "$2") AS ?activityLocal)
?activityName
?dateTimeStart
?dateTimeEnd

View file

@ -5,7 +5,7 @@
<list-view-config>
<query-select>
PREFIX afn: &lt;http://jena.apache.org/ARQ/function#&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/&gt;
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
@ -32,7 +32,7 @@
?role &lt;http://vivoweb.org/ontology/core#relatedBy&gt; ?activity .
?activity a core:Contract .
?activity rdfs:label ?activityLabel .
LET (?activityName := afn:localname(?activity))
LET (?activityName := REPLACE(STR(?activity),"^.*(#)(.*)$", "$2"))
}
OPTIONAL {
<precise-subquery>?subject ?property ?role .
@ -57,7 +57,7 @@
?role &lt;http://vivoweb.org/ontology/core#relatedBy&gt; ?activity .
?activity a core:Grant .
?activity rdfs:label ?activityLabel .
LET (?activityName := afn:localname(?activity))
LET (?activityName := REPLACE(STR(?activity),"^.*(#)(.*)$", "$2"))
}
OPTIONAL {
<precise-subquery>?subject ?property ?role .

View file

@ -8,7 +8,7 @@
<list-view-config>
<query-select>
PREFIX afn: &lt;http://jena.apache.org/ARQ/function#&gt;
PREFIX bibo: &lt;http://purl.org/ontology/bibo/&gt;
PREFIX vivo: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX owl: &lt;http://www.w3.org/2002/07/owl#&gt;
@ -38,7 +38,7 @@
?role &lt;http://purl.obolibrary.org/obo/BFO_0000054&gt; ?presentation .
?presentation a vivo:Presentation .
?presentation rdfs:label ?presentationLabel .
LET (?presentationName := afn:localname(?presentation))
LET (?presentationName := REPLACE(STR(?presentation),"^.*(#)(.*)$", "$2"))
}
OPTIONAL {
<precise-subquery>?subject ?property ?role .

View file

@ -5,7 +5,7 @@
<list-view-config>
<query-select>
PREFIX afn: &lt;http://jena.apache.org/ARQ/function#&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/&gt;
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
@ -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 {
<precise-subquery>?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 {
<precise-subquery>?subject ?property ?role .

View file

@ -5,7 +5,7 @@
<list-view-config>
<query-select>
PREFIX afn: &lt;http://jena.apache.org/ARQ/function#&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
PREFIX vitro: &lt;http://vitro.mannlib.cornell.edu/ns/vitro/0.7#&gt;
@ -14,7 +14,7 @@
?role
?subclassLabel
?activity
(afn:localname(?activity) AS ?activityLocal)
(REPLACE(STR(?activity),"^.*(#)(.*)$", "$2") AS ?activityLocal)
?activityName
?dateTimeStart
?dateTimeEnd

View file

@ -6,7 +6,7 @@
<list-view-config>
<query-select>
PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/&gt;
PREFIX afn: &lt;http://jena.apache.org/ARQ/function#&gt;
PREFIX bibo: &lt;http://purl.org/ontology/bibo/&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX owl: &lt;http://www.w3.org/2002/07/owl#&gt;
@ -26,7 +26,7 @@
WHERE {
?subject ?property ?issuedCredential .
?issuedCredential a core:IssuedCredential .
LET (?issuedCredentialLocal := afn:localname(?issuedCredential))
LET (?issuedCredentialLocal := REPLACE(STR(?issuedCredential),"^.*(#)(.*)$", "$2"))
OPTIONAL {
<precise-subquery>?subject ?property ?issuedCredential .
?issuedCredential a core:IssuedCredential .</precise-subquery>
@ -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 {
<precise-subquery>?subject ?property ?issuedCredential .

View file

@ -7,7 +7,7 @@
<list-view-config>
<query-select>
PREFIX afn: &lt;http://jena.apache.org/ARQ/function#&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/&gt;
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
@ -24,7 +24,7 @@
WHERE
{
?subject ?property ?object .
LET (?localName := afn:localname(?object))
LET (?localName := REPLACE(STR(?object),"^.*(#)(.*)$", "$2"))
OPTIONAL {
<precise-subquery>?subject ?property ?object .</precise-subquery>
@ -50,7 +50,7 @@
}
<collated>
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#" )
</collated>
# Order by ?type is important, because if the object has more than one mostSpecificType,

View file

@ -8,7 +8,7 @@
<query-select>
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX afn: &lt;http://jena.apache.org/ARQ/function#&gt;
PREFIX vitro: &lt;http://vitro.mannlib.cornell.edu/ns/vitro/0.7#&gt;
PREFIX vcard: &lt;http://www.w3.org/2006/vcard/ns#&gt;
@ -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 {

View file

@ -7,13 +7,13 @@
<list-view-config>
<query-select>
PREFIX afn: &lt;http://jena.apache.org/ARQ/function#&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
PREFIX vcard: &lt;http://www.w3.org/2006/vcard/ns#&gt;
SELECT ?vcard ?link
(afn:localname(?link) AS ?linkName)
(REPLACE(STR(?link),"^.*(#)(.*)$", "$2") AS ?linkName)
(group_concat(distinct ?linkLabel;separator="/") as ?label)
?url
?rank