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,341 @@
|
|
|
1
|
+
export = WOQLQuery;
|
|
2
|
+
/**
|
|
3
|
+
* @typedef {Object} WOQLJson - JSON-LD representation of a WOQL query
|
|
4
|
+
* @property {string} @type - The WOQL operation type
|
|
5
|
+
* @property {*} [subject] - Subject for triple patterns
|
|
6
|
+
* @property {*} [predicate] - Predicate for triple patterns
|
|
7
|
+
* @property {*} [object] - Object for triple patterns
|
|
8
|
+
* @property {WOQLJson[]} [and] - Array of queries for 'And' operations
|
|
9
|
+
* @property {WOQLJson[]} [or] - Array of queries for 'Or' operations
|
|
10
|
+
* @property {WOQLJson} [query] - Nested query
|
|
11
|
+
* @property {string[]} [variables] - Variable list for 'Select' operations
|
|
12
|
+
* @property {string} [graph] - Graph identifier
|
|
13
|
+
* @property {*} [consequent] - Consequent for path queries
|
|
14
|
+
* @property {string} [path_pattern] - Pattern for path queries
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* defines the internal functions of the woql query object - the
|
|
18
|
+
* language API is defined in WOQLQuery
|
|
19
|
+
* @module WOQLQuery
|
|
20
|
+
* @constructor
|
|
21
|
+
* @param {object} [query] json-ld query for initialisation
|
|
22
|
+
* @returns {WOQLQuery}
|
|
23
|
+
*/
|
|
24
|
+
declare class WOQLQuery {
|
|
25
|
+
/**
|
|
26
|
+
* defines the internal functions of the woql query object - the
|
|
27
|
+
* language API is defined in WOQLQuery
|
|
28
|
+
* @module WOQLQuery
|
|
29
|
+
* @constructor
|
|
30
|
+
* @param {object} [query] json-ld query for initialisation
|
|
31
|
+
* @returns {WOQLQuery}
|
|
32
|
+
*/
|
|
33
|
+
constructor(query?: object);
|
|
34
|
+
triple_builder_context: {};
|
|
35
|
+
query: any;
|
|
36
|
+
counter: number;
|
|
37
|
+
errors: any[];
|
|
38
|
+
cursor: {};
|
|
39
|
+
chain_ended: boolean;
|
|
40
|
+
contains_update: boolean;
|
|
41
|
+
paging_transitive_properties: string[];
|
|
42
|
+
update_operators: string[];
|
|
43
|
+
vocab: {
|
|
44
|
+
Class: string;
|
|
45
|
+
DatatypeProperty: string;
|
|
46
|
+
ObjectProperty: string;
|
|
47
|
+
Document: string;
|
|
48
|
+
abstract: string;
|
|
49
|
+
comment: string;
|
|
50
|
+
range: string;
|
|
51
|
+
domain: string;
|
|
52
|
+
subClassOf: string;
|
|
53
|
+
string: string;
|
|
54
|
+
integer: string;
|
|
55
|
+
decimal: string;
|
|
56
|
+
boolean: string;
|
|
57
|
+
email: string;
|
|
58
|
+
json: string;
|
|
59
|
+
dateTime: string;
|
|
60
|
+
date: string;
|
|
61
|
+
coordinate: string;
|
|
62
|
+
line: string;
|
|
63
|
+
polygon: string;
|
|
64
|
+
};
|
|
65
|
+
tripleBuilder: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Basic Error handling
|
|
68
|
+
*/
|
|
69
|
+
parameterError(msg: any): import("./woqlCore");
|
|
70
|
+
hasErrors(): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Internal library function which adds a subquery and sets the cursor
|
|
73
|
+
*/
|
|
74
|
+
addSubQuery(Subq: any): import("./woqlCore");
|
|
75
|
+
/**
|
|
76
|
+
* Does this query contain an update
|
|
77
|
+
*/
|
|
78
|
+
containsUpdate(json: any): any;
|
|
79
|
+
/**
|
|
80
|
+
* Called to inidicate that this query will cause an update to the DB
|
|
81
|
+
*/
|
|
82
|
+
updated(): import("./woqlCore");
|
|
83
|
+
/**
|
|
84
|
+
* A bunch of internal functions for formatting values for JSON-LD translation
|
|
85
|
+
*/
|
|
86
|
+
/**
|
|
87
|
+
* Wraps the passed value in a json-ld literal carriage
|
|
88
|
+
*/
|
|
89
|
+
jlt(val: any, type: any): {
|
|
90
|
+
'@type': any;
|
|
91
|
+
'@value': any;
|
|
92
|
+
};
|
|
93
|
+
varj(varb: any): any;
|
|
94
|
+
rawVar(varb: any): any;
|
|
95
|
+
rawVarList(vl: any): any[];
|
|
96
|
+
/**
|
|
97
|
+
* Transforms a javascript representation of a query into a json object if needs be
|
|
98
|
+
*/
|
|
99
|
+
jobj(qobj: any): any;
|
|
100
|
+
/**
|
|
101
|
+
* Wraps the elements of an AS variable in the appropriate json-ld
|
|
102
|
+
*/
|
|
103
|
+
asv(colname_or_index: any, variable: any, type: any): {
|
|
104
|
+
'@type': string;
|
|
105
|
+
indicator: {
|
|
106
|
+
'@type': string;
|
|
107
|
+
index: number;
|
|
108
|
+
name?: undefined;
|
|
109
|
+
} | {
|
|
110
|
+
'@type': string;
|
|
111
|
+
name: string;
|
|
112
|
+
index?: undefined;
|
|
113
|
+
};
|
|
114
|
+
variable: any;
|
|
115
|
+
type: any;
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* JSON LD Format Descriptor
|
|
119
|
+
* @param {object} opts
|
|
120
|
+
*/
|
|
121
|
+
wform(opts: object): import("./woqlCore");
|
|
122
|
+
/**
|
|
123
|
+
* Wraps arithmetic operators in the appropriate json-ld
|
|
124
|
+
*/
|
|
125
|
+
arop(arg: any): any;
|
|
126
|
+
/**
|
|
127
|
+
* takes input that can be either a string (variable name)
|
|
128
|
+
* or an array - each element of the array is a member of the list
|
|
129
|
+
*/
|
|
130
|
+
dataList(wvar: any, string_only: any): any[] | {
|
|
131
|
+
'@type': any;
|
|
132
|
+
variable: any;
|
|
133
|
+
node?: undefined;
|
|
134
|
+
} | {
|
|
135
|
+
'@type': any;
|
|
136
|
+
node: any;
|
|
137
|
+
variable?: undefined;
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* takes a list of input that can be any value
|
|
141
|
+
*/
|
|
142
|
+
valueList(wvar: any, string_only: any): any[] | {
|
|
143
|
+
'@type': any;
|
|
144
|
+
variable: any;
|
|
145
|
+
node?: undefined;
|
|
146
|
+
} | {
|
|
147
|
+
'@type': any;
|
|
148
|
+
node: any;
|
|
149
|
+
variable?: undefined;
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* creates an unadorned variable name list
|
|
153
|
+
*/
|
|
154
|
+
vlist(list: any): any[];
|
|
155
|
+
/**
|
|
156
|
+
* Wraps data values
|
|
157
|
+
*/
|
|
158
|
+
dataValueList(list: any): any[];
|
|
159
|
+
/**
|
|
160
|
+
* Transforms whatever is passed in as the subject into the appropriate json-ld for variable or id
|
|
161
|
+
*/
|
|
162
|
+
cleanSubject(s: any): any;
|
|
163
|
+
/**
|
|
164
|
+
* Transforms whatever is passed in as the predicate (id or variable) into the
|
|
165
|
+
* appropriate json-ld form
|
|
166
|
+
*/
|
|
167
|
+
cleanPredicate(p: any): any;
|
|
168
|
+
wellKnownPredicate(p: any, noxsd: any): boolean;
|
|
169
|
+
cleanPathPredicate(p: any): boolean;
|
|
170
|
+
/**
|
|
171
|
+
* Transforms whatever is passed in as the object of
|
|
172
|
+
* a triple into the appropriate json-ld form (variable, literal or id)
|
|
173
|
+
*/
|
|
174
|
+
cleanObject(o: any, t: any): any;
|
|
175
|
+
cleanDataValue(o: any, t: any): any;
|
|
176
|
+
cleanArithmeticValue(o: any, t: any): any;
|
|
177
|
+
cleanNodeValue(o: any, t: any): any;
|
|
178
|
+
/**
|
|
179
|
+
* Transforms a graph filter or graph id into the proper json-ld form
|
|
180
|
+
*/
|
|
181
|
+
cleanGraph(g: any): any;
|
|
182
|
+
/**
|
|
183
|
+
* Transforms strings that start with v: into variable json-ld structures
|
|
184
|
+
* @param varname - will be transformed if it starts with v:
|
|
185
|
+
*/
|
|
186
|
+
expandVariable(varname: any, type: any, always: any): {
|
|
187
|
+
'@type': any;
|
|
188
|
+
variable: any;
|
|
189
|
+
node?: undefined;
|
|
190
|
+
} | {
|
|
191
|
+
'@type': any;
|
|
192
|
+
node: any;
|
|
193
|
+
variable?: undefined;
|
|
194
|
+
};
|
|
195
|
+
expandValueVariable(varname: any, always: any): {
|
|
196
|
+
'@type': any;
|
|
197
|
+
variable: any;
|
|
198
|
+
node?: undefined;
|
|
199
|
+
} | {
|
|
200
|
+
'@type': any;
|
|
201
|
+
node: any;
|
|
202
|
+
variable?: undefined;
|
|
203
|
+
};
|
|
204
|
+
expandNodeVariable(varname: any, always: any): {
|
|
205
|
+
'@type': any;
|
|
206
|
+
variable: any;
|
|
207
|
+
node?: undefined;
|
|
208
|
+
} | {
|
|
209
|
+
'@type': any;
|
|
210
|
+
node: any;
|
|
211
|
+
variable?: undefined;
|
|
212
|
+
};
|
|
213
|
+
expandDataVariable(varname: any, always: any): {
|
|
214
|
+
'@type': any;
|
|
215
|
+
variable: any;
|
|
216
|
+
node?: undefined;
|
|
217
|
+
} | {
|
|
218
|
+
'@type': any;
|
|
219
|
+
node: any;
|
|
220
|
+
variable?: undefined;
|
|
221
|
+
};
|
|
222
|
+
expandArithmeticVariable(varname: any, always: any): {
|
|
223
|
+
'@type': any;
|
|
224
|
+
variable: any;
|
|
225
|
+
node?: undefined;
|
|
226
|
+
} | {
|
|
227
|
+
'@type': any;
|
|
228
|
+
node: any;
|
|
229
|
+
variable?: undefined;
|
|
230
|
+
};
|
|
231
|
+
defaultContext(DB_IRI: any): {
|
|
232
|
+
scm: string;
|
|
233
|
+
doc: string;
|
|
234
|
+
};
|
|
235
|
+
/**
|
|
236
|
+
* Retrieves the value of the current json-ld context
|
|
237
|
+
*/
|
|
238
|
+
getContext(q: any): any;
|
|
239
|
+
/**
|
|
240
|
+
* sets the value of the current json-ld context on a full query scope
|
|
241
|
+
*/
|
|
242
|
+
context(c: any): void;
|
|
243
|
+
/**
|
|
244
|
+
* vocabulary elements that can be used without prefixes in woql.js queries
|
|
245
|
+
*/
|
|
246
|
+
loadDefaultVocabulary(): {
|
|
247
|
+
Class: string;
|
|
248
|
+
DatatypeProperty: string;
|
|
249
|
+
ObjectProperty: string;
|
|
250
|
+
Document: string;
|
|
251
|
+
abstract: string;
|
|
252
|
+
comment: string;
|
|
253
|
+
range: string;
|
|
254
|
+
domain: string;
|
|
255
|
+
subClassOf: string;
|
|
256
|
+
string: string;
|
|
257
|
+
integer: string;
|
|
258
|
+
decimal: string;
|
|
259
|
+
boolean: string;
|
|
260
|
+
email: string;
|
|
261
|
+
json: string;
|
|
262
|
+
dateTime: string;
|
|
263
|
+
date: string;
|
|
264
|
+
coordinate: string;
|
|
265
|
+
line: string;
|
|
266
|
+
polygon: string;
|
|
267
|
+
};
|
|
268
|
+
/**
|
|
269
|
+
* Provides the query with a 'vocabulary' a list of well known predicates that can be used without
|
|
270
|
+
* prefixes mapping: id: prefix:id ...
|
|
271
|
+
*/
|
|
272
|
+
setVocabulary(vocab: any): void;
|
|
273
|
+
getVocabulary(vocab: any): {
|
|
274
|
+
Class: string;
|
|
275
|
+
DatatypeProperty: string;
|
|
276
|
+
ObjectProperty: string;
|
|
277
|
+
Document: string;
|
|
278
|
+
abstract: string;
|
|
279
|
+
comment: string;
|
|
280
|
+
range: string;
|
|
281
|
+
domain: string;
|
|
282
|
+
subClassOf: string;
|
|
283
|
+
string: string;
|
|
284
|
+
integer: string;
|
|
285
|
+
decimal: string;
|
|
286
|
+
boolean: string;
|
|
287
|
+
email: string;
|
|
288
|
+
json: string;
|
|
289
|
+
dateTime: string;
|
|
290
|
+
date: string;
|
|
291
|
+
coordinate: string;
|
|
292
|
+
line: string;
|
|
293
|
+
polygon: string;
|
|
294
|
+
};
|
|
295
|
+
/**
|
|
296
|
+
* Use instead woqlclient.query('myWOQLQuery')
|
|
297
|
+
* @deprecated
|
|
298
|
+
* Executes the query using the passed client to connect to a server
|
|
299
|
+
*
|
|
300
|
+
*/
|
|
301
|
+
execute(client: any, commit_msg: any): any;
|
|
302
|
+
/**
|
|
303
|
+
* converts back and forward from json
|
|
304
|
+
* if the argument is present, the current query is set to it,
|
|
305
|
+
* if the argument is not present, the current json version of this query is returned
|
|
306
|
+
* @param {WOQLJson} [json] - a query in json format
|
|
307
|
+
* @returns {WOQLQuery | WOQLJson} Returns WOQLQuery when setting (for chaining),
|
|
308
|
+
* or WOQLJson when getting
|
|
309
|
+
*/
|
|
310
|
+
json(json?: WOQLJson): WOQLQuery | WOQLJson;
|
|
311
|
+
/**
|
|
312
|
+
* Returns a script version of the query
|
|
313
|
+
*
|
|
314
|
+
* @param {string} [clang] - either "js" or "python"
|
|
315
|
+
*/
|
|
316
|
+
prettyPrint(clang?: string): any;
|
|
317
|
+
/**
|
|
318
|
+
* Finds the last woql element that has a subject in it and returns the json for that
|
|
319
|
+
* used for triplebuilder to chain further calls - when they may be inside ands or ors or subqueries
|
|
320
|
+
* @param {object} json
|
|
321
|
+
*/
|
|
322
|
+
findLastSubject(json: object): any;
|
|
323
|
+
/**
|
|
324
|
+
* Finds the last woql element that has a subject in that is a property id
|
|
325
|
+
* used for triplebuilder to chain further calls - when they may be inside ands or ors or subqueries
|
|
326
|
+
* @param {object} json
|
|
327
|
+
*/
|
|
328
|
+
findLastProperty(json: object): any;
|
|
329
|
+
_is_property_triple(pred: any, obj: any): boolean;
|
|
330
|
+
/**
|
|
331
|
+
* Turns a textual path pattern into a JSON-LD description
|
|
332
|
+
*/
|
|
333
|
+
compilePathPattern(pat: any): any;
|
|
334
|
+
}
|
|
335
|
+
declare namespace WOQLQuery {
|
|
336
|
+
export { WOQLJson };
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* - JSON-LD representation of a WOQL query
|
|
340
|
+
*/
|
|
341
|
+
type WOQLJson = any;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {...string} varNames
|
|
3
|
+
* @returns {object<Var>}
|
|
4
|
+
*/
|
|
5
|
+
export function Vars(...args: any[]): object;
|
|
6
|
+
/**
|
|
7
|
+
* @param {...string} varNames
|
|
8
|
+
* @returns {object<Var>}
|
|
9
|
+
*/
|
|
10
|
+
export function VarsUnique(...args: any[]): object;
|
|
11
|
+
/**
|
|
12
|
+
* @param {string} name The variable name
|
|
13
|
+
* @returns {Var}
|
|
14
|
+
*/
|
|
15
|
+
export function Var(name: string): Var;
|
|
16
|
+
export class Var {
|
|
17
|
+
/**
|
|
18
|
+
* @param {string} name The variable name
|
|
19
|
+
* @returns {Var}
|
|
20
|
+
*/
|
|
21
|
+
constructor(name: string);
|
|
22
|
+
name: string;
|
|
23
|
+
json: () => {
|
|
24
|
+
'@type': string;
|
|
25
|
+
variable: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @param {string} name The variable name
|
|
30
|
+
* @returns {VarUnique}
|
|
31
|
+
*/
|
|
32
|
+
export function VarUnique(name: string): VarUnique;
|
|
33
|
+
export class VarUnique {
|
|
34
|
+
/**
|
|
35
|
+
* @param {string} name The variable name
|
|
36
|
+
* @returns {VarUnique}
|
|
37
|
+
*/
|
|
38
|
+
constructor(name: string);
|
|
39
|
+
name: string;
|
|
40
|
+
json: () => {
|
|
41
|
+
'@type': string;
|
|
42
|
+
variable: string;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* @param {object} name
|
|
47
|
+
* @returns {object}
|
|
48
|
+
*/
|
|
49
|
+
export function Doc(obj: any): object;
|
|
50
|
+
export class Doc {
|
|
51
|
+
/**
|
|
52
|
+
* @param {object} name
|
|
53
|
+
* @returns {object}
|
|
54
|
+
*/
|
|
55
|
+
constructor(obj: any);
|
|
56
|
+
doc: any;
|
|
57
|
+
encoded: any;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Reset the unique variable counter to a specific value
|
|
61
|
+
* @param {number} start - starting value
|
|
62
|
+
*/
|
|
63
|
+
export function SetVarsUniqueCounter(start: number): void;
|