diff --git a/productMods/WEB-INF/visualization/visualizations-beans-injection.xml b/productMods/WEB-INF/visualization/visualizations-beans-injection.xml
index a3b7c4c7..a6b6d471 100644
--- a/productMods/WEB-INF/visualization/visualizations-beans-injection.xml
+++ b/productMods/WEB-INF/visualization/visualizations-beans-injection.xml
@@ -21,11 +21,6 @@
class="edu.cornell.mannlib.vitro.webapp.visualization.entitycomparison.EntityPublicationCountRequestHandler" />
-
-
-
-
@@ -49,9 +44,6 @@
-
-
-
diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipQueryRunner.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipQueryRunner.java
index f813865d..1f73985a 100644
--- a/src/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipQueryRunner.java
+++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipQueryRunner.java
@@ -399,23 +399,23 @@ public class CoAuthorshipQueryRunner implements QueryRunner {
DataSource dataSource) {
QueryExecution queryExecution = null;
- try {
+ // try {
Query query = QueryFactory.create(queryText, SYNTAX);
// QuerySolutionMap qs = new QuerySolutionMap();
// qs.add("authPerson", queryParam); // bind resource to s
queryExecution = QueryExecutionFactory.create(query, dataSource);
-
- if (query.isSelectType()) {
+ System.out.println("\n\nquery.isSelectType() is "+ query.isSelectType()+ " \n\n");
+// if (query.isSelectType()) {
return queryExecution.execSelect();
- }
- } finally {
- if (queryExecution != null) {
- queryExecution.close();
- }
- }
- return null;
+// }
+// } finally {
+// if (queryExecution != null) {
+// queryExecution.close();
+// }
+// }
+// return null;
}
private String generateEgoCoAuthorshipSparqlQuery(String queryURI) {
diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIGrantCountQueryRunner.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIGrantCountQueryRunner.java
index 8d5ff371..a924ee8a 100644
--- a/src/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIGrantCountQueryRunner.java
+++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIGrantCountQueryRunner.java
@@ -95,20 +95,20 @@ public class CoPIGrantCountQueryRunner implements QueryRunner {
private ResultSet executeQuery(String queryText, DataSource dataSource) {
QueryExecution queryExecution = null;
- try {
+// try {
Query query = QueryFactory.create(queryText, SYNTAX);
queryExecution = QueryExecutionFactory.create(query, dataSource);
-
- if (query.isSelectType()) {
+ System.out.println("\n\nquery.isSelectType() is "+ query.isSelectType()+ " \n\n");
+// if (query.isSelectType()) {
return queryExecution.execSelect();
- }
- } finally {
- if (queryExecution != null) {
- queryExecution.close();
- }
- }
- return null;
+// }
+// } finally {
+// if (queryExecution != null) {
+// queryExecution.close();
+// }
+// }
+// return null;
}
public CoPIData getQueryResult()
@@ -132,6 +132,7 @@ public class CoPIGrantCountQueryRunner implements QueryRunner {
ResultSet resultSet = executeQuery(generateEgoCoPIquery(this.egoURI),
this.dataSource);
+ System.out.println("ResultSet ");
return createQueryResult(resultSet);
}
@@ -190,11 +191,14 @@ public class CoPIGrantCountQueryRunner implements QueryRunner {
nodes.add(egoNode);
nodeURLToVO.put(egoPIURLNode.toString(), egoNode);
+
RDFNode authorLabelNode = solution.get(QueryFieldLabels.PI_LABEL);
if (authorLabelNode != null) {
egoNode.setNodeName(authorLabelNode.toString());
}
}
+ System.out.println("\n----------------------------------");
+ System.out.println("PI: "+ egoNode.getIndividualLabel());
RDFNode grantNode = solution.get(QueryFieldLabels.GRANT_URL);
Grant grant;
@@ -207,6 +211,7 @@ public class CoPIGrantCountQueryRunner implements QueryRunner {
}
egoNode.addGrant(grant);
+ System.out.println("Adding grant: "+ grant.getIndividualLabel());
/*
* After some discussion we concluded that for the purpose of this visualization
@@ -237,6 +242,7 @@ public class CoPIGrantCountQueryRunner implements QueryRunner {
}
}
+ System.out.println("Adding CO-PI: "+ coPINode.getIndividualLabel());
coPINode.addGrant(grant);
Set coPIsForCurrentGrant;
@@ -251,9 +257,10 @@ public class CoPIGrantCountQueryRunner implements QueryRunner {
}
coPIsForCurrentGrant.add(coPINode);
+ System.out.println("Co-PI for current grant : "+ coPINode.getIndividualLabel());
CoPIEdge egoCoPIEdge = getExistingEdge(egoNode, coPINode, edgeUniqueIdentifierToVO);
-
+ System.out.println("\n----------------------------------");
/*
* If "egoCoPIEdge" is null it means that no edge exists in between the egoNode
* & current coPINode. Else create a new edge, add it to the edges set & add
diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIGrantCountRequestHandler.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIGrantCountRequestHandler.java
index e73280e5..fc902965 100644
--- a/src/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIGrantCountRequestHandler.java
+++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIGrantCountRequestHandler.java
@@ -41,6 +41,8 @@ public class CoPIGrantCountRequestHandler implements VisualizationRequestHandler
try{
CoPIData PINodesAndEdges = queryManager.getQueryResult();
+ PINodesAndEdges.print();
+
if (VisualizationFrameworkConstants.DATA_RENDER_MODE
.equalsIgnoreCase(renderMode)) {
diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/entitycomparison/EntityPublicationCountQueryRunner.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/entitycomparison/EntityPublicationCountQueryRunner.java
index a8cff282..0116339c 100644
--- a/src/edu/cornell/mannlib/vitro/webapp/visualization/entitycomparison/EntityPublicationCountQueryRunner.java
+++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/entitycomparison/EntityPublicationCountQueryRunner.java
@@ -166,86 +166,123 @@ public class EntityPublicationCountQueryRunner implements QueryRunner {
private ResultSet executeQuery(String queryURI, DataSource dataSource) {
QueryExecution queryExecution = null;
- try {
+// try {
Query query = QueryFactory.create(
getSparqlQuery(queryURI, this.visMode), SYNTAX);
queryExecution = QueryExecutionFactory.create(query, dataSource);
-
- if (query.isSelectType()) {
- return queryExecution.execSelect();
- }
- } finally {
- if (queryExecution != null) {
- queryExecution.close();
- }
- }
- return null;
+ System.out.println("\n\nquery.isSelectType() is "+ query.isSelectType()+ " \n\n");
+ return queryExecution.execSelect();
+// if (query.isSelectType()) {
+// return queryExecution.execSelect();
+// }
+// } finally {
+// if (queryExecution != null) {
+// queryExecution.close();
+// }
+// }
+// return null;
}
private String getSparqlQuery(String queryURI, String visMode) {
String result = "";
if (visMode.equals("DEPARTMENT")) {
- result = getSparqlQueryForDepartment(queryURI);
+ // result = getSparqlQueryForDepartment(queryURI);
ENTITY_URL = QueryFieldLabels.DEPARTMENT_URL;
ENTITY_LABEL = QueryFieldLabels.DEPARTMENT_LABEL;
SUBENTITY_URL = QueryFieldLabels.PERSON_URL;
SUBENTITY_LABEL = QueryFieldLabels.PERSON_LABEL;
} else {
- result = getSparqlQueryForOrganization(queryURI);
+ // result = getSparqlQueryForOrganization(queryURI);
ENTITY_URL = QueryFieldLabels.ORGANIZATION_URL;
ENTITY_LABEL = QueryFieldLabels.ORGANIZATION_LABEL;
SUBENTITY_URL = QueryFieldLabels.SUBORGANIZATION_URL;
SUBENTITY_LABEL = QueryFieldLabels.SUBORGANIZATION_LABEL;
}
+ result = getSparqlQueryForOrganization(queryURI);
return result;
}
- private String getSparqlQueryForDepartment(String queryURI) {
+// private String getSparqlQueryForDepartment(String queryURI) {
+//
+// String sparqlQuery = QueryConstants.getSparqlPrefixQuery()
+// + "SELECT (str(?DepartmentLabel) as ?departmentLabelLit) "
+// + SPARQL_QUERY_COMMON_SELECT_CLAUSE + " (str(<" + queryURI
+// + ">) as ?" + QueryFieldLabels.DEPARTMENT_URL + ") "
+// + "WHERE { " + "<" + queryURI + "> rdf:type core:Department ;"
+// + " rdfs:label ?DepartmentLabel ;"
+// + " core:organizationForPosition ?Position . "
+// + " ?Position rdf:type core:Position ;"
+// + " core:positionForPerson ?Person . "
+// + " ?Person core:authorInAuthorship ?Resource ; "
+// + " rdfs:label ?PersonLabel ; core:personInPosition ?SecondaryPosition . "
+// + " ?Resource core:linkedInformationResource ?Document ."
+// + " ?SecondaryPosition rdfs:label ?SecondaryPositionLabel ."
+// + SPARQL_QUERY_COMMON_WHERE_CLAUSE + "}"
+// + " ORDER BY ?DocumentLabel";
+// System.out.println("\nThe sparql query is :\n" + sparqlQuery);
+// return sparqlQuery;
+//
+// }
+// private String getSparqlQueryForOrganization(String queryURI) {
+//
+// String sparqlQuery = QueryConstants.getSparqlPrefixQuery()
+// + "SELECT (str(?organizationLabel) as ?organizationLabelLit) "
+// + " (str(?subOrganization) as ?subOrganizationLit) "
+// + " (str(?subOrganizationLabel) as ?subOrganizationLabelLit) "
+// + SPARQL_QUERY_COMMON_SELECT_CLAUSE + " (str(<" + queryURI
+// + ">) as ?" + QueryFieldLabels.ORGANIZATION_URL + ") "
+// + "WHERE { " + "<" + queryURI + "> rdf:type foaf:Organization ;"
+// + " rdfs:label ?organizationLabel ;"
+// + " core:hasSubOrganization ?subOrganization ."
+// + " ?subOrganization rdfs:label ?subOrganizationLabel ;"
+// + " core:organizationForPosition ?Position . "
+// + " ?Position rdf:type core:Position ;"
+// + " core:positionForPerson ?Person . "
+// + " ?Person core:authorInAuthorship ?Resource ; "
+// + " rdfs:label ?PersonLabel ; core:personInPosition ?SecondaryPosition . "
+// + " ?Resource core:linkedInformationResource ?Document ."
+// + " ?SecondaryPosition rdfs:label ?SecondaryPositionLabel ."
+// + SPARQL_QUERY_COMMON_WHERE_CLAUSE + "}"
+// + " ORDER BY ?DocumentLabel";
+// System.out.println("\nThe sparql query is :\n" + sparqlQuery);
+// return sparqlQuery;
+//
+// }
+
+ private String getSparqlQueryForOrganization(String queryURI){
+
String sparqlQuery = QueryConstants.getSparqlPrefixQuery()
- + "SELECT (str(?DepartmentLabel) as ?departmentLabelLit) "
- + SPARQL_QUERY_COMMON_SELECT_CLAUSE + " (str(<" + queryURI
- + ">) as ?" + QueryFieldLabels.DEPARTMENT_URL + ") "
- + "WHERE { " + "<" + queryURI + "> rdf:type core:Department ;"
- + " rdfs:label ?DepartmentLabel ;"
- + " core:organizationForPosition ?Position . "
- + " ?Position rdf:type core:Position ;"
- + " core:positionForPerson ?Person . "
- + " ?Person core:authorInAuthorship ?Resource ; "
- + " rdfs:label ?PersonLabel ; core:personInPosition ?SecondaryPosition . "
- + " ?Resource core:linkedInformationResource ?Document ."
- + " ?SecondaryPosition rdfs:label ?SecondaryPositionLabel ."
- + SPARQL_QUERY_COMMON_WHERE_CLAUSE + "}"
- + " ORDER BY ?DocumentLabel";
- System.out.println("\nThe sparql query is :\n" + sparqlQuery);
- return sparqlQuery;
-
- }
-
- private String getSparqlQueryForOrganization(String queryURI) {
-
- String sparqlQuery = QueryConstants.getSparqlPrefixQuery()
- + "SELECT (str(?organizationLabel) as ?organizationLabelLit) "
- + " (str(?subOrganization) as ?subOrganizationLit) "
- + " (str(?subOrganizationLabel) as ?subOrganizationLabelLit) "
- + SPARQL_QUERY_COMMON_SELECT_CLAUSE + " (str(<" + queryURI
- + ">) as ?" + QueryFieldLabels.ORGANIZATION_URL + ") "
- + "WHERE { " + "<" + queryURI + "> rdf:type foaf:Organization ;"
- + " rdfs:label ?organizationLabel ;"
- + " core:hasSubOrganization ?subOrganization ."
- + " ?subOrganization rdfs:label ?subOrganizationLabel ;"
- + " core:organizationForPosition ?Position . "
- + " ?Position rdf:type core:Position ;"
- + " core:positionForPerson ?Person . "
- + " ?Person core:authorInAuthorship ?Resource ; "
- + " rdfs:label ?PersonLabel ; core:personInPosition ?SecondaryPosition . "
- + " ?Resource core:linkedInformationResource ?Document ."
- + " ?SecondaryPosition rdfs:label ?SecondaryPositionLabel ."
- + SPARQL_QUERY_COMMON_WHERE_CLAUSE + "}"
- + " ORDER BY ?DocumentLabel";
+ + "SELECT (str(?organizationLabel) as ?organizationLabelLit) "
+ + " (str(?subOrganization) as ?subOrganizationLit) "
+ + " (str(?subOrganizationLabel) as ?subOrganizationLabelLit) "
+ + " (str(?DepartmentLabel) as ?departmentLabelLit) "
+ + SPARQL_QUERY_COMMON_SELECT_CLAUSE + " (str(<" + queryURI
+ + ">) as ?" + ENTITY_URL + ") "
+ + "WHERE { " + "<" + queryURI + "> rdf:type foaf:Organization ;"
+ + " rdfs:label ?organizationLabel ."
+ + "{ "
+ + "<" + queryURI + "> core:hasSubOrganization ?subOrganization ."
+ + "?subOrganization rdfs:label ?subOrganizationLabel ; core:organizationForPosition ?Position . "
+ + " ?Position rdf:type core:Position ; core:positionForPerson ?Person ."
+ + " ?Person core:authorInAuthorship ?Resource ; rdfs:label ?PersonLabel ; core:personInPosition ?SecondaryPosition . "
+ + " ?Resource core:linkedInformationResource ?Document . "
+ + " ?SecondaryPosition rdfs:label ?SecondaryPositionLabel ."
+ + SPARQL_QUERY_COMMON_WHERE_CLAUSE + "}"
+ + "UNION "
+ + "{ "
+ + "<" + queryURI + "> rdf:type core:Department ; rdfs:label ?DepartmentLabel ; core:organizationForPosition ?Position ."
+ + " ?Position rdf:type core:Position ; core:positionForPerson ?Person ."
+ + " ?Person core:authorInAuthorship ?Resource ; rdfs:label ?PersonLabel ; core:personInPosition ?SecondaryPosition . "
+ + " ?Resource core:linkedInformationResource ?Document ."
+ + " ?SecondaryPosition rdfs:label ?SecondaryPositionLabel ."
+ + SPARQL_QUERY_COMMON_WHERE_CLAUSE + "}"
+ + "}";
+
System.out.println("\nThe sparql query is :\n" + sparqlQuery);
+
return sparqlQuery;
}
diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/entitycomparison/EntityPublicationCountRequestHandler.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/entitycomparison/EntityPublicationCountRequestHandler.java
index 7c2f1345..efc9752b 100644
--- a/src/edu/cornell/mannlib/vitro/webapp/visualization/entitycomparison/EntityPublicationCountRequestHandler.java
+++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/entitycomparison/EntityPublicationCountRequestHandler.java
@@ -61,13 +61,7 @@ public class EntityPublicationCountRequestHandler implements
String visContainer = vitroRequest
.getParameter(VisualizationFrameworkConstants.VIS_CONTAINER_KEY);
-
- System.out
- .println("\nInside EntityPublicationCountRequestHandler! \n----------------------------------------- ");
- System.out.println("\nEntity URI: " + entityURI + "\nRender Mode: "
- + renderMode + "\nVis Mode: " + ENTITY_VIS_MODE
- + "\nVis Containter: " + visContainer);
-
+
QueryRunner queryManager = new EntityPublicationCountQueryRunner(
entityURI, dataSource, log, ENTITY_VIS_MODE);
@@ -77,68 +71,23 @@ public class EntityPublicationCountRequestHandler implements
if (ENTITY_VIS_MODE.equals("DEPARTMENT")) {
SUB_ENTITY_VIS_MODE = "PERSON";
-// System.out
-// .println("\n\nDocuments within the Entity\n---------------------------------------------");
-// for (BiboDocument document : entity.getPublications()) {
-// System.out.println(document.getDocumentLabel() + " > "
-// + document.getDocumentURL());
-// }
-//
-// System.out
-// .println("\n\nSubEntities within the Entity\n---------------------------------------------");
-//
-// for (SubEntity person : entity.getSubEntities()) {
-// System.out.println(person.getIndividualLabel());
-// }
+
}else if (ENTITY_VIS_MODE.equals("SCHOOL")) {
SUB_ENTITY_VIS_MODE = "DEPARTMENT";
-// System.out
-// .println("\nDocuments within the Entity\n---------------------------------------------");
-// for (BiboDocument document : entity.getPublications()) {
-// System.out.println(document.getDocumentLabel() + " > "
-// + document.getDocumentURL());
-// }
-//
-// System.out
-// .println("\n\nSubEntities within the Entity\n---------------------------------------------");
-// for (SubEntity department : entity.getSubEntities()) {
-// System.out.println(department.getIndividualLabel());
-// }
+
}else {
SUB_ENTITY_VIS_MODE = "SCHOOL";
-// System.out
-// .println("\nDocuments within the Entity\n---------------------------------------------");
-// for (BiboDocument document : entity.getPublications()) {
-// System.out.println(document.getDocumentLabel() + " > "
-// + document.getDocumentURL());
-// }
-//
-// System.out
-// .println("\n\nSubEntities within the Entity\n---------------------------------------------");
-//
-// for (SubEntity school : entity.getSubEntities()) {
-// System.out.println(school.getIndividualLabel());
-//
-// }
+
}
QueryRunner