diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coprincipalinvestigator/CoPIGrantCountQueryRunner.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coprincipalinvestigator/CoPIGrantCountQueryRunner.java index 1ebc15b7..60b09801 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coprincipalinvestigator/CoPIGrantCountQueryRunner.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coprincipalinvestigator/CoPIGrantCountQueryRunner.java @@ -125,6 +125,28 @@ public class CoPIGrantCountQueryRunner implements QueryRunner { + "} " + + "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 { + "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); diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitygrantcount/EntityGrantCountQueryRunner.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitygrantcount/EntityGrantCountQueryRunner.java index 1f28e627..990f348e 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitygrantcount/EntityGrantCountQueryRunner.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitygrantcount/EntityGrantCountQueryRunner.java @@ -215,6 +215,13 @@ public class EntityGrantCountQueryRunner implements QueryRunner { + 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 { + " ?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); diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/persongrantcount/PersonGrantCountQueryRunner.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/persongrantcount/PersonGrantCountQueryRunner.java index 31e7f382..5a869ce2 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/persongrantcount/PersonGrantCountQueryRunner.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/persongrantcount/PersonGrantCountQueryRunner.java @@ -157,7 +157,23 @@ public class PersonGrantCountQueryRunner implements QueryRunner>{ + "} " + + + "UNION " + + + "{ " + + + "<" + queryURI + "> core:hasInvestigatorRole ?Role . " + + "?Role core:roleIn ?Grant . " + + + "?Grant rdfs:label ?GrantLabel . " + + + "OPTIONAL { ?Grant core:startDate ?GrantStartDate } . " + + + "OPTIONAL { ?Grant core:endDate ?GrantEndDate } . " + + + + "} " + "} ";