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,45 +4,29 @@
<!-- See guidelines in vitro/doc/list_view_configuration_guidelines.txt --> <!-- See guidelines in vitro/doc/list_view_configuration_guidelines.txt -->
<list-view-config> <list-view-config>
<query-base> <query-select>
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt; PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX afn: &lt;http://jena.hpl.hp.com/ARQ/function#&gt; PREFIX afn: &lt;http://jena.hpl.hp.com/ARQ/function#&gt;
SELECT DISTINCT ?authorship SELECT DISTINCT <collation-fragment> ?subclass </collation-fragment>
?infoResource ?infoResourceName
?dateTime WHERE {
?subject ?property ?authorship
OPTIONAL { ?authorship core:linkedInformationResource ?infoResource .
?infoResource rdfs:label ?infoResourceName
OPTIONAL { ?infoResource core:dateTimeValue ?dateTimeValue .
?dateTimeValue core:dateTime ?dateTime
}
}
} ORDER BY DESC(?dateTime) ?infoResourceName
</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
?authorship ?authorship
?infoResource ?infoResourceName ?infoResource ?infoResourceName
?dateTime WHERE { ?dateTime WHERE {
?subject ?property ?authorship ?subject ?property ?authorship
OPTIONAL { ?authorship core:linkedInformationResource ?infoResource . OPTIONAL { ?authorship core:linkedInformationResource ?infoResource .
?infoResource rdfs:label ?infoResourceName ?infoResource rdfs:label ?infoResourceName
<collation-fragment>
OPTIONAL { ?subclass rdfs:subClassOf core:InformationResource . OPTIONAL { ?subclass rdfs:subClassOf core:InformationResource .
?infoResource a ?subclass ?infoResource a ?subclass
} }
</collation-fragment>
OPTIONAL { ?infoResource core:dateTimeValue ?dateTimeValue . OPTIONAL { ?infoResource core:dateTimeValue ?dateTimeValue .
?dateTimeValue core:dateTime ?dateTime ?dateTimeValue core:dateTime ?dateTime
} }
} }
} ORDER BY ?subclass DESC(?dateTime) ?infoResourceName } ORDER BY <collation-fragment> ?subclass </collation-fragment> ?infoResourceName
</query-collated> </query-select>
<query-construct> <query-construct>
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt; PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;

View file

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

View file

@ -4,7 +4,7 @@
<!-- See guidelines in vitro/doc/list_view_configuration_guidelines.txt --> <!-- See guidelines in vitro/doc/list_view_configuration_guidelines.txt -->
<list-view-config> <list-view-config>
<query-base> <query-select>
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt; PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX afn: &lt;http://jena.hpl.hp.com/ARQ/function#&gt; PREFIX afn: &lt;http://jena.hpl.hp.com/ARQ/function#&gt;
@ -16,7 +16,7 @@
OPTIONAL { ?dateTimeValue core:dateTime ?dateTime } OPTIONAL { ?dateTimeValue core:dateTime ?dateTime }
OPTIONAL { ?dateTimeValue core:dateTimePrecision ?dateTimePrecision } OPTIONAL { ?dateTimeValue core:dateTimePrecision ?dateTimePrecision }
} }
</query-base> </query-select>
<query-construct> <query-construct>
CONSTRUCT { CONSTRUCT {

View file

@ -4,46 +4,13 @@
<!-- See guidelines in vitro/doc/list_view_configuration_guidelines.txt --> <!-- See guidelines in vitro/doc/list_view_configuration_guidelines.txt -->
<list-view-config> <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 ?edTraining
?org ?orgName
?degreeName ?degreeAbbr
?majorField ?deptOrSchool ?info
?dateTimeStart ?dateTimeEnd
WHERE {
?subject ?property ?edTraining
OPTIONAL { ?edTraining core:trainingAtOrganization ?org .
?org rdfs:label ?orgName
}
OPTIONAL { ?edTraining core:degreeEarned ?degree
OPTIONAL { ?degree rdfs:label ?degreeName }
OPTIONAL { ?degree core:abbreviation ?degreeAbbr }
}
OPTIONAL { ?edTraining core:majorField ?majorField }
OPTIONAL { ?edTraining core:departmentOrSchool ?deptOrSchool }
OPTIONAL { ?edTraining core:supplementalInformation ?info }
OPTIONAL { ?edTraining 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)
</query-base>
<query-collated>
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt; PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX afn: &lt;http://jena.hpl.hp.com/ARQ/function#&gt; PREFIX afn: &lt;http://jena.hpl.hp.com/ARQ/function#&gt;
PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/&gt; PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/&gt;
SELECT DISTINCT ?subclass SELECT DISTINCT <collation-fragment> ?subclass </collation-fragment>
?edTraining ?edTraining
?org ?orgName ?org ?orgName
?degreeName ?degreeAbbr ?degreeName ?degreeAbbr
@ -53,9 +20,11 @@
?subject ?property ?edTraining ?subject ?property ?edTraining
OPTIONAL { ?edTraining core:trainingAtOrganization ?org . OPTIONAL { ?edTraining core:trainingAtOrganization ?org .
?org rdfs:label ?orgName ?org rdfs:label ?orgName
<collation-fragment>
OPTIONAL { ?subclass rdfs:subClassOf foaf:Organization . OPTIONAL { ?subclass rdfs:subClassOf foaf:Organization .
?org a ?subclass ?org a ?subclass
} }
</collation-fragment>
} }
OPTIONAL { ?edTraining core:degreeEarned ?degree OPTIONAL { ?edTraining core:degreeEarned ?degree
OPTIONAL { ?degree rdfs:label ?degreeName } OPTIONAL { ?degree rdfs:label ?degreeName }
@ -73,7 +42,7 @@
} }
} }
} ORDER BY ?subclass DESC(?dateTimeEnd) DESC(?dateTimeStart) } ORDER BY ?subclass DESC(?dateTimeEnd) DESC(?dateTimeStart)
</query-collated> </query-select>
<query-construct> <query-construct>
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;

