-
Notifications
You must be signed in to change notification settings - Fork 0
/
grafter-transformations.apib
172 lines (128 loc) · 5.36 KB
/
grafter-transformations.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
# Group Grafter Transformations
## Performs Tabular transformation [/dapaas-services/grafter/transformation/pipe]
### Tabular transformation [POST]
Performs a PIPE transformation with Grafter and loads the result in a repository.
You can provide an `input-distribution` URI or send an `input-file` as file attachment.
+ Parameters
+ input%2Ddistribution: (optional, URI) -
URI of an existing distribution
+ result%2Ddistribution: (required, URI) -
URI of an existing distribution
+ result%2Dfile: (required, text) -
Result filename
+ result%2Dtype: (required, mimetype) -
Result mimetype ```text/csv```
+ transformation%2Did: (required, URI) -
URI of an existing distribution
+ Request (input-file)
+ Headers
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
result-distribution: http://dapaas.eu/users/15052/distribution/my-result-distribution-1
result-file: transformed-data.csv
result-type: text/csv
transformation-id: http://dapaas.eu/users/15052/transformation/my-new-transformation-1
+ Body
input-file (text/csv): {
name,age,gender
…
}
+ Request
+ Headers
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
input-distribution: http://dapaas.eu/users/15052/distribution/my-distribution-1
result-distribution: http://dapaas.eu/users/15052/distribution/my-result-distribution-2
result-file: transformed-data.csv
result-type: text/csv
transformation-id: http://dapaas.eu/users/15052/transformation/my-new-transformation-1
+ Response
## Performs Graft Transformation [/dapaas-services/grafter/transformation/graft]
### Graft Transformation [POST]
Performs a GRAFT transformation with Grafter and loads the result in a repository.
You can provide an `input-distribution` URI or send an `input-file` as file attachment.
+ Parameters
+ input%2Ddistribution: (optional, URI) -
URI of an existing distribution
+ result%2Ddistribution: (required, URI) -
URI of an existing distribution
+ result%2Dfile: (required, text) -
Result filename
+ result%2Dtype: (required, mimetype) -
Result mimetype ```application/edn```
+ transformation%2Did: (required, URI) -
URI of an existing distribution
+ Request (input-file)
+ Headers
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
result-distribution: http://dapaas.eu/users/15052/distribution/my-result-distribution-1
result-file: transformed-data.nt
result-type: application/edn
transformation-id: http://dapaas.eu/users/15052/transformation/my-new-transformation-1
+ Body
input-file (text/csv): {
name,age,gender
…
}
+ Request
+ Headers
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
input-distribution: http://dapaas.eu/users/15052/distribution/my-distribution-1
result-distribution: http://dapaas.eu/users/15052/distribution/my-result-distribution-2
result-file: transformed-data.nt
result-type: application/edn
transformation-id: http://dapaas.eu/users/15052/transformation/my-new-transformation-1
+ Response
## Preview Transformation [/dapaas-services/grafter/transformation/preview]
### Preview Transformation [POST]
Performs a data transformation with Grafter and returns directly the output without saving it.
**Attachments**
**input-file:** Optional input file (as an alternative to the input-distribution header).
**transformation-code:** The Clojure code (as an alternative to the transformation-id header).
+ Parameters
+ transformation%2Did: (optional, URI) -
URI of an existing distribution
+ input%2Ddistribution: (optional, URI) -
URI of an existing distribution
+ transformation%2Dtype: (optional, text) -
`graft` or `pipe`. Required when attaching the transformation-code.
+ command: (optional, text) -
The command to execute. Required when attaching the transformation-code.
+ Request
+ Headers
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
transformation-id: http://dapaas.eu/users/15052/transformation/my-new-transformation-1
input-distribution: http://dapaas.eu/users/15052/distribution/my-distribution-1
+ Request
+ Headers
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
transformation-id: http://dapaas.eu/users/15052/transformation/my-new-transformation-1
+ Body
input-file (text/csv): {
person-uri,name,gender
…
}
+ Request
+ Headers
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
input-distribution: http://dapaas.eu/users/15052/distribution/my-distribution-1
transformation-type: pipe
command: my-pipe
+ Body
transformation-code (text/plain): {
(defpipe my-pipe "Example pipeline" [data-file] (-> (read-dataset data-file :format :csv)))
}
+ Request
+ Headers
Authorization: Basic YXBpa2V5OmFwaXBhc3M=
transformation-type: pipe
command: my-pipe
+ Body
input-file (text/csv): {
person-uri,name,gender
…
},
transformation-code (text/plain): {
(defpipe my-pipe "Example pipeline" [data-file] (-> (read-dataset data-file :format :csv)…))
}
+ Response
:name,:age:gender
…