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:
bkoniden 2011-01-19 20:11:39 +00:00
parent df5f7eb38e
commit c73cb28426
3 changed files with 113 additions and 1 deletions

View file

@ -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 "
+ "{ "
@ -166,8 +188,69 @@ public class CoPIGrantCountQueryRunner implements QueryRunner<CoPIData> {
+ "OPTIONAL { ?Grant core:startDate ?GrantStartDate } . "
+ "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);

View file

@ -215,6 +215,13 @@ public class EntityGrantCountQueryRunner implements QueryRunner<Entity> {
+ SPARQL_QUERY_COMMON_WHERE_CLAUSE + "}"
+ "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 . "
+ " ?Position rdf:type core:Position ; core:positionForPerson ?Person ."
+ " ?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 ."
+ " ?Person core:hasPrincipalInvestigatorRole ?Role ; rdfs:label ?PersonLabel ; core:personInPosition ?SecondaryPosition . "
+ 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);

View file

@ -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 } . "
+ "} "
+ "} ";