View file

@ -4,37 +4,12 @@
<!-- See guidelines in vitro/doc/list_view_configuration_guidelines.txt --> <!-- See guidelines in vitro/doc/list_view_configuration_guidelines.txt -->
<list-view-config> <list-view-config>
<query-base> <query-select>
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt; PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX afn: &lt;http://jena.hpl.hp.com/ARQ/function#&gt; PREFIX afn: &lt;http://jena.hpl.hp.com/ARQ/function#&gt;
SELECT DISTINCT ?role SELECT DISTINCT <collation-fragment>?subclass</collation-fragment>
?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
?role ?role
?roleLabel ?roleLabel
?activity ?activityName ?activity ?activityName
@ -43,9 +18,11 @@
OPTIONAL { ?role core:roleIn ?activity . OPTIONAL { ?role core:roleIn ?activity .
?activity rdfs:label ?activityName ?activity rdfs:label ?activityName
} }
<collation-fragment>
OPTIONAL { ?role a ?subclass . OPTIONAL { ?role a ?subclass .
?subclass rdfs:subClassOf core:Role ?subclass rdfs:subClassOf core:Role
} }
</collation-fragment>
OPTIONAL { ?role rdfs:label ?roleLabel } OPTIONAL { ?role rdfs:label ?roleLabel }
OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval
OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue . OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue .
@ -55,8 +32,8 @@
?dateTimeEndValue core:dateTime ?dateTimeEnd ?dateTimeEndValue core:dateTime ?dateTimeEnd
} }
} }
} ORDER BY ?subclass DESC(?dateTimeEnd) DESC(?dateTimeStart) ?personName } ORDER BY <collation-fragment>?subclass</collation-fragment> DESC(?dateTimeEnd) DESC(?dateTimeStart) ?personName
</query-collated> </query-select>
<query-construct> <query-construct>
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;

View file

