@@ -58,12 +58,12 @@ WOQLQuery.prototype.iri = function(s) {
5858}
5959
6060WOQLQuery . prototype . update_triple = function ( subject , predicate , new_object , old_object ) {
61- old_object = old_object || 'v:AnyObject'
61+ const tmp_name = old_object || 'v:AnyObject__' + Date . now ( )
6262 return this . and (
6363 new WOQLQuery ( ) . opt (
6464 new WOQLQuery ( )
65- . triple ( subject , predicate , old_object )
66- . delete_triple ( subject , predicate , old_object )
65+ . triple ( subject , predicate , tmp_name )
66+ . delete_triple ( subject , predicate , tmp_name )
6767 . not ( )
6868 . triple ( subject , predicate , new_object ) ,
6969 ) ,
@@ -81,11 +81,12 @@ WOQLQuery.prototype.update_triple = function(subject, predicate, new_object, old
8181 */
8282
8383WOQLQuery . prototype . update_quad = function ( subject , predicate , new_object , graph ) {
84+ const tmp_name = 'v:AnyObject__' + Date . now ( )
8485 return this . and (
8586 new WOQLQuery ( ) . opt (
8687 new WOQLQuery ( )
87- . quad ( subject , predicate , 'v:AnyObject' , graph )
88- . delete_quad ( subject , predicate , 'v:AnyObject' , graph )
88+ . quad ( subject , predicate , tmp_name , graph )
89+ . delete_quad ( subject , predicate , tmp_name , graph )
8990 . not ( )
9091 . quad ( subject , predicate , new_object , graph ) ,
9192 ) ,
0 commit comments