forked from NCATSTranslator/ReasonerAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TranslatorReasonerAPI.yaml
419 lines (419 loc) · 13.5 KB
/
TranslatorReasonerAPI.yaml
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
openapi: 3.0.1
info:
description: OpenAPI for NCATS Biomedical Translator Reasoners
version: 0.9.3-dev
title: OpenAPI for NCATS Biomedical Translator Reasoners
contact:
email: [email protected]
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
termsOfService: INSERT-URL-HERE
externalDocs:
description: >-
Documentation for the NCATS Biomedical Translator Reasoners web services
url: https://github.com/NCATS-Tangerine/NCATS-ReasonerStdAPI
tags:
- name: predicates
description: Get supported relationships by source and target
externalDocs:
description: Documentation for the reasoner predicates function
url: http://reasonerhost.ncats.io/overview.html#predicates
- name: query
description: Query reasoner using a predefined question type
externalDocs:
description: Documentation for the reasoner query function
url: http://reasonerhost.ncats.io/overview.html#query
- name: translator
- name: reasoner
paths:
/predicates:
get:
tags:
- predicates
summary: Get supported relationships by source and target
responses:
'200':
description: Predicates by source and target
content:
application/json:
schema:
description: Source map
type: object
additionalProperties:
description: Target map
type: object
additionalProperties:
description: Array of predicates
type: array
items:
type: string
example:
'biolink:ChemicalSubstance':
'biolink:Gene':
- biolink:directly_interacts_with
- biolink:decreases_activity_of
/query:
post:
tags:
- query
summary: Query reasoner via one of several inputs
description: ''
operationId: query
requestBody:
description: Query information to be submitted
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Query'
responses:
'200':
description: >-
OK. There may or may not be results. Note that some of the provided
identifiers may not have been recognized.
content:
application/json:
schema:
$ref: '#/components/schemas/Response'
'400':
description: >-
Bad request. The request is invalid according to this OpenAPI
schema OR a specific identifier is believed to be invalid somehow
(not just unrecognized).
content:
application/json:
schema:
type: string
'500':
description: >-
Internal server error.
content:
application/json:
schema:
type: string
'501':
description: >-
Not implemented.
content:
application/json:
schema:
type: string
x-swagger-router-controller: swagger_server.controllers.query_controller
components:
schemas:
Query:
x-body-name: request_body
type: object
properties:
message:
$ref: '#/components/schemas/Message'
additionalProperties: true
required:
- message
Response:
type: object
properties:
message:
$ref: '#/components/schemas/Message'
status:
description: >-
One of a standardized set of short codes,
e.g. Success, QueryNotTraversable, KPsNotAvailable
type: string
description:
description: A brief human-readable description of the outcome
type: string
logs:
type: array
items:
$ref: '#/components/schemas/LogEntry'
required:
- message
Message:
type: object
properties:
results:
description: >-
List of all returned potential answers for the query posed
type: array
items:
$ref: '#/components/schemas/Result'
query_graph:
type: object
description: >-
QueryGraph object that contains a serialization of a query in the
form of a graph
$ref: '#/components/schemas/QueryGraph'
knowledge_graph:
type: object
description: >-
KnowledgeGraph object that contains all the nodes and edges
referenced in any of the possible answers to the query OR
connection information for a remote knowledge graph
$ref: '#/components/schemas/KnowledgeGraph'
additionalProperties: false
LogEntry:
type: object
properties:
timestamp:
type: string
format: date-time
description: Timestamp in ISO 8601 format
example: '2020-09-03T18:13:49+00:00'
level:
type: string
description: Logging level
enum:
- ERROR
- WARNING
- INFO
- DEBUG
code:
type: string
description: >-
One of a standardized set of short codes
e.g. QueryNotTraversable, KPNotAvailable, KPResponseMalformed
message:
type: string
description: A human-readable log message
Result:
type: object
description: One of potentially several results or answers for a query
properties:
node_bindings:
type: object
description: List of QNode-KNode bindings.
additionalProperties:
type: array
items:
$ref: '#/components/schemas/NodeBinding'
edge_bindings:
type: object
description: List of QEdge-KEdge bindings.
additionalProperties:
type: array
items:
$ref: '#/components/schemas/EdgeBinding'
required:
- node_bindings
- edge_bindings
NodeBinding:
type: object
properties:
kg_id:
type: string
description: A knowledge-graph node id, i.e. the `id` of a KNode
required:
- kg_id
EdgeBinding:
type: object
properties:
kg_id:
type: string
description: A knowledge-graph edge id, i.e. the `id` of a KEdge
required:
- kg_id
KnowledgeGraph:
type: object
description: >-
A thought graph associated with this result. This will commonly be a
linear path subgraph from one concept to another, but related items
aside of the path may be included.
properties:
nodes:
type: object
description: List of nodes in the KnowledgeGraph
additionalProperties:
$ref: '#/components/schemas/Node'
edges:
type: object
description: List of edges in the KnowledgeGraph
additionalProperties:
$ref: '#/components/schemas/Edge'
additionalProperties: true
required:
- nodes
- edges
QueryGraph:
type: object
description: >-
A graph intended to be the thought path to be followed by a reasoner to
answer the question. This graph is a representation of a question.
properties:
nodes:
type: object
description: List of nodes in the QueryGraph
additionalProperties:
$ref: '#/components/schemas/QNode'
edges:
type: object
description: List of edges in the QueryGraph
additionalProperties:
$ref: '#/components/schemas/QEdge'
additionalProperties: true
required:
- nodes
- edges
QNode:
type: object
description: A node in the QueryGraph
properties:
curie:
oneOf:
- type: string
- type: array
items:
type: string
example: OMIM:603903
description: CURIE identifier for this node
type:
oneOf:
- $ref: '#/components/schemas/BiolinkEntity'
- type: array
items:
$ref: '#/components/schemas/BiolinkEntity'
is_set:
type: boolean
description: >-
Boolean that if set to true, indicates that this QNode MAY have
multiple KnowledgeGraph Nodes bound to it within each Result.
The nodes in a set should be considered as a set of independent
nodes, rather than a set of dependent nodes, i.e., the answer
would still be valid if the nodes in the set were instead returned
individually. Multiple QNodes may have is_set=True. If a QNode
(n1) with is_set=True is connected to a QNode (n2) with
is_set=False, each n1 must be connected to n2. If a QNode (n1)
with is_set=True is connected to a QNode (n2) with is_set=True,
each n1 must be connected to at least one n2.
default: false
additionalProperties: true
QEdge:
type: object
description: An edge in the QueryGraph
properties:
type:
oneOf:
- $ref: '#/components/schemas/BiolinkRelation'
- type: array
items:
$ref: '#/components/schemas/BiolinkRelation'
relation:
type: string
example: upregulates
description: Lower-level relationship type of this edge
source_id:
type: string
example: https://omim.org/entry/603903
description: Corresponds to the @id of source node of this edge
target_id:
type: string
example: https://www.uniprot.org/uniprot/P00738
description: Corresponds to the @id of target node of this edge
additionalProperties: true
required:
- source_id
- target_id
Node:
type: object
description: A node in the knowledge graph
properties:
name:
type: string
example: Haptoglobin
description: Formal name of the entity
type:
oneOf:
- type: string
- type: array
items:
$ref: '#/components/schemas/BiolinkEntity'
attributes:
type: array
description: A list of attributes describing the node
items:
$ref: '#/components/schemas/Attribute'
additionalProperties: false
Attribute:
type: object
description: Generic attribute for a node
properties:
name:
type: string
description: >-
Human-readable name or label for the attribute. Should be the name
of the semantic type term.
example: PubMed Identifier
value:
example: 32529952
description: >-
Value of the attribute. May be any data type, including a list.
type:
type: string
description: >-
CURIE of the semantic type of the attribute, from the EDAM ontology
if possible. If a suitable identifier does not exist, enter a
descriptive phrase here and submit the new type for consideration
by the appropriate authority.
example: EDAM:data_1187
url:
type: string
description: >-
Human-consumable URL to link out and read about the attribute (not
the node).
example: https://pubmed.ncbi.nlm.nih.gov/32529952
source:
type: string
description: Source of the attribute, as a CURIE prefix.
example: UniProtKB
required:
- type
- value
additionalProperties: false
Edge:
type: object
description: An edge in the knowledge graph linking two nodes
properties:
type:
$ref: '#/components/schemas/BiolinkRelation'
relation:
type: string
example: upregulates
description: Lower-level relationship type of this edge
source_id:
type: string
example: OMIM:603903
description: >-
Corresponds to the map key CURIE of the source node of this edge
target_id:
type: string
example: UniProtKB:P00738
description: >-
Corresponds to the map key CURIE of the target node of this edge
attributes:
type: array
description: A list of additional attributes for this edge
items:
$ref: '#/components/schemas/Attribute'
additionalProperties: false
required:
- source_id
- target_id
BiolinkEntity:
description: >-
CURIE for a Biolink class, NamedThing or a child thereof (PascalCase)
type: string
pattern: ^biolink:[A-Z][a-zA-Z]*$
externalDocs:
description: Biolink model entities
url: https://biolink.github.io/biolink-model/docs/NamedThing.html
example: biolink:PhenotypicFeature
BiolinkRelation:
description: >-
CURIE for a Biolink slot, related_to or a child thereof (snake_case)
type: string
pattern: ^biolink:[a-z][a-z_]*$
externalDocs:
description: Biolink model relations
url: https://biolink.github.io/biolink-model/docs/related_to.html
example: biolink:interacts_with