Skip to content

Commit f675d98

Browse files
author
Gaurav SinghaRoy
committed
equivalent query in inequality filters
1 parent 8b972d0 commit f675d98

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

app/assets/javascripts/resources/querybuilder.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ QueryBuilder = {
8383
if(v.type == "data"){
8484
result += "\n&& (?d_filter"+k.toString()+" "+v.value+")";
8585
}
86+
else if(v.type == "object" && v.filter_type == "not_equals"){
87+
for(i=0;i<v.value.length;i++){
88+
result += "\n&& (?o_filter"+k.toString()+" != <"+v.value[i].uri+">)";
89+
}
90+
}
8691
});
8792
result += ")}\n";
8893
return result;
@@ -345,10 +350,15 @@ QueryBuilder = {
345350
$.each(selected_filter_values,function(k,v){
346351
if(v.type == "object"){
347352
// section for object type properties
348-
for(j=0;j<v.value.length;j++){
349-
if(j>0)
350-
result += " UNION ";
351-
result += "{ ?concept <"+v.property_uri+"> <"+v.value[j]["uri"]+"> }";
353+
if(v.filter_type == "not_equals"){
354+
result += "?concept <"+v.property_uri+"> ?o_filter"+k.toString();
355+
}
356+
else{
357+
for(j=0;j<v.value.length;j++){
358+
if(j>0)
359+
result += " UNION ";
360+
result += "{ ?concept <"+v.property_uri+"> <"+v.value[j]["uri"]+"> }";
361+
}
352362
}
353363
result += ".\n"
354364
}

0 commit comments

Comments
 (0)