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:
rjy7 2011-03-02 22:33:01 +00:00
parent 451ddd9461
commit 2a3b6615f7
9 changed files with 56 additions and 227 deletions

View file

@ -4,37 +4,12 @@
<!-- See guidelines in vitro/doc/list_view_configuration_guidelines.txt -->
<list-view-config>
<query-base>
<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.hpl.hp.com/ARQ/function#&gt;
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: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX afn: &lt;http://jena.hpl.hp.com/ARQ/function#&gt;
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: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;