-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathTranslatorReasonerAPI.yaml
More file actions
1777 lines (1777 loc) · 70.7 KB
/
TranslatorReasonerAPI.yaml
File metadata and controls
1777 lines (1777 loc) · 70.7 KB
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
---
openapi: 3.1.2
info:
description: INSERT-DESCRIPTION-OF-YOUR-SERVICE-HERE
version: INSERT-VERSION-OF-YOUR-SERVICE-HERE
title: INSERT-TITLE-OF-YOUR-SERVICE-HERE
contact:
email: INSERT@EMAIL-ADDRESS-OF-IMPLEMENTER-HERE.ORG
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
termsOfService: INSERT-URL-HERE
x-translator:
component: INSERT-EITHER-ARA-OR-KP-OR-ARS-OR-Utility-HERE
team:
- INSERT-ONE-TRANSLATOR-TEAM-NAME-PER-ELEMENT-HERE
biolink-version: INSERT-BIOLINK-MODEL-VERSION-HERE
infores: INSERT-INFORES-CURIE-OF-THIS-RESOURCE-HERE
externalDocs:
description: >-
The values for component and team are restricted according to this
external JSON schema. See schema and examples at url
url: >-
https://github.com/NCATSTranslator/translator_extensions/blob/production/x-translator/
x-trapi:
version: 2.0.0
multicuriequery: >-
REPLACE-WITH-true-IF-multicurie-queries-ARE-IMPLEMENTED-ELSE-false
asyncquery: REPLACE-WITH-true-IF-/asyncquery-IS-IMPLEMENTED-ELSE-false
pathfinderquery: >-
REPLACE-WITH-true-IF-pathfinder-queries-ARE-IMPLEMENTED-ELSE-false
operations:
- LIST-ALL-SUPPORTED-OPERATION-IDS-HERE-OR-REMOVE-THIS-SECTION
batch_size_limit: ADD-BATCH-SIZE-LIMIT-OR-REMOVE-IF-NO-LIMIT
rate_limit: ADD-REQUEST-RATE-LIMIT-OR-REMOVE-IF-NO-LIMIT
test_data_location: ADD-URL-THAT-RESOLVES-TO-SRI-TESTING-HARNESS-DATA
externalDocs:
description: >-
The values for version are restricted according to the regex in
this external JSON schema. See schema and examples at url
url: >-
https://github.com/NCATSTranslator/translator_extensions/blob/production/x-trapi/
servers:
- url: INSERT-URL-HERE
description: INSERT-SERVER-DESCRIPTION-HERE
externalDocs:
description: >-
Documentation for the NCATS Biomedical Translator Reasoners web services
url: https://github.com/NCATSTranslator/ReasonerAPI
tags:
- name: meta_knowledge_graph
description: >-
Retrieve the meta knowledge graph representation of this
TRAPI web service. KPs MUST provide all subject category - predicate -
object category triplets that are supported by the service,
NOT including all implied ancestor relationships. ARAs SHOULD provide
the union of all meta knowledge graphs of all the KPs that they can
consult.
externalDocs:
description: >-
Documentation for the reasoner meta_knowledge_graph function
url: INSERT-URL-HERE-OR-REMOVE-EXTERNALDOCS-IF-NA
- name: query
description: Initiate a query and wait to receive the response
externalDocs:
description: Documentation for the reasoner query function
url: INSERT-URL-HERE-OR-REMOVE-EXTERNALDOCS-IF-NA
- name: asyncquery
description: Initiate a query with a callback to receive the response
externalDocs:
description: Documentation for the reasoner asynchquery function
url: INSERT-URL-HERE-OR-REMOVE-EXTERNALDOCS-IF-NA
- name: asyncquery_status
description: >-
Retrieve the current status of a previously submitted
asyncquery given its job_id
- name: translator
description: Required for SmartAPI validation of x-translator
- name: trapi
description: Required for SmartAPI validation of x-trapi
paths:
/meta_knowledge_graph:
get:
tags:
- meta_knowledge_graph
summary: Meta knowledge graph representation of this TRAPI web service.
responses:
'200':
description: >-
Returns meta knowledge graph representation of this TRAPI web
service.
content:
application/json:
schema:
$ref: '#/components/schemas/MetaKnowledgeGraph'
/query:
post:
tags:
- query
summary: Initiate a query and wait to receive a Response
description: ''
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
'409':
description: >-
There is a conflict between client-given TRAPI parameters and server
capabilities. The response body may contain additional details about
the conflict.
content:
application/json:
schema:
type: string
'413':
description: >-
Payload too large. Indicates that batch size was over the limit
specified in x-trapi.
content:
application/json:
schema:
type: string
'429':
description: >-
Too many requests. Indicates that the client issued requests that
exceed the rate limit specified in x-trapi.
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
/asyncquery:
post:
tags:
- asyncquery
summary: Initiate a query with a callback to receive the response
description: ''
requestBody:
description: Query information to be submitted
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AsyncQuery'
responses:
'200':
description: >-
The query is accepted for processing and the Response will be
sent to the callback url when complete.
content:
application/json:
schema:
$ref: '#/components/schemas/AsyncQueryResponse'
'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
'409':
description: >-
There is a conflict between client-given TRAPI parameters and server
capabilities. The response body may contain additional details about
the conflict.
content:
application/json:
schema:
type: string
'413':
description: >-
Payload too large. Indicates that batch size was over the limit
specified in x-trapi.
content:
application/json:
schema:
type: string
'429':
description: >-
Too many requests. Indicates that the client issued requests that
exceed the rate limit specified in x-trapi.
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
/asyncquery_status/{job_id}:
get:
tags:
- asyncquery_status
summary: >-
Retrieve the current status of a previously submitted
asyncquery given its job_id
operationId: asyncquery_status
parameters:
- in: path
name: job_id
description: Identifier of the job for status request
required: true
schema:
type: string
examples:
- rXEOAosN3L
responses:
'200':
description: >-
Returns the status and current logs of a previously
submitted asyncquery.
content:
application/json:
schema:
$ref: '#/components/schemas/AsyncQueryStatusResponse'
'404':
description: job_id not found
'501':
description: >-
Return code 501 indicates that this endpoint has not been
implemented at this site. Sites that implement /asyncquery
MUST implement /asyncquery_status/{job_id}, but those that
do not implement /asyncquery SHOULD NOT implement
/asyncquery_status.
content:
application/json:
schema:
type: string
components:
schemas:
Query:
description: >-
The Query class is used to package a user request for information. A
Query object consists of a required Message object with optional
additional properties. Additional properties are intended to convey
implementation-specific or query-independent parameters. For example,
an additional property specifying a log level could allow a user to
override the default log level in order to receive more fine-grained
log information when debugging an issue.
x-body-name: request_body
type: object
properties:
submitter:
type: string
description: >-
Any string for self-identifying the submitter of a query. The
purpose of this optional property is to aid in the tracking of
the source of queries for development and issue resolution.
parameters:
$ref: '#/components/schemas/QueryParameters'
description: >-
Query-time parameters that don't affect the semantics
of the query or intended workflow, but may affect overall
behavior of the server in the execution of this query.
The server MUST maintain parameters it is given in the response.
message:
$ref: '#/components/schemas/Message'
description: >-
The query Message is a serialization of the user request. Content
of the Message object depends on the intended TRAPI operation. For
example, the fill operation requires a non-empty query_graph property
as part of the Message, whereas other operations, e.g. overlay,
require non-empty results and knowledge_graph properties.
workflow:
$ref: https://standards.ncats.io/workflow/1.3.5/schema
description: List of workflow steps to be executed.
additionalProperties: true
required:
- message
AsyncQuery:
description: >-
The AsyncQuery class is effectively the same as the Query class but
it requires a callback property.
allOf:
- $ref: '#/components/schemas/Query'
- type: object
properties:
callback:
type: string
format: uri
pattern: ^https?://
description: >-
Upon completion, this server will send a POST request to the
callback URL with `Content-Type: application/json` header and
request body containing a JSON-encoded `Response` object.
The server MAY POST `Response` objects before work is fully
complete to provide interim results with a Response.status
value of 'Running'. If a POST operation to the callback URL
does not succeed, the server SHOULD retry the POST at least
once.
additionalProperties: true
required:
- callback
QueryParameters:
type: object
description: >-
Query-time parameters that don't affect the semantics
of a query or intended workflow, but may affect overall
behavior of the server in the execution of this query.
The server MUST maintain parameters it is given in the response.
properties:
timeout:
type: number
description: >-
Custom time in seconds that the client is willing to wait for a response.
After this time has elapsed, the service MAY consider the query
failed and respond with logs indicating as such.
If the service knows it cannot respond in the given time, it MAY
respond with an HTTP 409 and a response explaining its time capabilities.
Negative values SHOULD be interpreted as disabling any default
timeout the server implements.
log_level:
$ref: '#/components/schemas/LogLevel'
description: The least critical level of logs to return.
bypass_cache:
type: boolean
default: false
description: >-
Set to true in order to request that the agent obtain
fresh information from its sources in all cases where
it has a viable choice between requesting fresh information
in real time and using cached information. The agent
receiving this flag MUST also include it in TRAPI sent to
downstream sources (e.g., ARS -> ARAs -> KPs).
additionalProperties: true
AsyncQueryResponse:
type: object
description: >-
The AsyncQueryResponse object contains a payload that must be
returned from a submitted async_query.
properties:
status:
description: >-
One of a standardized set of short codes:
e.g. Accepted, QueryNotTraversable, KPsNotAvailable
type: string
examples:
- Accepted
description:
description: >-
A brief human-readable description of the result of the
async_query submission.
type: string
examples:
- Async_query has been queued
job_id:
description: >-
An identifier for the submitted job that can be used with
/async_query_status to receive an update on the status of
the job.
type: string
examples:
- rXEOAosN3L
additionalProperties: true
required:
- job_id
AsyncQueryStatusResponse:
type: object
description: >-
The AsyncQueryStatusResponse object contains a payload that describes
the current status of a previously submitted async_query.
properties:
status:
description: >-
One of a standardized set of short codes:
Queued, Running, Completed, Failed
type: string
examples:
- Running
description:
description: >-
A brief human-readable description of the current state
or summary of the problem if the status is Failed.
type: string
examples:
- Callback URL returned 500
logs:
description: >-
A list of LogEntry items, containing errors, warnings, debugging
information, etc. List items MUST be in chronological order with
earliest first. The most recent entry should be last. Its timestamp
will be compared against the current time to see if there is
still activity.
type: array
items:
$ref: '#/components/schemas/LogEntry'
minItems: 1
response_url:
description: >-
Optional URL that can be queried to restrieve the full TRAPI
Response.
type: string
examples:
- https://arax.ncats.io/api/arax/v1.3/response/116481
additionalProperties: true
required:
- status
- description
- logs
Response:
type: object
description: >-
The Response object contains the main payload when a TRAPI query
endpoint interprets and responds to the submitted query successfully
(i.e., HTTP Status Code 200). The message property contains the
knowledge of the response (query graph, knowledge graph, and results).
The status, description, and logs properties provide additional details
about the response.
properties:
parameters:
$ref: '#/components/schemas/QueryParameters'
description: >-
Query-time parameters that the service received in the original query.
The server MUST maintain parameters it is given in the response.
message:
$ref: '#/components/schemas/Message'
description: >-
Contains the knowledge of the response (query graph, knowledge
graph, and results).
status:
description: >-
One of a standardized set of short codes,
e.g. Success, QueryNotTraversable, KPsNotAvailable
type: string
examples:
- Success
description:
description: A brief human-readable description of the outcome
type: string
examples:
- Success. 42 results found.
logs:
description: >-
A list of LogEntry items, containing errors, warnings, debugging
information, etc. List items MUST be in chronological order with
earliest first.
type: array
items:
$ref: '#/components/schemas/LogEntry'
minItems: 1
workflow:
$ref: https://standards.ncats.io/workflow/1.3.5/schema
description: List of workflow steps that were executed.
schema_version:
type: string
examples:
- 1.4.0
description: Version label of the TRAPI schema used in this document
biolink_version:
type: string
examples:
- 3.1.2
description: Version label of the Biolink model used in this document
additionalProperties: true
required:
- message
Message:
description: >-
The message object holds the main content of a Query or a Response in
three properties: query_graph, results, and knowledge_graph.
The query_graph property contains the query configuration, the results
property contains any answers that are returned by the service,
and knowledge_graph property contains lists of edges and nodes in the
thought graph corresponding to this message. The content of these
properties is context-dependent to the encompassing object and
the TRAPI operation requested.
type: object
properties:
results:
description: >-
List of all returned Result objects for the query posed.
The list SHOULD NOT be assumed to be ordered. The 'score' property,
if present, MAY be used to infer result rankings. If Results are
not expected (such as for a query Message), this property SHOULD
be absent. If Results are expected (such as for a response
Message) and no Results are available, this property SHOULD be an
array with 0 Results in it.
type: array
items:
$ref: '#/components/schemas/Result'
query_graph:
description: >-
QueryGraph object that contains a serialization of a query in the
form of a graph
$ref: '#/components/schemas/QueryGraph'
knowledge_graph:
$ref: '#/components/schemas/KnowledgeGraph'
description: >-
KnowledgeGraph object that contains lists of nodes and edges
in the thought graph corresponding to the message
auxiliary_graphs:
type: object
description: >-
Dictionary of AuxiliaryGraph instances that are used by Knowledge
Graph Edges and Result Analyses. These are referenced elsewhere by
the dictionary key.
additionalProperties:
$ref: '#/components/schemas/AuxiliaryGraph'
minProperties: 1
additionalProperties: false
LogEntry:
description: >-
The LogEntry object contains information useful for tracing
and debugging across Translator components. Although an
individual component (for example, an ARA or KP) may have its
own logging and debugging infrastructure, this internal
information is not, in general, available to other components.
In addition to a timestamp and logging level, LogEntry
includes a string intended to be read by a human, along with
one of a standardized set of codes describing the condition of
the component sending the message.
type: object
properties:
timestamp:
type: string
format: date-time
description: >-
Timestamp in ISO 8601 format, providing the LogEntry time
either in univeral coordinated time (UTC) using the 'Z' tag
(e.g 2020-09-03T18:13:49Z), or, if local time is provided,
the timezone offset must be provided
(e.g. 2020-09-03T18:13:49-04:00).
examples:
- '2020-09-03T18:13:49+00:00'
level:
$ref: '#/components/schemas/LogLevel'
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
additionalProperties: true
required:
- timestamp
- message
LogLevel:
type: string
description: Logging level
enum:
- ERROR
- WARNING
- INFO
- DEBUG
Result:
type: object
description: >-
A Result object specifies the nodes and edges in the knowledge graph
that satisfy the structure or conditions of a user-submitted query
graph. It must contain a NodeBindings object (list of query graph node
to knowledge graph node mappings) and a list of Analysis objects.
properties:
node_bindings:
type: object
description: >-
The dictionary of Input Query Graph to Result Knowledge Graph node
bindings where the dictionary keys are the key identifiers of the
Query Graph nodes and the associated values of those keys are
instances of NodeBinding schema type (see below). Because a given
QNode may have multiple knowledge Nodes bound in the result,
the NodeBinding object may list multiple knowledge Nodes.
additionalProperties:
$ref: '#/components/schemas/NodeBinding'
minProperties: 1
analyses:
type: array
description: >-
The list of all Analysis components that contribute to the result.
See below for Analysis components.
items:
$ref: '#/components/schemas/Analysis'
minItems: 1
additionalProperties: true
required:
- node_bindings
NodeBinding:
type: object
description: >-
A NodeBinding object defines all relevant KnowledgeGraph Node mappings,
identified by the corresponding object key identifier(s) of the
Node(s) within the Knowledge Graph. Instances of NodeBinding may
include extra annotation in the form of additional properties.
(such annotation is not yet fully standardized). Each Node
Binding must bind directly to node in the original Query Graph.
properties:
ids:
type: array
items:
$ref: '#/components/schemas/CURIE'
minItems: 1
description: >-
The CURIEs of one or more Nodes within the Knowledge Graph.
additionalProperties: true
required:
- ids
Analysis:
type: object
description: >-
An analysis is a dictionary that contains information about
the result tied to a particular service. Each Analysis is
generated by a single reasoning service, and describes the
outputs of analyses performed by the reasoner on a particular
Result (e.g. a result score), along with provenance information
supporting the analysis (e.g. method or data that supported
generation of the score).
properties:
resource_id:
$ref: '#/components/schemas/CURIE'
description: The id of the resource generating this Analysis
edge_bindings:
type: object
minProperties: 1
description: >-
The dictionary of input Query Graph to Knowledge Graph edge
bindings where the dictionary keys are the key identifiers of
the Query Graph edges and the associated values of those keys
are instances of EdgeBinding schema type (see below). Because
a given QEdge may have multiple knowledge Edges bound in the
result, the EdgeBinding object may list multiple knowledge Edges.
additionalProperties:
$ref: '#/components/schemas/EdgeBinding'
path_bindings:
type: object
minProperties: 1
description: >-
The dictionary of input Query Graph paths to Analysis paths,
specifically only for pathfinder queries.
additionalProperties:
$ref: '#/components/schemas/PathBinding'
score:
type: number
format: float
examples:
- 163.233
description: >-
A numerical score associated with this result indicating the
relevance or confidence of this result relative to others in the
returned set. Higher MUST be better.
support_graphs:
type: array
description: >-
This is a list of references to Auxiliary Graph instances
that supported the analysis of a Result as performed by the
reasoning service. Each item in the list is the key of a
single Auxiliary Graph.
minItems: 1
items:
type: string
scoring_method:
type: string
description: >-
An identifier and link to an explanation for the method used
to generate the score
attributes:
type: array
description: >-
The attributes of this particular Analysis.
items:
$ref: '#/components/schemas/Attribute'
additionalProperties: true
required:
- resource_id
anyOf:
- required: [edge_bindings]
- required: [path_bindings]
EdgeBinding:
type: object
description: >-
An EdgeBinding object defines all relevant KnowledgeGraph Edge mappings,
identified by the corresponding 'id' object key identifier of the
Edge within the Knowledge Graph. Instances of EdgeBinding may include
extra annotation (such annotation is not yet fully standardized).
Edge bindings are captured within a specific reasoner's Analysis
object because the Edges in the Knowledge Graph that get bound to
the input Query Graph may differ between reasoners.
properties:
ids:
type: array
items:
type: string
minItems: 1
description: The key identifiers of specific KnowledgeGraph Edges.
additionalProperties: true
required:
- ids
PathBinding:
type: object
description: >-
A PathBinding object binds a single QueryGraph path (the key to
this object) to one or more relevant AuxiliaryGraph ids containing
a list of edges in the path. The Auxiliary Graph does not convey any
order of edges in the path.
properties:
ids:
type: array
items:
type: string
minItems: 1
description: The key identifiers of specific auxiliary graphs.
additionalProperties: true
required:
- ids
AuxiliaryGraph:
type: object
description: >-
A single AuxiliaryGraph instance that is used by Knowledge Graph
Edges, Result Analysis support graphs, and Path Bindings.
Edges comprising an Auxiliary Graph are a subset of the
Knowledge Graph in the message. Data creators can
create an AuxiliaryGraph to assemble a specific collection
of edges from the Knowledge Graph into a named graph that can be
referenced from an Edge as evidence/explanation supporting that Edge,
from a Result Analysis as information used to generate a score, or
from a Path Binding as the path for that Analysis.
properties:
edges:
type: array
description: >-
List of edges that form the Auxiliary Graph. Each item is a
reference to a single Knowledge Graph Edge. This list is not
ordered, nor is the order intended to convey any relationship
between the edges that form this Auxiliary Graph.
items:
type: string
minItems: 1
additionalProperties: true
required:
- edges
KnowledgeGraph:
type: object
description: >-
The knowledge graph associated with a set of results. The instances
of Node and Edge defining this graph represent instances of
biolink:NamedThing (concept nodes) and biolink:Association
(relationship edges) representing (Attribute) annotated knowledge
returned from the knowledge sources and inference agents wrapped by
the given TRAPI implementation.
properties:
nodes:
type: object
description: >-
Dictionary of Node instances used in the KnowledgeGraph,
referenced elsewhere in the TRAPI output by the dictionary key.
additionalProperties:
$ref: '#/components/schemas/Node'
edges:
type: object
description: >-
Dictionary of Edge instances used in the KnowledgeGraph,
referenced elsewhere in the TRAPI output by the dictionary key.
additionalProperties:
$ref: '#/components/schemas/Edge'
additionalProperties: true
required:
- nodes
QueryGraph:
type: object
description: >-
A graph representing a biomedical question. It serves as a template for
each result (answer), where each bound knowledge graph node/edge is
expected to obey the constraints of the associated query graph element.
properties:
nodes:
type: object
description: >-
The node specifications. The keys of this map are unique node
identifiers and the corresponding values include the constraints
on bound nodes.
additionalProperties:
$ref: '#/components/schemas/QNode'
minProperties: 1
edges:
type: object
description: >-
The edge specifications. The keys of this map are unique edge
identifiers and the corresponding values include the constraints
on bound edges, in addition to specifying the subject and object
QNodes.
additionalProperties:
$ref: '#/components/schemas/QEdge'
minProperties: 1
paths:
type: object
description: >-
The QueryGraph path specification, used only for pathfinder type
queries. The keys of this map are unique path identifiers and
the corresponding values include the constraints on bound paths,
in addition to specifying the subject, object, and intermediate
QNodes.
additionalProperties:
$ref: '#/components/schemas/QPath'
minProperties: 1
maxProperties: 1
additionalProperties: true
required:
- nodes
QNode:
type: object
description: A node in the QueryGraph used to represent an entity in a
query. If a CURIE is not specified, any nodes matching the category of
the QNode will be returned in the Results.
properties:
ids:
type: array
items:
$ref: '#/components/schemas/CURIE'
minItems: 1
examples:
- [OMIM:603903]
description: >-
A CURIE identifier (or list of identifiers) for this node.
The 'ids' property will hold a list of CURIEs only in the case of a
BATCH set_interpretation, where each CURIE is queried
separately. If a list of queried CURIEs is to be considered as a
set (as under a MANY or ALL set_interpretation), the 'ids' property
will hold a single id representing this set, and the individual members
of this set will be captured in a separate 'member_ids' property.
Note that the set id MUST be created as a UUID by the system that
defines the queried set, using a centralized nodenorm service.
Note also that downstream systems MUST re-use the original set UUID
in the messages they create/send, which will facilitate merging or
caching operations.
categories:
type: array
description: >-
These should be Biolink Model categories and are allowed
to be of type 'abstract' or 'mixin' (only in QGraphs!).
Use of 'deprecated' categories should be avoided.
items:
$ref: '#/components/schemas/BiolinkEntity'
minItems: 1
set_interpretation:
type: string
description: >-
Indicates how multiple CURIEs in the ids property MUST be
interpreted. BATCH indicates that the query is intended to be
a batch query and each CURIE is treated independently. ALL means
that all specified CURIES MUST appear in each Result.
MANY means that member CURIEs MUST form one or more
sets in the Results, and sets with more members are generally
considered more desirable that sets with fewer members.
Only when there are no ids provided, set_interpretation MAY be
set to COLLATE to indicate that multiple matching nodes MUST be
collated into a single Result, rather than separated into
separate Results. If this property is absent, the default is
BATCH.
enum:
- BATCH
- ALL
- MANY
- COLLATE
member_ids:
type: array
description: >-
A list of CURIE identifiers for members of a queried set. This
property MUST be populated under a set_interpretation of MANY
or ALL, when the 'ids' property holds a UUID representing the set
itself. This property MUST NOT be used under a set_interpretation
of BATCH or COLLATE or when set_interpretation is absent.
minItems: 1
items:
$ref: '#/components/schemas/CURIE'
constraints:
type: array
description: >-
A list of constraints applied to a query node.
If there are multiple items, they must all be true (equivalent
to AND)
items:
$ref: '#/components/schemas/AttributeConstraint'
minItems: 1
additionalProperties: true
QEdge:
type: object
description: >-
An edge in the QueryGraph used as a filter pattern specification in a
query. If the optional predicate property is not specified,
it is assumed to be a wildcard match to the target knowledge space.
If specified, the ontological inheritance hierarchy associated with
the term provided is assumed, such that edge bindings returned may be
an exact match to the given QEdge predicate term,
or to a term that is a descendant of the QEdge predicate term.
properties:
knowledge_type:
description: >-
Indicates the type of knowledge that the client wants from the
server between the subject and object. If the value is
'lookup', then the client wants direct lookup information from
knowledge sources. If the value is 'inferred', then the client
wants the server to get creative and connect the subject and
object in more speculative and non-direct-lookup ways. If this
property is absent, it MUST be assumed to mean
'lookup'. This feature is currently experimental and may be
further extended in the future.
examples:
- lookup
type: string
predicates:
type: array
description: >-
These should be Biolink Model predicates and are allowed to be of
type 'abstract' or 'mixin' (only in QGraphs!). Use of 'deprecated'
predicates should be avoided.
items:
$ref: '#/components/schemas/BiolinkPredicate'
minItems: 1
subject:
type: string
examples:
- https://omim.org/entry/603903
description: >-
Corresponds to the map key identifier of the
subject concept node anchoring the query filter
pattern for the query relationship edge.
object:
type: string
examples:
- https://www.uniprot.org/uniprot/P00738
description: >-
Corresponds to the map key identifier of the
object concept node anchoring the query filter
pattern for the query relationship edge.
constraints:
$ref: '#/components/schemas/QEdgeConstraints'
description: >-
An object containing all constraints placed on the QEdge.
ALL edges bound to this QEdge MUST conform to ALL given constraints;
underlying edges (such as those appearing in supporting graphs)
are not required to conform to the given constraints.
additionalProperties: true
required:
- subject
- object
QEdgeConstraints:
type: object
description: >-
A subschema for constraints that may be placed on a given QEdge.
ALL edges bound to the given QEdge MUST conform to ALL given constraints;
underlying edges (such as those appearing in supporting graphs)
are not required to conform to the given constraints.
minProperties: 1
additionalProperties: true
properties:
knowledge_level:
$ref: '#/components/schemas/AllowDenyConstraint'
description: >-
A constraint defining knowledge_level values which are either allowed
or denied on bound edges.
Provided string(s) MUST be a valid biolink knowledge_level value.
(See https://biolink.github.io/biolink-model/KnowledgeLevelEnum/)
agent_type:
$ref: '#/components/schemas/AllowDenyConstraint'