NIHVIVO-2056 Correct and improve queries for core:relatedRole list view
This commit is contained in:
parent
43269929a6
commit
78493a91a4
1 changed files with 28 additions and 49 deletions
|
@ -9,27 +9,26 @@
|
||||||
PREFIX core: <http://vivoweb.org/ontology/core#>
|
PREFIX core: <http://vivoweb.org/ontology/core#>
|
||||||
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
|
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
|
||||||
|
|
||||||
SELECT DISTINCT ?role (afn:localname(?role) AS ?roleName)
|
SELECT DISTINCT ?role (afn:localname(?role) AS ?roleName)
|
||||||
|
?roleLabel ?roleTypeLabel
|
||||||
?indivInRole (afn:localname(?indivInRole) AS ?indivName)
|
?indivInRole (afn:localname(?indivInRole) AS ?indivName)
|
||||||
?indivLabel
|
?indivLabel
|
||||||
?roleLabel ?roleTypeLabel
|
|
||||||
?dateTimeInterval ?dateTimeStart ?dateTimeEnd WHERE {
|
?dateTimeInterval ?dateTimeStart ?dateTimeEnd WHERE {
|
||||||
|
|
||||||
?subject ?property ?role
|
?subject ?property ?role
|
||||||
|
|
||||||
|
OPTIONAL { ?role rdfs:label ?roleLabel }
|
||||||
|
|
||||||
# We need ?subclass in query-base to get the roleTypeLabel for roles that
|
# We need ?subclass in query-base to get the roleTypeLabel for roles that
|
||||||
# have no label (e.g., InvestigatorRole and its subclasses)
|
# 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 }
|
||||||
}
|
?roleProp rdfs:subPropertyOf core:roleOf ;
|
||||||
|
rdfs:domain ?subclass .
|
||||||
OPTIONAL { ?roleProp rdfs:subPropertyOf core:roleOf .
|
|
||||||
?role ?roleProp ?indivInRole
|
?role ?roleProp ?indivInRole
|
||||||
OPTIONAL { ?indivInRole rdfs:label ?indivLabel }
|
OPTIONAL { ?indivInRole rdfs:label ?indivLabel }
|
||||||
}
|
}
|
||||||
|
|
||||||
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 .
|
||||||
|
@ -39,12 +38,7 @@
|
||||||
?dateTimeEndValue core:dateTime ?dateTimeEnd
|
?dateTimeEndValue core:dateTime ?dateTimeEnd
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# Make sure we get the role that goes with the role property
|
|
||||||
FILTER (
|
|
||||||
( ?roleProp != core:investigatorRoleOf || ?subclass = core:InvestigatorRole ) &&
|
|
||||||
( ?roleProp != core:principalInvestigatorRoleOf || ?subclass = core:PrincipalInvestigatorRole ) &&
|
|
||||||
( ?roleProp != core:co-PrincipalInvestigatorRoleOf || ?subclass = core:CoPrincipalInvestigatorRole )
|
|
||||||
)
|
|
||||||
} ORDER BY ?indivName ?indivLabel ?roleLabel ?roleTypeLabel
|
} ORDER BY ?indivName ?indivLabel ?roleLabel ?roleTypeLabel
|
||||||
</query-base>
|
</query-base>
|
||||||
|
|
||||||
|
@ -55,24 +49,23 @@
|
||||||
|
|
||||||
SELECT DISTINCT ?subclass
|
SELECT DISTINCT ?subclass
|
||||||
?role (afn:localname(?role) AS ?roleName)
|
?role (afn:localname(?role) AS ?roleName)
|
||||||
|
?roleLabel ?roleTypeLabel
|
||||||
?indivInRole (afn:localname(?indivInRole) AS ?indivName)
|
?indivInRole (afn:localname(?indivInRole) AS ?indivName)
|
||||||
?indivLabel
|
?indivLabel
|
||||||
?roleLabel ?roleTypeLabel
|
|
||||||
?dateTimeInterval ?dateTimeStart ?dateTimeEnd WHERE {
|
?dateTimeInterval ?dateTimeStart ?dateTimeEnd WHERE {
|
||||||
|
|
||||||
?subject ?property ?role
|
?subject ?property ?role
|
||||||
|
|
||||||
|
OPTIONAL { ?role rdfs:label ?roleLabel }
|
||||||
|
|
||||||
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 }
|
||||||
}
|
?roleProp rdfs:subPropertyOf core:roleOf ;
|
||||||
|
rdfs:domain ?subclass .
|
||||||
OPTIONAL { ?roleProp rdfs:subPropertyOf core:roleOf .
|
|
||||||
?role ?roleProp ?indivInRole
|
?role ?roleProp ?indivInRole
|
||||||
OPTIONAL { ?indivInRole rdfs:label ?indivLabel }
|
OPTIONAL { ?indivInRole rdfs:label ?indivLabel }
|
||||||
}
|
}
|
||||||
|
|
||||||
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 .
|
||||||
|
@ -82,32 +75,21 @@
|
||||||
?dateTimeEndValue core:dateTime ?dateTimeEnd
|
?dateTimeEndValue core:dateTime ?dateTimeEnd
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# Make sure we get the role that goes with the role property
|
|
||||||
FILTER (
|
|
||||||
( ?roleProp != core:investigatorRoleOf || ?subclass = core:InvestigatorRole ) &&
|
|
||||||
( ?roleProp != core:principalInvestigatorRoleOf || ?subclass = core:PrincipalInvestigatorRole ) &&
|
|
||||||
( ?roleProp != core:co-PrincipalInvestigatorRoleOf || ?subclass = core:CoPrincipalInvestigatorRole )
|
|
||||||
)
|
|
||||||
} ORDER BY ?subclass ?indivName ?indivLabel ?roleLabel ?roleTypeLabel
|
} ORDER BY ?subclass ?indivName ?indivLabel ?roleLabel ?roleTypeLabel
|
||||||
</query-collated>
|
</query-collated>
|
||||||
|
|
||||||
<query-construct>
|
<query-construct>
|
||||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||||
PREFIX core: <http://vivoweb.org/ontology/core#>
|
PREFIX core: <http://vivoweb.org/ontology/core#>
|
||||||
CONSTRUCT {
|
CONSTRUCT {
|
||||||
?subclass rdfs:subClassOf core:Role
|
?subclass rdfs:subClassOf core:Role .
|
||||||
|
?roleProp rdfs:subPropertyOf core:roleOf .
|
||||||
|
?roleProp rdfs:domain ?subclass
|
||||||
} WHERE {
|
} WHERE {
|
||||||
?subclass rdfs:subClassOf core:Role
|
?subclass rdfs:subClassOf core:Role .
|
||||||
}
|
?roleProp rdfs:subPropertyOf core:roleOf ;
|
||||||
</query-construct>
|
rdfs:domain ?subclass
|
||||||
|
|
||||||
<query-construct>
|
|
||||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
|
||||||
PREFIX core: <http://vivoweb.org/ontology/core#>
|
|
||||||
CONSTRUCT {
|
|
||||||
?roleProp rdfs:subPropertyOf core:roleOf
|
|
||||||
} WHERE {
|
|
||||||
?roleProp rdfs:subPropertyOf core:roleOf
|
|
||||||
}
|
}
|
||||||
</query-construct>
|
</query-construct>
|
||||||
|
|
||||||
|
@ -169,9 +151,6 @@
|
||||||
?dateTimeEndValue core:dateTime ?dateTimeEnd
|
?dateTimeEndValue core:dateTime ?dateTimeEnd
|
||||||
}
|
}
|
||||||
</query-construct>
|
</query-construct>
|
||||||
<!--
|
|
||||||
<postprocessor>edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.RelatedRoleDataPostProcessor</postprocessor>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<template>propStatement-relatedRole.ftl</template>
|
<template>propStatement-relatedRole.ftl</template>
|
||||||
</list-view-config>
|
</list-view-config>
|
||||||
|
|
Loading…
Add table
Reference in a new issue