@ -4,40 +4,26 @@
<!-- See guidelines in vitro/doc/list_view_configuration_guidelines.txt --> <!-- See guidelines in vitro/doc/list_view_configuration_guidelines.txt -->
<list-view-config> <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 ?authorship
?person ?personName WHERE {
?subject ?property ?authorship
OPTIONAL { ?authorship core:authorRank ?rank }
OPTIONAL { ?authorship core:linkedAuthor ?person .
?person rdfs:label ?personName
}
} ORDER BY ?rank ?personName
</query-base>
<query-collated>
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt; PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX afn: &lt;http://jena.hpl.hp.com/ARQ/function#&gt; PREFIX afn: &lt;http://jena.hpl.hp.com/ARQ/function#&gt;
PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/&gt; PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/&gt;
SELECT DISTINCT ?subclass SELECT DISTINCT <collation-fragment> ?subclass </collation-fragment>
?authorship ?authorship
?person ?personName WHERE { ?person ?personName WHERE {
?subject ?property ?authorship ?subject ?property ?authorship
OPTIONAL { ?authorship core:authorRank ?rank } OPTIONAL { ?authorship core:authorRank ?rank }
OPTIONAL { ?authorship core:linkedAuthor ?person . OPTIONAL { ?authorship core:linkedAuthor ?person .
?person rdfs:label ?personName ?person rdfs:label ?personName
<collation-fragment>
OPTIONAL { ?person a ?subclass . OPTIONAL { ?person a ?subclass .
?subclass rdfs:subClassOf foaf:Person ?subclass rdfs:subClassOf foaf:Person
} }
} </collation-fragment>
} ORDER BY ?subclass ?rank ?personName } ORDER BY <collation-fragment> ?subclass </collation-fragment> ?rank ?personName
</query-collated> </query-select>
<query-construct> <query-construct>
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;

View file

@ -4,40 +4,12 @@
<!-- See guidelines in vitro/doc/list_view_configuration_guidelines.txt --> <!-- See guidelines in vitro/doc/list_view_configuration_guidelines.txt -->
<list-view-config> <list-view-config>
<query-base> <query-select>
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt; PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX afn: &lt;http://jena.hpl.hp.com/ARQ/function#&gt; PREFIX afn: &lt;http://jena.hpl.hp.com/ARQ/function#&gt;
SELECT DISTINCT ?position SELECT DISTINCT <collation-fragment> ?subclass </collation-fragment>
?positionTitle
?person ?personName
?dateTimeStart ?dateTimeEnd WHERE {
?subject ?property ?position
OPTIONAL { ?position core:positionForPerson ?person .
?person rdfs:label ?personName
}
OPTIONAL { ?position rdfs:label ?positionTitle }
OPTIONAL { ?position core:dateTimeInterval ?dateTimeInterval
OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue .
?dateTimeStartValue core:dateTime ?dateTimeStart
}
OPTIONAL { ?dateTimeInterval core:end ?dateTimeEndValue .
?dateTimeEndValue core:dateTime ?dateTimeEnd
}
# Current positions only: end date is either null or not in the past
} FILTER ( !bound(?dateTimeEnd) ||
afn:substring(str(?dateTimeEnd), 0, 4) &gt;= afn:substring(str(afn:now()), 0, 4) )
} ORDER BY ?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
?position ?position
?positionTitle ?positionTitle
?person ?personName ?person ?personName
@ -46,9 +18,11 @@
OPTIONAL { ?position core:positionForPerson ?person . OPTIONAL { ?position core:positionForPerson ?person .
?person rdfs:label ?personName ?person rdfs:label ?personName
} }
<collation-fragment>
OPTIONAL { ?position a ?subclass . OPTIONAL { ?position a ?subclass .
?subclass rdfs:subClassOf core:Position ?subclass rdfs:subClassOf core:Position
} }
</collation-fragment>
OPTIONAL { ?position rdfs:label ?positionTitle } OPTIONAL { ?position rdfs:label ?positionTitle }
OPTIONAL { ?position core:dateTimeInterval ?dateTimeInterval OPTIONAL { ?position core:dateTimeInterval ?dateTimeInterval
OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue . OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue .
@ -60,8 +34,8 @@
# Current positions only: end date is either null or not in the past # Current positions only: end date is either null or not in the past
} FILTER ( !bound(?dateTimeEnd) || } FILTER ( !bound(?dateTimeEnd) ||
afn:substring(str(?dateTimeEnd), 0, 4) &gt;= afn:substring(str(afn:now()), 0, 4) ) afn:substring(str(?dateTimeEnd), 0, 4) &gt;= afn:substring(str(afn:now()), 0, 4) )
} ORDER BY ?subclass ?personName } ORDER BY <collation-fragment> ?subclass </collation-fragment> ?personName
</query-collated> </query-select>
<query-construct> <query-construct>
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;

View file

