Skip to content

Commit

Permalink
Fix child traversal error in query (#104)
Browse files Browse the repository at this point in the history
* Fix child traversal error in query

* Fix graph node coloring
  • Loading branch information
dboreham authored Sep 17, 2023
1 parent 42b6801 commit 7acabda
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions scripts/graphioGremlin.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ var graphioGremlin = (function(){
let gremlin_query_edges = "edges = " + traversal_source + ".V(nodes).aggregate('node').outE().as('edge').inV().where(within('node')).select('edge').toList();";
let gremlin_query_edges_no_vars = "edges = " + traversal_source + ".V()"+has_str+".aggregate('node').outE().as('edge').inV().where(within('node')).select('edge').toList();";
//let gremlin_query_edges_no_vars = "edges = " + traversal_source + ".V()"+has_str+".bothE();";
let gremlin_query = gremlin_query_nodes + gremlin_query_edges + "[nodes,edges]";
let gremlin_query = 'g = graph.traversal();' + gremlin_query_nodes + gremlin_query_edges + "[nodes,edges]";
console.log(gremlin_query);

// while busy, show we're doing something in the messageArea.
Expand Down Expand Up @@ -184,7 +184,7 @@ var graphioGremlin = (function(){
if (communication_method == "GraphSON3_4") {
// Version 3.4
gremlin_query_nodes += ".valueMap().with(WithOptions.tokens)";
gremlin_query_nodes += '.fold().inject(' + traversal_source + '.V(' + id + ').valueMap().with(WithOptions.tokens)).unfold()';
gremlin_query_nodes += '.fold().inject(' + '__' + '.V(' + id + ').valueMap().with(WithOptions.tokens)).unfold()';
} else {
gremlin_query_nodes += '.fold().inject(' + traversal_source + '.V(' + id + ')).unfold()';
}
Expand Down Expand Up @@ -535,8 +535,12 @@ var graphioGremlin = (function(){
//console.log(prop_dic)
for (var key in prop_dic) {
if (prop_dic.hasOwnProperty(key)) {
if (data.type == 'vertex') {// Extracting the Vertexproperties (properties of properties for vertices)
var property = prop_dic[key].toString();
if (key == "properties") {
data_dic.properties = { ...data_dic.properties, ...prop_dic[key]}
continue;
}
else if (data.type == 'vertex') {// Extracting the Vertexproperties (properties of properties for vertices)
//var property = prop_dic[key].toString();
//property['summary'] = get_vertex_prop_in_list(prop_dic[key]).toString();
//property = get_vertex_prop_in_list(prop_dic[key]).toString();
} else {
Expand Down

0 comments on commit 7acabda

Please sign in to comment.