-
Notifications
You must be signed in to change notification settings - Fork 0
/
datasets-catalog.apib
352 lines (257 loc) · 9.52 KB
/
datasets-catalog.apib
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
# Group Datasets Catalog
## List All Datasets [/catalog/datasets/catalog]
List of datasets catalog records using the DCAT vocabulary in RDF or JSON-LD.
Use the **showShared** header parameter to include the public datasets.
+ Parameters
+ showShared: (optional, y|n) - defaults to `n`
+ Accept: (required, mimetype) -
```application/ld+json``` or ```application/rdf+xml```
### List user's datasets [GET]
+ Request
+ Headers
Accept: application/ld+json
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
showShared: n
+ Response 200
{
"@context": { ... }
"@type": "dcat:Catalog",
"dct:publisher": "dapaas",
"@id": "http://dapaas.eu/users/dapaas/catalog",
"dcat:record": [
{
"@type": "dcat:CatalogRecord",
"foaf:primaryTopic": "http://eu.dapaas/dataset/1",
"dct:issued": "2014-09-16",
"dct:modified": "2014-09-17",
"dct:title": "My first DaPaaS dataset",
"dcat:public": "true",
"dct:publisher": "dapaas"
},
{
"@type": "dcat:CatalogRecord",
"foaf:primaryTopic": "http://eu.dapaas/dataset/2",
"dct:issued": "2014-09-15",
"dct:modified": "2014-09-17",
"dct:title": "My second DaPaaS dataset",
"dcat:public": "false",
"dct:publisher": "dapaas"
}
]
}
## Search Datasets [/catalog/datasets/search]
Text search on the datasets metadata.
Use the **showShared** header parameter to include the public datasets.
+ Parameters
+ q: (required, text) - The text query
+ showShared: (optional, y|n) - defaults to `n`
+ Accept: (required, mimetype) -
```application/ld+json``` or ```application/rdf+xml```
### Search user's datasets [GET]
+ Request
+ Headers
Accept: application/ld+json
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
showShared: n
q: DaPaaS
+ Response 200
{
"@context": { ... }
"@type": "dcat:Catalog",
"dct:publisher": "dapaas",
"@id": "http://dapaas.eu/users/dapaas/catalog",
"dcat:record": [
{
"@type": "dcat:CatalogRecord",
"foaf:primaryTopic": "http://eu.dapaas/dataset/1",
"dct:issued": "2014-09-16",
"dct:modified": "2014-09-17",
"dct:title": "My first DaPaaS dataset",
"dcat:public": "true",
"dct:publisher": "dapaas"
},
{
"@type": "dcat:CatalogRecord",
"foaf:primaryTopic": "http://eu.dapaas/dataset/2",
"dct:issued": "2014-09-15",
"dct:modified": "2014-09-17",
"dct:title": "My second DaPaaS dataset",
"dcat:public": "false",
"dct:publisher": "dapaas"
}
]
}
## Dataset CRUD [/catalog/datasets]
### Create Dataset [POST]
If the description contains no `@id`, the system will generate one from the title.
A successful creation returns the URI of the new dataset.
+ Parameters
+ Content%2DType: (required, mimetype) -
```application/ld+json``` or ```application/rdf+xml```
+ Request (application/ld+json)
+ Headers
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
+ Body
{
'@context': {...},
'@type': 'dcat:Dataset',
'dct:title': 'My new dataset',
'dct:description': 'Example dataset for the documentation',
'dcat:public': 'false'
}
+ Response 200
{
"@id": "http://dapaas.eu/users/15052/dataset/my-new-dataset-1"
}
### Read Dataset [GET]
Get the complete dataset description using the DCAT vocabulary in RDF or JSON-LD.
+ Parameters
+ dataset%2Did: (required, URI)
URI of the dataset, taken from the catalog
+ Accept: (required, mimetype) -
```application/ld+json``` or ```application/rdf+xml```
+ Request
+ Headers
Accept: application/ld+json
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
dataset-id: http://dapaas.eu/users/15052/dataset/preview-1
+ Response 200
{
"@context": {...},
"@id": "http://dapaas.eu/users/15052/dataset/preview-1",
"@type": "dcat:Dataset",
"dcat:distribution": [
"http://dapaas.eu/users/15052/distribution/July+-+2005-2006.csv-1",
...],
"dcat:keyword": [],
"dct:description": "Dataset containing the previewed files from Grafterizer",
"dct:public": false,
"dct:publisher": "dapaas",
"dct:title": "Previewed files"
}
### Update Dataset [PUT]
Note: The complete dataset should be included. It is not merged with the previous version.
+ Parameters
+ Content%2DType: (required, mimetype) -
```application/ld+json``` or ```application/rdf+xml```
+ Request (application/ld+json)
+ Headers
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
+ Body
{
'@context': {...},
'@type': 'dcat:Dataset',
'@id': 'http://dapaas.eu/users/15052/dataset/my-new-dataset-1',
'dct:title': 'My new dataset',
'dct:description': 'My dataset now public',
'dcat:public': 'true'
}
+ Response 200
### Delete Dataset [DELETE]
When deleting a dataset, the system will also delete the attached distributions.
+ Parameters
+ dataset%2Did: (required, URI)
URI of the dataset, taken from the catalog
+ Request
+ Headers
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
dataset-id: http://dapaas.eu/users/15052/dataset/preview-1
+ Response 200
## Distribution CRUD [/catalog/distributions]
### Create Distribution [POST]
A successful creation returns the URI of the new dataset.
**Attachments**
**meta:** Distribution metadata as RDF or JSON-LD.
Use `Content-Type` to determine the metadata-format. The metadata should contain the file meta data (content-type, size, name). See the Model reference for the details.
If the metadata doesn't contain a distribution id, the system will generate one.
**file:** The raw file content.
If the distribution is not a RDF distribution, the file attachment is optional.
+ Parameters
+ dataset%2Did: (required, URI)
URI of the dataset container
+ Content%2DType: (required, mimetype) -
```multipart/mixed``` or ```multipart/form-data```
+ Request
+ Headers
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
+ Body
meta (application/ld+json): {
'@context': {...},
'@type': 'dcat:Distribution',
'dct:title': 'my-distribution',
'dct:description': 'Distribution example',
'dcat:fileName': 'source.csv',
'dcat:mediaType': 'text/csv'
},
file: <RAW>
+ Response 200
{
"@id": "http://dapaas.eu/users/15052/distribution/my-distribution-1"
}
### Read Distribution [GET]
Get the complete distribution description.
+ Parameters
+ distrib%2Did: (required, URI) -
URI of the distribution, taken from the catalog
+ Accept: (required, mimetype) -
```application/ld+json``` or ```application/rdf+xml```
+ Request
+ Headers
Accept: application/ld+json
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
distrib-id: http://dapaas.eu/users/15052/distribution/my-distribution-1
+ Response 200
{
"@context": {...},
"@id": "http://dapaas.eu/users/15052/distribution/my-distribution-1",
"@type": "dcat:Distribution",
"dct:title": "my-distribution",
"dct:description": "Distribution example",
"dct:fileID": "159532fa-62ec-4543-a662-fc7a081181b3.bin",
"http://www.w3.org/ns/dcat#mediaType": "text/csv",
"http://www.w3.org/ns/dcat#fileName": "source.csv"
}
### Update Distribution [PUT]
**Attachments**
**meta:** Distribution metadata as RDF or JSON-LD.
Use `Content-Type` to determine the metadata-format.
**file:** The raw file content.
The file attachment is optional. If provided, it will overwrite the previous one. The metadata should also be provided to contain the updated file metadata (content-type, size, name).
+ Parameters
+ Content%2DType: (required, mimetype) -
```multipart/mixed``` or ```multipart/form-data```
+ Request
+ Headers
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
+ Body
meta (application/ld+json): {
'@context': {...},
'@type': 'dcat:Distribution',
'@id': 'http://dapaas.eu/users/15052/distribution/my-distribution-1',
'dct:title': 'my-distribution',
'dct:description': 'Distribution example',
'dcat:fileName': 'source.csv',
'dcat:mediaType': 'text/csv'
},
file: <RAW>
+ Response 200
### Delete Distribution [DELETE]
When deleting a distribution, the system will also release the attached RDF repositories.
+ Parameters
+ distrib%2Did: (required, URI)
URI of the distribution
+ Request
+ Headers
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
dataset-id: http://dapaas.eu/users/15052/dataset/preview-1
+ Response 200
## Distribution raw file access [/catalog/distributions/file]
### Distribution Raw file access [GET]
+ Parameters
+ distrib%2Did: (required, URI)
URI of the distribution
+ Request
+ Headers
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
dataset-id: http://dapaas.eu/users/15052/dataset/preview-1
+ Response 200