@@ -7,6 +7,7 @@ const FramePattern = require('./framePattern');
7
7
const FrameHelper = require ( './frameHelper' ) ;
8
8
9
9
const WOQL = { } ;
10
+
10
11
WOQL . when = function ( Query , Update ) { return new WOQLQuery ( ) . when ( Query , Update ) ; }
11
12
WOQL . opt = function ( query ) { return new WOQLQuery ( ) . opt ( query ) ; }
12
13
WOQL . from = function ( dburl , query ) { return new WOQLQuery ( ) . from ( dburl , query ) ; }
@@ -34,7 +35,7 @@ WOQL.divide = function(...args){ return new WOQLQuery().divide(...args); }
34
35
WOQL . exp = function ( a , b ) { return new WOQLQuery ( ) . exp ( a , b ) ; }
35
36
WOQL . json = function ( json ) { return new WOQLQuery ( ) . json ( json ) ; }
36
37
WOQL . rule = function ( ) { return new FramePattern . FrameRule ( ) }
37
- WOQL . getAllDocuments = function ( ) { return new WOQLQuery ( ) . getAllDocuments ( ) }
38
+ // WOQL.getAllDocuments= function(){return new WOQLQuery().getAllDocuments()}
38
39
39
40
function WOQLQuery ( query , results ) {
40
41
this . query = ( query ? query : { } ) ;
@@ -108,7 +109,7 @@ WOQLQuery.prototype.setPagingProperty = function(pageprop, val, q){
108
109
WOQLQuery . prototype . addStart = function ( val , q ) {
109
110
q = ( q ? q : this . query ) ;
110
111
for ( const prop of Object . keys ( q ) ) {
111
- if ( prop == limit ) {
112
+ if ( prop == " limit" ) {
112
113
var nval = { "start" : [ 0 , q [ prop ] [ 1 ] ] }
113
114
q [ prop ] [ 1 ] = nval ;
114
115
}
@@ -405,7 +406,7 @@ WOQLQuery.prototype.and = function(...queries){
405
406
return this ;
406
407
}
407
408
408
- WOQLQuery . prototype . or = function ( queries ) {
409
+ WOQLQuery . prototype . or = function ( ... queries ) {
409
410
this . cursor [ "or" ] = [ ] ;
410
411
for ( var i = 0 ; i < queries . length ; i ++ ) {
411
412
if ( queries [ i ] . contains_update ) this . contains_update = true ;
@@ -552,6 +553,9 @@ WOQLQuery.prototype.documentMetadata = function(){
552
553
) ;
553
554
}
554
555
556
+
557
+
558
+
555
559
WOQLQuery . prototype . propertyMetadata = function ( ) {
556
560
return this . and (
557
561
WOQL . or (
@@ -602,9 +606,9 @@ WOQLQuery.prototype.getDataOfProperty = function(chosen){
602
606
603
607
WOQLQuery . prototype . documentProperties = function ( id ) {
604
608
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")'
608
612
) ;
609
613
}
610
614
0 commit comments