Skip to content

Commit

Permalink
add node and edge limits to graph info query
Browse files Browse the repository at this point in the history
  • Loading branch information
bricaud committed Apr 15, 2020
1 parent adab60d commit 20c76e5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions scripts/graphConf.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ const SINGLE_COMMANDS_AND_NO_VARS = false;
const REST_TIMEOUT = 2000
// TODO: configuration for the secure server

// limit number for graph info (avoid overwhelming the server for large graphs)
const limit_request = 10000

// Graph configuration
const default_nb_of_layers = 3;
Expand Down
8 changes: 4 additions & 4 deletions scripts/graphioGremlin.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ var graphioGremlin = (function(){
}

function get_graph_info(){
var gremlin_query_nodes = "nodes = " + traversal_source + ".V().groupCount().by(label);"
var gremlin_query_edges = "edges = " + traversal_source + ".E().groupCount().by(label);"
var gremlin_query_nodes_prop = "nodesprop = " + traversal_source + ".V().valueMap().select(keys).groupCount();"
var gremlin_query_edges_prop = "edgesprop = " + traversal_source + ".E().valueMap().select(keys).groupCount();"
var gremlin_query_nodes = "nodes = " + traversal_source + ".V().limit(" + limit_request + ").groupCount().by(label);"
var gremlin_query_edges = "edges = " + traversal_source + ".E().limit(" + limit_request + ").groupCount().by(label);"
var gremlin_query_nodes_prop = "nodesprop = " + traversal_source + ".V().limit(" + limit_request + ").valueMap().select(keys).groupCount();"
var gremlin_query_edges_prop = "edgesprop = " + traversal_source + ".E().limit(" + limit_request + ").valueMap().select(keys).groupCount();"

var gremlin_query = gremlin_query_nodes+gremlin_query_nodes_prop
+gremlin_query_edges+gremlin_query_edges_prop
Expand Down
1 change: 1 addition & 0 deletions scripts/infobox.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ var infobox = (function(){
function create(label_graph,label_graphElem){
var graph_bar = d3.select(label_graph);
graph_bar.append("h2").text("Graph Info");
graph_bar.append("h4").text("Limited to the first " + limit_request + " nodes and edges");
_table_Graphinfo = graph_bar.append("table").attr("id","tableGraph");
init_table(_table_Graphinfo,["Type","Count"]);

Expand Down

0 comments on commit 20c76e5

Please sign in to comment.