Skip to content

Commit 02da6c8

Browse files
committed
review value and link
1 parent eb60107 commit 02da6c8

File tree

2 files changed

+33
-35
lines changed

2 files changed

+33
-35
lines changed

lib/query/woqlBuilder.js

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -158,39 +158,4 @@ WOQLQuery.prototype.insert = function (id, type, refGraph) {
158158
return this.add_triple(id, 'rdf:type', `@schema:${type}`);
159159
};
160160

161-
/**
162-
* @description Creates a pattern matching rule for a quad [Subject, Predicate, Object, Graph]
163-
* or for a triple [Subject, Predicate, Object]
164-
* add extra information about the type of the value object
165-
* @param {string} subject - The IRI of a triple’s subject or a variable
166-
* @param {string} predicate - The IRI of a property or a variable
167-
* @param {string | number | boolean} objValue - an specific value
168-
* @param {string} [graph] - specify a graph type, default is instance schema|instance
169-
*/
170-
WOQLQuery.prototype.value = function (subject, predicate, objValue, graph) {
171-
if (typeof objValue === 'string') {
172-
objValue = this.string(objValue);
173-
} else if (typeof objValue === 'number') {
174-
objValue = this.literal(objValue, 'xsd:decimal');
175-
} else if (typeof objValue === 'boolean') {
176-
objValue = this.literal(objValue, 'xsd:boolean');
177-
}
178-
if (graph) {
179-
this.quad(subject, predicate, objValue, graph);
180-
} else {
181-
this.triple(subject, predicate, objValue);
182-
}
183-
};
184-
185-
WOQLQuery.prototype.link = function (a, b, c, g) {
186-
if (typeof c === 'string') {
187-
c = this.iri(c);
188-
}
189-
if (g) {
190-
this.quad(a, b, c, g);
191-
} else {
192-
this.triple(a, b, c);
193-
}
194-
};
195-
196161
module.exports = WOQLQuery;

lib/query/woqlQuery.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,39 @@ WOQLQuery.prototype.value = function (a, b, c) {
259259
return this;
260260
};
261261

262+
/**
263+
* @description Creates a pattern matching rule for a quad [Subject, Predicate, Object, Graph]
264+
* or for a triple [Subject, Predicate, Object]
265+
* add extra information about the type of the value object
266+
* @param {string} subject - The IRI of a triple’s subject or a variable
267+
* @param {string} predicate - The IRI of a property or a variable
268+
* @param {string | number | boolean} objValue - an specific value
269+
* @param {string} [graph] - specify a graph type, default is instance schema|instance
270+
*/
271+
/* WOQLQuery.prototype.value = function (subject, predicate, objValue, graph) {
272+
if (typeof objValue === 'string') {
273+
objValue = this.string(objValue);
274+
} else if (typeof objValue === 'number') {
275+
objValue = this.literal(objValue, 'xsd:decimal');
276+
} else if (typeof objValue === 'boolean') {
277+
objValue = this.literal(objValue, 'xsd:boolean');
278+
}
279+
if (graph) {
280+
return this.quad(subject, predicate, objValue, graph);
281+
}
282+
return this.triple(subject, predicate, objValue);
283+
};
284+
285+
WOQLQuery.prototype.link = function (a, b, c, g) {
286+
if (typeof c === 'string') {
287+
c = this.iri(c);
288+
}
289+
if (g) {
290+
return this.quad(a, b, c, g);
291+
}
292+
return this.triple(a, b, c);
293+
}; */
294+
262295
WOQLQuery.prototype.quad = function (a, b, c, g) {
263296
if (this.cursor['@type']) this.wrapCursorWithAnd();
264297
const args = this.triple(a, b, c);

0 commit comments

Comments
 (0)