forked from typedb/typedb-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanswer.yml
535 lines (513 loc) · 18.3 KB
/
answer.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
title: "Answer"
description:
common: &common-description >
The type of answers returned by execution of a query depends on the type of query executed.
The table below illustrates the answer types mapped to query types.
java: *common-description
javascript: *common-description
python: *common-description
mappings:
-
query: match
answer: "Stream/Iterator of [ConceptMap](#conceptmap)"
-
query: "match aggregate (count/min/max/sum/mean/std)"
answer: "[QueryFuture](#queryfuture) of [Numeric](#numeric)"
-
query: match group
answer: "Stream/Iterator of [ConceptMapGroup](#conceptmapgroup)"
-
query: match group aggregate
answer: "Stream/Iterator of [NumericGroup](#numericgroup)"
-
query: insert
answer: "Stream/Iterator of [ConceptMap](#conceptmap)"
-
query: delete
answer: "[QueryFuture](#queryfuture)"
-
query: update
answer: "Stream/Iterator of [ConceptMap](#conceptmap)"
-
query: explain
answer: "Stream/Iterator of [Explanation](#explanation)"
-
query: define
answer: "[QueryFuture](#queryfuture)"
-
query: undefine
answer: "[QueryFuture](#queryfuture)"
types:
- type1:
title: ConceptMap
methods:
- method:
common: &method-conceptmap-map
title: Retrieve a mapping of variables to concepts
java:
<<: *method-conceptmap-map
method: conceptMap.map();
description: Produces a Map where keys are variable names and values are [`concept`](../concept-api/concept)s.
returns:
- "Map<String, Concept>"
javascript:
<<: *method-conceptmap-map
method: conceptMap.map;
description: Produces a Map where keys are variable names and values are [`concept`](../concept-api/concept)s.
returns:
- "`Map<String, Concept>`"
python:
<<: *method-conceptmap-map
method: concept_map.map()
description: Produces a dictionary where keys are variable names and values are [`concept`](../concept-api/concept)s.
returns:
- "Dictionary of String to [`Concept`](../concept-api/concept?tab=python#concept-methods)"
- method:
common: &method-conceptmap-concepts
title: Retrieve concepts
java:
<<: *method-conceptmap-concepts
method: conceptMap.concepts();
description: Return a collection of all the [`concept`](../concept-api/concept)s in this ConceptMap.
returns:
- "Collection<Concept>"
javascript:
<<: *method-conceptmap-concepts
method: conceptMap.concepts();
description: Return an iterator of all the [`concept`](../concept-api/concept)s in this ConceptMap.
returns:
- "Iterator of Concept"
python:
<<: *method-conceptmap-concepts
method: concept_map.concepts()
description: Return an iterable collection of all the [`concept`](../concept-api/concept)s in this ConceptMap.
returns:
- "Iterable of Concept"
- method:
common: &method-conceptmap-get
title: Retrieve a concept corresponding to a specific variable
description: Retrieve a concept for a given variable name
accepts:
param1:
name: var
description: The string representation of a variable
type: String
java:
<<: *method-conceptmap-get
method: conceptMap.get(String var)
returns:
- "[`Concept`](../concept-api/concept?tab=java#concept-methods)"
python:
<<: *method-conceptmap-get
method: conceptMap.get(var)
returns:
- "[`Concept`](../concept-api/concept?tab=python#concept-methods)"
javascript:
<<: *method-conceptmap-get
method: concept_map.get(var)
returns:
- "[`Concept`](../concept-api/concept?tab=javascript#concept-methods)"
- method:
common: &method-conceptmap-explainables
title: Retrieve explainable concepts
description: Gets the [Explainables](#explainables) object for this ConceptMap, exposing which of the Concepts in this ConceptMap are explainable
java:
<<: *method-conceptmap-explainables
method: conceptMap.explainables()
returns:
- "[`ConceptMap.Explainables`](#explainables)"
python:
<<: *method-conceptmap-explainables
method: concept_map.explainables()
returns:
- "[`ConceptMap.Explainables`](#explainables)"
javascript:
<<: *method-conceptmap-explainables
method: conceptMap.explainables
returns:
- "[`ConceptMap.Explainables`](#explainables)"
- type2:
title: Numeric
methods:
- method:
java:
title: Retrieve numeric value of an aggregate answer as a long
method: numeric.asLong();
returns:
- long
- method:
java:
title: Retrieve numeric value of an aggregate answer as a double
method: numeric.asDouble();
returns:
- double
- method:
java:
title: Retrieve numeric value of an aggregate answer
method: numeric.asNumber();
returns:
- Number
- method:
python:
title: Retrieve numeric value of an aggregate answer as an integer
method: numeric.as_int();
returns:
- int
- method:
python:
title: Retrieve numeric value of an aggregate answer as a float
method: numeric.as_float();
returns:
- float
- method:
javascript:
title: Retrieve numeric value of an aggregate answer
method: numeric.asNumber();
returns:
- number
- method:
java:
title: Checks if the type of an aggregate answer is a long
method: numeric.isLong();
returns:
- boolean
- method:
java:
title: Checks if the type of an aggregate answer is a double
method: numeric.isDouble();
returns:
- boolean
- method:
python:
title: Checks if the type of an aggregate answer is an integer
method: numeric.is_int();
returns:
- boolean
- method:
python:
title: Checks if the type of an aggregate answer is a float
method: numeric.is_float();
returns:
- boolean
- method:
javascript:
title: Checks if the type of an aggregate answer is a number
method: numeric.isNumber();
returns:
- boolean
- method:
common: &method-numeric-isnan
title: Checks if the type of an aggregate answer is not a number
returns:
- boolean
java:
<<: *method-numeric-isnan
method: conceptMapGroup.isNaN();
javascript:
<<: *method-numeric-isnan
method: conceptMapGroup.isNaN();
python:
<<: *method-numeric-isnan
method: concept_map_group.is_NaN()
- type3:
title: ConceptMapGroup
methods:
- method:
common: &method-conceptmapgroup-owner
title: Retrieve the concept that is the group owner
java:
<<: *method-conceptmapgroup-owner
method: conceptMapGroup.owner();
returns:
- "[`Concept`](../concept-api/concept?tab=java#concept-methods)"
javascript:
<<: *method-conceptmapgroup-owner
method: conceptMapGroup.owner;
returns:
- "[`Concept`](../concept-api/concept?tab=javascript#concept-methods)"
python:
<<: *method-conceptmapgroup-owner
method: concept_map_group.owner()
returns:
- "[`Concept`](../concept-api/concept?tab=python#concept-methods)"
- method:
common: &method-conceptmapgroup-conceptmaps
title: Retrieve the ConceptMaps of the group
java:
<<: *method-conceptmapgroup-conceptmaps
method: conceptMapGroup.conceptMaps();
returns:
- List<[`ConceptMap`](#conceptmap)>
javascript:
<<: *method-conceptmapgroup-conceptmaps
method: conceptMapGroup.conceptMaps;
returns:
- Array of [`ConceptMap`](#conceptmap)s
python:
<<: *method-conceptmapgroup-conceptmaps
method: concept_map_group.concept_maps();
returns:
- List of [`ConceptMap`](#conceptmap)s
- type4:
title: NumericGroup
methods:
- method:
common: &method-numericgroup-owner
title: Retrieve the concept that is the group owner
java:
<<: *method-numericgroup-owner
method: numericGroup.owner();
returns:
- "[`Concept`](../concept-api/concept?tab=java#concept-methods)"
javascript:
<<: *method-numericgroup-owner
method: numericGroup.owner;
returns:
- "[`Concept`](../concept-api/concept?tab=javascript#concept-methods)"
python:
<<: *method-numericgroup-owner
method: numeric_group.owner()
returns:
- "[`Concept`](../concept-api/concept?tab=python#concept-methods)"
- method:
common: &method-numericgroup-numeric
title: Retrieve the Numeric answer of the group
java:
<<: *method-numericgroup-numeric
method: numericGroup.numeric();
returns:
- "[Numeric](#numeric)"
javascript:
<<: *method-numericgroup-numeric
method: numericGroup.numeric;
returns:
- "[Numeric](#numeric)"
python:
<<: *method-numericgroup-numeric
method: numeric_group.numeric()
returns:
- "[Numeric](#numeric)"
- type5:
title: Explainables
methods:
- method:
common: &method-explainables-relation
title: Retrieve explainable relation
description: Retrieves the explainable relation with the given variable name.
accepts:
param1:
name: variable
description: The string representation of a variable
type: String
returns:
- "[`ConceptMap.Explainable`](#explainable)"
java:
<<: *method-explainables-relation
method: conceptMap.explainables().relation(String variable);
javascript:
<<: *method-explainables-relation
method: conceptMap.explainables.relation(variable);
python:
<<: *method-explainables-relation
method: concept_map.explainables().relation(variable);
- method:
common: &method-explainables-attribute
title: Retrieve explainable attribute
description: Retrieves the explainable attribute with the given variable name.
accepts:
param1:
name: variable
description: The string representation of a variable
type: String
returns:
- "[`ConceptMap.Explainable`](#explainable)"
java:
<<: *method-explainables-attribute
method: conceptMap.explainables().attribute(String variable);
javascript:
<<: *method-explainables-attribute
method: conceptMap.explainables.attribute(variable);
python:
<<: *method-explainables-attribute
method: concept_map.explainables().attribute(variable);
- method:
common: &method-explainables-ownership
title: Retrieve explainable ownership
description: Retrieves the explainable attribute ownership with the pair of (owner, attribute) variable names.
accepts:
param1:
name: variable
description: The string representation of a variable
type: String
returns:
- "[`ConceptMap.Explainable`](#explainable)"
java:
<<: *method-explainables-ownership
method: conceptMap.explainables().ownership(String ownerVar, String attributeVar);
javascript:
<<: *method-explainables-ownership
method: conceptMap.explainables.ownership(ownerVar, attributeVar);
python:
<<: *method-explainables-ownership
method: concept_map.explainables().ownership(owner_var, attribute_var);
- method:
common: &method-explainables-relations
title: Retrieve explainable relations
description: Retrieves all of this ConceptMap's explainable relations.
java:
<<: *method-explainables-relations
method: conceptMap.explainables().relations();
returns:
- "Map<String, [`ConceptMap.Explainable`](#explainable)>"
javascript:
<<: *method-explainables-relations
method: conceptMap.explainables.relations;
returns:
- "Map<String, [`ConceptMap.Explainable`](#explainable)>"
python:
<<: *method-explainables-relations
method: concept_map.explainables().relations();
returns:
- Dictionary of String to [`ConceptMap.Explainable`](#explainable)
- method:
common: &method-explainables-attributes
title: Retrieve explainable attributes
description: Retrieves all of this ConceptMap's explainable attributes.
java:
<<: *method-explainables-attributes
method: conceptMap.explainables().attributes();
returns:
- "Map<String, [`ConceptMap.Explainable`](#explainable)>"
javascript:
<<: *method-explainables-attributes
method: conceptMap.explainables.attributes;
returns:
- "Map<String, [`ConceptMap.Explainable`](#explainable)>"
python:
<<: *method-explainables-attributes
method: concept_map.explainables().attributes();
returns:
- Dictionary of String to [`ConceptMap.Explainable`](#explainable)
- method:
common: &method-explainables-ownerships
title: Retrieve explainable ownerships
description: Retrieves all of this ConceptMap's explainable attribute ownerships.
java:
<<: *method-explainables-ownerships
method: conceptMap.explainables().ownerships();
returns:
- "Map<Pair<String, String>, [`ConceptMap.Explainable`](#explainable)>"
javascript:
<<: *method-explainables-ownerships
method: conceptMap.explainables.ownerships;
returns:
- "Map<[String, String], [`ConceptMap.Explainable`](#explainable)>"
python:
<<: *method-explainables-ownerships
method: concept_map.explainables().ownerships();
returns:
- Dictionary of (String, String) to [`ConceptMap.Explainable`](#explainable)
- type6:
title: Explainable
methods:
- method:
common: &method-explainable-conjunction
title: Retrieve conjunction
description: Retrieves the subquery of the original query that is actually being explained.
returns:
- String
java:
<<: *method-explainable-conjunction
method: explainable.conjunction()
javascript:
<<: *method-explainable-conjunction
method: explainable.conjunction
python:
<<: *method-explainable-conjunction
method: explainable.conjunction()
- method:
common: &method-explainable-id
title: Retrieve ID
description: Retrieves the unique ID that identifies this Explainable.
java:
<<: *method-explainable-id
method: explainable.id()
returns:
- long
javascript:
<<: *method-explainable-id
method: explainable.id
returns:
- number
python:
<<: *method-explainable-id
method: explainable.explainable_id()
returns:
- int
- type7:
title: Explanation
methods:
- method:
common: &method-explanation-rule
title: Retrieve the rule
description: Retrieves the Rule for this Explanation.
returns:
- Rule
java:
<<: *method-explanation-rule
method: explanation.rule();
javascript:
<<: *method-explanation-rule
method: explanation.rule;
python:
<<: *method-explanation-rule
method: explanation.rule()
- method:
common: &method-explanation-conclusion
title: Retrieve the conclusion
description: Retrieves the Conclusion for this Explanation.
returns:
- ConceptMap
java:
<<: *method-explanation-conclusion
method: explanation.conclusion()
javascript:
<<: *method-explanation-conclusion
method: explanation.conclusion
python:
<<: *method-explanation-conclusion
method: explanation.conclusion()
- method:
common: &method-explanation-condition
title: Retrieve the condition
description: Retrieves the Condition for this Explanation.
returns:
- ConceptMap
java:
<<: *method-explanation-condition
method: explanation.condition()
javascript:
<<: *method-explanation-condition
method: explanation.condition
python:
<<: *method-explanation-condition
method: explanation.condition()
- method:
common: &method-explanation-varmap
title: Retrieve the variable mapping
description: Retrieves the mapping between rule variables and query variables for this Explanation.
java:
<<: *method-explanation-varmap
method: explanation.variableMapping()
returns:
- "Map<String, Set<String>>"
python:
<<: *method-explanation-varmap
method: explanation.variable_mapping()
returns:
- "Map<String, Set<String>>"
javascript:
<<: *method-explanation-varmap
method: explanation.variableMapping
returns:
- "Map<String, Set<String>>"