From 54bb42cdef4668762668c2614f5868007f781869 Mon Sep 17 00:00:00 2001 From: Gavin Mendel-Gleason Date: Tue, 12 Jul 2022 11:45:50 +0200 Subject: [PATCH] Adding link and value --- lib/query/woqlQuery.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/lib/query/woqlQuery.js b/lib/query/woqlQuery.js index 5c568e75..95eba50c 100644 --- a/lib/query/woqlQuery.js +++ b/lib/query/woqlQuery.js @@ -237,6 +237,28 @@ WOQLQuery.prototype.removed_triple = function (a, b, c) { return this; }; +WOQLQuery.prototype.link = function (a, b, c) { + // if (a && a === 'args') + // return ['subject', 'predicate', 'object'] + if (this.cursor['@type']) this.wrapCursorWithAnd(); + this.cursor['@type'] = 'Triple'; + this.cursor.subject = this.cleanSubject(a); + this.cursor.predicate = this.cleanPredicate(b); + this.cursor.object = this.cleanSubject(c); + return this; +}; + +WOQLQuery.prototype.value = function (a, b, c) { + // if (a && a === 'args') + // return ['subject', 'predicate', 'object'] + if (this.cursor['@type']) this.wrapCursorWithAnd(); + this.cursor['@type'] = 'Triple'; + this.cursor.subject = this.cleanSubject(a); + this.cursor.predicate = this.cleanPredicate(b); + this.cursor.object = this.cleanDataValue(c, 'xsd:string'); + return this; +}; + WOQLQuery.prototype.quad = function (a, b, c, g) { if (this.cursor['@type']) this.wrapCursorWithAnd(); const args = this.triple(a, b, c);