forked from STARInformatics/beacon-aggregator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
beacon-aggregator-api.yaml
1676 lines (1675 loc) · 63.1 KB
/
beacon-aggregator-api.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
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
swagger: '2.0'
info:
title: Translator Knowledge Beacon Aggregator API
version: 1.1.4
contact:
url: 'http://starinformatics.com'
email: [email protected]
description: >
This is the Translator Knowledge Beacon Aggregator web service application
programming interface (API) that provides integrated access to a pool of
knowledge sources publishing concepts and relations through the Translator
Knowledge Beacon API. This API is similar to that of the latter mentioned
API with the addition of some extra informative endpoints plus session
identifier and beacon indices. These latter identifiers are locally assigned
numeric indices provided to track the use of specific registered beacons
within the aggregator API itself.
license:
name: MIT License
url: 'http://opensource.org/licenses/MIT'
host: kba.ncats.io
basePath: /
schemes:
- https
produces:
- application/json
tags:
- name: metadata
description: Queries about global characteristics of the knowledge beacon network
- name: concepts
description: Queries relating to concepts
- name: statements
description: Queries relating to concept-relationship statements and their evidence
paths:
/beacons:
get:
description: |
Get a list of all of the knowledge beacons that the aggregator can query
tags:
- metadata
operationId: getBeacons
responses:
'200':
schema:
type: array
items:
title: ServerKnowledgeBeacon
type: object
properties:
beacon:
type: integer
description: |
aggregator assigned beacon index identifier
name:
type: string
description: |
beacon name
url:
type: string
description: |
URL used to execute API calls on the beacon
description:
type: string
description: |
beacon description
contact:
type: string
description: |
name of the person responsible for this beacon
wraps:
type: string
description: |
URL of this beacon's data source
repo:
type: string
description: |
URL of this beacon's repository
description: |
Successful response with beacons
examples:
application/json:
- id: 1
name: SemMedDB
url: 'https://rkb.ncats.io'
description: ''
/categories:
get:
description: >
Get a list of semantic categories and number of instances in each
available knowledge beacon, including associated beacon-specific
metadata
tags:
- metadata
parameters:
- name: beacons
in: query
description: >
set of aggregator indices of beacons to constrain categories
returned
required: false
type: array
items:
type: integer
operationId: getConceptCategories
responses:
'200':
schema:
type: array
items:
title: ServerConceptCategory
type: object
properties:
id:
type: string
description: >-
the CURIE of the concept category (see [Biolink Model
Classes](https://biolink.github.io/biolink-model)
uri:
type: string
description: >-
the URI of the concept category (see [Biolink Model
Classes](https://biolink.github.io/biolink-model) for the
full list of URI)
category:
type: string
description: >
the human readable label of the concept category (see
[Biolink Model
Classes](https://biolink.github.io/biolink-model) for the
full list of concept categories)
description:
type: string
description: >
human readable definition assigned by the beacon for the
specified concept category
beacons:
type: array
description: >
list of metadata for beacons that support the use of this
concept category
items:
title: ServerConceptCategoriesByBeacon
type: object
properties:
beacon:
type: integer
description: |
Aggregator index identifier of the given beacon
categories:
type: array
items:
title: ServerBeaconConceptCategory
type: object
description: |
Single local concept categories from a given beacon
properties:
id:
type: string
description: >
the 'local' CURIE-encoded identifier of the
given concept category, as published by the
given beacon
uri:
type: string
description: >
the 'local' URI of the given concept category,
as published by the given beacon
category:
type: string
description: >
the 'local' human readable label of the given
concept category, as published by the given
beacon
frequency:
type: integer
description: >
the number of instances of the specified concept
category is used in statements within the given
beacon
description: |
Successful response with concept categories and frequency returned
examples:
application/json:
- id: 'BLM:Gene'
uri: 'http://bioentity.io/vocab/Gene'
category: gene
description: >
A region (or regions) that includes all of the sequence
elements necessary to encode a functional transcript. A gene
may include regulatory regions, transcribed regions and/or
other functional sequence regions.
beacons:
- beacon: 1
categories:
- id: 'UMLSSG:GENE'
uri: 'https://metamap.nlm.nih.gov/Docs/SemGroups_2013#GENE'
category: GENE
frequency: 1234
- beacon: 5
categories:
- id: 'SO:0000704'
uri: 'http://www.sequenceontology.org/0000704'
category: gene
frequency: 5678
/predicates/details:
get:
description: >
Get a list of predicates used in statements issued by the knowledge
source
tags:
- metadata
parameters:
- name: beacons
in: query
description: >
set of aggregator indices of beacons to constrain predicates
returned
required: false
type: array
items:
type: integer
operationId: getPredicatesDetails
responses:
'200':
schema:
type: array
items:
title: ServerPredicate
type: object
properties:
id:
type: string
description: >-
the CURIE of the predicate relation (see [Biolink
Model](https://biolink.github.io/biolink-model)
uri:
type: string
description: >-
the URI of the predicate relation (see [Biolink
Model](https://biolink.github.io/biolink-model) for the full
list of URI)
edge_label:
type: string
description: >-
the human readable 'edge label' of the 'minimal' predicate
(see [Biolink
Model](https://biolink.github.io/biolink-model) for the full
list of Biolink Model minimal predicates)
description:
type: string
description: >
human readable definition assigned by the beacon for the
predicate relation
beacons:
type: array
description: >
list of metadata for beacons that support the use of this
predicate relation
items:
title: ServerPredicatesByBeacon
type: object
properties:
beacon:
type: integer
description: |
aggregator index of the given beacon
predicates:
type: array
items:
title: ServerBeaconPredicate
type: object
description: |
Local predicate definition from a given beacon
properties:
id:
type: string
description: >
the 'local' CURIE-encoded identifier of a
maximal predicate relation, as published by the
given beacon
uri:
type: string
description: >
the 'local' URI of a maximal predicate
relation, as published by the given beacon
relation:
type: string
description: >
the human readable 'relation of the 'maximal'
predicate (see the [Biolink
Model](https://biolink.github.io/biolink-model)
for a list of Biolink maximal predicates; this
field may map onto beacon-specific non-Biolink
relations
description:
type: string
description: >
human readable definition of the given
predicate relation
frequency:
type: integer
description: >
the number of instances of the specified
predicate relation is used in statements within
the given beacon
description: >
Successful response with predicates with CURIE and definitions
indexed by beacons which support the relation
examples:
application/json:
- id: 'BLM:affects_risk_for'
uri: 'http://bioentity.io/vocab/affects_risk_for'
edge_label: affects_risk_for
description: |
holds between two entities where exposure to one entity
alters the chance of developing the other
beacons:
- beacon: 1
predicates:
- id: 'SEMMEDDB:PREDISPOSES'
uri: 'https://metamap.nlm.nih.gov/predicate/PREDISPOSES'
relation: PREDISPOSES
description: >-
agent which predisposes individual to a given
condition
frequency: 123
/kmap:
get:
description: >
Get a high level knowledge map of the all the beacons specified by
triplets of subject concept category, relationship predicate and concept
object category
tags:
- metadata
parameters:
- name: beacons
in: query
description: >
set of aggregator indices of beacons constraining knowledge maps
returned
required: false
type: array
items:
type: integer
operationId: getKnowledgeMap
responses:
'200':
schema:
type: array
items:
title: ServerKnowledgeMap
type: object
properties:
beacon:
type: integer
description: |
aggregator assigned beacon index identifier
statements:
type: array
items:
title: ServerKnowledgeMapStatement
type: object
properties:
subject:
title: ServerKnowledgeMapSubject
type: object
properties:
category:
type: string
description: >
the human readable label of the concept category
of a statement subject
prefixes:
type: array
items:
type: string
description: >
the prefix of the namespace of statement subject
concept identifiers which may conceivably be
bound to the given relationship
predicate:
title: ServerKnowledgeMapPredicate
type: object
properties:
edge_label:
type: string
description: >-
the human readable edge label of the 'minimal'
predicate of the given relationship
relation:
type: string
description: >-
the human readable label of the 'maximal'
predicate of the given relationship
negated:
type: boolean
object:
title: ServerKnowledgeMapObject
type: object
properties:
category:
type: string
description: >
the human readable label of the concept category
of a statement object
prefixes:
type: array
items:
type: string
description: >
the prefix of the namespace of statement object
concept identifiers which may conceivably be
bound to the given relationship
frequency:
type: integer
description: >
the frequency of statements of the specified
relationship within the given beacon
description:
type: string
description: |
a description of the nature of the relationship
description: |
Successful response with categories and frequency returned
examples:
application/json:
- beacon: 1
statements:
- subject:
category: gene
prefixes:
- DRUGBANK
- CHEMBL
- UNIPROT
predicate:
edge_label: is substance that treats
relation: 'RO:0002606'
object:
category: disease or phenotypic feature
prefixes:
- MP
- HP
- DOID
count: 500
description: >
a small molecule or compound that is capable of some
activity that negative regulates or decreases the
magnitude of a pathological process, phenotype or disease
- subject:
category: drug
prefixes:
- DRUGBANK
- CHEMBL
predicate:
edge_label: chemical_to_pathway_association
relation: 'SIO:001250'
object:
category: pathway
prefixes:
- KEGG
count: 100
description: |
Drug interacts with a given pathway
/errorlog:
get:
description: |
Get a log of the system errors associated with a specified query
tags:
- metadata
parameters:
- name: queryId
in: query
description: |
query identifier returned from a POSTed query
required: true
type: string
operationId: getErrorLog
responses:
'200':
schema:
type: array
items:
title: ServerLogEntry
type: object
properties:
queryId:
type: string
description: |
session identifier of initiated query
timestamp:
type: string
description: |
timestamp
beacon:
type: integer
description: |
aggregator assigned beacon index identifier
query:
type: string
description: |
URL of the API call executed by the aggregator
message:
type: string
description: |
error message
description: |
Successful response with most recent errors
examples:
application/json:
- queryId: AB123
timestamp: '2018-12-31 15:09:24.614'
beacon: 2
query: 'https://wikidata.ncats.io/concepts?keywords=WRN'
message: Bad Gateway
/concepts:
post:
description: |
Posts the query parameters to retrieves a list of
concepts from the system
tags:
- concepts
parameters:
- name: keywords
in: query
description: >-
an array of keywords or substrings against which to match concept
names and synonyms
required: true
type: array
items:
type: string
- name: categories
in: query
description: >
a subset array of concept categories (specified as codes 'gene',
'pathway', etc.) to which to constrain concepts matched by the main
keyword search (see [Biolink
Model](https://biolink.github.io/biolink-model) for the full list of
codes)
required: false
type: array
items:
type: string
- name: beacons
in: query
description: >
subset of aggregator indices of beacons to be used as knowledge
sources for the query (if omitted, then the all beacons are queried)
required: false
type: array
items:
type: integer
operationId: postConceptsQuery
responses:
'200':
schema:
title: ServerConceptsQuery
type: object
properties:
queryId:
type: string
description: |
session identifier of initiated query
keywords:
type: array
items:
type: string
description: |
'keywords' string parameter to API call, echoed back
categories:
type: array
items:
type: string
description: |
'categories' string parameter to API call, echoed back
description: >
Successful concept query initialization, with initial query status
returned
examples:
application/json:
queryId: XRBTu9CgfiXEhcfMdr4y
keywords:
- Werner
- Syndrome
categories:
- gene
- protein
- disease
'/concepts/status/{queryId}':
get:
description: >
Retrieves the status of a given keyword search query about the concepts
in the system
tags:
- concepts
parameters:
- name: queryId
in: path
description: >-
an active query identifier as returned by a POST of concept query
parameters.
required: true
type: string
- name: beacons
in: query
description: >
subset of aggregator indices of beacons whose status is being polled
(if omitted, then the status of all beacons from the query are
returned)
required: false
type: array
items:
type: integer
operationId: getConceptsQueryStatus
responses:
'200':
schema:
title: ServerConceptsQueryStatus
type: object
properties:
queryId:
type: string
description: >
session identifier of a query previously initiated by
/concepts
status:
type: array
description: |
array of beacon-specific query status reports
items:
title: ServerConceptsQueryBeaconStatus
type: object
properties:
beacon:
type: integer
description: |
Index number of beacon providing these concept details
status:
type: integer
description: >
Http code status of beacon API - 200 means 'data ready',
102 means 'query in progress', other codes (e.g. 500)
are server errors. Once a beacon has a '200' success
code, then the /concepts/data endpoint may be used to
retrieve it.
discovered:
type: integer
description: >
A count of how many items a beacon has returned. This
number will not always be the same as the final number
of results since we merge duplicate items.
processed:
type: integer
description: >
A count of how many of the beacon responses have been
processed and are ready for consumption.
count:
type: integer
description: >
When a 200 status code is returned, this integer
designates the number of concepts matched by the query
for the given beacon.
description: |
Current query status returned
examples:
application/json:
queryId: XRBTu9CgfiXEhcfMdr4y
status:
- beacon: 1
status: 200
discovered: 3
processed: 3
count: 3
- beacon: 2
status: 500
discovered: null
processed: null
count: null
- beacon: 5
status: 102
discovered: 37
processed: 10
count: null
'/concepts/data/{queryId}':
get:
description: >
Retrieves a (paged) list of basic equivalent concept clique data from
beacons
'data ready' from a previously /concepts posted query parameter
submission
tags:
- concepts
parameters:
- name: queryId
in: path
description: >-
the query identifier of a concepts query previously posted by the
/concepts endpoint
required: true
type: string
- name: beacons
in: query
description: |
set of aggregator indices of beacons whose data are to be retrieved
required: false
type: array
items:
type: integer
- name: pageNumber
in: query
description: |
(1-based) number of the page to be returned in a paged set of query
results. Defaults to '1'.
required: false
type: integer
- name: pageSize
in: query
description: |
number of concepts per page to be returned in a paged set of query
results. Defaults to '10'.
required: false
type: integer
operationId: getConcepts
responses:
'200':
schema:
title: ServerConceptsQueryResult
type: object
properties:
queryId:
type: string
description: |
session identifier of the query returning the results
beacons:
type: array
items:
type: integer
description: >
subset of aggregator indices of beacons whose concepts are
to be retrieved
pageNumber:
type: integer
description: |
'pageNumber' string parameter to API call, echoed back
pageSize:
type: integer
description: |
'pageSize' string parameter to API call, echoed back
results:
type: array
items:
title: ServerConcept
type: object
properties:
clique:
type: string
description: >
CURIE identifying the inferred equivalent concept clique
to which the concept belongs. This is assigned by an
identifier precedence heuristic by the beacon-aggregator
name:
type: string
description: |
Canonical human readable name of the concept
categories:
type: array
items:
type: string
description: >
Concept categories associated with the given concept
((see [Biolink
Model](https://biolink.github.io/biolink-model) for the
full list of categories).
description: |
Successful response with concept list returned
examples:
application/json:
queryId: XRBTu9CgfiXEhcfMdr4y
beacons:
- 1
- 5
pageNumber: 1
pageSize: 4
results:
- clique: 'UNIPROT:Q14191'
name: 'WRN protein, human'
category: protein
- clique: 'NCBIGENE:56897'
name: WRNIP1
category: gene
- clique: 'NCBIGENE:7486'
name: WRN
category: gene
- clique: 'DOID:5686'
name: Werner Syndrome
category: disease
/cliques:
post:
description: >
Retrieves the beacon aggregator assigned cliques of equivalent concepts
that includes the specified (url-encoded) CURIE identifiers. Note that
the clique to which a given concept CURIE belongs may change over time
as the aggregator progressively discovers the members of the clique. Any
unmatched identifiers will be ignored (e.g. the id couldn't be found in
any of the beacons)
tags:
- concepts
parameters:
- name: ids
in: query
description: >-
an array of [CURIE-encoded](https://www.w3.org/TR/curie/)
identifiers of interest to be resolved to a list of concept cliques
required: true
type: array
items:
type: string
operationId: postCliquesQuery
responses:
'200':
schema:
title: ServerCliquesQuery
type: object
properties:
queryId:
type: string
description: |
session identifier of initiated query
ids:
type: array
items:
type: string
description: |
'ids' string parameter to call, echoed back
description: >
Successful clique query initialization, with initial query status
returned
examples:
application/json:
queryId: XRBTu9CgfiXEhcfMdr4y
ids:
- 'NCIT:C34942'
- 'MONDO:0005406'
'/cliques/status/{queryId}':
get:
description: |
Retrieves the status of a given query about the cliques in the system
tags:
- concepts
parameters:
- name: queryId
in: path
description: >-
an active query identifier as returned by a POST of clique query
parameters.
required: true
type: string
operationId: getCliquesQueryStatus
responses:
'200':
schema:
title: ServerCliquesQueryStatus
type: object
properties:
queryId:
type: string
description: |
session identifier of a query previously initiated by /cliques
status:
type: array
description: |
array of beacon-specific query status reports
items:
title: ServerCliquesQueryBeaconStatus
type: object
properties:
beacon:
type: integer
description: |
Index number of beacon providing these concept details
status:
type: integer
description: >
Http code status of beacon API - 200 means 'data ready',
102 means 'query in progress', other codes (e.g. 500)
are server errors. Once a beacon has a '200' success
code, then the /cliques/data endpoint may be used to
retrieve it
count:
type: integer
description: >
When a 200 status code is returned, this integer
designates the number of ids matched by the query for
the given beacon.
description: |
Current query status returned
examples:
application/json:
queryId: XRBTu9CgfiXEhcfMdr4y
status:
- beacon: 1
status: 200
count: 10
- beacon: 2
status: 500
count: null
- beacon: 5
status: 102
count: null
'/cliques/data/{queryId}':
get:
description: >
Retrieves a list of concept cliques based on 'data ready' from a
previously /cliques posted query parameter submission
tags:
- concepts
parameters:
- name: queryId
in: path
description: >-
the query identifier of a concepts query previously posted by the
/cliques endpoint
required: true
type: string
operationId: getCliques
responses:
'200':
schema:
title: ServerCliquesQueryResult
type: object
properties:
queryId:
type: string
description: |
session identifier of the query returning the results
results:
type: array
items:
title: ServerClique
type: object
properties:
id:
type: string
description: >
CURIE identifying the concept whose concept clique is
being resolved
cliqueId:
type: string
description: >
CURIE identifying the equivalent concept clique to which
the input concept CURIE belongs.
description: |
Successful response with clique identifiers returned
examples:
application/json:
queryId: XRBTu9CgfiXEhcfMdr4y
results:
- id: 'NCBIGENE:2176'
cliqueId: 'NCBIGENE:2176'
- id: 'MONDO:0005406'
cliqueId: 'NCIT:C34942'
'/concepts/details/{cliqueId}':
get:
description: >
Retrieves details for a specified clique of equivalent concepts in the
system, as specified by a (url-encoded) CURIE identifier of a clique
known to the aggregator
tags:
- concepts
parameters:
- name: cliqueId
in: path
description: >-
a [CURIE-encoded](https://www.w3.org/TR/curie/) identifier, as
returned by any other endpoint of the beacon aggregator API, of an
exactly matching concept clique of interest.
required: true
type: string
- name: beacons
in: query
description: >
set of aggregator indices of beacons to be used as knowledge sources
for the query
required: false
type: array
items:
type: integer
operationId: getConceptDetails
responses:
'200':
schema:
title: ServerConceptWithDetails
type: object
description: |
A single record of a given concept clique with details
properties:
clique:
type: string
description: >
CURIE identifying the equivalent concept clique to which the