Skip to content

Commit a50fdd7

Browse files
committed
fix or function
1 parent 5464428 commit a50fdd7

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

lib/woql.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const FramePattern = require('./framePattern');
77
const FrameHelper = require('./frameHelper');
88

99
const WOQL = {};
10+
1011
WOQL.when = function(Query, Update){ return new WOQLQuery().when(Query, Update);}
1112
WOQL.opt = function(query){ return new WOQLQuery().opt(query); }
1213
WOQL.from = function(dburl, query){ return new WOQLQuery().from(dburl, query); }
@@ -34,7 +35,7 @@ WOQL.divide = function(...args){ return new WOQLQuery().divide(...args); }
3435
WOQL.exp = function(a, b){ return new WOQLQuery().exp(a, b); }
3536
WOQL.json = function(json){ return new WOQLQuery().json(json); }
3637
WOQL.rule = function(){ return new FramePattern.FrameRule() }
37-
WOQL.getAllDocuments= function(){return new WOQLQuery().getAllDocuments()}
38+
//WOQL.getAllDocuments= function(){return new WOQLQuery().getAllDocuments()}
3839

3940
function WOQLQuery(query, results){
4041
this.query = (query ? query : {});
@@ -108,7 +109,7 @@ WOQLQuery.prototype.setPagingProperty = function(pageprop, val, q){
108109
WOQLQuery.prototype.addStart = function(val, q){
109110
q = (q ? q : this.query);
110111
for (const prop of Object.keys(q)) {
111-
if(prop == limit) {
112+
if(prop == "limit") {
112113
var nval = { "start": [0, q[prop][1]]}
113114
q[prop][1] = nval;
114115
}
@@ -405,7 +406,7 @@ WOQLQuery.prototype.and = function(...queries){
405406
return this;
406407
}
407408

408-
WOQLQuery.prototype.or = function(queries){
409+
WOQLQuery.prototype.or = function(...queries){
409410
this.cursor["or"] = [];
410411
for(var i = 0; i<queries.length; i++){
411412
if(queries[i].contains_update) this.contains_update = true;
@@ -552,6 +553,9 @@ WOQLQuery.prototype.documentMetadata = function(){
552553
);
553554
}
554555

556+
557+
558+
555559
WOQLQuery.prototype.propertyMetadata = function(){
556560
return this.and(
557561
WOQL.or(
@@ -602,9 +606,9 @@ WOQLQuery.prototype.getDataOfProperty = function(chosen){
602606

603607
WOQLQuery.prototype.documentProperties = function(id){
604608
return this.and(
605-
WOQL.triple(id, "v:Property", "v:Property_Value"),
606-
WOQL.opt().quad("v:Property", "rdfs:label", "v:Property_Label", "db:schema"),
607-
WOQL.opt().quad("v:Property", "rdf:type", "v:Property_Type", "db:schema")
609+
'WOQL.triple(id, "v:Property", "v:Property_Value")',
610+
'WOQL.opt().quad("v:Property", "rdfs:label", "v:Property_Label", "db:schema")',
611+
'WOQL.opt().quad("v:Property", "rdf:type", "v:Property_Type", "db:schema")'
608612
);
609613
}
610614

0 commit comments

Comments
 (0)