You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Get co-authors for node and add edge to graph only if that
60
61
// neighbor is within our radius
61
-
62
-
// we have uri -> coauthors.uri -> site
63
-
// PreparedStatement theStmt =
64
-
// conn.prepareStatement("select candidate.*,person.uri from vivo_aggregated.person, vivo_aggregated.site_loc as candidate, vivo_aggregated.site_loc as center where center.id=person.id and center.id=? and circle(center.position,(?/111.0)) @> candidate.position");
65
62
PreparedStatementtheStmt = conn
66
63
.prepareStatement("select candidate.* from vivo_aggregated.site_loc as candidate, vivo_aggregated.site_loc as center where center.id=? and circle(center.position,(?/111.0)) @> candidate.position");
67
64
@@ -71,37 +68,29 @@ public void filterNodes(Graph theGraph, String selectedNode, int radius) {
logger.debug("Sites within our search radius are " + sites);
75
+
logger.debug("Sites within our search radius are " + sites + "size of hashtable " + sites_hash.size());
78
76
rs.close();
79
77
theStmt.close();
80
78
logger.debug("Before Filter: Number of nodes=" + nodes.size() + " Number of edges=" + edges.size());
79
+
81
80
// keep nodes belonging to site above and remove others
82
-
theStmt = conn.prepareStatement("select person.uri from vivo_aggregated.person where person.id not in (" + sites.substring(0, sites.length() - 1) + ")");
83
-
logger.debug("Query:: " + theStmt.toString());
84
-
rs = theStmt.executeQuery();
85
-
while (rs.next()) {
86
-
uri = rs.getString(1);
87
-
GraphNodenode = theGraph.getNode(uri);
88
-
if (node != null) {
89
-
theGraph.removeNode(node);
90
-
try {
91
-
if (theGraph.getNode(uri) != null) {
92
-
logger.debug("Something is wrong");
93
-
}
94
-
} catch (Exceptione) {
95
-
e.printStackTrace();
96
-
}
81
+
for (intx = nodes.size() - 1; x >= 0; x--) {
82
+
GraphNoden = nodes.elementAt(x);
83
+
if (!sites_hash.containsKey(n.getGroup("site"))){
84
+
logger.trace("Current node :" + n.getLabel() + " does not match the filter criteria with site:"+ n.getGroup("site"));
85
+
theGraph.removeNode(n);
86
+
}
97
87
}
98
-
}
99
88
logger.debug("After Filter: Number of nodes=" + nodes.size() + " Number of edges=" + edges.size());
0 commit comments