terminusdb 12.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Contributing.md +36 -0
- package/LICENSE +201 -0
- package/README.md +175 -0
- package/RELEASE_NOTES.md +462 -0
- package/dist/index.html +22 -0
- package/dist/terminusdb-client.min.js +3 -0
- package/dist/terminusdb-client.min.js.LICENSE.txt +188 -0
- package/dist/terminusdb-client.min.js.map +1 -0
- package/dist/typescript/index.d.ts +14 -0
- package/dist/typescript/lib/accessControl.d.ts +554 -0
- package/dist/typescript/lib/axiosInstance.d.ts +2 -0
- package/dist/typescript/lib/connectionConfig.d.ts +381 -0
- package/dist/typescript/lib/const.d.ts +54 -0
- package/dist/typescript/lib/dispatchRequest.d.ts +17 -0
- package/dist/typescript/lib/errorMessage.d.ts +25 -0
- package/dist/typescript/lib/query/woqlBuilder.d.ts +75 -0
- package/dist/typescript/lib/query/woqlCore.d.ts +341 -0
- package/dist/typescript/lib/query/woqlDoc.d.ts +63 -0
- package/dist/typescript/lib/query/woqlLibrary.d.ts +718 -0
- package/dist/typescript/lib/query/woqlPrinter.d.ts +71 -0
- package/dist/typescript/lib/query/woqlQuery.d.ts +833 -0
- package/dist/typescript/lib/typedef.d.ts +624 -0
- package/dist/typescript/lib/utils.d.ts +199 -0
- package/dist/typescript/lib/valueHash.d.ts +146 -0
- package/dist/typescript/lib/viewer/chartConfig.d.ts +62 -0
- package/dist/typescript/lib/viewer/chooserConfig.d.ts +38 -0
- package/dist/typescript/lib/viewer/documentFrame.d.ts +44 -0
- package/dist/typescript/lib/viewer/frameConfig.d.ts +74 -0
- package/dist/typescript/lib/viewer/frameRule.d.ts +145 -0
- package/dist/typescript/lib/viewer/graphConfig.d.ts +73 -0
- package/dist/typescript/lib/viewer/objectFrame.d.ts +212 -0
- package/dist/typescript/lib/viewer/streamConfig.d.ts +23 -0
- package/dist/typescript/lib/viewer/tableConfig.d.ts +66 -0
- package/dist/typescript/lib/viewer/terminusRule.d.ts +75 -0
- package/dist/typescript/lib/viewer/viewConfig.d.ts +47 -0
- package/dist/typescript/lib/viewer/woqlChart.d.ts +1 -0
- package/dist/typescript/lib/viewer/woqlChooser.d.ts +56 -0
- package/dist/typescript/lib/viewer/woqlGraph.d.ts +26 -0
- package/dist/typescript/lib/viewer/woqlPaging.d.ts +1 -0
- package/dist/typescript/lib/viewer/woqlResult.d.ts +128 -0
- package/dist/typescript/lib/viewer/woqlRule.d.ts +96 -0
- package/dist/typescript/lib/viewer/woqlStream.d.ts +31 -0
- package/dist/typescript/lib/viewer/woqlTable.d.ts +102 -0
- package/dist/typescript/lib/viewer/woqlView.d.ts +49 -0
- package/dist/typescript/lib/woql.d.ts +1267 -0
- package/dist/typescript/lib/woqlClient.d.ts +1216 -0
- package/index.js +28 -0
- package/lib/.eslintrc +1 -0
- package/lib/accessControl.js +988 -0
- package/lib/axiosInstance.js +5 -0
- package/lib/connectionConfig.js +765 -0
- package/lib/const.js +59 -0
- package/lib/dispatchRequest.js +236 -0
- package/lib/errorMessage.js +110 -0
- package/lib/query/woqlBuilder.js +234 -0
- package/lib/query/woqlCore.js +934 -0
- package/lib/query/woqlDoc.js +177 -0
- package/lib/query/woqlLibrary.js +1015 -0
- package/lib/query/woqlPrinter.js +476 -0
- package/lib/query/woqlQuery.js +1865 -0
- package/lib/typedef.js +248 -0
- package/lib/utils.js +817 -0
- package/lib/valueHash.js_old +581 -0
- package/lib/viewer/chartConfig.js +411 -0
- package/lib/viewer/chooserConfig.js +234 -0
- package/lib/viewer/documentFrame.js +206 -0
- package/lib/viewer/frameConfig.js +469 -0
- package/lib/viewer/frameRule.js +519 -0
- package/lib/viewer/graphConfig.js +345 -0
- package/lib/viewer/objectFrame.js +1550 -0
- package/lib/viewer/streamConfig.js +82 -0
- package/lib/viewer/tableConfig.js +310 -0
- package/lib/viewer/terminusRule.js +196 -0
- package/lib/viewer/viewConfig.js +219 -0
- package/lib/viewer/woqlChart.js +17 -0
- package/lib/viewer/woqlChooser.js +171 -0
- package/lib/viewer/woqlGraph.js +295 -0
- package/lib/viewer/woqlPaging.js +148 -0
- package/lib/viewer/woqlResult.js +258 -0
- package/lib/viewer/woqlRule.js +312 -0
- package/lib/viewer/woqlStream.js +27 -0
- package/lib/viewer/woqlTable.js +332 -0
- package/lib/viewer/woqlView.js +107 -0
- package/lib/woql.js +1693 -0
- package/lib/woqlClient.js +2091 -0
- package/package.json +110 -0
|
@@ -0,0 +1,833 @@
|
|
|
1
|
+
export = WOQLQuery;
|
|
2
|
+
declare class WOQLQuery extends WOQLCore {
|
|
3
|
+
/**
|
|
4
|
+
* defines the internal functions of the woql query object - the
|
|
5
|
+
* language API is defined in WOQLQuery
|
|
6
|
+
* @module WOQLQuery
|
|
7
|
+
* @constructor
|
|
8
|
+
* @param {object} [query] json-ld query for initialisation
|
|
9
|
+
* @returns {WOQLQuery}
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Update a pattern matching rule for the triple (Subject, Predicate, oldObjValue) with the
|
|
13
|
+
* new one (Subject, Predicate, newObjValue)
|
|
14
|
+
* @param {string|Var} subject - The IRI of a triple’s subject or a variable
|
|
15
|
+
* @param {string|Var} predicate - The IRI of a property or a variable
|
|
16
|
+
* @param {string|Var} newObjValue - The value to update or a literal
|
|
17
|
+
* @param {string|Var} oldObjValue - The old value of the object
|
|
18
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the a Update Triple Statement
|
|
19
|
+
*/
|
|
20
|
+
update_triple(subject: string | Var, predicate: string | Var, newObjValue: string | Var, oldObjValue: string | Var): WOQLQuery;
|
|
21
|
+
/**
|
|
22
|
+
* Generates a query that by default matches all triples in a graph identified by "graph"
|
|
23
|
+
* or in all the current terminusDB's graph
|
|
24
|
+
* @param {string | boolean} [graph] - false or the resource identifier of a graph possible
|
|
25
|
+
* value are schema/{main - myschema - *} | instance/{main - myschema - *} |
|
|
26
|
+
* inference/{main - myschema - *}
|
|
27
|
+
* @param {string|Var} [subject] - The IRI of a triple’s subject or a variable,
|
|
28
|
+
* default value "v:Subject"
|
|
29
|
+
* @param {string|Var} [predicate] - The IRI of a property or a variable,
|
|
30
|
+
* default value "v:Predicate"
|
|
31
|
+
* @param {string|Var} [object] - The IRI of a node or a variable, or a literal,
|
|
32
|
+
* default value "v:Object"
|
|
33
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the pattern matching expression
|
|
34
|
+
*/
|
|
35
|
+
star(graph?: string | boolean, subject?: string | Var, predicate?: string | Var, object?: string | Var): WOQLQuery;
|
|
36
|
+
/**
|
|
37
|
+
* Update a pattern matching rule for the quad [S, P, O, G] (Subject, Predicate, Object, Graph)
|
|
38
|
+
* @param {string|Var} subject - The IRI of a triple’s subject or a variable
|
|
39
|
+
* @param {string|Var} predicate - The IRI of a property or a variable
|
|
40
|
+
* @param {string|Var} newObject - The value to update or a literal
|
|
41
|
+
* @param {typedef.GraphRef} graphRef - A valid graph resource identifier string
|
|
42
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the a Update Quad Statement
|
|
43
|
+
*/
|
|
44
|
+
update_quad(subject: string | Var, predicate: string | Var, newObject: string | Var, graphRef: typedef.GraphRef): WOQLQuery;
|
|
45
|
+
/**
|
|
46
|
+
* @param {string|Var} id - IRI string or variable containing
|
|
47
|
+
* @param {string|Var} type - IRI string or variable containing the IRI of the
|
|
48
|
+
* @param {typedef.GraphRef} [refGraph] - Optional Graph resource identifier
|
|
49
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the insert expression
|
|
50
|
+
*/
|
|
51
|
+
insert(id: string | Var, type: string | Var, refGraph?: typedef.GraphRef): WOQLQuery;
|
|
52
|
+
/**
|
|
53
|
+
* Sets the graph resource ID that will be used for subsequent chained function calls
|
|
54
|
+
* @param {typedef.GraphRef} [graphRef] Resource String identifying the graph which will
|
|
55
|
+
* be used for subsequent chained schema calls
|
|
56
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the partial Graph pattern matching expression
|
|
57
|
+
*/
|
|
58
|
+
graph(graphRef?: typedef.GraphRef): WOQLQuery;
|
|
59
|
+
/**
|
|
60
|
+
* Specifies the identity of a node that can then be used in subsequent builder functions.
|
|
61
|
+
* Note that node() requires subsequent chained functions to complete the triples / quads
|
|
62
|
+
* that it produces - by itself it only generates the subject.
|
|
63
|
+
* @param {string|Var} nodeid - The IRI of a node or a variable containing an IRI which will
|
|
64
|
+
* be the subject of the builder functions
|
|
65
|
+
* @param {typedef.FuntionType} [chainType] - Optional type of builder function to build
|
|
66
|
+
* (default is triple)
|
|
67
|
+
* @returns {WOQLQuery} - A WOQLQuery which contains the partial Node pattern matching expression
|
|
68
|
+
*/
|
|
69
|
+
node(nodeid: string | Var, chainType?: typedef.FuntionType): WOQLQuery;
|
|
70
|
+
/**
|
|
71
|
+
* Deletes all triples in the passed graph (defaults to instance/main)
|
|
72
|
+
* @param {typedef.GraphRef} [graphRef] - Resource String identifying the graph from
|
|
73
|
+
* which all triples will be removed
|
|
74
|
+
* @returns {WOQLQuery} - A WOQLQuery which contains the deletion expression
|
|
75
|
+
* @example
|
|
76
|
+
* nuke("schema/main")
|
|
77
|
+
* //will delete everything from the schema/main graph
|
|
78
|
+
*/
|
|
79
|
+
nuke(graphRef?: typedef.GraphRef): WOQLQuery;
|
|
80
|
+
/**
|
|
81
|
+
* @param {string|Var} [Subj] - The IRI of a triple’s subject or a variable
|
|
82
|
+
* @param {string|Var} [Pred] - The IRI of a property or a variable
|
|
83
|
+
* @param {string|Var} [Obj] - The IRI of a node or a variable, or a literal
|
|
84
|
+
* @param {typedef.GraphRef} [Graph] - the resource identifier of a graph possible
|
|
85
|
+
* @returns {WOQLQuery} - A WOQLQuery which contains the pattern matching expression
|
|
86
|
+
*/
|
|
87
|
+
all(Subj?: string | Var, Pred?: string | Var, Obj?: string | Var, Graph?: typedef.GraphRef): WOQLQuery;
|
|
88
|
+
/**
|
|
89
|
+
* @param {boolean} tf
|
|
90
|
+
* @returns {object}
|
|
91
|
+
*/
|
|
92
|
+
boolean(tf: boolean): object;
|
|
93
|
+
/**
|
|
94
|
+
* @param {string} s
|
|
95
|
+
* @returns {object}
|
|
96
|
+
*/
|
|
97
|
+
string(s: string): object;
|
|
98
|
+
/**
|
|
99
|
+
* @param {any} s
|
|
100
|
+
* @param {string} t
|
|
101
|
+
* @returns {object}
|
|
102
|
+
|
|
103
|
+
*/
|
|
104
|
+
literal(s: any, t: string): object;
|
|
105
|
+
/**
|
|
106
|
+
* @param {string} s
|
|
107
|
+
* @returns {object}
|
|
108
|
+
*/
|
|
109
|
+
iri(s: string): object;
|
|
110
|
+
_set_context(ctxt: any): this;
|
|
111
|
+
/**
|
|
112
|
+
* @param {WOQLQuery} Subq
|
|
113
|
+
* @returns {WOQLQuery}
|
|
114
|
+
*/
|
|
115
|
+
addSubQuery(Subq: WOQLQuery): WOQLQuery;
|
|
116
|
+
/**
|
|
117
|
+
* @param {string} msg
|
|
118
|
+
* @returns {WOQLQuery}
|
|
119
|
+
*/
|
|
120
|
+
parameterError(msg: string): WOQLQuery;
|
|
121
|
+
/**
|
|
122
|
+
* @returns {WOQLQuery}
|
|
123
|
+
*/
|
|
124
|
+
updated(): WOQLQuery;
|
|
125
|
+
/**
|
|
126
|
+
* Read a node identified by an IRI as a JSON-LD document
|
|
127
|
+
* @param {string} IRI - The document id or a variable to read
|
|
128
|
+
* @param {string} output - Variable which will be bound to the document.
|
|
129
|
+
* @return {WOQLQuery} WOQLQuery
|
|
130
|
+
*/
|
|
131
|
+
read_document(IRI: string, output: string): WOQLQuery;
|
|
132
|
+
/**
|
|
133
|
+
* Insert a document in the graph.
|
|
134
|
+
* @param {object} docjson - The document to insert. Must either have an '@id' or
|
|
135
|
+
* have a class specified key.
|
|
136
|
+
* @param {string} [IRI] - An optional identifier specifying the document location.
|
|
137
|
+
* @return {WOQLQuery} WOQLQuery
|
|
138
|
+
*/
|
|
139
|
+
insert_document(docjson: object, IRI?: string): WOQLQuery;
|
|
140
|
+
/**
|
|
141
|
+
* Update a document identified by an IRI
|
|
142
|
+
* @param {object} docjson - The document to update. Must either have an '@id' or
|
|
143
|
+
* have a class specified key.
|
|
144
|
+
* @param {string} [IRI] - An optional identifier specifying the document location.
|
|
145
|
+
* @return {WOQLQuery} WOQLQuery
|
|
146
|
+
*/
|
|
147
|
+
update_document(docjson: object, IRI?: string): WOQLQuery;
|
|
148
|
+
/**
|
|
149
|
+
* Delete a document from the graph.
|
|
150
|
+
* @param {string} IRI - The document id or a variable
|
|
151
|
+
* @return {WOQLQuery} WOQLQuery
|
|
152
|
+
*/
|
|
153
|
+
delete_document(IRI: string): WOQLQuery;
|
|
154
|
+
/**
|
|
155
|
+
* Contains definitions of the WOQL functions which map directly to JSON-LD types
|
|
156
|
+
* All other calls and queries can be composed from these
|
|
157
|
+
*/
|
|
158
|
+
wrapCursorWithAnd(): void;
|
|
159
|
+
/**
|
|
160
|
+
* Query running against any specific commit Id
|
|
161
|
+
* @param {string} refPath - path to specific reference Id or commit Id
|
|
162
|
+
* @param {WOQLQuery} [subquery] - subquery for the specific commit point
|
|
163
|
+
* @returns {WOQLQuery}
|
|
164
|
+
*/
|
|
165
|
+
using(refPath: string, subquery?: WOQLQuery): WOQLQuery;
|
|
166
|
+
/**
|
|
167
|
+
* Adds a text comment to a query - can also be used to wrap any part of a query to turn it off
|
|
168
|
+
* @param {string} comment - text comment
|
|
169
|
+
* @param {WOQLQuery} [subquery] - query that is "commented out"
|
|
170
|
+
* @returns {WOQLQuery}
|
|
171
|
+
*/
|
|
172
|
+
comment(comment: string, subquery?: WOQLQuery): WOQLQuery;
|
|
173
|
+
/**
|
|
174
|
+
* Filters the query so that only the variables included in [V1...Vn] are returned in the bindings
|
|
175
|
+
* @param {...string|...Var} varNames - only these variables are returned
|
|
176
|
+
* @returns {WOQLQuery}
|
|
177
|
+
*/
|
|
178
|
+
select(...varNames: any[]): WOQLQuery;
|
|
179
|
+
/**
|
|
180
|
+
* Build a localized scope for variables to prevent leaking local variables to outer scope.
|
|
181
|
+
* Returns a tuple [localized, v] where:
|
|
182
|
+
* - localized: function that wraps queries with select("") and eq() bindings
|
|
183
|
+
* - v: object with unique variable names for use in the inner query
|
|
184
|
+
*
|
|
185
|
+
* Parameters with non-null values are bound from outer scope via eq().
|
|
186
|
+
* Parameters with null values are local-only variables.
|
|
187
|
+
*
|
|
188
|
+
* @param {object} paramSpec - Object mapping parameter names to values (or null for local vars)
|
|
189
|
+
* @returns {LocalizeResult} Tuple of [localized function, variables object]
|
|
190
|
+
* @example
|
|
191
|
+
* const [localized, v] = WOQL.localize({ consSubject, valueVar, last_cell: null });
|
|
192
|
+
* return localized(
|
|
193
|
+
* WOQL.and(
|
|
194
|
+
* WOQL.triple(v.consSubject, 'rdf:type', 'rdf:List'),
|
|
195
|
+
* WOQL.triple(v.last_cell, 'rdf:rest', 'rdf:nil')
|
|
196
|
+
* )
|
|
197
|
+
* );
|
|
198
|
+
*/
|
|
199
|
+
localize(paramSpec: object): LocalizeResult;
|
|
200
|
+
/**
|
|
201
|
+
* Filter the query to return only results that are distinct in the given variables
|
|
202
|
+
* @param {...string|...Var} varNames - these variables are guaranteed to be unique as a tuple
|
|
203
|
+
* @returns {WOQLQuery}
|
|
204
|
+
*/
|
|
205
|
+
distinct(...varNames: any[]): WOQLQuery;
|
|
206
|
+
/**
|
|
207
|
+
* Logical conjunction of the contained queries - all queries must match or the entire clause fails
|
|
208
|
+
* @param {...WOQLQuery} subqueries - A list of one or more woql queries to execute as a conjunction
|
|
209
|
+
* @returns {WOQLQuery} - A WOQLQuery object containing the conjunction of queries
|
|
210
|
+
*/
|
|
211
|
+
and(...subqueries: WOQLQuery[]): WOQLQuery;
|
|
212
|
+
/**
|
|
213
|
+
* Creates a logical OR of the arguments
|
|
214
|
+
* @param {...WOQLQuery} subqueries - A list of one or more woql queries
|
|
215
|
+
* to execute as alternatives
|
|
216
|
+
* @returns {WOQLQuery} - A WOQLQuery object containing the logical Or of the subqueries
|
|
217
|
+
*/
|
|
218
|
+
or(...subqueries: WOQLQuery[]): WOQLQuery;
|
|
219
|
+
/**
|
|
220
|
+
* Specifies the database URL that will be the default database for the enclosed query
|
|
221
|
+
* @param {typedef.GraphRef} graphRef- A valid graph resource identifier string
|
|
222
|
+
* @param {WOQLQuery} [query] - The query
|
|
223
|
+
* @returns {WOQLQuery} A WOQLQuery object containing the from expression
|
|
224
|
+
*/
|
|
225
|
+
/**
|
|
226
|
+
* Specifies the database URL that will be the default database for the enclosed query
|
|
227
|
+
* @param {typedef.GraphRef} graphRef- A valid graph resource identifier string
|
|
228
|
+
* @param {WOQLQuery} [query] - The query
|
|
229
|
+
* @returns {WOQLQuery} A WOQLQuery object containing the from expression
|
|
230
|
+
*/
|
|
231
|
+
from(graphRef: any, query?: WOQLQuery): WOQLQuery;
|
|
232
|
+
/**
|
|
233
|
+
* Specifies the graph resource to write the contained query into
|
|
234
|
+
* @param {typedef.GraphRef} graphRef- A valid graph resource identifier string
|
|
235
|
+
* @param {WOQLQuery} [subquery] - The query which will be written into the graph
|
|
236
|
+
* @returns {WOQLQuery} A WOQLQuery which will be written into the graph in question
|
|
237
|
+
*/
|
|
238
|
+
into(graphRef: any, subquery?: WOQLQuery): WOQLQuery;
|
|
239
|
+
/**
|
|
240
|
+
* Creates a triple pattern matching rule for the triple [S, P, O] (Subject, Predicate, Object)
|
|
241
|
+
* @param {string|Var} subject - The IRI of a triple’s subject or a variable
|
|
242
|
+
* @param {string|Var} predicate - The IRI of a property or a variable
|
|
243
|
+
* @param {string|Var} object - The IRI of a node or a variable, or a literal
|
|
244
|
+
* @returns {WOQLQuery}
|
|
245
|
+
*/
|
|
246
|
+
triple(subject: string | Var, predicate: string | Var, object: string | Var): WOQLQuery;
|
|
247
|
+
/**
|
|
248
|
+
* Creates a triple pattern matching rule for the triple [S, P, O] (Subject, Predicate,
|
|
249
|
+
* Object) added in the current layer
|
|
250
|
+
* @param {string|Var} subject - The IRI of a triple’s subject or a variable
|
|
251
|
+
* @param {string|Var} predicate - The IRI of a property or a variable
|
|
252
|
+
* @param {string|Var} object - The IRI of a node or a variable, or a literal
|
|
253
|
+
* @returns {WOQLQuery}
|
|
254
|
+
*/
|
|
255
|
+
added_triple(subject: string | Var, predicate: string | Var, object: string | Var): WOQLQuery;
|
|
256
|
+
/**
|
|
257
|
+
* Creates a triple pattern matching rule for the triple [S, P, O] (Subject, Predicate,
|
|
258
|
+
* Object) added in the current commit
|
|
259
|
+
* @param {string|Var} subject - The IRI of a triple’s subject or a variable
|
|
260
|
+
* @param {string|Var} predicate - The IRI of a property or a variable
|
|
261
|
+
* @param {string|Var} object - The IRI of a node or a variable, or a literal
|
|
262
|
+
* @returns {WOQLQuery}
|
|
263
|
+
*/
|
|
264
|
+
removed_triple(subject: string | Var, predicate: string | Var, object: string | Var): WOQLQuery;
|
|
265
|
+
/**
|
|
266
|
+
* Creates a pattern matching rule for triple [Subject, Predicate, Object]
|
|
267
|
+
* @param {string|Var} subject - The IRI of a triple’s subject or a variable
|
|
268
|
+
* @param {string|Var} predicate - The IRI of a property or a variable
|
|
269
|
+
* @param {string|Var} object - The IRI of a node or a variable, or a literal
|
|
270
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the a quad or a triple Statement
|
|
271
|
+
*/
|
|
272
|
+
link(subject: string | Var, predicate: string | Var, object: string | Var): WOQLQuery;
|
|
273
|
+
/**
|
|
274
|
+
* Creates a pattern matching rule for triple [Subject, Predicate, Object]
|
|
275
|
+
* add extra information about the type of the value object
|
|
276
|
+
* @param {string|Var} subject - The IRI of a triple’s subject or a variable
|
|
277
|
+
* @param {string|Var} predicate - The IRI of a property or a variable
|
|
278
|
+
* @param {string | number | boolean | Var} objValue - an specific value
|
|
279
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the a quad or a triple Statement
|
|
280
|
+
*/
|
|
281
|
+
value(subject: string | Var, predicate: string | Var, objValue: string | number | boolean | Var): WOQLQuery;
|
|
282
|
+
/**
|
|
283
|
+
* Creates a pattern matching rule for the quad [S, P, O, G] (Subject, Predicate, Object, Graph)
|
|
284
|
+
* @param {string|Var} subject - The IRI of a triple’s subject or a variable
|
|
285
|
+
* @param {string|Var} predicate - The IRI of a property or a variable
|
|
286
|
+
* @param {string|Var} object - The IRI of a node or a variable, or a literal
|
|
287
|
+
* @param {typedef.GraphRef} graphRef - A valid graph resource identifier string
|
|
288
|
+
* @returns {WOQLQuery}
|
|
289
|
+
*/
|
|
290
|
+
quad(subject: string | Var, predicate: string | Var, object: string | Var, graphRef: typedef.GraphRef): WOQLQuery;
|
|
291
|
+
/**
|
|
292
|
+
* Creates a pattern matching rule for the quad [S, P, O, G] (Subject, Predicate,
|
|
293
|
+
* Object, Graph) removed from the current commit
|
|
294
|
+
* @param {string|Var} subject - The IRI of a triple’s subject or a variable
|
|
295
|
+
* @param {string|Var} predicate - The IRI of a property or a variable
|
|
296
|
+
* @param {string|Var} object - The IRI of a node or a variable, or a literal
|
|
297
|
+
* @param {typedef.GraphRef} graphRef- A valid graph resource identifier string
|
|
298
|
+
* @returns {WOQLQuery}
|
|
299
|
+
*/
|
|
300
|
+
added_quad(subject: string | Var, predicate: string | Var, object: string | Var, graphRef: any): WOQLQuery;
|
|
301
|
+
/**
|
|
302
|
+
* Creates a pattern matching rule for the quad [S, P, O, G] (Subject, Predicate,
|
|
303
|
+
* Object, Graph) removed from the current commit
|
|
304
|
+
* @param {string|Var} subject - The IRI of a triple’s subject or a variable
|
|
305
|
+
* @param {string|Var} predicate - The IRI of a property or a variable
|
|
306
|
+
* @param {string|Var} object - The IRI of a node or a variable, or a literal
|
|
307
|
+
* @param {typedef.GraphRef} graphRef- A valid graph resource identifier string
|
|
308
|
+
* @returns {WOQLQuery}
|
|
309
|
+
*/
|
|
310
|
+
removed_quad(subject: string | Var, predicate: string | Var, object: string | Var, graphRef: any): WOQLQuery;
|
|
311
|
+
/**
|
|
312
|
+
* Returns true if ClassA subsumes ClassB, according to the current DB schema
|
|
313
|
+
* @param {string} classA - ClassA
|
|
314
|
+
* @param {string} classB - ClassB
|
|
315
|
+
* @returns {boolean} WOQLQuery
|
|
316
|
+
*/
|
|
317
|
+
sub(classA: string, classB: string): boolean;
|
|
318
|
+
subsumption: (classA: string, classB: string) => boolean;
|
|
319
|
+
/**
|
|
320
|
+
* Matches if a is equal to b
|
|
321
|
+
* @param {string|number|boolean|array|Var} varName - literal, variable, array, or id
|
|
322
|
+
* @param {string|number|boolean|array|Var} varValue - literal, variable, array, or id
|
|
323
|
+
* @returns {WOQLQuery}
|
|
324
|
+
*/
|
|
325
|
+
eq(varName: string | number | boolean | any[] | Var, varValue: string | number | boolean | any[] | Var): WOQLQuery;
|
|
326
|
+
equals: (varName: string | number | boolean | any[] | Var, varValue: string | number | boolean | any[] | Var) => WOQLQuery;
|
|
327
|
+
/**
|
|
328
|
+
* Substring
|
|
329
|
+
* @param {string|Var} string - String or variable
|
|
330
|
+
* @param {number|Var} before - integer or variable (characters from start to begin)
|
|
331
|
+
* @param {number|Var} [length] - integer or variable (length of substring)
|
|
332
|
+
* @param {number|Var} [after] - integer or variable (number of characters after substring)
|
|
333
|
+
* @param {string|Var} [subString] - String or variable
|
|
334
|
+
* @returns {WOQLQuery}
|
|
335
|
+
*/
|
|
336
|
+
substr(string: string | Var, before: number | Var, length?: number | Var, after?: number | Var, subString?: string | Var): WOQLQuery;
|
|
337
|
+
substring: (string: string | Var, before: number | Var, length?: number | Var, after?: number | Var, subString?: string | Var) => WOQLQuery;
|
|
338
|
+
/**
|
|
339
|
+
* Use the document inteface to import documents
|
|
340
|
+
* @deprecated
|
|
341
|
+
* Retrieves the exernal resource defined by QueryResource and copies values
|
|
342
|
+
* from it into variables defined in AsVars
|
|
343
|
+
* @param {Vars | array<Var>} asvars - an array of AsVar variable mappings (see as for format below)
|
|
344
|
+
* @param {WOQLQuery} queryResource - an external resource (remote, file, post) to query
|
|
345
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the get expression
|
|
346
|
+
*/
|
|
347
|
+
get(asvars: typeof Vars | array<Var>, queryResource: WOQLQuery): WOQLQuery;
|
|
348
|
+
/**
|
|
349
|
+
* Use the document inteface to import documents
|
|
350
|
+
* @deprecated
|
|
351
|
+
* @put Outputs the results of a query to a file
|
|
352
|
+
* @param {Vars | array<Var>} varsToExp - an array of AsVar variable
|
|
353
|
+
* mappings (see as for format below)
|
|
354
|
+
* @param {WOQLQuery} query - The query which will be executed to produce the results
|
|
355
|
+
* @param {string} fileResource - an file resource local to the server
|
|
356
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the put expression
|
|
357
|
+
*/
|
|
358
|
+
put(varsToExp: typeof Vars | array<Var>, query: WOQLQuery, fileResource: string): WOQLQuery;
|
|
359
|
+
/**
|
|
360
|
+
* @param {...(array|string|Var)} varList variable number of arguments
|
|
361
|
+
* @returns WOQLQuery
|
|
362
|
+
*/
|
|
363
|
+
as(...varList: (any[] | string | Var)[]): WOQLQuery;
|
|
364
|
+
/**
|
|
365
|
+
* Identifies a remote resource by URL and specifies the format of the resource through the options
|
|
366
|
+
* @param {object} remoteObj - The URL at which the remote resource can be accessed
|
|
367
|
+
* @param {typedef.DataFormatObj} [formatObj] - The format of the resource data {}
|
|
368
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the remote resource identifier
|
|
369
|
+
*/
|
|
370
|
+
remote(remoteObj: object, formatObj?: typedef.DataFormatObj): WOQLQuery;
|
|
371
|
+
/**
|
|
372
|
+
* Identifies a resource as a local path on the client, to be sent to the server through a
|
|
373
|
+
* HTTP POST request, with the format defined through the options
|
|
374
|
+
* @param {string} url - The Path on the server at which the file resource can be accessed
|
|
375
|
+
* @param {typedef.DataFormatObj} [formatObj] - imput options, optional
|
|
376
|
+
* @param {string} [source] - It defines the source of the file, it can be 'url','post'
|
|
377
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the Post resource identifier
|
|
378
|
+
*/
|
|
379
|
+
post(url: string, formatObj?: typedef.DataFormatObj, source?: string): WOQLQuery;
|
|
380
|
+
/**
|
|
381
|
+
* Deletes a single triple from the default graph of the database
|
|
382
|
+
* @param {string|Var} subject - The IRI of a triple’s subject or a variable
|
|
383
|
+
* @param {string|Var} predicate - The IRI of a property or a variable
|
|
384
|
+
* @param {string|Var} object - The IRI of a node or a variable, or a literal
|
|
385
|
+
* @returns {WOQLQuery} - A WOQLQuery which contains the Triple Deletion statement
|
|
386
|
+
*/
|
|
387
|
+
delete_triple(subject: string | Var, predicate: string | Var, object: string | Var): WOQLQuery;
|
|
388
|
+
/**
|
|
389
|
+
* Adds triples according to the the pattern [subject,predicate,object]
|
|
390
|
+
* @param {string|Var} subject - The IRI of a triple’s subject or a variable
|
|
391
|
+
* @param {string|Var} predicate - The IRI of a property or a variable
|
|
392
|
+
* @param {string|Var} object - The IRI of a node or a variable, or a literal
|
|
393
|
+
* @returns {WOQLQuery}
|
|
394
|
+
*/
|
|
395
|
+
add_triple(subject: string | Var, predicate: string | Var, object: string | Var): WOQLQuery;
|
|
396
|
+
/**
|
|
397
|
+
* Deletes a single triple from the graph [Subject, Predicate, Object, Graph]
|
|
398
|
+
* @param {string|Var} subject - The IRI of a triple’s subject or a variable
|
|
399
|
+
* @param {string|Var} predicate - The IRI of a property or a variable
|
|
400
|
+
* @param {string|Var} object - The IRI of a node or a variable, or a literal
|
|
401
|
+
* @param {typedef.GraphRef} graphRef - A valid graph resource identifier string
|
|
402
|
+
* @returns {WOQLQuery} - A WOQLQuery which contains the Delete Quad Statement
|
|
403
|
+
*/
|
|
404
|
+
delete_quad(subject: string | Var, predicate: string | Var, object: string | Var, graphRef: typedef.GraphRef): WOQLQuery;
|
|
405
|
+
/**
|
|
406
|
+
* Adds quads according to the pattern [S,P,O,G]
|
|
407
|
+
* @param {string|Var} subject - The IRI of a triple’s subject or a variable
|
|
408
|
+
* @param {string|Var} predicate - The IRI of a property or a variable
|
|
409
|
+
* @param {string|Var} object - The IRI of a node or a variable, or a literal
|
|
410
|
+
* @param {typedef.GraphRef} graphRef - A valid graph resource identifier string
|
|
411
|
+
* @returns {WOQLQuery}
|
|
412
|
+
*/
|
|
413
|
+
add_quad(subject: string | Var, predicate: string | Var, object: string | Var, graphRef: typedef.GraphRef): WOQLQuery;
|
|
414
|
+
/**
|
|
415
|
+
* Remove whitespace from both sides of a string:
|
|
416
|
+
* @param {string|Var} inputStr - A string or variable containing
|
|
417
|
+
* the untrimmed version of the string
|
|
418
|
+
* @param {string|Var} resultVarName - A string or variable
|
|
419
|
+
* containing the trimmed version of the string
|
|
420
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the Trim pattern matching expression
|
|
421
|
+
*/
|
|
422
|
+
trim(inputStr: string | Var, resultVarName: string | Var): WOQLQuery;
|
|
423
|
+
/**
|
|
424
|
+
* Evaluates the passed arithmetic expression and generates or matches the result value
|
|
425
|
+
* @param {object| WOQLQuery | string} arithExp - query or JSON-LD representing the query
|
|
426
|
+
* @param {string|Var} resultVarName - output variable
|
|
427
|
+
* @returns {WOQLQuery}
|
|
428
|
+
*/
|
|
429
|
+
eval(arithExp: object | WOQLQuery | string, resultVarName: string | Var): WOQLQuery;
|
|
430
|
+
/**
|
|
431
|
+
* Evaluates the passed arithmetic expression and generates or matches the result value.
|
|
432
|
+
* Alias for eval() to support both naming conventions in fluent/chained style.
|
|
433
|
+
* @param {object|WOQLQuery|string} arithExp - A WOQL query containing a valid arithmetic expression
|
|
434
|
+
* @param {string|number|Var} resultVarName - Either a variable to store the result, or a numeric
|
|
435
|
+
* literal to test against the evaluated expression
|
|
436
|
+
* @returns {WOQLQuery}
|
|
437
|
+
*/
|
|
438
|
+
evaluate(arithExp: object | WOQLQuery | string, resultVarName: string | number | Var): WOQLQuery;
|
|
439
|
+
/**
|
|
440
|
+
* Adds the numbers together
|
|
441
|
+
* @param {...(string|number|Var)} args - a variable or numeric containing the values to add
|
|
442
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the addition expression
|
|
443
|
+
*/
|
|
444
|
+
plus(...args: (string | number | Var)[]): WOQLQuery;
|
|
445
|
+
/**
|
|
446
|
+
*
|
|
447
|
+
* Subtracts Numbers N1..Nn
|
|
448
|
+
* @param {...(string|number|Var)} args - variable or numeric containing the value that will be
|
|
449
|
+
* subtracted from
|
|
450
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the subtraction expression
|
|
451
|
+
*/
|
|
452
|
+
minus(...args: (string | number | Var)[]): WOQLQuery;
|
|
453
|
+
/**
|
|
454
|
+
*
|
|
455
|
+
* Multiplies numbers N1...Nn together
|
|
456
|
+
* @param {...(string|number|Var)} args - a variable or numeric containing the value
|
|
457
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the multiplication expression
|
|
458
|
+
*/
|
|
459
|
+
times(...args: (string | number | Var)[]): WOQLQuery;
|
|
460
|
+
/**
|
|
461
|
+
* Divides numbers N1...Nn by each other left, to right precedence
|
|
462
|
+
* @param {...(string|number|Var )} args - numbers to tbe divided
|
|
463
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the division expression
|
|
464
|
+
*/
|
|
465
|
+
divide(...args: (string | number | Var)[]): WOQLQuery;
|
|
466
|
+
/**
|
|
467
|
+
* Division - integer division - args are divided left to right
|
|
468
|
+
* @param {...(string|number|Var)} args - numbers for division
|
|
469
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the division expression
|
|
470
|
+
*/
|
|
471
|
+
div(...args: (string | number | Var)[]): WOQLQuery;
|
|
472
|
+
/**
|
|
473
|
+
* Exponent - raises varNum01 to the power of varNum02
|
|
474
|
+
* @param {string|number|Var} varNum - a variable or numeric containing the number to be
|
|
475
|
+
* raised to the power of the second number
|
|
476
|
+
* @param {number} expNum - a variable or numeric containing the exponent
|
|
477
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the exponent expression
|
|
478
|
+
*/
|
|
479
|
+
exp(varNum: string | number | Var, expNum: number): WOQLQuery;
|
|
480
|
+
/**
|
|
481
|
+
* Generates the nearest lower integer to the passed number
|
|
482
|
+
* @param {string|number|Var} varNum - Variable or numeric containing the number to be floored
|
|
483
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the floor expression
|
|
484
|
+
*/
|
|
485
|
+
floor(varNum: string | number | Var): WOQLQuery;
|
|
486
|
+
/**
|
|
487
|
+
* Tests whether a given instance IRI has type Class, according to the current state of the DB
|
|
488
|
+
* @param {string|Var} instanceIRI - A string IRI or a variable that identify the class instance
|
|
489
|
+
* @param {string|Var} classId - A Class IRI or a variable
|
|
490
|
+
* @returns {WOQLQuery} A WOQLQuery object containing the type test
|
|
491
|
+
*/
|
|
492
|
+
isa(instanceIRI: string | Var, classId: string | Var): WOQLQuery;
|
|
493
|
+
/**
|
|
494
|
+
* Generates a string Leverstein distance measure between stringA and stringB
|
|
495
|
+
* @param {string|Var} stringA - string literal or variable representing a string to be compared
|
|
496
|
+
* @param {string|Var } stringB - string literal or variable
|
|
497
|
+
* representing the other string to be compared
|
|
498
|
+
* @param {number|string|Var} distance - variable representing the distance between the variables
|
|
499
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the Like pattern matching expression
|
|
500
|
+
*/
|
|
501
|
+
like(stringA: string | Var, stringB: string | Var, distance: number | string | Var): WOQLQuery;
|
|
502
|
+
/**
|
|
503
|
+
* Compares the value of v1 against v2 and returns true if v1 is less than v2
|
|
504
|
+
* @param {string|number|Var} varNum01 - a variable or numeric containing
|
|
505
|
+
* the number to be compared
|
|
506
|
+
* @param {string|number|Var} varNum02 - a variable or numeric containing the second comporator
|
|
507
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the comparison expression
|
|
508
|
+
*/
|
|
509
|
+
less(varNum01: string | number | Var, varNum02: string | number | Var): WOQLQuery;
|
|
510
|
+
/**
|
|
511
|
+
* Compares the value of v1 against v2 and returns true if v1 is greater than v2
|
|
512
|
+
* @param {string|number|Var} varNum01 - a variable or numeric containing the number to be compared
|
|
513
|
+
* @param {string|number|Var} varNum02 - a variable or numeric containing the second comporator
|
|
514
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the comparison expression
|
|
515
|
+
*/
|
|
516
|
+
greater(varNum01: string | number | Var, varNum02: string | number | Var): WOQLQuery;
|
|
517
|
+
/**
|
|
518
|
+
* Specifies that the Subquery is optional - if it does not match the query will not fail
|
|
519
|
+
* @param {WOQLQuery} [subquery] - A subquery which will be optionally matched
|
|
520
|
+
* @returns {WOQLQuery} A WOQLQuery object containing the optional sub Query
|
|
521
|
+
*/
|
|
522
|
+
opt(subquery?: WOQLQuery): WOQLQuery;
|
|
523
|
+
optional: (subquery?: WOQLQuery) => WOQLQuery;
|
|
524
|
+
/**
|
|
525
|
+
* Generate a new IRI from the prefix and a hash of the variables which will be unique for any
|
|
526
|
+
* given combination of variables
|
|
527
|
+
* @param {string} prefix - A prefix for the IRI - typically formed of the doc prefix and the
|
|
528
|
+
* classtype of the entity (“doc:Person”)
|
|
529
|
+
* @param {array|string|Var} inputVarList - An array of variables and / or strings from which the
|
|
530
|
+
* unique hash will be generated
|
|
531
|
+
* @param {string|Var} resultVarName - Variable in which the unique ID is stored
|
|
532
|
+
* @returns {WOQLQuery} A WOQLQuery object containing the unique ID generating function
|
|
533
|
+
*/
|
|
534
|
+
unique(prefix: string, inputVarList: any[] | string | Var, resultVarName: string | Var): WOQLQuery;
|
|
535
|
+
/**
|
|
536
|
+
* Generates the node's ID combined the variable list with a specific prefix (URL base).
|
|
537
|
+
* If the input variables's values are the same, the output value will be the same.
|
|
538
|
+
* @param {string} prefix
|
|
539
|
+
* @param {string |array} inputVarList the variable input list for generate the id
|
|
540
|
+
* @param {string} outputVar the output variable name
|
|
541
|
+
*/
|
|
542
|
+
idgen(prefix: string, inputVarList: string | any[], outputVar: string): WOQLQuery;
|
|
543
|
+
idgenerator: (prefix: string, inputVarList: string | any[], outputVar: string) => WOQLQuery;
|
|
544
|
+
/**
|
|
545
|
+
* Generates a random ID with a specified prefix
|
|
546
|
+
* Uses cryptographically secure random base64 encoding to generate unique identifiers
|
|
547
|
+
* @param {string} prefix - prefix for the generated ID
|
|
548
|
+
* @param {string} outputVar - variable that stores the generated ID
|
|
549
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the random ID generation pattern
|
|
550
|
+
* idgen_random("Person/", "v:person_id")
|
|
551
|
+
*/
|
|
552
|
+
idgen_random(prefix: string, outputVar: string): WOQLQuery;
|
|
553
|
+
/**
|
|
554
|
+
* Backward-compatible alias for idgen_random
|
|
555
|
+
* @deprecated Use idgen_random instead
|
|
556
|
+
*/
|
|
557
|
+
random_idgen: (prefix: string, outputVar: string) => WOQLQuery;
|
|
558
|
+
/**
|
|
559
|
+
* Changes a string to upper-case
|
|
560
|
+
* @param {string|Var} inputVarName - string or variable representing the uncapitalized string
|
|
561
|
+
* @param {string|Var} resultVarName - variable that stores the capitalized string output
|
|
562
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the Upper case pattern matching expression
|
|
563
|
+
*/
|
|
564
|
+
upper(inputVarName: string | Var, resultVarName: string | Var): WOQLQuery;
|
|
565
|
+
/**
|
|
566
|
+
* Changes a string to lower-case
|
|
567
|
+
* @param {string|Var} inputVarName - string or variable representing the non-lowercased string
|
|
568
|
+
* @param {string|Var} resultVarName - variable that stores the lowercased string output
|
|
569
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the Lower case pattern matching expression
|
|
570
|
+
*/
|
|
571
|
+
lower(inputVarName: string | Var, resultVarName: string | Var): WOQLQuery;
|
|
572
|
+
/**
|
|
573
|
+
* Pads out the string input to be exactly len long by appending the pad character pad to
|
|
574
|
+
* form output
|
|
575
|
+
* @param {string|Var} inputVarName - The input string or variable in unpadded state
|
|
576
|
+
* @param {string|Var} pad - The characters to use to pad the string or a variable representing them
|
|
577
|
+
* @param {number | string | Var} len - The variable or integer value representing the length of
|
|
578
|
+
* the output string
|
|
579
|
+
* @param {string|Var} resultVarName - stores output
|
|
580
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the Pad pattern matching expression
|
|
581
|
+
*/
|
|
582
|
+
pad(inputVarName: string | Var, pad: string | Var, len: number | string | Var, resultVarName: string | Var): WOQLQuery;
|
|
583
|
+
/**
|
|
584
|
+
* Splits a string (Input) into a list strings (Output) by removing separator
|
|
585
|
+
* @param {string|Var} inputVarName - A string or variable representing the unsplit string
|
|
586
|
+
* @param {string|Var} separator - A string or variable containing a sequence of charatcters
|
|
587
|
+
* to use as a separator
|
|
588
|
+
* @param {string|Var} resultVarName - variable that stores output list
|
|
589
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the Split pattern matching expression
|
|
590
|
+
*/
|
|
591
|
+
split(inputVarName: string | Var, separator: string | Var, resultVarName: string | Var): WOQLQuery;
|
|
592
|
+
/**
|
|
593
|
+
* Matches if List includes Element
|
|
594
|
+
* @param {string|object|Var} element - Either a variable, IRI or any simple datatype
|
|
595
|
+
* @param {string|array|Var} list - List ([string, literal] or string*) Either a variable
|
|
596
|
+
* representing a list or a list of variables or literals
|
|
597
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the List inclusion pattern matching expression
|
|
598
|
+
*/
|
|
599
|
+
member(element: string | object | Var, list: string | any[] | Var): WOQLQuery;
|
|
600
|
+
/**
|
|
601
|
+
* Computes the set difference between two lists (elements in listA but not in listB)
|
|
602
|
+
* @param {string|Var|array} listA - First list or variable
|
|
603
|
+
* @param {string|Var|array} listB - Second list or variable
|
|
604
|
+
* @param {string|Var} result - Variable to store the result
|
|
605
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the SetDifference expression
|
|
606
|
+
*/
|
|
607
|
+
set_difference(listA: string | Var | any[], listB: string | Var | any[], result: string | Var): WOQLQuery;
|
|
608
|
+
/**
|
|
609
|
+
* Computes the set intersection of two lists (elements in both listA and listB)
|
|
610
|
+
* @param {string|Var|array} listA - First list or variable
|
|
611
|
+
* @param {string|Var|array} listB - Second list or variable
|
|
612
|
+
* @param {string|Var} result - Variable to store the result
|
|
613
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the SetIntersection expression
|
|
614
|
+
*/
|
|
615
|
+
set_intersection(listA: string | Var | any[], listB: string | Var | any[], result: string | Var): WOQLQuery;
|
|
616
|
+
/**
|
|
617
|
+
* Computes the set union of two lists (all unique elements from both lists)
|
|
618
|
+
* @param {string|Var|array} listA - First list or variable
|
|
619
|
+
* @param {string|Var|array} listB - Second list or variable
|
|
620
|
+
* @param {string|Var} result - Variable to store the result
|
|
621
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the SetUnion expression
|
|
622
|
+
*/
|
|
623
|
+
set_union(listA: string | Var | any[], listB: string | Var | any[], result: string | Var): WOQLQuery;
|
|
624
|
+
/**
|
|
625
|
+
* Checks if an element is a member of a set (efficient O(log n) lookup)
|
|
626
|
+
* @param {string|Var|any} element - Element to check
|
|
627
|
+
* @param {string|Var|array} set - Set (list) to check membership in
|
|
628
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the SetMember expression
|
|
629
|
+
*/
|
|
630
|
+
set_member(element: string | Var | any, set: string | Var | any[]): WOQLQuery;
|
|
631
|
+
/**
|
|
632
|
+
* Converts a list to a set (removes duplicates and sorts)
|
|
633
|
+
* @param {string|Var|array} list - Input list or variable
|
|
634
|
+
* @param {string|Var} set - Variable to store the resulting set
|
|
635
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the ListToSet expression
|
|
636
|
+
*/
|
|
637
|
+
list_to_set(list: string | Var | any[], set: string | Var): WOQLQuery;
|
|
638
|
+
/**
|
|
639
|
+
* takes a variable number of string arguments and concatenates them into a single string
|
|
640
|
+
* @param {array|string|Var} varList - a variable representing a list or a list of variables or
|
|
641
|
+
* strings - variables can be embedded in the string if they do not contain spaces
|
|
642
|
+
* @param {string|Var} resultVarName - A variable or string containing the output string
|
|
643
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the Concatenation pattern matching expression
|
|
644
|
+
*/
|
|
645
|
+
concat(varList: any[] | string | Var, resultVarName: string | Var): WOQLQuery;
|
|
646
|
+
concatenate: (varList: any[] | string | Var, resultVarName: string | Var) => WOQLQuery;
|
|
647
|
+
/**
|
|
648
|
+
* Joins a list variable together (Input) into a string variable (Output) by glueing the strings
|
|
649
|
+
* together with Glue
|
|
650
|
+
* @param {string|array|Var} varList - a variable representing a list or a list of strings
|
|
651
|
+
* and / or variables
|
|
652
|
+
* @param {string|Var} glue - A variable (v:glue) or (glue) string representing the characters
|
|
653
|
+
* to put in between the joined strings in input
|
|
654
|
+
* @param {string|Var} resultVarName - A variable or string containing the output string
|
|
655
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the Join pattern matching expression
|
|
656
|
+
*/
|
|
657
|
+
join(varList: string | any[] | Var, glue: string | Var, resultVarName: string | Var): WOQLQuery;
|
|
658
|
+
/**
|
|
659
|
+
* computes the sum of the List of values passed. In contrast to other arithmetic functions,
|
|
660
|
+
* sum self-evaluates - it does not have to be passed to evaluate()
|
|
661
|
+
* @param {WOQLQuery} subquery - a subquery or ([string or numeric]) - a list variable, or a
|
|
662
|
+
* list of variables or numeric literals
|
|
663
|
+
* @param {string|Var} total - the variable name with the sum result of the values in List
|
|
664
|
+
* @returns {WOQLQuery} - A WOQLQuery which contains the Sum expression
|
|
665
|
+
*/
|
|
666
|
+
sum(subquery: WOQLQuery, total: string | Var): WOQLQuery;
|
|
667
|
+
/**
|
|
668
|
+
*
|
|
669
|
+
* Specifies an offset position in the results to start listing results from
|
|
670
|
+
* @param {number|string|Var} start - A variable that refers to an interger or an integer literal
|
|
671
|
+
* @param {WOQLQuery} [subquery] - WOQL Query object, you can pass a subquery as an argument
|
|
672
|
+
* or a chained query
|
|
673
|
+
* @returns {WOQLQuery} A WOQLQuery whose results will be returned starting from
|
|
674
|
+
* the specified offset
|
|
675
|
+
*/
|
|
676
|
+
start(start: number | string | Var, subquery?: WOQLQuery): WOQLQuery;
|
|
677
|
+
/**
|
|
678
|
+
* Specifies a maximum number of results that will be returned from the subquery
|
|
679
|
+
* @param {number|string} limit - A variable that refers to an non-negative integer or a
|
|
680
|
+
* non-negative integer
|
|
681
|
+
* @param {WOQLQuery} [subquery] - A subquery whose results will be limited
|
|
682
|
+
* @returns {WOQLQuery} A WOQLQuery whose results will be returned starting from
|
|
683
|
+
* the specified offset
|
|
684
|
+
*/
|
|
685
|
+
limit(limit: number | string, subquery?: WOQLQuery): WOQLQuery;
|
|
686
|
+
/**
|
|
687
|
+
* Matches the regular expression defined in Patern against the Test string, to produce
|
|
688
|
+
* the matched patterns in Matches
|
|
689
|
+
* @param {string} pattern - string or variable using normal PCRE regular expression syntax with
|
|
690
|
+
* the exception that special characters have to be escaped twice (to enable transport in JSONLD)
|
|
691
|
+
* @param {string|Var} inputVarName - string or variable containing the string to be tested for
|
|
692
|
+
* patterns with the regex
|
|
693
|
+
* @param {string|array|object|Var} resultVarList - variable representing the list of matches
|
|
694
|
+
* or a list of strings or variables
|
|
695
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the Regular Expression pattern
|
|
696
|
+
* matching expression
|
|
697
|
+
*/
|
|
698
|
+
re(pattern: string, inputVarName: string | Var, resultVarList: string | any[] | object | Var): WOQLQuery;
|
|
699
|
+
regexp: (pattern: string, inputVarName: string | Var, resultVarList: string | any[] | object | Var) => WOQLQuery;
|
|
700
|
+
/**
|
|
701
|
+
* Calculates the length of the list in va and stores it in vb
|
|
702
|
+
* @param {string|array} inputVarList - Either a variable representing a list or a list of
|
|
703
|
+
* variables or literals
|
|
704
|
+
* @param {string|Var} resultVarName - A variable in which the length of the list is stored or
|
|
705
|
+
* the length of the list as a non-negative integer
|
|
706
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the Length pattern matching expression
|
|
707
|
+
*/
|
|
708
|
+
length(inputVarList: string | any[], resultVarName: string | Var): WOQLQuery;
|
|
709
|
+
/**
|
|
710
|
+
* Extracts a contiguous subsequence from a list, following JavaScript's slice() semantics
|
|
711
|
+
* @param {string|array|Var} inputList - Either a variable representing a list or a list of
|
|
712
|
+
* variables or literals
|
|
713
|
+
* @param {string|Var} resultVarName - A variable in which the sliced list is stored
|
|
714
|
+
* @param {number|string|Var} start - The start index (0-based, supports negative indices)
|
|
715
|
+
* @param {number|string|Var} [end] - The end index (exclusive, optional - defaults to list length)
|
|
716
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the Slice pattern matching expression
|
|
717
|
+
* let [result] = vars("result")
|
|
718
|
+
* slice(["a", "b", "c", "d"], result, 1, 3) // result = ["b", "c"]
|
|
719
|
+
* slice(["a", "b", "c", "d"], result, -2) // result = ["c", "d"]
|
|
720
|
+
*/
|
|
721
|
+
slice(inputList: string | any[] | Var, resultVarName: string | Var, start: number | string | Var, end?: number | string | Var): WOQLQuery;
|
|
722
|
+
/**
|
|
723
|
+
*
|
|
724
|
+
* Logical negation of the contained subquery - if the subquery matches, the query
|
|
725
|
+
* will fail to match
|
|
726
|
+
* @param {string | WOQLQuery} [subquery] - A subquery which will be negated
|
|
727
|
+
* @returns {WOQLQuery} A WOQLQuery object containing the negated sub Query
|
|
728
|
+
*/
|
|
729
|
+
not(subquery?: string | WOQLQuery): WOQLQuery;
|
|
730
|
+
/**
|
|
731
|
+
* Results in one solution of the subqueries
|
|
732
|
+
* @param {string| WOQLQuery } [subquery] - WOQL Query objects
|
|
733
|
+
* @returns {WOQLQuery} A WOQLQuery object containing the once sub Query
|
|
734
|
+
*/
|
|
735
|
+
once(subquery?: string | WOQLQuery): WOQLQuery;
|
|
736
|
+
/**
|
|
737
|
+
* Runs the query without backtracking on side-effects
|
|
738
|
+
* @param {string| WOQLQuery } [subquery] - WOQL Query objects
|
|
739
|
+
* @returns {WOQLQuery} A WOQLQuery object containing the immediately sub Query
|
|
740
|
+
*/
|
|
741
|
+
immediately(query: any): WOQLQuery;
|
|
742
|
+
/**
|
|
743
|
+
* Creates a count of the results of the query
|
|
744
|
+
* @param {string|number|Var} countVarName - variable or integer count
|
|
745
|
+
* @param {WOQLQuery} [subquery]
|
|
746
|
+
* @returns {WOQLQuery} A WOQLQuery object containing the count sub Query
|
|
747
|
+
*/
|
|
748
|
+
count(countVarName: string | number | Var, subquery?: WOQLQuery): WOQLQuery;
|
|
749
|
+
/**
|
|
750
|
+
* Casts the value of Input to a new value of type Type and stores the result in CastVar
|
|
751
|
+
* @param {string|number|object|Var} varName - Either a single variable or a
|
|
752
|
+
* literal of any basic type
|
|
753
|
+
* @param {string|Var} varType - Either a variable or a basic datatype (xsd / xdd)
|
|
754
|
+
* @param {string|Var} resultVarName - save the return variable
|
|
755
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the casting expression
|
|
756
|
+
*/
|
|
757
|
+
typecast(varName: string | number | object | Var, varType: string | Var, resultVarName: string | Var): WOQLQuery;
|
|
758
|
+
cast: (varName: string | number | object | Var, varType: string | Var, resultVarName: string | Var) => WOQLQuery;
|
|
759
|
+
/**
|
|
760
|
+
* Orders the results of the contained subquery by a precedence list of variables
|
|
761
|
+
* @param {...string|...Var|...array} orderedVarlist - A sequence of variables,
|
|
762
|
+
* by which to order the results,
|
|
763
|
+
* each optionally followed by either “asc” or “desc” to represent order as a list, by default
|
|
764
|
+
* it will sort the variable in ascending order
|
|
765
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the ordering expression
|
|
766
|
+
*/
|
|
767
|
+
order_by(...orderedVarlist: any[]): WOQLQuery;
|
|
768
|
+
/**
|
|
769
|
+
*
|
|
770
|
+
* Groups the results of the contained subquery on the basis of identical values for Groupvars,
|
|
771
|
+
* extracts the patterns defined in PatternVars and stores the results in GroupedVar
|
|
772
|
+
* @param {array|string|Var} gvarlist - Either a single variable or an array of variables
|
|
773
|
+
* @param {array|string|Var} groupedvar - Either a single variable or an array of variables
|
|
774
|
+
* @param {string|Var} output - output variable name
|
|
775
|
+
* @param {WOQLQuery} [groupquery] - The query whose results will be grouped
|
|
776
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the grouping expression
|
|
777
|
+
*/
|
|
778
|
+
group_by(gvarlist: any[] | string | Var, groupedvar: any[] | string | Var, output: string | Var, groupquery?: WOQLQuery): WOQLQuery;
|
|
779
|
+
/**
|
|
780
|
+
* A function that always matches, always returns true
|
|
781
|
+
* @returns {WOQLQuery} A WOQLQuery object containing the true value that will match any pattern
|
|
782
|
+
*/
|
|
783
|
+
true(): WOQLQuery;
|
|
784
|
+
/**
|
|
785
|
+
* Performs a path regular expression match on the graph
|
|
786
|
+
* @param {string|Var} subject - An IRI or variable that refers to an IRI representing the subject,
|
|
787
|
+
* i.e. the starting point of the path
|
|
788
|
+
* @param {string} pattern -(string) - A path regular expression describing a pattern through
|
|
789
|
+
* multiple edges of the graph (see: https://terminusdb.com/docs/path-query-reference-guide)
|
|
790
|
+
* @param {string|Var} object - An IRI or variable that refers to an IRI representing the object,
|
|
791
|
+
* i.e. ending point of the path
|
|
792
|
+
* @param {string|Var} [resultVarName] - A variable in which the actual paths
|
|
793
|
+
* traversed will be stored
|
|
794
|
+
* @returns {WOQLQuery} - A WOQLQuery which contains the path regular expression matching expression
|
|
795
|
+
*/
|
|
796
|
+
path(subject: string | Var, pattern: string, object: string | Var, resultVarName?: string | Var): WOQLQuery;
|
|
797
|
+
/**
|
|
798
|
+
* Extract the value of a key in a bound document.
|
|
799
|
+
* @param {string|Var} document - Document which is being accessed.
|
|
800
|
+
* @param {string|Var} field - The field from which the document which is being accessed.
|
|
801
|
+
* @param {string|Var} value - The value for the document and field.
|
|
802
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the a dot Statement
|
|
803
|
+
*/
|
|
804
|
+
dot(document: string | Var, field: string | Var, value: string | Var): WOQLQuery;
|
|
805
|
+
/**
|
|
806
|
+
* Calculates the size in bytes of the contents of the resource identified in ResourceID
|
|
807
|
+
* @param {string|Var} resourceId - A valid resource identifier string (can refer to any graph /
|
|
808
|
+
* branch / commit / db)
|
|
809
|
+
* @param {string|Var} resultVarName - The variable name
|
|
810
|
+
*/
|
|
811
|
+
size(resourceId: string | Var, resultVarName: string | Var): WOQLQuery;
|
|
812
|
+
/**
|
|
813
|
+
*
|
|
814
|
+
* Calculates the number of triples of the contents of the resource identified in ResourceID
|
|
815
|
+
* @param {string|Var} resourceId - A valid resource identifier string (can refer to any graph /
|
|
816
|
+
* branch / commit / db)
|
|
817
|
+
* @param {string|number|Var} tripleCount - An integer literal with the size in bytes or a
|
|
818
|
+
* variable containing that integer
|
|
819
|
+
* @returns {WOQLQuery} A WOQLQuery which contains the size expression
|
|
820
|
+
*/
|
|
821
|
+
triple_count(resourceId: string | Var, TripleCount: any): WOQLQuery;
|
|
822
|
+
/**
|
|
823
|
+
* Returns true if 'elementId' is of type 'elementType', according to the current DB schema
|
|
824
|
+
* @param {string|Var} elementId - the id of a schema graph element
|
|
825
|
+
* @param {string|Var} elementType - the element type
|
|
826
|
+
* @returns {WOQLQuery} A WOQLQuery object containing the type_of pattern matching rule
|
|
827
|
+
*/
|
|
828
|
+
type_of(elementId: string | Var, elementType: string | Var): WOQLQuery;
|
|
829
|
+
}
|
|
830
|
+
import WOQLCore = require("./woqlCore");
|
|
831
|
+
import { Var } from "./woqlDoc";
|
|
832
|
+
import typedef = require("../typedef");
|
|
833
|
+
import { Vars } from "./woqlDoc";
|