Skip to content

Commit 8ee25d8

Browse files
committed
Transformations
1 parent a10602f commit 8ee25d8

5 files changed

+468
-13
lines changed

datasets-catalog.apib

+20-12
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,26 @@ Use the **showShared** header parameter to include the public datasets.
2525
{
2626
"@context": { ... }
2727
"@type": "dcat:Catalog",
28-
"dct:publisher": "Alex",
29-
"@id": "http://dapaas.eu/users/Alex/datasets",
28+
"dct:publisher": "dapaas",
29+
"@id": "http://dapaas.eu/users/dapaas/catalog",
3030
"dcat:record": [
3131
{
3232
"@type": "dcat:CatalogRecord",
3333
"foaf:primaryTopic": "http://eu.dapaas/dataset/1",
3434
"dct:issued": "2014-09-16",
3535
"dct:modified": "2014-09-17",
36-
"dct:title": "My first DaPaaS dataset"
36+
"dct:title": "My first DaPaaS dataset",
37+
"dcat:public": "true",
38+
"dct:publisher": "dapaas"
3739
},
3840
{
3941
"@type": "dcat:CatalogRecord",
4042
"foaf:primaryTopic": "http://eu.dapaas/dataset/2",
4143
"dct:issued": "2014-09-15",
4244
"dct:modified": "2014-09-17",
43-
"dct:title": "My second DaPaaS dataset"
45+
"dct:title": "My second DaPaaS dataset",
46+
"dcat:public": "false",
47+
"dct:publisher": "dapaas"
4448
}
4549
]
4650
}
@@ -70,22 +74,26 @@ Use the **showShared** header parameter to include the public datasets.
7074
{
7175
"@context": { ... }
7276
"@type": "dcat:Catalog",
73-
"dct:publisher": "Alex",
74-
"@id": "http://dapaas.eu/users/Alex/datasets",
77+
"dct:publisher": "dapaas",
78+
"@id": "http://dapaas.eu/users/dapaas/catalog",
7579
"dcat:record": [
7680
{
7781
"@type": "dcat:CatalogRecord",
7882
"foaf:primaryTopic": "http://eu.dapaas/dataset/1",
7983
"dct:issued": "2014-09-16",
8084
"dct:modified": "2014-09-17",
81-
"dct:title": "My first DaPaaS dataset"
85+
"dct:title": "My first DaPaaS dataset",
86+
"dcat:public": "true",
87+
"dct:publisher": "dapaas"
8288
},
8389
{
8490
"@type": "dcat:CatalogRecord",
8591
"foaf:primaryTopic": "http://eu.dapaas/dataset/2",
8692
"dct:issued": "2014-09-15",
8793
"dct:modified": "2014-09-17",
88-
"dct:title": "My second DaPaaS dataset"
94+
"dct:title": "My second DaPaaS dataset",
95+
"dcat:public": "false",
96+
"dct:publisher": "dapaas"
8997
}
9098
]
9199
}
@@ -94,7 +102,7 @@ Use the **showShared** header parameter to include the public datasets.
94102
95103
### Create Dataset [POST]
96104
97-
If the description contains no @id, the system will generate one from the title.
105+
If the description contains no `@id`, the system will generate one from the title.
98106
99107
A successfull creation returns the URI of the new dataset.
100108
@@ -208,7 +216,7 @@ A successfull creation returns the URI of the new dataset.
208216
209217
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.
210218
211-
If the metadata doesn't contain a distirbution id, the system will generate one.
219+
If the metadata doesn't contain a distribution id, the system will generate one.
212220
213221
**file:** The raw file content.
214222
@@ -228,7 +236,7 @@ If the distribution is not a RDF distribution, the file attachment is optional.
228236
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
229237
+ Body
230238
231-
meta:  {
239+
meta (application/ld+json):  {
232240
'@context': {...},
233241
'@type': 'dcat:Distribution',
234242
'dct:title': 'my-distribution',
@@ -297,7 +305,7 @@ The file attachment is optional. If provided, it will overwrite the previous one
297305
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
298306
+ Body
299307
300-
meta:  {
308+
meta (application/ld+json):  {
301309
'@context': {...},
302310
'@type': 'dcat:Distribution',
303311
'@id': 'http://dapaas.eu/users/15052/distribution/my-distribution-1',

documentation.apib

+5
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ Authorization: Basic a2V5OnNlY3JldA==
3232
q: mysearch
3333
```
3434

35+
3536
<!-- include(datasets-catalog.apib) -->
3637

3738
<!-- include(rdf-repositories.apib) -->
39+
40+
<!-- include(transformations-catalog.apib) -->
41+
42+
<!-- include(grafter-transformations.apib) -->

grafter-transformations.apib

+172
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
# Group Grafter Transformations
2+
3+
## Performs Tabular transformation [/dapaas-service/grafter/transformation/pipe]
4+
5+
### Tabular transformation [POST]
6+
7+
Performs a PIPE transformation with Grafter and loads the result in a repository.
8+
9+
You can provide an `input-distribution` URI or send an `input-file` as file attachment.
10+
11+
+ Parameters
12+
+ input%2Ddistribution: (optional, URI) -
13+
URI of an existing distribution
14+
+ result%2Ddistribution: (required, URI) -
15+
URI of an existing distribution
16+
+ result%2Dfile: (required, text) -
17+
Result filename
18+
+ result%2Dtype: (required, mimetype) -
19+
Result mimetype ```text/csv```
20+
+ transformation%2Did: (required, URI) -
21+
URI of an existing distribution
22+
23+
+ Request (input-file)
24+
+ Headers
25+
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
26+
result-distribution: http://dapaas.eu/users/15052/distribution/my-result-distribution-1
27+
result-file: transformed-data.csv
28+
result-type: text/csv
29+
transformation-id: http://dapaas.eu/users/15052/transformation/my-new-transformation-1
30+
31+
+ Body
32+
33+
input-file (text/csv):  {
34+
name,age,gender
35+
36+
}
37+
38+
+ Request
39+
+ Headers
40+
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
41+
input-distribution: http://dapaas.eu/users/15052/distribution/my-distribution-1
42+
result-distribution: http://dapaas.eu/users/15052/distribution/my-result-distribution-2
43+
result-file: transformed-data.csv
44+
result-type: text/csv
45+
transformation-id: http://dapaas.eu/users/15052/transformation/my-new-transformation-1
46+
47+
+ Response
48+
49+
50+
## Performs Graft Transformation [/dapaas-service/grafter/transformation/graft]
51+
52+
### Graft Transformation [POST]
53+
54+
Performs a GRAFT transformation with Grafter and loads the result in a repository.
55+
56+
You can provide an `input-distribution` URI or send an `input-file` as file attachment.
57+
58+
+ Parameters
59+
+ input%2Ddistribution: (optional, URI) -
60+
URI of an existing distribution
61+
+ result%2Ddistribution: (required, URI) -
62+
URI of an existing distribution
63+
+ result%2Dfile: (required, text) -
64+
Result filename
65+
+ result%2Dtype: (required, mimetype) -
66+
Result mimetype ```application/edn```
67+
+ transformation%2Did: (required, URI) -
68+
URI of an existing distribution
69+
70+
+ Request (input-file)
71+
+ Headers
72+
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
73+
result-distribution: http://dapaas.eu/users/15052/distribution/my-result-distribution-1
74+
result-file: transformed-data.nt
75+
result-type: application/edn
76+
transformation-id: http://dapaas.eu/users/15052/transformation/my-new-transformation-1
77+
78+
+ Body
79+
80+
input-file (text/csv):  {
81+
name,age,gender
82+
83+
}
84+
85+
+ Request
86+
+ Headers
87+
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
88+
input-distribution: http://dapaas.eu/users/15052/distribution/my-distribution-1
89+
result-distribution: http://dapaas.eu/users/15052/distribution/my-result-distribution-2
90+
result-file: transformed-data.nt
91+
result-type: application/edn
92+
transformation-id: http://dapaas.eu/users/15052/transformation/my-new-transformation-1
93+
94+
+ Response
95+
96+
## Preview Transformation [/dapaas-service/grafter/transformation/preview]
97+
98+
### Preview Transformation [POST]
99+
100+
Performs a data transformation with Grafter and returns directly the output without saving it.
101+
102+
**Attachments**
103+
104+
**input-file:** Optional input file (as an alternative to the input-distribution header).
105+
106+
**transformation-code:** The Clojure code (as an alternative to the transformation-id header).
107+
108+
+ Parameters
109+
+ transformation%2Did: (optional, URI) -
110+
URI of an existing distribution
111+
112+
+ input%2Ddistribution: (optional, URI) -
113+
URI of an existing distribution
114+
115+
+ transformation%2Dtype: (optional, text) -
116+
`graft` or `pipe`. Required when attaching the transformation-code.
117+
118+
+ command: (optional, text) -
119+
The command to execute. Required when attaching the transformation-code.
120+
121+
122+
+ Request
123+
+ Headers
124+
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
125+
transformation-id: http://dapaas.eu/users/15052/transformation/my-new-transformation-1
126+
input-distribution: http://dapaas.eu/users/15052/distribution/my-distribution-1
127+
128+
+ Request
129+
+ Headers
130+
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
131+
transformation-id: http://dapaas.eu/users/15052/transformation/my-new-transformation-1
132+
133+
+ Body
134+
135+
input-file (text/csv):  {
136+
person-uri,name,gender
137+
138+
}
139+
140+
+ Request
141+
+ Headers
142+
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
143+
input-distribution: http://dapaas.eu/users/15052/distribution/my-distribution-1
144+
transformation-type: pipe
145+
command: my-pipe
146+
147+
+ Body
148+
149+
transformation-code (text/plain):  {
150+
(defpipe my-pipe "Example pipeline" [data-file] (-> (read-dataset data-file :format :csv)))
151+
}
152+
153+
+ Request
154+
+ Headers
155+
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
156+
transformation-type: pipe
157+
command: my-pipe
158+
159+
+ Body
160+
161+
input-file (text/csv):  {
162+
person-uri,name,gender
163+
164+
},
165+
transformation-code (text/plain):  {
166+
(defpipe my-pipe "Example pipeline" [data-file] (-> (read-dataset data-file :format :csv)…))
167+
}
168+
169+
+ Response
170+
171+
:name,:age:gender
172+

rdf-repositories.apib

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ It exposes the [OpenRDF Sesame API](http://rdf4j.org/sesame/2.7/docs/system.docb
99

1010
**However the authentication is still required.** Using the Authorization header as defined in the beginning of this document.
1111

12-
##RDF repository [/catalog/distributions/repository]
12+
## RDF repository [/catalog/distributions/repository]
1313

1414
### Provision RDF repository [PUT]
1515

0 commit comments

Comments
 (0)