-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgeneric-adapter-rest-OpenAPI.yaml
More file actions
1569 lines (1567 loc) · 56 KB
/
generic-adapter-rest-OpenAPI.yaml
File metadata and controls
1569 lines (1567 loc) · 56 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.0.1
info:
title: InterConnect Generic Adapter REST API Documentation
description: This is OpenAPI documentation for REST API provided by the InterConnect Generic Adapter.
version: '2.2.2'
servers:
- url: 'http://localhost:9090'
description: Generated server url
tags:
- name: smart connector - life cycle
description: methods for interacting with the Knowledge Engine and managing smart connector instance
- name: smart connector - knowledge interaction life cycle
description: methods for interacting with the smart connector instance and managing knowledge interactions for your service
- name: smart connector - proactive interactions
description: methods for exchanging data with other services in proactive manner
- name: smart connector - reactive interactions
description: methods for exchanging data with other services in reactive manner
- name: service store - authentication controller
description: methods for performing authentication and authorization with the service store
# - name: service store - docker controller (to be added)
# description: methods for managing docker containers of the registered interoperable services
- name: service store - generic adapter controller
description: methods for managing generic adapter instance for registered services
- name: service store - service controller
description: methods for managing service store catalog of interoperable services
- name: generic adapter - control panel controller
description: methods for configuring generic adapter instance
- name: smart connector - lease
paths:
/smartconnector/post:
post:
summary: Execute the given Post Knowledge Interaction with the given binding set. It is possible to target this post to a specific Knowledge Base by including RecipientSelector in the requestBody.
tags:
- smart connector - proactive interactions
operationId: postKnowledgeInteraction
parameters:
- name: KnowledgeBaseId
in: header
required: true
schema:
type: string
- name: KnowledgeInteractionId
in: header
required: true
schema:
type: string
requestBody:
required: true
description: Either a BindingSet only or a RecipientSelector and BindingSet. The recipient selector currently only supports a single Knowledge-Base-Id, but might be extended in the future. The keys bindings must be complete, and they must correspond to the binding keys that were defined in the knowledge interaction.
content:
application/json; charset=UTF-8:
schema:
oneOf:
- $ref: '#/components/schemas/RecipientAndBindingSet'
- $ref: '#/components/schemas/recipientSelector'
- $ref: '#/components/schemas/BindingSet'
examples:
bindingset only:
value:
- p: <http://www.tno.nl/s1>
q: <http://www.tno.nl/p1>
r: <http://www.tno.nl/o1>
recipient and bindingset:
value:
recipientSelector:
knowledgeBases:
- http://www.tno.nl/kb2
- http://www.tno.nl/kb3
bindingSet:
- p: <http://www.tno.nl/s1>
q: <http://www.tno.nl/p1>
r: <http://www.tno.nl/o1>
single recipient and bindingset:
value:
recipientSelector:
singleKnowledgeBase: http://www.tno.nl/kb1
bindingSet:
- p: <http://www.tno.nl/s1>
q: <http://www.tno.nl/p1>
r: <http://www.tno.nl/o1>
responses:
'200':
description: If the post was successful it optionally returns all
result variable bindings together with all exchange infos. The
exchange info shows the other Knowledge Bases that contributed to
the answer with timing, initiator information.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/PostResult'
'401':
description: If not authorized.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/ResponseMessage'
'404':
description: If a Knowledge Interaction for the given Knowledge-Base-Id and Knowledge-Interaction-Id cannot be found.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/ResponseMessage'
'500':
description: If an internal server error occurs.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/ResponseMessage'
/smartconnector/RDF/post:
post:
summary: Execute the given Post Knowledge Interaction with the given binding set. It is possible to target this post to a specific Knowledge Base by including RecipientSelector in the requestBody.
tags:
- smart connector - proactive interactions
operationId: postKnowledgeInteractionRDFBindings
parameters:
- name: KnowledgeBaseId
in: header
required: true
schema:
type: string
- name: KnowledgeInteractionId
in: header
required: true
schema:
type: string
requestBody:
required: true
description: Either a BindingSet only or a RecipientSelector and BindingSet in the shape of RDP triples. The recipient selector currently only supports a single Knowledge-Base-Id, but might be extended in the future. The keys bindings must be complete, and they must correspond to the binding keys that were defined in the knowledge interaction in the shape of RDP triples.
content:
application/json; charset=UTF-8:
schema:
oneOf:
- $ref: '#/components/schemas/RecipientAndRDFBindingSet'
- $ref: '#/components/schemas/RDFBindingSet'
examples:
bindingset only:
value:
- <http://x.org/s> <p2> <http://x.org/o3> . <http://x.org/s> <p2> <http://x.org/o2> . <http://x.org/s> <p2> <http://x.org/o1> . <http://x.org/s> <p1> <http://x.org/o> .
recipient and bindingset:
value:
recipientSelector:
knowledgeBases:
- http://www.tno.nl/kb2
- http://www.tno.nl/kb3
RDFBindingSet: <http://x.org/s> <p2> <http://x.org/o3> . <http://x.org/s> <p2> <http://x.org/o2> . <http://x.org/s> <p2> <http://x.org/o1> . <http://x.org/s> <p1> <http://x.org/o> .
single recipient and bindingset:
value:
recipientSelector:
singleKnowledgeBase: http://www.tno.nl/kb1
RDFBindingSet: <http://x.org/s> <p2> <http://x.org/o3> . <http://x.org/s> <p2> <http://x.org/o2> . <http://x.org/s> <p2> <http://x.org/o1> . <http://x.org/s> <p1> <http://x.org/o> .
responses:
'200':
description: OK
content:
'*/*':
schema:
type: object
/smartconnector/ki/register-ask-answer:
post:
summary: Register a Knowledge Interaction with the Smart Connector of the given Knowledge Base Id.
tags:
- smart connector - knowledge interaction life cycle
operationId: registerKnowledgeInteractionAskAnswer
parameters:
- name: KnowledgeBaseId
in: header
required: true
schema:
type: string
requestBody:
required: true
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/RegisterKnowledgeInteractionAskAnswer'
examples:
ASK without prefixes:
value:
knowledgeInteractionType: AskKnowledgeInteraction
graphPattern: "?a <http://example.org/isRelatedTo> ?b ."
ASK with prefixes:
value:
knowledgeInteractionType: AskKnowledgeInteraction
graphPattern: "?a rdf:type ex:Something ."
prefixes:
rdf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
ex: "http://example.org/"
ASK with name and prefixes:
value:
knowledgeInteractionType: AskKnowledgeInteraction
knowledgeInteractionName: books-by-shakespeare
graphPattern: "?a rdf:type ex:Book . ?a ex:hasAuthor ex:Shakespeare"
prefixes:
rdf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
ex: "http://example.org/"
responses:
'200':
description: If the Knowledge Interaction is successfully registered, it returns the knowledge interaction id.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/KnowledgeInteractionId'
example:
knowledgeInteractionId:
https://www.interconnectproject.eu/knowledge-engine/knowledgebase/example/a-reacting-kb/42
'400':
description: If the Knowledge Interaction is not successfully registered.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/ResponseMessage'
'401':
description: If not authorized.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/ResponseMessage'
'404':
description: If a Smart Connector for the given Knowledge-Base-Id cannot be found.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/ResponseMessage'
/smartconnector/ki/register-post-react:
post:
summary: Register a Knowledge Interaction with the Smart Connector of the given Knowledge Base Id.
tags:
- smart connector - knowledge interaction life cycle
operationId: registerKnowledgeInteractionPostReact
parameters:
- name: KnowledgeBaseId
in: header
required: true
schema:
type: string
requestBody:
required: true
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/RegisterKnowledgeInteractionPostReact'
examples:
REACT without prefixes:
value:
knowledgeInteractionType: ReactKnowledgeInteraction
argumentGraphPattern:
?a rdf:type ex:Measurement .
?a ex:hasValueInMeters ?b .
resultGraphPattern:
?a rdf:type ex:Measurement .
?a ex:hasValueInYards ?b .
REACT with prefixes:
value:
knowledgeInteractionType: ReactKnowledgeInteraction
argumentGraphPattern:
?a rdf:type ex:Measurement .
?a ex:hasValueInMeters ?b .
resultGraphPattern:
?a rdf:type ex:Measurement .
?a ex:hasValueInYards ?b .
prefixes:
rdf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
ex: "http://example.org/"
REACT with name and prefixes:
value:
knowledgeInteractionType: ReactKnowledgeInteraction
knowledgeInteractionName: interaction-name
argumentGraphPattern:
?a rdf:type ex:Measurement .
?a ex:hasValueInMeters ?b .
resultGraphPattern:
?a rdf:type ex:Measurement .
?a ex:hasValueInYards ?b .
prefixes:
rdf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
ex: "http://example.org/"
responses:
'200':
description: If the Knowledge Interaction is successfully registered, it returns the knowledge interaction id.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/KnowledgeInteractionId'
example:
knowledgeInteractionId:
https://www.interconnectproject.eu/knowledge-engine/knowledgebase/example/a-reacting-kb/42
'400':
description: If the Knowledge Interaction is not successfully registered.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/ResponseMessage'
'401':
description: If not authorized.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/ResponseMessage'
'404':
description: If a Smart Connector for the given Knowledge-Base-Id cannot be found.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/ResponseMessage'
/smartconnector/handle/send:
post:
summary: Send the answer or reaction of the last long polling handle
request back to the Smart Connector of the given Knowledge-Base-Id.
description: For more information about boolean parameter <i>shortPolling</i> check <a href="https://gitlab.inesctec.pt/interconnect/generic-adapter/-/blob/master/docs/05_REST.md" target="_blank">docs</a>.
tags:
- smart connector - reactive interactions
operationId: sendAnswerReaction
parameters:
- name: shortPolling
in: query
required: false
schema:
type: boolean
- name: KnowledgeBaseId
in: header
required: true
schema:
type: string
- name: KnowledgeInteractionId
in: header
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/HandleResponse'
required: true
responses:
'200':
description: If the answer is successfully processed by your smart connector.
'400':
description: If the answer was not successfully processed by the Knowledge Base's smart connector.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/ResponseMessage'
'401':
description: If not authorized.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/ResponseMessage'
'404':
description: If a Handle Request Id or Knowledge Interaction for the
given Knowledge-Base-Id and Knowledge-Interaction-Id cannot be found.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/ResponseMessage'
/smartconnector/RDF/handle/send:
post:
summary: Send the answer or reaction of the last long polling handle
request back to the Smart Connector of the given Knowledge-Base-Id.
tags:
- smart connector - reactive interactions
operationId: sendAnswerReactionRDF
parameters:
- name: KnowledgeBaseId
in: header
required: true
schema:
type: string
- name: KnowledgeInteractionId
in: header
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RDFBindingSet'
required: true
responses:
'200':
description: OK
content:
'*/*':
schema:
type: object
/smartconnector/create:
post:
summary: Create a new Smart Connector for the given Knowledge Base.
tags:
- smart connector - life cycle
operationId: createSmartConnector
requestBody:
required: true
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/CreateSmartConnector'
examples:
without lease:
value:
knowledgeBaseId: http://example.org/a-knowledge-base-id
knowledgeBaseName: Example Knowledge Base
knowledgeBaseDescription: This is a detailed description
with 60 seconds lease:
value:
knowledgeBaseId: http://example.org/a-knowledge-base-id
knowledgeBaseName: Example Knowledge Base
knowledgeBaseDescription: This is a detailed description
leaseRenewalTime: 60
description:
The created smart connector will be cleaned up automatically
after about 60 seconds. To postpone the cleanup, your
knowledge base has to call /smartconnector/lease/renew to extend the lease
by 60 seconds.
with reasoner enabled:
value:
knowledgeBaseId: http://example.org/a-knowledge-base-id
knowledgeBaseName: Example Knowledge Base
knowledgeBaseDescription: This is a detailed description
reasonerEnabled: true
description:
The reasoner is disabled by default. If enabled, the created smart
connector will use a reasoner to orchestrate the data exchange.
This increases the flexibility, but can decrease the performance
and cause unexpected behaviour, for now. This flexibility means the
smart connector will automatically try to combine data coming
from different knowledge bases or try to convert units of measures.
If the reasoner is disabled, the smart connector will only exchange
data with other smart connectors if their graph patterns match
entirely (apart from ordering and variable names).
responses:
'200':
description: If the Smart Connector for the given Knowledge Base is successfully created.
'400':
description: If the creation of the Smart Connector for the given Knowledge Base failed.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/ResponseMessage'
'401':
description: If not authorized.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/ResponseMessage'
/smartconnector/ask:
post:
summary: Execute the given Ask Knowledge Interaction with the given binding set. It is possible to target this ask to a specific Knowledge Base by including a RecipientSelector in the requestBody.
tags:
- smart connector - proactive interactions
parameters:
- name: KnowledgeBaseId
in: header
required: true
description: The Knowledge Base Id for which to execute the ask.
schema:
type: string
- name: KnowledgeInteractionId
in: header
required: true
description: The Ask Knowledge Interaction Id to execute.
schema:
type: string
requestBody:
required: true
description: Either a BindingSet only or a RecipientSelector and BindingSet. The recipient selector supports multiple Knowledge-Base-Id. The keys (i.e. variables) in the BindingSet are allowed to be incomplete, but they must correspond to the keys that were defined in the graph pattern of the knowledge interaction.
content:
application/json; charset=UTF-8:
schema:
oneOf:
- $ref: '#/components/schemas/RecipientAndBindingSet'
- $ref: '#/components/schemas/recipientSelector'
- $ref: '#/components/schemas/BindingSet'
examples:
bindingset only:
value:
- p: <http://www.tno.nl/s1>
q: <http://www.tno.nl/p1>
r: <http://www.tno.nl/o1>
recipient and bindingset:
value:
recipientSelector:
knowledgeBases:
- http://www.tno.nl/kb2
- http://www.tno.nl/kb3
bindingSet:
- p: <http://www.tno.nl/s1>
q: <http://www.tno.nl/p1>
r: <http://www.tno.nl/o1>
single recipient and bindingset:
value:
recipientSelector:
singleKnowledgeBase: http://www.tno.nl/kb1
bindingSet:
- p: <http://www.tno.nl/s1>
q: <http://www.tno.nl/p1>
r: <http://www.tno.nl/o1>
responses:
'200':
description: If the ask was successful it returns all found variable
bindings together with additional exchange info. The returned bindings form
a set and there is no quaranteed ordering. The exchange info shows the other
Knowledge Bases that contributed to the answer with timing, initiator information.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/AskResult'
'400':
description: If the ask failed.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/ResponseMessage'
'401':
description: If not authorized.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/ResponseMessage'
'404':
description: If a Knowledge Interaction for the given Knowledge-Base-Id and Knowledge-Interaction-Id cannot be found.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/ResponseMessage'
'500':
description: If an internal server error occurs.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/ResponseMessage'
/smartconnector/RDF/ask:
post:
summary: Execute the given Ask Knowledge Interaction with the given binding set. It is possible to target this ask to a specific Knowledge Base by including a RecipientSelector in the requestBody.
tags:
- smart connector - proactive interactions
operationId: askKnowledgeInteractionRDFBindings
parameters:
- name: KnowledgeBaseId
in: header
required: true
schema:
type: string
- name: KnowledgeInteractionId
in: header
required: true
schema:
type: string
requestBody:
required: true
content:
application/json; charset=UTF-8:
schema:
oneOf:
- $ref: '#/components/schemas/RecipientAndRDFBindingSet'
- $ref: '#/components/schemas/RecipientAndRDFBindingSet'
- $ref: '#/components/schemas/RDFBindingSet'
examples:
bindingset only:
value:
- <http://x.org/s> <p2> <http://x.org/o3> . <http://x.org/s> <p2> <http://x.org/o2> . <http://x.org/s> <p2> <http://x.org/o1> . <http://x.org/s> <p1> <http://x.org/o> .
recipient and bindingset:
value:
recipientSelector:
knowledgeBases:
- http://www.tno.nl/kb2
- http://www.tno.nl/kb3
RDFBindingSet: <http://x.org/s> <p2> <http://x.org/o3> . <http://x.org/s> <p2> <http://x.org/o2> . <http://x.org/s> <p2> <http://x.org/o1> . <http://x.org/s> <p1> <http://x.org/o> .
single recipient and bindingset:
value:
recipientSelector:
singleKnowledgeBase: http://www.tno.nl/kb1
RDFBindingSet: <http://x.org/s> <p2> <http://x.org/o3> . <http://x.org/s> <p2> <http://x.org/o2> . <http://x.org/s> <p2> <http://x.org/o1> . <http://x.org/s> <p1> <http://x.org/o> .
responses:
'200':
description: OK
content:
'*/*':
schema:
type: object
/servicestore/service/add-service:
post:
summary: Register new service in the service store
tags:
- service store - service controller
operationId: registerService
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RegisterServiceForm'
required: true
responses:
'200':
description: OK
content:
'*/*':
schema:
type: string
'201':
description: Created
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not Found
/servicestore/login:
post:
summary: Authenticate user of the service
tags:
- service store - authentication controller
operationId: login
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/LoginForm'
required: true
responses:
'200':
description: OK
content:
'*/*':
schema:
type: object
'201':
description: Created
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not Found
/servicestore/adapter/register:
post:
summary: Register generic adapter instance for the service
tags:
- service store - generic adapter controller
operationId: registerAdapter
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RegisterAdapterForm'
examples:
without assetID:
value:
hash: a425a89c7687447ec0b4360c5cade4391963ceadda00c570a4a9
language: Java
transport: HTTP
description:
By default an adapter ID will be randomly generated. This output should be used to create the smart connector.
with assetID:
value:
hash: a425a89c7687447ec0b4360c5cade4391963ceadda00c570a4a9
language: Java
transport: HTTP
assetID: name-for-my-adpter
description:
By default an adapter ID will be randomly generated. This output should be used to create the smart connector.
If a specific adapterID is specified, the assetID will be used to register the adapter and becomes the output to create the smart connector.
In case case, the user must ensure no colisions by having a unique assetID.
required: true
responses:
'200':
description: OK - If the adapter is successfully registered.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/RegisterAdapterResult'
example:
adapterID:
https://ke.interconnectproject.eu/adapter/generic-adapter-test-asset2
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not Found
'406':
description: Not Acceptable - The adapter ID that is being registered already exists.
/smartconnector/ki/get:
get:
summary: Get all KnowledgeInteractions for a given Knowledge-Base-Id
tags:
- smart connector - knowledge interaction life cycle
operationId: getKnowledgeInteractions
parameters:
- name: KnowledgeBaseId
in: header
required: true
schema:
type: string
responses:
'200':
description: If the Knowledge Interactions were successfully returned.
content:
application/json; charset=UTF-8:
schema:
type: array
items:
$ref: '#/components/schemas/KnowledgeInteraction'
'401':
description: If not authorized.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/ResponseMessage'
/smartconnector/handle/start:
get:
summary: Start waiting for a handle request for the given Knowledge Base Id.
description: Note that this is a long polling HTTP call.
It will block until the client is expected to handle something in which
case it returns. When it returns, a new request to this same endpoint
should be immediately made to receive further handle requests. (*** What
if one or more handle requests came in in the meantime? ***) All handle
requests (both for Answer and React Knowledge Interactions) for the
given Knowledge-Base-Id will be received via a single long polling http
connection. The Knowledge Interaction Id can be used to distinguish
between different Knowledge Interactions. The <i>handle request id</i>
(which is unique per Knowledge Base Id) should be used when sending the
result back to the server. It allows the server to know which handle
request you are reacting to in the <i>post</i> method of this path. </b>
For more information about boolean parameter <i>shortPolling</i> check <a href="https://gitlab.inesctec.pt/interconnect/generic-adapter/-/blob/master/docs/05_REST.md" target="_blank">docs</a>.
tags:
- smart connector - reactive interactions
operationId: startWaitingForHandleRequest
parameters:
- name: shortPolling
in: query
required: false
schema:
type: boolean
- name: KnowledgeBaseId
in: header
required: true
schema:
type: string
responses:
'200':
description: If a request to handle a particular Knowledge Interaction Id comes in with a binding set.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/HandleRequest'
example:
knowledgeInteractionId: http://example.org/ki/your-knowledge-interaction-id
handleRequestId: 1
bindingSet:
- a: <http://example.org/some-incoming-value>
b: <http://example.org/another-incoming-value>
requestingKnowledgeBaseId: http://example.org/knowledge-base-id-of-requesting-side
'202':
description: No problems, but please reinitiate the long polling request. To prevent very long open connections (which might cause problems for some systems), we regularly return with status code 202 to renew the long polling connection. Note that no handlerequests will be missed, because these are queued automatically.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/ResponseMessage'
'401':
description: If not authorized.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/ResponseMessage'
'404':
description: If a Knowledge Interaction for the given Knowledge-Base-Id and Knowledge-Interaction-Id cannot be found.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/ResponseMessage'
'409':
description: Only one connection per Knowledge-Base-Id is allowed and we already have one.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/ResponseMessage'
'410':
description: This long polling connection has stopped because the server will shut down, please do <b>not</b> reinitiate this request.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/ResponseMessage'
'500':
description: If a problem occurred. Please reinitiate this long polling http call.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/ResponseMessage'
/smartconnector/handle/collect-reply:
get:
tags:
- smart connector - reactive interactions
operationId: colectNoPollingReply
parameters:
- name: replyCollectionHash
in: header
required: true
schema:
type: string
responses:
'200':
description: OK
content:
'*/*':
schema:
type: object
'204':
description: No content
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/ResponseMessage'
'401':
description: If not authorized.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/ResponseMessage'
/smartconnector/get-all-or-one:
get:
summary: Either get all available Smart Connectors or a specific one if the Knowledge-Base-Id is provided.
tags:
- smart connector - life cycle
parameters:
- name: KnowledgeBaseId
in: header
required: false
description: The knowledge base id who's Smart Connector information you would like to have.
schema:
type: string
responses:
'200':
description: A list of Smart Connectors. It will have only a single element if the Knowledge-Base-Id was provided.
content:
application/json; charset=UTF-8:
schema:
type: array
items:
$ref: '#/components/schemas/SmartConnector'
'401':
description: If not authorized.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/ResponseMessage'
'404':
description: If there is no Smart Connector for the given Knowledge-Base-Id.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/ResponseMessage'
'500':
description: If a problem occurred.
content:
application/json; charset=UTF-8:
schema:
$ref: '#/components/schemas/ResponseMessage'
/servicestore/users/userinfo:
get:
summary: Get information about the reistered user
tags:
- service store - authentication controller
operationId: getUserInfo
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ServiceStoreUser'
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not Found
'/servicestore/services/{id}':
post:
summary: Get basic information about the service with service_id
tags:
- service store - service controller
operationId: getServiceDetail
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int32
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Service'
'201':
description: Created
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not Found
'/servicestore/services/services/{serviceId}/details':
get:
summary: Now working.. It should return User's onboardings
tags:
- service store - service controller
operationId: getUserOnboardings
parameters:
- name: serviceId
in: path
required: true
schema:
type: integer
format: int32
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
type: object
/servicestore/service-list:
get:
summary: Get list of titles and service_ids of all registered services
tags:
- service store - service controller
operationId: getAllServiceList
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Service'
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not Found
/servicestore/my-services:
get:
summary: get list of titles and service_ids of all services belonging to the registered user
tags:
- service store - service controller
operationId: getMyServiceList
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Service'
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not Found
/servicestore/adapter/adapter-list:
get:
summary: Get list of generic adapter_ids for all services
tags:
- service store - generic adapter controller
operationId: getAdapters
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Adapter'
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not Found
/smartconnector/ki/unregister:
delete:
summary: Unregister the given Knowledge Interaction with the Smart Connector of the given Knowledge Base
tags:
- smart connector - knowledge interaction life cycle
operationId: unregisterKnowledgeInteraction
parameters:
- name: KnowledgeBaseId