@@ -50,6 +50,8 @@ WOQL.list = function(vars){ return new WOQLQuery().list(vars); }
50
50
//These ones are special ones for dealing with the schema only...
51
51
WOQL . addClass = function ( classid , graph ) { return new WOQLQuery ( ) . addClass ( classid , graph ) ; }
52
52
WOQL . addProperty = function ( propid , type , graph ) { return new WOQLQuery ( ) . addProperty ( propid , type , graph ) ; }
53
+ WOQL . deleteClass = function ( classid , graph ) { return new WOQLQuery ( ) . deleteClass ( classid , graph ) ; }
54
+ WOQL . deleteProperty = function ( propid , type , graph ) { return new WOQLQuery ( ) . deleteProperty ( propid , type , graph ) ; }
53
55
WOQL . node = function ( nodeid , type ) { return new WOQLQuery ( ) . node ( nodeid , type ) ; }
54
56
55
57
@@ -233,7 +235,6 @@ WOQLQuery.prototype.nspaces = function (n) {
233
235
return spaces ;
234
236
} ;
235
237
236
-
237
238
WOQLQuery . prototype . prettyPrint = function ( indent , show_context , q , embed ) {
238
239
if ( ! embed ) this . indent = indent ;
239
240
q = ( q ? q : this . query ) ;
@@ -344,6 +345,7 @@ WOQLQuery.prototype.setPage = function (pagenum) {
344
345
return this ;
345
346
} ;
346
347
348
+ < << << << HEAD
347
349
348
350
WOQLQuery . prototype . hasStart = function ( ) {
349
351
return ( typeof this . getPagingProperty ( 'start' ) !== 'undefined' ) ;
@@ -354,6 +356,9 @@ WOQLQuery.prototype.getStart = function () {
354
356
} ;
355
357
356
358
WOQLQuery . prototype . nextPage = function ( ) {
359
+ = === ===
360
+ WOQLQuery . prototype . nextPage = function ( ) {
361
+ > >>> >>> c85055e6384aa4c834e1a014093ad63850781f8f
357
362
return this . setPage ( this . getPage ( ) + 1 ) ;
358
363
} ;
359
364
@@ -367,9 +372,26 @@ WOQLQuery.prototype.previousPage = function () {
367
372
return this ;
368
373
} ;
369
374
375
+ < << << << HEAD
370
376
WOQLQuery . prototype . hasSelect = function ( ) {
371
377
return this . getPagingProperty ( 'select' ) ;
372
378
} ;
379
+ = === ===
380
+ WOQLQuery . prototype . setPageSize = function ( size ) {
381
+ this . setPagingProperty ( "limit" , size ) ;
382
+ if ( this . hasStart ( ) ) {
383
+ this . setStart ( 0 ) ;
384
+ }
385
+ else {
386
+ this . addStart ( 0 ) ;
387
+ }
388
+ return this ;
389
+ }
390
+
391
+ WOQLQuery . prototype . hasSelect = function ( ) {
392
+ return this . getPagingProperty ( "select" ) ;
393
+ }
394
+ >>> > >>> c85055e6384aa4c834e1a014093ad63850781f8f
373
395
374
396
WOQLQuery . prototype . getSelectVariables = function ( q ) {
375
397
q = ( q || this . query ) ;
@@ -387,6 +409,7 @@ WOQLQuery.prototype.getSelectVariables = function (q) {
387
409
}
388
410
} ;
389
411
412
+ < << << << HEAD
390
413
WOQLQuery . prototype . setStart = function ( start ) {
391
414
return this . setPagingProperty ( "start" , start ) ;
392
415
}
@@ -400,6 +423,19 @@ WOQLQuery.prototype.setPageSize = function (size) {
400
423
}
401
424
return this ;
402
425
} ;
426
+ = === ===
427
+ WOQLQuery . prototype . hasStart = function ( ) {
428
+ return ( typeof this . getPagingProperty ( "start" ) != "undefined" ) ;
429
+ }
430
+
431
+ WOQLQuery . prototype . getStart = function ( ) {
432
+ return this . getPagingProperty ( "start" ) ;
433
+ }
434
+
435
+ WOQLQuery . prototype . setStart = function ( start ) {
436
+ return this . setPagingProperty ( "start" , start ) ;
437
+ }
438
+ >>> > >>> c85055e6384aa4c834e1a014093ad63850781f8f
403
439
404
440
/*
405
441
* Called to indicate an update that is the last chainable element in a query
@@ -763,12 +799,22 @@ WOQLQuery.prototype.propertyMetadata = function(){
763
799
764
800
WOQLQuery . prototype . elementMetadata = function ( ) {
765
801
return this . and (
802
+ < << << << HEAD
766
803
WOQL . quad ( 'v:Element' , 'rdf:type' , 'v:Type' , 'db:schema' ) ,
767
804
WOQL . opt ( ) . quad ( 'v:Element' , 'tcs:tag' , 'v:Abstract' , 'db:schema' ) ,
768
805
WOQL . opt ( ) . quad ( 'v:Element' , 'rdfs:label' , 'v:Label' , 'db:schema' ) ,
769
806
WOQL . opt ( ) . quad ( 'v:Element' , 'rdfs:comment' , 'v:Comment' , 'db:schema' ) ,
770
807
WOQL . opt ( ) . quad ( 'v:Element' , 'rdfs:domain' , 'v:Domain' , 'db:schema' ) ,
771
808
WOQL . opt ( ) . quad ( 'v:Element' , 'rdfs:range' , 'v:Range' , 'db:schema' )
809
+ === = ===
810
+ WOQL . quad ( "v:Element" , "rdf:type" , "v:Type" , "db:schema" ) ,
811
+ WOQL . opt ( ) . quad ( "v:Element" , "tcs:tag" , "v:Abstract" , "db:schema" ) ,
812
+ WOQL . opt ( ) . quad ( "v:Element" , "rdfs:label" , "v:Label" , "db:schema" ) ,
813
+ WOQL . opt ( ) . quad ( "v:Element" , "rdfs:comment" , "v:Comment" , "db:schema" ) ,
814
+ WOQL . opt ( ) . quad ( "v:Element" , "rdfs:subClassOf" , "v:Parent" , "db:schema" ) ,
815
+ WOQL . opt ( ) . quad ( "v:Element" , "rdfs:domain" , "v:Domain" , "db:schema" ) ,
816
+ WOQL . opt ( ) . quad ( "v:Element" , "rdfs:range" , "v:Range" , "db:schema" )
817
+ >>> > >>> c85055e6384aa4c834e1a014093ad63850781f8f
772
818
) ;
773
819
} ;
774
820
@@ -861,36 +907,36 @@ WOQLQuery.prototype.cleanSubject = function(s){
861
907
if ( typeof s != "string" ) return s ;
862
908
if ( s . indexOf ( ":" ) != - 1 ) return s ;
863
909
if ( this . vocab && this . vocab [ s ] ) return this . vocab [ s ] ;
864
- return "v :" + s ;
910
+ return "doc :" + s ;
865
911
}
866
912
867
913
WOQLQuery . prototype . cleanPredicate = function ( p ) {
868
914
if ( p . indexOf ( ":" ) != - 1 ) return p ;
869
915
if ( this . vocab && this . vocab [ p ] ) return this . vocab [ p ] ;
870
- return "v :" + p ;
916
+ return "scm :" + p ;
871
917
}
872
918
WOQLQuery . prototype . cleanType = function ( t ) {
873
919
if ( t . indexOf ( ":" ) != - 1 ) return t ;
874
920
if ( this . vocab && this . vocab [ t ] ) return this . vocab [ t ] ;
875
- return "v :" + t ;
921
+ return "scm :" + t ;
876
922
}
877
923
878
924
WOQLQuery . prototype . cleanObject = function ( o ) {
879
925
if ( typeof o != "string" || o . indexOf ( ":" ) != - 1 ) return o ;
880
926
if ( this . vocab && this . vocab [ o ] ) return this . vocab [ o ] ;
881
- return "v:" + o ;
927
+ return { "@value" : o , "@language" : "en" } ;
882
928
}
883
929
884
930
WOQLQuery . prototype . cleanGraph = function ( g ) {
885
931
if ( g . indexOf ( ":" ) != - 1 ) return g ;
886
932
if ( this . vocab && this . vocab [ g ] ) return this . vocab [ g ] ;
887
- return "v :" + g ;
933
+ return "db :" + g ;
888
934
}
889
935
890
936
WOQLQuery . prototype . cleanClass = function ( c ) {
891
937
if ( c . indexOf ( ":" ) != - 1 ) return c ;
892
938
if ( this . vocab && this . vocab [ c ] ) return this . vocab [ c ] ;
893
- return "v :" + c ;
939
+ return "scm :" + c ;
894
940
}
895
941
896
942
/**
@@ -1038,7 +1084,7 @@ TripleBuilder.prototype.min = function(m){
1038
1084
return this . card ( m , "min" ) ;
1039
1085
}
1040
1086
1041
- TripleBuilder . prototype . s = function ( s ) {
1087
+ TripleBuilder . prototype . node = function ( s ) {
1042
1088
this . subject = this . query . cleanSubject ( s ) ;
1043
1089
return this ;
1044
1090
}
0 commit comments