Skip to content

Commit eb60107

Browse files
Merge pull request #199 from terminusdb/value_link
Adding link and value
2 parents c136cff + 54bb42c commit eb60107

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

lib/query/woqlQuery.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,28 @@ WOQLQuery.prototype.removed_triple = function (a, b, c) {
237237
return this;
238238
};
239239

240+
WOQLQuery.prototype.link = function (a, b, c) {
241+
// if (a && a === 'args')
242+
// return ['subject', 'predicate', 'object']
243+
if (this.cursor['@type']) this.wrapCursorWithAnd();
244+
this.cursor['@type'] = 'Triple';
245+
this.cursor.subject = this.cleanSubject(a);
246+
this.cursor.predicate = this.cleanPredicate(b);
247+
this.cursor.object = this.cleanSubject(c);
248+
return this;
249+
};
250+
251+
WOQLQuery.prototype.value = function (a, b, c) {
252+
// if (a && a === 'args')
253+
// return ['subject', 'predicate', 'object']
254+
if (this.cursor['@type']) this.wrapCursorWithAnd();
255+
this.cursor['@type'] = 'Triple';
256+
this.cursor.subject = this.cleanSubject(a);
257+
this.cursor.predicate = this.cleanPredicate(b);
258+
this.cursor.object = this.cleanDataValue(c, 'xsd:string');
259+
return this;
260+
};
261+
240262
WOQLQuery.prototype.quad = function (a, b, c, g) {
241263
if (this.cursor['@type']) this.wrapCursorWithAnd();
242264
const args = this.triple(a, b, c);

0 commit comments

Comments
 (0)