-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathubkg-api-spec.yaml
595 lines (595 loc) · 17.4 KB
/
ubkg-api-spec.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
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
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
openapi: 3.0.3
info:
title: UBKG API
description: This document describes the UBKG API
version: 1.2.0
servers:
- url: https://ontology.api.hubmapconsortium.org/
paths:
/codes/{code_id}/codes:
get:
summary: Returns a list of code_ids {Concept, Code, SAB} that code the same concept(s) as the code_id, optionally restricted to source (SAB)
operationId: codes_code_id_codes_get
parameters:
- name: code_id
in: path
required: true
description: The code identifier
schema:
type: string
example: SNOMEDCT_US 254837009
- name: sab
in: query
required: false
description: One or more sources (SABs) to return
schema:
type: array
uniqueItems: true
items:
type: string
example: NCI,MDR
default: []
responses:
'200':
description: A JSON array of dictionaries
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/CodesCodesObj'
/codes/{code_id}/concepts:
get:
operationId: codes_code_id_concepts_get
summary: Returns a list of concepts {Concept, Prefterm} that the code_id codes
parameters:
- name: code_id
in: path
required: true
description: The code identifier
schema:
type: string
example: SNOMEDCT_US 254837009
responses:
'200':
description: A JSON array of dictionaries
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/ConceptDetail'
/concepts/{concept_id}/codes:
get:
operationId: concepts_concept_id_codes_get
summary: Returns a distinct list of code_id(s) that code the concept
parameters:
- name: concept_id
in: path
required: true
description: The concept identifier
schema:
type: string
example: C0678222
- name: sab
in: query
required: false
description: One or more sources (SABs) to return
schema:
type: array
uniqueItems: true
items:
type: string
example: MEDLINEPLUS,MSH,MEDCIN
default: []
responses:
'200':
description: A JSON array of code_id(s) that code the concept
content:
application/json:
schema:
type: array
items:
type: string
example: CHV 0000052645
/concepts/{concept_id}/concepts:
get:
operationId: concepts_concept_id_concepts_get
summary: Returns a list of concepts {Sab, Relationship, Concept, Prefterm} related to the concept
parameters:
- name: concept_id
in: path
required: true
description: The concept identifier
schema:
type: string
example: C0006142
responses:
'200':
description: A JSON array of {Sab, Relationship, Concept, Prefterm} dictionaries
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/SabRelationshipConceptTerm'
/concepts/expand:
post:
operationId: concepts_expand_post
summary: Returns a unique list of concepts (Concept, Preferred Term) on all paths including starting concept (query_concept_id) restricted by list of relationship types (rel), list of relationship sources (sab), and depth of travel.
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ConceptSabRelDepth"
example:
query_concept_id: C2720507
sab: [SNOMEDCT_US, HGNC]
rel: [isa, isa]
depth: 2
responses:
'200':
description: Return all {concept, prefterm}
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/ConceptPrefterm'
/concepts/paths:
post:
operationId: concepts_path_post
summary: Return all paths of the relationship pattern specified within the selected sources
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ConceptSabRel"
example:
query_concept_id: C2720507
sab: [SNOMEDCT_US, HGNC]
rel: [isa, isa]
responses:
'200':
description: Return all paths of the relationship pattern specified within the selected sources
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/PathItemConceptRelationshipSabPrefterm'
/concepts/shortestpaths:
post:
operationId: concepts_shortestpaths_post
summary: Return all paths of the relationship pattern specified within the selected sources
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/QconceptTconceptSabRel"
example:
query_concept_id: C2720507
target_concept_id: C1272753
sab: [SNOMEDCT_US, HGNC]
rel: [isa, part_of]
responses:
'200':
description: Return all paths of the relationship pattern specified within the selected sources
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/PathItemConceptRelationshipSabPrefterm'
/concepts/trees:
post:
operationId: concepts_trees_post
summary: Return all paths of the relationship pattern specified within the selected sources
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ConceptSabRelDepth"
example:
query_concept_id: C2720507
sab: [SNOMEDCT_US, HGNC]
rel: [isa, isa]
depth: 2
responses:
'200':
description: Return all paths of the relationship pattern specified within the selected sources
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/PathItemConceptRelationshipSabPrefterm'
/concepts/{concept_id}/definitions:
get:
operationId: concepts_concept_id_definitions_get
summary: Returns a list of definitions {Sab, Definition} of the concept
parameters:
- name: concept_id
in: path
required: true
description: The concept identifier
schema:
type: string
example: C0006142
responses:
'200':
description: A JSON array of {Sab, Definition} dictionaries
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/SabDefinition'
/concepts/{concept_id}/semantics:
get:
operationId: concepts_concept_id_semantics_get
summary: Returns a list of semantic_types {Sty, Tui, Stn} of the concept
parameters:
- name: concept_id
in: path
required: true
description: The concept identifier
schema:
type: string
example: C0304055
responses:
'200':
description: A JSON array of {Sty, Tui, Stn} dictionaries
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/StyTuiStn'
/semantics/{semantic_id}/semantics:
get:
operationId: semantics_semantic_id_semantics_get
summary: Returns a list of semantic_types {queryTUI, querySTN ,semantic, TUI_STN} of the semantic type
parameters:
- name: semantic_id
in: path
required: true
description: The semantic identifier
schema:
type: string
example: Physical Object
responses:
'200':
description: A JSON array of {queryTUI, querySTN ,semantic, TUI_STN} dictionaries
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/QQST'
/tui/{tui_id}/semantics:
get:
operationId: tui_tui_id_semantics_get
summary: Returns a list of symantic_types {semantic, STN} of the type unique id (tui)
parameters:
- name: tui_id
in: path
required: true
description: The TUI identifier
schema:
type: string
example: T200
responses:
'200':
description: A JSON array of {semantic, STN} dictionaries
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/SemanticStn'
/terms/{term_id}/codes:
get:
operationId: terms_term_id_codes_get
summary: Returns a list of codes {TermType, Code} of the text string
parameters:
- name: term_id
in: path
required: true
description: The term identifier
schema:
type: string
example: Breast cancer
responses:
'200':
description: A JSON array of {TermType, Code} dictionaries
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/TermtypeCode'
/terms/{term_id}/concepts:
get:
operationId: terms_term_id_concepts_get
summary: Returns a list of concepts associated with the text string
parameters:
- name: term_id
in: path
required: true
description: The term identifier
schema:
type: string
example: Breast cancer
responses:
'200':
description: A JSON array of concepts associated with the term
content:
application/json:
schema:
type: array
items:
type: string
example: C0794811
/terms/{term_id}/concepts/terms:
get:
operationId: terms_term_id_concepts_terms_get
summary: Returns an expanded list of concept(s) and preferred term(s) {Concept, Term} from an exact text match
parameters:
- name: term_id
in: path
required: true
description: The term identifier
schema:
type: string
example: Breast cancer
responses:
'200':
description: A JSON array of {Concept, Term} dictionaries
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/ConceptTerm'
/valueset:
get:
operationId: valueset_get
summary: Returns a valueset of concepts that are children (have as isa relationship) of another concept.
parameters:
- name: parent_sab
in: query
required: true
description: the SAB of the parent concept
schema:
type: string
example: HUBMAP
- name: parent_code
in: query
required: true
description: the code of the parent concept in the SAB (local ontology)
schema:
type: string
example: C000530
- name: child_sabs
in: query
required: true
description: the list of SABs for child concepts, in order of preference (in case of parent concepts with cross-references)
schema:
type: array
uniqueItems: true
items:
type: string
example: HUSAT,SNOMEDCT_US
default: [ ]
responses:
'200':
description: A JSON array of preferred terms for child codes that have an isa relationship with the parent code
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/SabCodeTerm'
components:
schemas:
CodesCodesObj: # Schema name
type: object
properties:
concept:
type: string
example: C0006142
code:
type: string
example: CCS 2.5
SAB:
type: string
example: CCF
ConceptDetail: # Schema name
type: object
properties:
concept:
type: string
example: C0006142
prefterm:
type: string
example: Malignant neoplasm of breast
ConceptSabRel: # Schema name
type: object
properties:
query_concept_id:
type: string
example: C2720507
sab:
type: array
items:
type: string
example: ["SNOMEDCT_US", "HGNC"]
rel:
type: array
items:
type: string
example: ["isa", "isa"]
ConceptSabRelDepth: # Schema name
type: object
properties:
query_concept_id:
type: string
example: C2720507
sab:
type: array
items:
type: string
example: ["SNOMEDCT_US", "HGNC"]
rel:
type: array
items:
type: string
example: ["isa","isa"]
depth:
type: integer
example: 2
ConceptPrefterm: # Schema name
type: object
properties:
concept:
type: string
example: C0006826
prefterm:
type: string
example: Malignant Neoplasms
ConceptTerm: # Schema name
type: object
properties:
concept:
type: string
example: C0006826
term:
type: string
example: LNC LA14283-8
PathItemConceptRelationshipSabPrefterm: # Schema name
type: object
properties:
path:
type: string
item:
type: string
concept:
type: string
example: C0006826
relationship:
type: string
example: CHD
sab:
type: string
example: ICD10AM
prefterm:
type: string
example: Malignant Neoplasms
QconceptTconceptSabRel: # Schema name
type: object
properties:
query_concept_id:
type: string
example: C2720507
target_concept_id:
type: string
example: C1272753
sab:
type: array
items:
type: string
example: ["SNOMEDCT_US", "HGNC"]
rel:
type: array
items:
type: string
example: ["isa", "part_of"]
QQST: # Schema name
type: object
properties:
queryTUI:
type: string
example: T072
querySTN:
type: string
example: A1
semantic:
type: string
example: Entity
TUI:
type: string
example: T071
STN:
type: string
example: A
SabDefinition: # Schema name
type: object
properties:
sab:
type: string
example: NCI
definition:
type: string
example: A primary or metastatic malignant neoplasm involving the breast. The vast majority of cases are carcinomas arising from the breast parenchyma or the nipple. Malignant breast neoplasms occur more frequently in females than in males.
SabRelationshipConceptTerm: # Schema name
type: object
properties:
sab:
type: string
example: ICD10AM
relationship:
type: string
example: CHD
concept:
type: string
example: C0006826
prefterm:
type: string
example: Malignant Neoplasms
SemanticStn: # Schema name
type: object
properties:
semantic:
type: string
example: Entity
STN:
type: string
example: A
StyTuiStn: # Schema name
type: object
properties:
sty:
type: string
example: Organic Chemical
tui:
type: string
example: T109
stn:
type: string
example: A1.4.1.2.1
TermtypeCode: # Schema name
type: object
properties:
termtype:
type: string
example: LA
code:
type: string
example: LNC LA14283-8
SabCodeTerm: # Schema name
type: object
properties:
sab:
type: string
example: NCI
code:
type: string
example: C16853
term:
type: string
example: Microscopy