NIHVIVO-1879 Combine collated and uncollated list view queries into a single query, with preprocessing to get the right version.
This commit is contained in:
parent
451ddd9461
commit
2a3b6615f7
9 changed files with 56 additions and 227 deletions
|
@ -4,37 +4,12 @@
|
|||
<!-- See guidelines in vitro/doc/list_view_configuration_guidelines.txt -->
|
||||
|
||||
<list-view-config>
|
||||
<query-base>
|
||||
<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#>
|
||||
|
||||
SELECT DISTINCT ?role
|
||||
?roleLabel
|
||||
?activity ?activityName
|
||||
?dateTimeStart ?dateTimeEnd WHERE {
|
||||
?subject ?property ?role
|
||||
OPTIONAL { ?role core:roleIn ?activity .
|
||||
?activity rdfs:label ?activityName
|
||||
}
|
||||
OPTIONAL { ?role rdfs:label ?roleLabel }
|
||||
OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval
|
||||
OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue .
|
||||
?dateTimeStartValue core:dateTime ?dateTimeStart
|
||||
}
|
||||
OPTIONAL { ?dateTimeInterval core:end ?dateTimeEndValue .
|
||||
?dateTimeEndValue core:dateTime ?dateTimeEnd
|
||||
}
|
||||
}
|
||||
} ORDER BY DESC(?dateTimeEnd) DESC(?dateTimeStart) ?personName
|
||||
</query-base>
|
||||
|
||||
<query-collated>
|
||||
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#>
|
||||
|
||||
SELECT DISTINCT ?subclass
|
||||
SELECT DISTINCT <collation-fragment>?subclass</collation-fragment>
|
||||
?role
|
||||
?roleLabel
|
||||
?activity ?activityName
|
||||
|
@ -43,9 +18,11 @@
|
|||
OPTIONAL { ?role core:roleIn ?activity .
|
||||
?activity rdfs:label ?activityName
|
||||
}
|
||||
<collation-fragment>
|
||||
OPTIONAL { ?role a ?subclass .
|
||||
?subclass rdfs:subClassOf core:Role
|
||||
}
|
||||
</collation-fragment>
|
||||
OPTIONAL { ?role rdfs:label ?roleLabel }
|
||||
OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval
|
||||
OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue .
|
||||
|
@ -55,8 +32,8 @@
|
|||
?dateTimeEndValue core:dateTime ?dateTimeEnd
|
||||
}
|
||||
}
|
||||
} ORDER BY ?subclass DESC(?dateTimeEnd) DESC(?dateTimeStart) ?personName
|
||||
</query-collated>
|
||||
} ORDER BY <collation-fragment>?subclass</collation-fragment> DESC(?dateTimeEnd) DESC(?dateTimeStart) ?personName
|
||||
</query-select>
|
||||
|
||||
<query-construct>
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue