Skip to content

Commit ea92835

Browse files
committed
2 parents 69ea908 + 6244409 commit ea92835

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

lib/viewer/woqlGraph.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ WOQLGraph.prototype.setResult = function(result){
4343
}
4444

4545
WOQLGraph.prototype.calculateVariableTypes = function(){
46-
var bindings = this.result.getBindings();
46+
//var bindings = this.result.getBindings();
47+
var bindings = this.result
4748
if(bindings && bindings.length){
4849
for(var i = 0; i<bindings.length; i++){
4950
this.extractFromBinding(bindings[i], i);
@@ -55,7 +56,7 @@ WOQLGraph.prototype.calculateVariableTypes = function(){
5556

5657
WOQLGraph.prototype.extractFromBinding = function(row, rownum){
5758
/*
58-
* check if I have to add the row
59+
* check if I have to add the row
5960
*/
6061
if(this.includeRow(row, rownum)){
6162
//get all the nodes (ids - non literals) //
@@ -78,13 +79,13 @@ WOQLGraph.prototype.extractFromBinding = function(row, rownum){
7879
ndid = (ndid['@value'] ?ndid['@value'] : ndid )
7980
this.addAdornedNode(ndid, nodes[i], row);
8081
}
81-
}
82+
}
8283
}
8384

8485
WOQLGraph.prototype.addAdornedEdge = function(source, target, ks, kt, row){
8586
source = (source['@value'] ?source['@value'] : source )
8687
target = (target['@value'] ? target['@value'] : target )
87-
var edge = { type: "link", target: target, source: source, text: kt};
88+
var edge = { type: "link", target: target, source: source, text: target};
8889
const matched_rules = new WOQLRule().matchEdge(this.config.rules, row, ks, kt);
8990
var hid = false;
9091
for(var i = 0; i<matched_rules.length; i++){
@@ -117,15 +118,15 @@ WOQLGraph.prototype.addAdornedEdge = function(source, target, ks, kt, row){
117118
edge.weight = UTILS.getConfigValue(rule.weight, row);
118119
}
119120
}
120-
if(!hid) this.edges.push(edge);
121+
if(!hid) this.edges.push(edge);
121122
}
122123

123124
/*
124125
* the rules' order are important
125126
*/
126127

127128
WOQLGraph.prototype.addAdornedNode = function(nid, k, row){
128-
var node = { type: "node", id: nid, nodetype: k };
129+
var node = { type: "node", id: nid, nodetype: k};
129130
const matched_rules = new WOQLRule().matchNode(this.config.rules, row, k, nid);
130131
for(var i = 0; i<matched_rules.length; i++){
131132
var rule = matched_rules[i].rule;
@@ -262,7 +263,7 @@ WOQLGraph.prototype.includeNode = function(v, row){
262263
}
263264

264265
/*
265-
* check if I have to visualise literals node
266+
* check if I have to visualise literals node
266267
*/
267268
WOQLGraph.prototype.includeLiteralNode = function(variableName, row){
268269
if(this.config.literals()===false) return false;
@@ -284,4 +285,4 @@ WOQLGraph.prototype.includeRow = function(row, num){
284285

285286

286287

287-
module.exports = WOQLGraph;
288+
module.exports = WOQLGraph;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@terminusdb/terminusdb-client",
3-
"version": "4.2.1",
3+
"version": "4.3.1",
44
"description": "TerminusDB client library",
55
"main": "index.js",
66
"types": "./dist/typescript/index.d.ts",

0 commit comments

Comments
 (0)