-
Notifications
You must be signed in to change notification settings - Fork 1
/
linking.json
343 lines (342 loc) · 14.9 KB
/
linking.json
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
{
"info": {
"version": "1.0",
"title": "ELEXIS Protocol for Dictionary Linking",
"description": "This protocol is used by the ELEXIS Dictonary Matrix to provide linking between two dictionaries, it is implemented by services such as the Naisc system and the BabelNet linker. This protocol depends on the REST API for accessing dictionaries: https://elexis-eu.github.io/elexis-rest/",
"contact": {
"name": "ELEXIS project",
"url": "https://elex.is/"
},
"license": {
"name" : "Public Domain",
"url": "https://creativecommons.org/publicdomain/zero/1.0/"
},
"x-logo": {
"url": "logo.jpeg",
"altText": "ELEXIS European Lexicographic Infrasturcture"
}
},
"paths": {
"/submit": {
"post": {
"summary": "Submit a linking task",
"description": "Link the sense of two dictionaries from two endpoints implemented the ELEXIS dictionary access protocol. This protocol returns on a success status, so that the result must be obtained with the /result query, and as such it is suitable for longer tasks, e.g., linking complete dictionaries",
"parameters": [],
"requestBody": {
"description": "Linking task description",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/task"
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"type": "string",
"description": "A unique identifier for this task"
}
}
}
},
"403": {
"description": "It was not possible to start a task with this ID, for example it is already in use"
},
"500": {
"$ref": "#/components/responses/server_error"
},
"501": {
"$ref": "#/components/responses/not_supported"
}
}
}
},
"/status" : {
"post": {
"summary": "Get the status of a linking task",
"description": "Returns the status of a task submitted with <tt>/submit</tt>, including whether it has failed or completed",
"requestBody": {
"content": {
"text/plain": {
"schema": {
"type": "string",
"description": "The ID as returned by <tt>submit</tt>"
}
}
}
},
"parameters": [],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/status"
}
}
}
},
"404": {
"description": "The task ID was not found, for example, because it was not submitted"
}
}
}
},
"/result": {
"post": {
"summary": "Get the result of a linking",
"description": "Get the linking between two dictonaries. This should be called only after a submit and once the status has reached 'completed'",
"requestBody": {
"content": {
"text/plain": {
"schema": {
"type": "string",
"description": "The ID as returned by <tt>submit</tt>"
}
}
}
},
"parameters": [{
"in": "query",
"name": "retain",
"schema": {
"type": "boolean"
},
"description": "Whether the server should retain this result or can delete all information related to this run"
}],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/linking"
}
}
}
},
"404": {
"description": "The task ID was not found, for example, because it was not submitted or the result is not available yet"
}
}
}
}
},
"components": {
"schemas": {
"task": {
"properties": {
"source": {
"description": "The source dictionary",
"type": "object",
"properties": {
"endpoint": {
"description": "The endpoint (an implementation of the ELEXIS REST protocol), where the source dictionary is available or omitted if the dictionary is available locally",
"type": "string",
"format": "uri"
},
"id" : {
"description": "The identifier of the source dictionary to be linked, as it is specified by the source endpoint",
"type": "string"
},
"entries": {
"description": "The list of source entries to link by their ID in the endpoint. If empty all entries are linked",
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"type": "string"
}
},
"apiKey": {
"description": "A key to be used to access the dictionary, to be passed as an X-API-KEY header",
"type": "string"
}
},
"required": ["id"]
},
"target": {
"description": "The target dictionary",
"type": "object",
"properties": {
"endpoint": {
"description": "The endpoint (an implementation of the ELEXIS REST protocol), where the target dictionary is available or omitted if the dictionary is available locally",
"type": "string",
"format": "uri"
},
"id" : {
"description": "The identifier of the source dictionary to be linked, as it is specified by the source endpoint",
"type": "string"
},
"entries": {
"description": "The list of target entries to link by their ID in the endpoint. If empty all entries are linked",
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"type": "string"
}
}
},
"required": ["id"]
},
"configuration": {
"description": "An implementation specific configuration object",
"type": "object"
}
},
"required": ["source","target"],
"example": {
"source": {
"endpoint": "http://elex.is/lexonomy/",
"id": "my_dictionary",
"entries": [ "cat-n", "dog-n", "work-v" ]
},
"target": {
"id": "babelnet"
},
"configuration": {
"some": "application specific values"
}
}
},
"linking": {
"type": "array",
"items": {
"properties": {
"source_entry": {
"description": "The ID of the source entry",
"type": "string"
},
"target_entry": {
"description": "The ID of the target entry",
"type": "string"
},
"linking": {
"type": "array",
"items": {
"type": "object",
"properties": {
"source_sense": {
"description": "The ID of the source sense",
"type": "string"
},
"target_sense": {
"description": "The ID of the target sense",
"type": "string"
},
"type": {
"description": "The kind of link",
"enum": [
"exact",
"broader",
"narrower",
"related"
]
},
"score": {
"description": "The score of the linking",
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": ["source_sense","target_sense","type"]
}
}
},
"required": ["source_entry","target_entry","linking"],
"example": [{
"source_entry": "cat-n",
"target_entry": "cat-EN",
"linking": [{
"source_sense": "sense1",
"target_sense": "00016606n",
"type": "exact",
"score": 0.8
},{
"source_sense": "sense2",
"target_sense": "00001844n",
"type": "broader",
"score": 0.2
}]
},{
"source_entry": "dog-n",
"target_entry": "dog-EN",
"linking": [{
"source_sense": "sense1",
"target_sense": "00015267n",
"type": "exact"
}]
}]
}
},
"status": {
"properties": {
"state": {
"description": "What state the task is in",
"enum": [
"PROCESSING",
"COMPLETED",
"FAILED"
]
},
"message": {
"description": "Any informative messages to show the user about the processing",
"type": "string"
}
},
"required": ["state"],
"example": {
"state": "PROCESSING",
"message": "Still working away"
}
},
"upload_confirm": {
"properties": {
"id": {
"type": "string",
"description": "The identifier of the resource"
},
"key": {
"type": "string",
"description": "A secret key that can be used to delete this resource"
}
}
}
},
"responses": {
"server_error": {
"description": "Internal Server Error",
"content": {
"text/plain": {
"schema": {
"type": "string",
"description": "The error message as plain text",
"example": "Something has gone terribly wrong..."
}
}
}
},
"not_supported": {
"description": "The linking service does not support some part of the linking task specified.",
"content": {
"text/plain": {
"schema": {
"type": "string",
"description": "The error message as plain text. This may occur because the linking service is limited in the endpoints it supports, the configuration is not appropriate or the server does not support one of the formats (XML/RDF/JSON) of the dictionary",
"example": "Configuration not supported."
}
}
}
}
}
},
"openapi": "3.0.0"
}