Skip to content

Commit d3eb2e1

Browse files
Merge pull request #204 from terminusdb/dashboard-local
fix update_triple
2 parents 5e10d57 + f876c19 commit d3eb2e1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/query/woqlBuilder.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
const WOQLQuery = require('./woqlQuery');
1414
const WOQLLibrary = require('./woqlLibrary');
1515

16+
WOQLQuery.prototype.counter = 1;
1617
/* class WOQLQuery extends WOQLQueryImp {
1718
constructor(query) {
1819
super(query)
@@ -63,7 +64,7 @@ WOQLQuery.prototype.iri = function (s) {
6364
};
6465

6566
WOQLQuery.prototype.update_triple = function (subject, predicate, new_object, old_object) {
66-
const tmp_name = old_object || `v:AnyObject__${Date.now()}`;
67+
const tmp_name = old_object || `v:AnyObject__${this.counter += 1}`;
6768
return this.and(
6869
new WOQLQuery().opt(
6970
new WOQLQuery()
@@ -88,7 +89,7 @@ WOQLQuery.prototype.update_triple = function (subject, predicate, new_object, ol
8889
*/
8990

9091
WOQLQuery.prototype.update_quad = function (subject, predicate, new_object, graph) {
91-
const tmp_name = `v:AnyObject__${Date.now()}`;
92+
const tmp_name = `v:AnyObject__${this.counter += 1}`;
9293
return this.and(
9394
new WOQLQuery().opt(
9495
new WOQLQuery()

0 commit comments

Comments
 (0)