|
| 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 | + … |
0 commit comments