@@ -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
@@ -343,15 +345,6 @@ WOQLQuery.prototype.setPage = function(pagenum){
343
345
return this ;
344
346
}
345
347
346
-
347
- WOQLQuery . prototype . hasStart = function ( ) {
348
- return ( typeof this . getPagingProperty ( "start" ) != "undefined" ) ;
349
- }
350
-
351
- WOQLQuery . prototype . getStart = function ( ) {
352
- return this . getPagingProperty ( "start" ) ;
353
- }
354
-
355
348
WOQLQuery . prototype . nextPage = function ( ) {
356
349
return this . setPage ( this . getPage ( ) + 1 ) ;
357
350
}
@@ -366,6 +359,18 @@ WOQLQuery.prototype.previousPage = function(){
366
359
return this ;
367
360
}
368
361
362
+ WOQLQuery . prototype . setPageSize = function ( size ) {
363
+ this . setPagingProperty ( "limit" , size ) ;
364
+ if ( this . hasStart ( ) ) {
365
+ this . setStart ( 0 ) ;
366
+ }
367
+ else {
368
+ this . addStart ( 0 ) ;
369
+ }
370
+ return this ;
371
+ }
372
+
373
+
369
374
WOQLQuery . prototype . hasSelect = function ( ) {
370
375
return this . getPagingProperty ( "select" ) ;
371
376
}
@@ -386,19 +391,17 @@ WOQLQuery.prototype.getSelectVariables = function(q){
386
391
}
387
392
}
388
393
389
- WOQLQuery . prototype . setStart = function ( start ) {
390
- return this . setPagingProperty ( "start" , start ) ;
394
+
395
+ WOQLQuery . prototype . hasStart = function ( ) {
396
+ return ( typeof this . getPagingProperty ( "start" ) != "undefined" ) ;
391
397
}
392
398
393
- WOQLQuery . prototype . setPageSize = function ( size ) {
394
- this . setPagingProperty ( "limit" , size ) ;
395
- if ( this . hasStart ( ) ) {
396
- this . setStart ( 0 ) ;
397
- }
398
- else {
399
- this . addStart ( 0 ) ;
400
- }
401
- return this ;
399
+ WOQLQuery . prototype . getStart = function ( ) {
400
+ return this . getPagingProperty ( "start" ) ;
401
+ }
402
+
403
+ WOQLQuery . prototype . setStart = function ( start ) {
404
+ return this . setPagingProperty ( "start" , start ) ;
402
405
}
403
406
404
407
/*
@@ -772,6 +775,7 @@ WOQLQuery.prototype.elementMetadata = function(){
772
775
WOQL . opt ( ) . quad ( "v:Element" , "tcs:tag" , "v:Abstract" , "db:schema" ) ,
773
776
WOQL . opt ( ) . quad ( "v:Element" , "rdfs:label" , "v:Label" , "db:schema" ) ,
774
777
WOQL . opt ( ) . quad ( "v:Element" , "rdfs:comment" , "v:Comment" , "db:schema" ) ,
778
+ WOQL . opt ( ) . quad ( "v:Element" , "rdfs:subClassOf" , "v:Parent" , "db:schema" ) ,
775
779
WOQL . opt ( ) . quad ( "v:Element" , "rdfs:domain" , "v:Domain" , "db:schema" ) ,
776
780
WOQL . opt ( ) . quad ( "v:Element" , "rdfs:range" , "v:Range" , "db:schema" )
777
781
) ;
@@ -866,36 +870,36 @@ WOQLQuery.prototype.cleanSubject = function(s){
866
870
if ( typeof s != "string" ) return s ;
867
871
if ( s . indexOf ( ":" ) != - 1 ) return s ;
868
872
if ( this . vocab && this . vocab [ s ] ) return this . vocab [ s ] ;
869
- return "v :" + s ;
873
+ return "doc :" + s ;
870
874
}
871
875
872
876
WOQLQuery . prototype . cleanPredicate = function ( p ) {
873
877
if ( p . indexOf ( ":" ) != - 1 ) return p ;
874
878
if ( this . vocab && this . vocab [ p ] ) return this . vocab [ p ] ;
875
- return "v :" + p ;
879
+ return "scm :" + p ;
876
880
}
877
881
WOQLQuery . prototype . cleanType = function ( t ) {
878
882
if ( t . indexOf ( ":" ) != - 1 ) return t ;
879
883
if ( this . vocab && this . vocab [ t ] ) return this . vocab [ t ] ;
880
- return "v :" + t ;
884
+ return "scm :" + t ;
881
885
}
882
886
883
887
WOQLQuery . prototype . cleanObject = function ( o ) {
884
888
if ( typeof o != "string" || o . indexOf ( ":" ) != - 1 ) return o ;
885
889
if ( this . vocab && this . vocab [ o ] ) return this . vocab [ o ] ;
886
- return "v:" + o ;
890
+ return { "@value" : o , "@language" : "en" } ;
887
891
}
888
892
889
893
WOQLQuery . prototype . cleanGraph = function ( g ) {
890
894
if ( g . indexOf ( ":" ) != - 1 ) return g ;
891
895
if ( this . vocab && this . vocab [ g ] ) return this . vocab [ g ] ;
892
- return "v :" + g ;
896
+ return "db :" + g ;
893
897
}
894
898
895
899
WOQLQuery . prototype . cleanClass = function ( c ) {
896
900
if ( c . indexOf ( ":" ) != - 1 ) return c ;
897
901
if ( this . vocab && this . vocab [ c ] ) return this . vocab [ c ] ;
898
- return "v :" + c ;
902
+ return "scm :" + c ;
899
903
}
900
904
901
905
/**
@@ -1043,7 +1047,7 @@ TripleBuilder.prototype.min = function(m){
1043
1047
return this . card ( m , "min" ) ;
1044
1048
}
1045
1049
1046
- TripleBuilder . prototype . s = function ( s ) {
1050
+ TripleBuilder . prototype . node = function ( s ) {
1047
1051
this . subject = this . query . cleanSubject ( s ) ;
1048
1052
return this ;
1049
1053
}
0 commit comments