@@ -43,7 +43,8 @@ WOQLGraph.prototype.setResult = function(result){
43
43
}
44
44
45
45
WOQLGraph . prototype . calculateVariableTypes = function ( ) {
46
- var bindings = this . result . getBindings ( ) ;
46
+ //var bindings = this.result.getBindings();
47
+ var bindings = this . result
47
48
if ( bindings && bindings . length ) {
48
49
for ( var i = 0 ; i < bindings . length ; i ++ ) {
49
50
this . extractFromBinding ( bindings [ i ] , i ) ;
@@ -55,7 +56,7 @@ WOQLGraph.prototype.calculateVariableTypes = function(){
55
56
56
57
WOQLGraph . prototype . extractFromBinding = function ( row , rownum ) {
57
58
/*
58
- * check if I have to add the row
59
+ * check if I have to add the row
59
60
*/
60
61
if ( this . includeRow ( row , rownum ) ) {
61
62
//get all the nodes (ids - non literals) //
@@ -78,13 +79,13 @@ WOQLGraph.prototype.extractFromBinding = function(row, rownum){
78
79
ndid = ( ndid [ '@value' ] ?ndid [ '@value' ] : ndid )
79
80
this . addAdornedNode ( ndid , nodes [ i ] , row ) ;
80
81
}
81
- }
82
+ }
82
83
}
83
84
84
85
WOQLGraph . prototype . addAdornedEdge = function ( source , target , ks , kt , row ) {
85
86
source = ( source [ '@value' ] ?source [ '@value' ] : source )
86
87
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 } ;
88
89
const matched_rules = new WOQLRule ( ) . matchEdge ( this . config . rules , row , ks , kt ) ;
89
90
var hid = false ;
90
91
for ( var i = 0 ; i < matched_rules . length ; i ++ ) {
@@ -117,15 +118,15 @@ WOQLGraph.prototype.addAdornedEdge = function(source, target, ks, kt, row){
117
118
edge . weight = UTILS . getConfigValue ( rule . weight , row ) ;
118
119
}
119
120
}
120
- if ( ! hid ) this . edges . push ( edge ) ;
121
+ if ( ! hid ) this . edges . push ( edge ) ;
121
122
}
122
123
123
124
/*
124
125
* the rules' order are important
125
126
*/
126
127
127
128
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 } ;
129
130
const matched_rules = new WOQLRule ( ) . matchNode ( this . config . rules , row , k , nid ) ;
130
131
for ( var i = 0 ; i < matched_rules . length ; i ++ ) {
131
132
var rule = matched_rules [ i ] . rule ;
@@ -262,7 +263,7 @@ WOQLGraph.prototype.includeNode = function(v, row){
262
263
}
263
264
264
265
/*
265
- * check if I have to visualise literals node
266
+ * check if I have to visualise literals node
266
267
*/
267
268
WOQLGraph . prototype . includeLiteralNode = function ( variableName , row ) {
268
269
if ( this . config . literals ( ) === false ) return false ;
@@ -284,4 +285,4 @@ WOQLGraph.prototype.includeRow = function(row, num){
284
285
285
286
286
287
287
- module . exports = WOQLGraph ;
288
+ module . exports = WOQLGraph ;
0 commit comments