@@ -94,6 +94,15 @@ WOQLQuery.prototype.loadDefaultVocabulary = function(){
94
94
vocab . type = "rdf:type" ;
95
95
vocab . label = "rdfs:label" ;
96
96
vocab . Class = "owl:Class" ;
97
+ vocab . DatatypeProperty = "owl:DatatypeProperty" ;
98
+ vocab . ObjectProperty = "owl:ObjectProperty" ;
99
+ vocab . Entity = "tcs:Entity" ;
100
+ vocab . Document = "tcs:Document" ;
101
+ vocab . Relationship = "tcs:Relationship" ;
102
+ vocab . temporality = "tcs:temporality" ;
103
+ vocab . geotemporality = "tcs:geotemporality" ;
104
+ vocab . geography = "tcs:geography" ;
105
+ vocab . abstract = "tcs:abstract" ;
97
106
vocab . comment = "rdfs:comment" ;
98
107
vocab . range = "rdfs:range" ;
99
108
vocab . domain = "rdfs:domain" ;
@@ -277,15 +286,15 @@ WOQLQuery.prototype.prettyPrint = function(indent, show_context, q, embed){
277
286
str += "(\n" + this . nspaces ( indent ) + "WOQL." + clauses . join ( ",\n" + this . nspaces ( indent ) + "WOQL." ) + "\n" + this . nspaces ( indent - this . indent ) + ")" ;
278
287
279
288
}
280
- else if ( typeof val [ val . length - 1 ] == "object" ) {
289
+ else if ( typeof val [ val . length - 1 ] == "object" && typeof val [ val . length - 1 ] [ '@value' ] == "undefined" ) {
281
290
var nvals = [ ]
282
291
for ( var i = 0 ; i < val . length - 1 ; i ++ ) {
283
292
if ( key == "limit" || key == "start" ) {
284
293
nvals . push ( val [ i ] ) ;
285
294
}
286
295
else {
287
296
if ( typeof val [ i ] == "string" ) {
288
- nvals . push ( '"' + self . unclean ( val [ i ] ) + '"' ) ;
297
+ nvals . push ( self . unclean ( val [ i ] ) ) ;
289
298
}
290
299
else if ( typeof val [ i ] == "object" ) {
291
300
nvals . push ( JSON . stringify ( val [ i ] ) ) ;
@@ -297,8 +306,8 @@ WOQLQuery.prototype.prettyPrint = function(indent, show_context, q, embed){
297
306
}
298
307
if ( nvals . length ) {
299
308
str += unclean ( nvals ) ;
300
- if ( key == "from" ) str += ") \n ." ;
301
- else str += ") ." ;
309
+ if ( key == "from" ) str += "\n ." ;
310
+ else str += "." ;
302
311
}
303
312
else {
304
313
str += "()." ;
@@ -474,8 +483,8 @@ WOQLQuery.prototype.when = function(Query, Update){
474
483
475
484
WOQLQuery . prototype . opt = function ( query ) {
476
485
if ( query ) {
477
- q = ( query . json ? query . json ( ) : q ) ;
478
- this . cursor [ "opt" ] = [ query ] ;
486
+ q = ( query . json ? query . json ( ) : query ) ;
487
+ this . cursor [ "opt" ] = [ q ] ;
479
488
}
480
489
else {
481
490
this . cursor [ 'opt' ] = [ { } ] ;
@@ -658,7 +667,8 @@ WOQLQuery.prototype.addClass = function(c, graph){
658
667
}
659
668
660
669
WOQLQuery . prototype . addProperty = function ( p , t , g ) {
661
- if ( p && t ) {
670
+ t = ( t ? t : "xsd:string" ) ;
671
+ if ( p ) {
662
672
graph = ( g ? this . cleanGraph ( g ) : "db:schema" ) ;
663
673
p = ( p . indexOf ( ":" ) == - 1 ) ? "scm:" + p : p ;
664
674
t = ( t . indexOf ( ":" ) == - 1 ) ? this . cleanType ( t ) : t ;
0 commit comments