@@ -57,8 +57,8 @@ WOQLQuery.prototype.literal = function(s, t) {
57
57
58
58
WOQLQuery . prototype . iri = function ( s ) {
59
59
return {
60
- '@type' : 'woql:Node ' ,
61
- 'woql: node' : s ,
60
+ '@type' : 'NodeValue ' ,
61
+ 'node' : s ,
62
62
}
63
63
}
64
64
@@ -130,7 +130,7 @@ WOQLQuery.prototype.property = function(proId, type_or_value) {
130
130
let part = this . findLastSubject ( this . cursor )
131
131
let g = false
132
132
let gpart
133
- if ( part ) gpart = part [ 'woql: graph_filter' ] || part [ 'woql: graph' ]
133
+ if ( part ) gpart = part [ 'graph_filter' ] || part [ 'graph' ]
134
134
if ( gpart ) g = gpart [ '@value' ]
135
135
let nprop = new WOQLQuery ( )
136
136
. add_property ( proId , type_or_value , g )
@@ -144,13 +144,13 @@ WOQLQuery.prototype.property = function(proId, type_or_value) {
144
144
145
145
WOQLQuery . prototype . node = function ( node , type ) {
146
146
type = type || false
147
- if ( type == 'add_quad' ) type = 'AddQuad '
148
- else if ( type == 'delete_quad' ) type = 'DeleteQuad '
147
+ if ( type == 'add_quad' ) type = 'AddTriple '
148
+ else if ( type == 'delete_quad' ) type = 'DeleteTriple '
149
149
else if ( type == 'add_triple' ) type = 'AddTriple'
150
150
else if ( type == 'delete_triple' ) type = 'DeleteTriple'
151
- else if ( type == 'quad' ) type = 'Quad '
151
+ else if ( type == 'quad' ) type = 'Triple '
152
152
else if ( type == 'triple' ) type = 'Triple'
153
- if ( type && type . indexOf ( ':' ) == - 1 ) type = 'woql:' + type
153
+ if ( type && type . indexOf ( ':' ) == - 1 ) type = type
154
154
let ctxt = { subject : node }
155
155
if ( type ) ctxt . action = type
156
156
this . _set_context ( ctxt )
@@ -161,9 +161,9 @@ WOQLQuery.prototype.insert = function(id, type, refGraph) {
161
161
type = this . cleanType ( type , true )
162
162
refGraph = refGraph || ( this . triple_builder_context ? this . triple_builder_context . graph : false )
163
163
if ( refGraph ) {
164
- return this . add_quad ( id , 'type' , type , refGraph )
164
+ return this . add_quad ( id , 'rdf: type' , '@schema:' + type , refGraph )
165
165
}
166
- return this . add_triple ( id , 'type' , type )
166
+ return this . add_triple ( id , 'rdf: type' , '@schema:' + type )
167
167
}
168
168
169
169
WOQLQuery . prototype . insert_data = function ( data , refGraph ) {
@@ -290,24 +290,24 @@ WOQLQuery.prototype._add_partial = function(s, p, o, g) {
290
290
//if the last subject is a cardinality restriction quad
291
291
//I'm looking for the last property
292
292
if (
293
- lastsubj [ 'woql: predicate' ] &&
294
- lastsubj [ 'woql: predicate' ] [ 'woql: node' ] &&
295
- lastsubj [ 'woql: predicate' ] [ 'woql: node' ] . indexOf ( 'Cardinality' ) > - 1
293
+ lastsubj [ 'predicate' ] &&
294
+ lastsubj [ 'predicate' ] [ 'node' ] &&
295
+ lastsubj [ 'predicate' ] [ 'node' ] . indexOf ( 'Cardinality' ) > - 1
296
296
) {
297
297
lastsubj = this . findLastProperty ( this . cursor )
298
298
}
299
- if ( lastsubj && ! s ) s = lastsubj [ 'woql: subject' ]
299
+ if ( lastsubj && ! s ) s = lastsubj [ 'subject' ]
300
300
let t = ctxt . action || lastsubj [ '@type' ]
301
301
if ( ! g ) {
302
- const gobj = lastsubj [ 'woql: graph_filter' ] || lastsubj [ 'woql: graph' ]
303
- g = gobj ? gobj [ '@value' ] : 'schema/main '
302
+ const gobj = lastsubj [ 'graph_filter' ] || lastsubj [ 'graph' ]
303
+ g = gobj ? gobj [ '@value' ] : 'schema'
304
304
}
305
- if ( t == 'woql: AddTriple' ) this . and ( new WOQLQuery ( ) . add_triple ( s , p , o ) )
306
- else if ( t == 'woql: DeleteTriple' ) this . and ( new WOQLQuery ( ) . delete_triple ( s , p , o ) )
307
- else if ( t == 'woql:AddQuad ' ) this . and ( new WOQLQuery ( ) . add_quad ( s , p , o , g ) )
308
- else if ( t == 'woql:DeleteQuad ' ) this . and ( new WOQLQuery ( ) . delete_quad ( s , p , o , g ) )
309
- else if ( t == 'woql:Quad ' ) this . and ( new WOQLQuery ( ) . quad ( s , p , o , g ) )
310
- else this . and ( new WOQLQuery ( ) . triple ( s , p , o ) )
305
+ if ( t == 'AddTriple' ) this . and ( new WOQLQuery ( ) . add_quad ( s , p , o , g ) )
306
+ else if ( t == 'DeleteTriple' ) this . and ( new WOQLQuery ( ) . delete_quad ( s , p , o , g ) )
307
+ else if ( t == 'AddTriple ' ) this . and ( new WOQLQuery ( ) . add_quad ( s , p , o , g ) )
308
+ else if ( t == 'DeleteTriple ' ) this . and ( new WOQLQuery ( ) . delete_quad ( s , p , o , g ) )
309
+ else if ( t == 'Triple ' ) this . and ( new WOQLQuery ( ) . quad ( s , p , o , g ) )
310
+ else this . and ( new WOQLQuery ( ) . quad ( s , p , o , g ) )
311
311
return this
312
312
}
313
313
@@ -318,7 +318,7 @@ WOQLQuery.prototype._add_partial = function(s, p, o, g) {
318
318
WOQLQuery . prototype . _adding_class = function ( string_only ) {
319
319
if ( this . triple_builder_context ) {
320
320
let x = this . triple_builder_context [ 'adding_class' ]
321
- if ( x && string_only && typeof x == 'object' ) return x [ 'woql: node' ]
321
+ if ( x && string_only && typeof x == 'object' ) return x [ 'node' ]
322
322
return x
323
323
}
324
324
return false
@@ -346,14 +346,14 @@ WOQLQuery.prototype._set_context = function(ctxt) {
346
346
* used to find the class that a property cardinality restriction is applied to
347
347
*/
348
348
WOQLQuery . prototype . _get_object = function ( s , p ) {
349
- if ( this . cursor [ '@type' ] == 'woql: And' ) {
350
- for ( var i = 0 ; i < this . cursor [ 'woql: query_list' ] . length ; i ++ ) {
351
- let subq = this . cursor [ 'woql: query_list' ] [ i ] [ 'woql: query' ]
349
+ if ( this . cursor [ '@type' ] == 'And' ) {
350
+ for ( var i = 0 ; i < this . cursor [ 'query_list' ] . length ; i ++ ) {
351
+ let subq = this . cursor [ 'query_list' ] [ i ] [ 'query' ]
352
352
if (
353
- this . _same_entry ( subq [ 'woql: subject' ] , s ) &&
354
- this . _same_entry ( subq [ 'woql: predicate' ] , p )
353
+ this . _same_entry ( subq [ 'subject' ] , s ) &&
354
+ this . _same_entry ( subq [ 'predicate' ] , p )
355
355
)
356
- return subq [ 'woql: object' ]
356
+ return subq [ 'object' ]
357
357
}
358
358
}
359
359
return false
@@ -385,9 +385,9 @@ WOQLQuery.prototype._same_entry = function(a, b) {
385
385
* @returns {string|boolean }
386
386
*/
387
387
WOQLQuery . prototype . _string_matches_object = function ( str , node ) {
388
- if ( node [ 'woql: node' ] ) return str == node [ 'woql: node' ]
388
+ if ( node [ 'node' ] ) return str == node [ 'node' ]
389
389
if ( node [ '@value' ] ) return str == node [ '@value' ]
390
- if ( node [ 'woql: variable_name' ] ) return str == 'v:' + node [ 'woql: variable_name' ] [ '@value' ]
390
+ if ( node [ 'variable_name' ] ) return str == 'v:' + node [ 'variable_name' ] [ '@value' ]
391
391
return false
392
392
}
393
393
@@ -405,14 +405,14 @@ WOQLQuery.prototype._card = function(cardValue, which) {
405
405
let subject = ctxt . subject
406
406
let graph = ctxt . graph
407
407
let lastsubj = this . findLastProperty ( this . cursor )
408
- if ( lastsubj && ! subject ) subject = lastsubj [ 'woql: subject' ]
408
+ if ( lastsubj && ! subject ) subject = lastsubj [ 'subject' ]
409
409
if ( typeof subject === 'object' ) {
410
- if ( subject [ 'woql: node' ] ) subject = subject [ 'woql: node' ]
410
+ if ( subject [ 'node' ] ) subject = subject [ 'node' ]
411
411
else return this
412
412
}
413
413
414
414
if ( lastsubj && ! graph ) {
415
- const gobj = lastsubj [ 'woql: graph_filter' ] || lastsubj [ 'woql: graph' ]
415
+ const gobj = lastsubj [ 'graph_filter' ] || lastsubj [ 'graph' ]
416
416
graph = gobj ? gobj [ '@value' ] : false
417
417
}
418
418
let cardId = subject + '_' + which + '_' + cardValue
0 commit comments