-
Notifications
You must be signed in to change notification settings - Fork 0
/
transformations-catalog.apib
278 lines (206 loc) · 8.5 KB
/
transformations-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
# Group Transformations Catalog
Transformations are usefull to clean and convert your data.
The transformation main component consists of a [Grafter](http://grafter.org/) script.
[![](grafter_logo.png)](http://grafter.org)
You can use [Grafterizer](https://grafterizer.datagraft.net/) to generate the transformations and the Clojure source code.
[![](grafterizer_logo.png)](https://grafterizer.datagraft.net/)
## List all Transformations [/catalog/transformations/catalog]
List of transformations records using the DCAT vocabulary in RDF or JSON-LD.
Use the **showShared** header parameter to include the public transformations.
+ Parameters
+ showShared: (optional, y|n) - defaults to `n`
+ Accept: (required, mimetype) -
```application/ld+json``` or ```application/rdf+xml```
### List user's transformations [GET]
+ Request
+ Headers
Accept: application/ld+json
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
showShared: n
+ Response 200
{
"@context": { ... }
"@type": "dcat:Catalog",
"@id": "http://dapaas.eu/users/dapaas/catalog",
"dct:publisher": "dapaas",
"dcat:record": [
{
"@type": "dcat:CatalogRecord",
"foaf:primaryTopic": "http://eu.dapaas/transformation/1",
"dct:issued": "2014-09-16",
"dct:modified": "2014-09-17",
"dct:title": "My first DaPaaS transformation",
"dcat:public: "true",
"dct:publisher": "dapaas"
},
{
"@type": "dcat:CatalogRecord",
"foaf:primaryTopic": "http://eu.dapaas/transformation/2",
"dct:issued": "2014-09-15",
"dct:modified": "2014-09-17",
"dct:title": "My second DaPaaS transformation",
"dcat:public: "false",
"dct:publisher": "dapaas"
}
]
}
## Search transformations [/catalog/transformations/search]
Text search on the transformations metadata.
Use the **showShared** header parameter to include the public transformations.
+ 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 transformations [GET]
+ Request
+ Headers
Accept: application/ld+json
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
showShared: n
q: DaPaaS
+ Response 200
{
"@context": { ... }
"@type": "dcat:Catalog",
"@id": "http://dapaas.eu/users/dapaas/catalog",
"dct:publisher": "dapaas",
"dcat:record": [
{
"@type": "dcat:CatalogRecord",
"foaf:primaryTopic": "http://eu.dapaas/transformation/1",
"dct:issued": "2014-09-16",
"dct:modified": "2014-09-17",
"dct:title": "My first DaPaaS transformation",
"dcat:public: "true",
"dct:publisher": "dapaas"
},
{
"@type": "dcat:CatalogRecord",
"foaf:primaryTopic": "http://eu.dapaas/transformation/2",
"dct:issued": "2014-09-15",
"dct:modified": "2014-09-17",
"dct:title": "My second DaPaaS transformation",
"dcat:public: "false",
"dct:publisher": "dapaas"
}
]
}
## Transformation CRUD [/catalog/transformations]
### Create Transformation [POST]
A successful creation returns the URI of the new transformation.
If the description contains no `@id`, the system will generate one from the title.
Note: only new transformations are created with this method. Any subsequent calls with the same data generate an error response.
**Attachments**
**meta:** Transformation metadata as RDF or JSON-LD.
Use `Content-Type` to determine the metadata-format.
If the metadata doesn't contain a distribution id, the system will generate one.
**tr-clojure:** The code of the transformation as [Grafter Clojure](http://api.grafter.org/0.4.0/).
+ Parameters
+ Content%2DType: (required, mimetype) -
```multipart/mixed``` or ```multipart/form-data```
+ Request
+ Headers
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
+ Body
meta (application/ld+json): {
'@context': {...},
'@type': 'dcat:Transformation',
'dct:title': 'My new transformation',
'dct:description': 'Example transformation for the documentation',
'dcat:public': 'false',
'dct:modified': '2014-09-17',
'dcat:transformationType': 'pipe',
'dcat:transformationCommand': 'my-pipe'
},
tr-clojure: "<clojure source code>"
+ Response 200
{
"@id": "http://dapaas.eu/users/15052/transformation/my-new-transformation-1"
}
### Read Transformation [GET]
Get the complete transformation description using the DCAT vocabulary in RDF or JSON-LD.
+ Parameters
+ transformation%2Did: (required, URI)
URI of the transformation, taken from the catalog
+ Accept: (required, mimetype) -
```application/ld+json``` or ```application/rdf+xml```
+ Request
+ Headers
Accept: application/ld+json
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
transformation-id: http://dapaas.eu/users/15052/transformation/my-new-transformation-1
+ Response 200
{
"@context": {...},
"@id": "http://dapaas.eu/users/15052/transformation/my-new-transformation-1",
"@type": "dcat:Transformation",
"dct:public": false,
"dct:publisher": "dapaas",
"dct:title": "My new transformation",
"dcat:keyword": [],
"dct:description": "Example transformation for the documentation",
"dct:clojureDataID": "a959cdca-8a49-4a10-bba0-98dc59083246.clj",
"dct:jsonDataID": "2184a1bc-b0b7-450c-b839-9e74be065e77.json",
"dct:modified: "2015-07-15",
"http://www.w3.org/ns/dcat#transformationCommand": "my-pipe",
"http://www.w3.org/ns/dcat#transformationType": "pipe"
}
### Update Transformation [PUT]
**Attachments**
**meta:** Optional transformation metadata as RDF or JSON-LD.
Use `Content-Type` to determine the metadata-format.
Note: The complete transformation metadata should be included. It is not merged with the previous version.
**tr-clojure:** Optional code of the transformation as [Grafter Clojure](http://api.grafter.org/0.4.0/).
meta and tr-clojure can be managed separately.
+ Parameters
+ Content%2DType: (required, mimetype) -
```multipart/mixed``` or ```multipart/form-data```
+ transformation%2Did: (required, URI)
URI of the transformation, taken from the catalog
+ Request
+ Headers
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
transformation-id: http://dapaas.eu/users/15052/transformation/my-new-transformation-1
+ Body
meta (application/ld+json): {
'@context': {...},
'@type': 'dcat:Transformation',
'dct:title': 'My new transformation',
'dct:description': 'Updated transformation',
'dcat:public': 'false',
'dct:modified': '2014-09-17',
'dcat:transformationType': 'pipe',
'dcat:transformationCommand': 'my-pipe'
},
tr-clojure: "<clojure source code>"
+ Response 200
### Delete Transformation [DELETE]
+ Parameters
+ transformation%2Did: (required, URI)
URI of the transformation, taken from the catalog
+ Request
+ Headers
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
transformation-id: http://dapaas.eu/users/15052/transformation/my-new-transformation-1
+ Response 200
## Distribution Clojure code [/catalog/distributions/code/clojure]
The transformation code consists of clojure using [the Grafter API](http://api.grafter.org/0.4.0/grafter.tabular.html).
### Retrieve Clojure code [GET]
+ Parameters
+ transformation%2Did: (required, URI)
URI of the transformation
+ Request
+ Headers
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
transformation-id: http://dapaas.eu/users/15052/transformation/my-new-transformation-1
+ Response 200
### Delete Clojure code [DELETE]
+ Parameters
+ transformation%2Did: (required, URI)
URI of the transformation
+ Request
+ Headers
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
transformation-id: http://dapaas.eu/users/15052/transformation/my-new-transformation-1
+ Response 200