@ -4,39 +4,12 @@
<!-- See guidelines in vitro/doc/list_view_configuration_guidelines.txt --> <!-- See guidelines in vitro/doc/list_view_configuration_guidelines.txt -->
<list-view-config> <list-view-config>
<query-base> <query-select>
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt; PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX afn: &lt;http://jena.hpl.hp.com/ARQ/function#&gt; PREFIX afn: &lt;http://jena.hpl.hp.com/ARQ/function#&gt;
SELECT DISTINCT ?position SELECT DISTINCT <collation-fragment>?subclass</collation-fragment>
?positionTitle
?hrJobTitle
?org ?orgName
?dateTimeStart ?dateTimeEnd WHERE {
?subject ?property ?position
OPTIONAL { ?position core:positionInOrganization ?org .
?org rdfs:label ?orgName
}
OPTIONAL { ?position rdfs:label ?positionTitle }
OPTIONAL { ?position core:hrJobTitle ?hrJobTitle }
OPTIONAL { ?position 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) ?orgName
</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
?position ?position
?positionTitle ?positionTitle
?hrJobTitle ?hrJobTitle
@ -56,11 +29,13 @@
?dateTimeEndValue core:dateTime ?dateTimeEnd ?dateTimeEndValue core:dateTime ?dateTimeEnd
} }
} }
<collation-fragment>
OPTIONAL { ?position a ?subclass . OPTIONAL { ?position a ?subclass .
?subclass rdfs:subClassOf core:Position ?subclass rdfs:subClassOf core:Position
} }
} ORDER BY ?subclass DESC(?dateTimeEnd) DESC(?dateTimeStart) ?orgName </collation-fragment>
</query-collated> } ORDER BY <collation-fragment>?subclass</collation-fragment> DESC(?dateTimeEnd) DESC(?dateTimeStart) ?orgName
</query-select>
<query-construct> <query-construct>
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;

View file

@ -4,50 +4,12 @@
<!-- See guidelines in vitro/doc/list_view_configuration_guidelines.txt --> <!-- See guidelines in vitro/doc/list_view_configuration_guidelines.txt -->
<list-view-config> <list-view-config>
<query-base> <query-select>
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt; PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX afn: &lt;http://jena.hpl.hp.com/ARQ/function#&gt; PREFIX afn: &lt;http://jena.hpl.hp.com/ARQ/function#&gt;
SELECT DISTINCT ?role SELECT DISTINCT <collation-fragment>?subclass</collation-fragment>
?roleLabel ?roleTypeLabel
?indivInRole (afn:localname(?indivInRole) AS ?indivName)
?indivLabel
?dateTimeInterval ?dateTimeStart ?dateTimeEnd WHERE {
?subject ?property ?role
OPTIONAL { ?role rdfs:label ?roleLabel }
# We need ?subclass in query-base to get the roleTypeLabel for roles that
# have no label (e.g., InvestigatorRole and its subclasses)
OPTIONAL { ?role a ?subclass .
?subclass rdfs:subClassOf core:Role
OPTIONAL { ?subclass rdfs:label ?roleTypeLabel }
?roleProp rdfs:subPropertyOf core:roleOf ;
rdfs:domain ?subclass .
?role ?roleProp ?indivInRole
OPTIONAL { ?indivInRole rdfs:label ?indivLabel }
}
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 ?indivName ?indivLabel ?roleLabel ?roleTypeLabel
</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
?role ?role
?roleLabel ?roleTypeLabel ?roleLabel ?roleTypeLabel
?indivInRole (afn:localname(?indivInRole) AS ?indivName) ?indivInRole (afn:localname(?indivInRole) AS ?indivName)
@ -58,6 +20,8 @@
OPTIONAL { ?role rdfs:label ?roleLabel } OPTIONAL { ?role rdfs:label ?roleLabel }
# We need ?subclass in the uncollated query to get the roleTypeLabel
# for roles that have no label (e.g., InvestigatorRole and its subclasses).
OPTIONAL { ?role a ?subclass . OPTIONAL { ?role a ?subclass .
?subclass rdfs:subClassOf core:Role ?subclass rdfs:subClassOf core:Role
OPTIONAL { ?subclass rdfs:label ?roleTypeLabel } OPTIONAL { ?subclass rdfs:label ?roleTypeLabel }
@ -76,8 +40,8 @@
} }
} }
} ORDER BY ?subclass ?indivName ?indivLabel ?roleLabel ?roleTypeLabel } ORDER BY <collation-fragment>?subclass</collation-fragment>?indivName ?indivLabel ?roleLabel ?roleTypeLabel
</query-collated> </query-select>
<query-construct> <query-construct>
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;