The queries for TemporalGraph, CoPI and PersonGrantCount (individual sparkline for grants) now include core:hasInvestigatorRole and core:investigatorRoleOf while calculating the total number of grants.
This commit is contained in:
parent
df5f7eb38e
commit
c73cb28426
3 changed files with 113 additions and 1 deletions
|
@ -125,6 +125,28 @@ public class CoPIGrantCountQueryRunner implements QueryRunner<CoPIData> {
|
||||||
|
|
||||||
+ "} "
|
+ "} "
|
||||||
|
|
||||||
|
+ "UNION "
|
||||||
|
|
||||||
|
+ "{ "
|
||||||
|
|
||||||
|
+ "<" + queryURI + "> core:hasPrincipalInvestigatorRole ?Role . "
|
||||||
|
|
||||||
|
+ "?Role core:roleIn ?Grant . "
|
||||||
|
|
||||||
|
+ "?Grant rdfs:label ?GrantLabel ; "
|
||||||
|
|
||||||
|
+ "core:relatedRole ?RelatedRole . "
|
||||||
|
|
||||||
|
+ "?RelatedRole core:investigatorRoleOf ?CoPI . "
|
||||||
|
|
||||||
|
+ "?CoPI rdfs:label ?CoPILabel . "
|
||||||
|
|
||||||
|
+ "OPTIONAL { ?Grant core:startDate ?GrantStartDate } . "
|
||||||
|
|
||||||
|
+ "OPTIONAL { ?Grant core:endDate ?GrantEndDate } . "
|
||||||
|
|
||||||
|
+ "} "
|
||||||
|
|
||||||
+ "UNION "
|
+ "UNION "
|
||||||
|
|
||||||
+ "{ "
|
+ "{ "
|
||||||
|
@ -166,8 +188,69 @@ public class CoPIGrantCountQueryRunner implements QueryRunner<CoPIData> {
|
||||||
+ "OPTIONAL { ?Grant core:startDate ?GrantStartDate } . "
|
+ "OPTIONAL { ?Grant core:startDate ?GrantStartDate } . "
|
||||||
|
|
||||||
+ "OPTIONAL { ?Grant core:endDate ?GrantEndDate } . "
|
+ "OPTIONAL { ?Grant core:endDate ?GrantEndDate } . "
|
||||||
+ "} "
|
+ "} "
|
||||||
|
|
||||||
|
+ "UNION "
|
||||||
|
|
||||||
|
+ "{ "
|
||||||
|
|
||||||
|
+ "<" + queryURI + "> core:hasPrincipalInvestigatorRole ?Role . "
|
||||||
|
|
||||||
|
+ "?Role core:roleIn ?Grant . "
|
||||||
|
|
||||||
|
+ "?Grant rdfs:label ?GrantLabel ; "
|
||||||
|
|
||||||
|
+ "core:relatedRole ?RelatedRole . "
|
||||||
|
|
||||||
|
+ "?RelatedRole core:investigatorRoleOf ?CoPI . "
|
||||||
|
|
||||||
|
+ "?CoPI rdfs:label ?CoPILabel . "
|
||||||
|
|
||||||
|
+ "OPTIONAL { ?Grant core:startDate ?GrantStartDate } . "
|
||||||
|
|
||||||
|
+ "OPTIONAL { ?Grant core:endDate ?GrantEndDate } . "
|
||||||
|
+ "} "
|
||||||
|
+ "UNION "
|
||||||
|
|
||||||
|
+ "{ "
|
||||||
|
|
||||||
|
+ "<" + queryURI + "> core:hasInvestigatorRole ?Role . "
|
||||||
|
|
||||||
|
+ "?Role core:roleIn ?Grant . "
|
||||||
|
|
||||||
|
+ "?Grant rdfs:label ?GrantLabel ; "
|
||||||
|
|
||||||
|
+ "core:relatedRole ?RelatedRole . "
|
||||||
|
|
||||||
|
+ "?RelatedRole core:co-PrincipalInvestigatorRoleOf ?CoPI . "
|
||||||
|
|
||||||
|
+ "?CoPI rdfs:label ?CoPILabel . "
|
||||||
|
|
||||||
|
+ "OPTIONAL { ?Grant core:startDate ?GrantStartDate } . "
|
||||||
|
|
||||||
|
+ "OPTIONAL { ?Grant core:endDate ?GrantEndDate } . "
|
||||||
|
+ "} "
|
||||||
|
|
||||||
|
+ "UNION "
|
||||||
|
|
||||||
|
+ "{ "
|
||||||
|
|
||||||
|
+ "<" + queryURI + "> core:hasInvestigatorRole ?Role . "
|
||||||
|
|
||||||
|
+ "?Role core:roleIn ?Grant . "
|
||||||
|
|
||||||
|
+ "?Grant rdfs:label ?GrantLabel ; "
|
||||||
|
|
||||||
|
+ "core:relatedRole ?RelatedRole . "
|
||||||
|
|
||||||
|
+ "?RelatedRole core:principalInvestigatorRoleOf ?CoPI . "
|
||||||
|
|
||||||
|
+ "?CoPI rdfs:label ?CoPILabel . "
|
||||||
|
|
||||||
|
+ "OPTIONAL { ?Grant core:startDate ?GrantStartDate } . "
|
||||||
|
|
||||||
|
+ "OPTIONAL { ?Grant core:endDate ?GrantEndDate } . "
|
||||||
|
+ "} "
|
||||||
+ "} ";
|
+ "} ";
|
||||||
|
|
||||||
log.debug("COPI QUERY - " + sparqlQuery);
|
log.debug("COPI QUERY - " + sparqlQuery);
|
||||||
|
|
|
@ -215,6 +215,13 @@ public class EntityGrantCountQueryRunner implements QueryRunner<Entity> {
|
||||||
+ SPARQL_QUERY_COMMON_WHERE_CLAUSE + "}"
|
+ SPARQL_QUERY_COMMON_WHERE_CLAUSE + "}"
|
||||||
+ "UNION "
|
+ "UNION "
|
||||||
+ "{ "
|
+ "{ "
|
||||||
|
+ "<" + queryURI + "> core:hasSubOrganization ?subOrganization . "
|
||||||
|
+ " ?subOrganization rdfs:label ?subOrganizationLabel ; core:organizationForPosition ?Position . "
|
||||||
|
+ " ?Position rdf:type core:Position ; core:positionForPerson ?Person ."
|
||||||
|
+ " ?Person core:hasInvestigatorRole ?Role ; rdfs:label ?PersonLabel ; core:personInPosition ?SecondaryPosition . "
|
||||||
|
+ SPARQL_QUERY_COMMON_WHERE_CLAUSE + "}"
|
||||||
|
+ "UNION "
|
||||||
|
+ "{ "
|
||||||
+ "<" + queryURI + "> core:organizationForPosition ?Position . "
|
+ "<" + queryURI + "> core:organizationForPosition ?Position . "
|
||||||
+ " ?Position rdf:type core:Position ; core:positionForPerson ?Person ."
|
+ " ?Position rdf:type core:Position ; core:positionForPerson ?Person ."
|
||||||
+ " ?Person core:hasCo-PrincipalInvestigatorRole ?Role ; rdfs:label ?PersonLabel ; core:personInPosition ?SecondaryPosition . "
|
+ " ?Person core:hasCo-PrincipalInvestigatorRole ?Role ; rdfs:label ?PersonLabel ; core:personInPosition ?SecondaryPosition . "
|
||||||
|
@ -225,6 +232,12 @@ public class EntityGrantCountQueryRunner implements QueryRunner<Entity> {
|
||||||
+ " ?Position rdf:type core:Position ; core:positionForPerson ?Person ."
|
+ " ?Position rdf:type core:Position ; core:positionForPerson ?Person ."
|
||||||
+ " ?Person core:hasPrincipalInvestigatorRole ?Role ; rdfs:label ?PersonLabel ; core:personInPosition ?SecondaryPosition . "
|
+ " ?Person core:hasPrincipalInvestigatorRole ?Role ; rdfs:label ?PersonLabel ; core:personInPosition ?SecondaryPosition . "
|
||||||
+ SPARQL_QUERY_COMMON_WHERE_CLAUSE + "}"
|
+ SPARQL_QUERY_COMMON_WHERE_CLAUSE + "}"
|
||||||
|
+ "UNION "
|
||||||
|
+ "{ "
|
||||||
|
+ "<" + queryURI + "> core:organizationForPosition ?Position . "
|
||||||
|
+ " ?Position rdf:type core:Position ; core:positionForPerson ?Person ."
|
||||||
|
+ " ?Person core:hasInvestigatorRole ?Role ; rdfs:label ?PersonLabel ; core:personInPosition ?SecondaryPosition . "
|
||||||
|
+ SPARQL_QUERY_COMMON_WHERE_CLAUSE + "}"
|
||||||
+ " } ";
|
+ " } ";
|
||||||
|
|
||||||
//System.out.println("\n\nEntity Grant Count query is: "+ sparqlQuery);
|
//System.out.println("\n\nEntity Grant Count query is: "+ sparqlQuery);
|
||||||
|
|
|
@ -157,7 +157,23 @@ public class PersonGrantCountQueryRunner implements QueryRunner<Set<Grant>>{
|
||||||
|
|
||||||
|
|
||||||
+ "} "
|
+ "} "
|
||||||
|
|
||||||
|
+ "UNION "
|
||||||
|
|
||||||
|
+ "{ "
|
||||||
|
|
||||||
|
+ "<" + queryURI + "> core:hasInvestigatorRole ?Role . "
|
||||||
|
|
||||||
|
+ "?Role core:roleIn ?Grant . "
|
||||||
|
|
||||||
|
+ "?Grant rdfs:label ?GrantLabel . "
|
||||||
|
|
||||||
|
+ "OPTIONAL { ?Grant core:startDate ?GrantStartDate } . "
|
||||||
|
|
||||||
|
+ "OPTIONAL { ?Grant core:endDate ?GrantEndDate } . "
|
||||||
|
|
||||||
|
|
||||||
|
+ "} "
|
||||||
|
|
||||||
+ "} ";
|
+ "} ";
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue