NIHVIVO-2723 Fix collated queries on listViewConfig-hasRole and listViewConfig-hasEditReviewRole.
This commit is contained in:
parent
22d103590b
commit
2418a41c1e
2 changed files with 49 additions and 23 deletions
|
@ -8,15 +8,16 @@
|
|||
|
||||
<list-view-config>
|
||||
<query-select>
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX core: <http://vivoweb.org/ontology/core#>
|
||||
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
|
||||
PREFIX bibo: <http://purl.org/ontology/bibo/>
|
||||
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#>
|
||||
|
||||
SELECT DISTINCT <collated>?subclass</collated>
|
||||
# send the property to the template, since this view supports multiple role properties
|
||||
?property
|
||||
?role
|
||||
?startDateOnly
|
||||
?roleLabel
|
||||
?activity ?activityName
|
||||
?activityLabel
|
||||
|
@ -34,12 +35,17 @@
|
|||
OPTIONAL { ?role core:forInformationResource ?infoResource
|
||||
LET (?infoResourceName := afn:localname(?infoResource))
|
||||
OPTIONAL { ?infoResource rdfs:label ?infoResourceLabel }
|
||||
}
|
||||
<collated>
|
||||
OPTIONAL { ?role a ?subclass .
|
||||
?subclass rdfs:subClassOf core:Role
|
||||
# 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.
|
||||
OPTIONAL { ?infoResource vitro:mostSpecificType ?subclass .
|
||||
?subclass rdfs:subClassOf bibo:Collection
|
||||
}
|
||||
</collated>
|
||||
}
|
||||
|
||||
OPTIONAL { ?role rdfs:label ?roleLabel }
|
||||
OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval
|
||||
OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue .
|
||||
|
@ -52,16 +58,27 @@
|
|||
<critical-data-required>
|
||||
FILTER ( bound(?infoResource) )
|
||||
</critical-data-required>
|
||||
} ORDER BY <collated>?subclass</collated> DESC(?dateTimeEnd) DESC(?dateTimeStart) ?infoResourceName
|
||||
} ORDER BY <collated>?subclass</collated> DESC(?dateTimeEnd) DESC(?dateTimeStart) ?infoResourceLabel ?infoResourceName
|
||||
</query-select>
|
||||
|
||||
<query-construct>
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX bibo: <http://purl.org/ontology/bibo/>
|
||||
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#>
|
||||
|
||||
CONSTRUCT {
|
||||
?subclass rdfs:subClassOf core:Role
|
||||
?subject ?property ?role .
|
||||
?role core:forInformationResource ?infoResource .
|
||||
# ?infoResource a ?subclass .
|
||||
?infoResource vitro:mostSpecificType ?subclass .
|
||||
?subclass rdfs:subClassOf bibo:Collection
|
||||
} WHERE {
|
||||
?subclass rdfs:subClassOf core:Role
|
||||
?subject ?property ?role .
|
||||
?role core:forInformationResource ?infoResource .
|
||||
# ?infoResource a ?subclass .
|
||||
?infoResource vitro:mostSpecificType ?subclass .
|
||||
?subclass rdfs:subClassOf bibo:Collection
|
||||
}
|
||||
</query-construct>
|
||||
|
||||
|
|
|
@ -5,15 +5,15 @@
|
|||
|
||||
<list-view-config>
|
||||
<query-select>
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX core: <http://vivoweb.org/ontology/core#>
|
||||
PREFIX afn: <http://jena.hpl.hp.com/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#>
|
||||
|
||||
SELECT DISTINCT <collated>?subclass</collated>
|
||||
# send the property to the template, since this view supports multiple role properties
|
||||
?property
|
||||
?role
|
||||
?startDateOnly
|
||||
?roleLabel
|
||||
?activity ?activityName
|
||||
?activityLabel
|
||||
|
@ -26,8 +26,9 @@
|
|||
OPTIONAL { ?activity rdfs:label ?activityLabel }
|
||||
}
|
||||
<collated>
|
||||
OPTIONAL { ?role a ?subclass .
|
||||
?subclass rdfs:subClassOf core:Role
|
||||
OPTIONAL {
|
||||
# ?activity a ?subclass
|
||||
?activity vitro:mostSpecificType ?subclass
|
||||
}
|
||||
</collated>
|
||||
OPTIONAL { ?role rdfs:label ?roleLabel }
|
||||
|
@ -42,16 +43,24 @@
|
|||
<critical-data-required>
|
||||
FILTER ( bound(?activity) )
|
||||
</critical-data-required>
|
||||
} ORDER BY <collated>?subclass</collated> DESC(?dateTimeEnd) DESC(?dateTimeStart) ?activityName
|
||||
} ORDER BY <collated>?subclass</collated> DESC(?dateTimeEnd) DESC(?dateTimeStart) ?activityLabel ?activityName
|
||||
</query-select>
|
||||
|
||||
<query-construct>
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
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#>
|
||||
|
||||
CONSTRUCT {
|
||||
?subclass rdfs:subClassOf core:Role
|
||||
?subject ?property ?role .
|
||||
?role core:roleIn ?activity .
|
||||
# ?activity a ?subclass .
|
||||
?activity vitro:mostSpecificType ?subclass .
|
||||
} WHERE {
|
||||
?subclass rdfs:subClassOf core:Role
|
||||
?subject ?property ?role .
|
||||
?role core:roleIn ?activity .
|
||||
# ?activity a ?subclass .
|
||||
?activity vitro:mostSpecificType ?subclass
|
||||
}
|
||||
</query-construct>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue