This repository has been archived by the owner on Sep 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmapping_noattributes.yaml
249 lines (248 loc) · 7.56 KB
/
mapping_noattributes.yaml
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
---
description: "Icecat-SPHERE Mapping (no fact sheet attributes, just what's in the urls_rich feed)"
# TODO: do the product variants need to be directly adjacent? How else would the import detect variants that belong together?
groupColumn:
col: "model_identifier"
type: "constant"
columnMapping:
# -
# type: "copyFromOriginal"
# excludeCols:
# # please keep all original columns listed as reference, just comment out and in
# - "product_id"
# - "prod_id"
# - "Quality"
# - "URL"
# - "supplier_id"
# - "High_res_img"
# - "Low_res_img"
# - "Thumbnail_img"
# - "UNCATID"
# - "Category_ID
# - "m_prod_id"
# - "ean_upcs"
# - "model_name"
# - "original_supplier_id"
# - "product_view"
# - "on_market"
# - "country_market_set"
# - "Updated"
# - "supplier_id"
# - "Name"
# - "catid"
# - "category_name.en"
# - "sphere_model_id"
-
# the slug is our self generated product (=poor man's icecat model) identifier and sort criterion
type: "addColumn"
fromCol: "model_identifier"
toCol: "slug"
valueTransformers:
-
type: "required"
-
# variantId needs to be generated ascending (never change this)
type: "addColumn"
toCol: "variantId"
valueTransformers:
-
type: "groupCounter"
startAt: 1
-
# "sku" is a required built-in field. We use the icecat internal ID
# Attention: product_id is not unique in the CSV index files (copies for synonymous manufacturer ids), just in XML
# by frequency analysis (21-19-19-18-17):
# these seem to go 1:1: m_prod_id, the EAN/UPC list, the icecat XML sheet URL, AND the icecat ID (used as sku)
# stuff like this are the marketing synonymous manufacturer ids:
# F1R80AW
# F1R80AW#AB7
# F1R80AW#AB8
type: "transformColumn"
fromCol: "product_id"
toCol: "sku"
valueTransformers:
-
type: "required"
-
# productType is a required and built-in field. generate with fixed value if there's just one type.
type: "addColumn"
toCol: "productType"
valueTransformers:
-
type: "constant"
value: "simpleIcecatProduct"
-
# "name" is a translatable required and built-in field.
type: "addColumn"
# fromCol: "model_name"
toCol: "name.en"
valueTransformers:
-
type: "fallback"
valueTransformers:
-
type: "column"
col: "model_name"
-
type: "column"
col: "product_id"
-
type: "required"
# -
# # "description" is a translatable built-in field.
# type: "transformColumn"
# fromCol: "Style_LongDesc"
# toCol: "description.de"
-
type: "transformColumn"
fromCol: "Name"
toCol: "manufacturer_name"
-
type: "transformColumn"
fromCol: "supplier_id"
toCol: "manufacturer_icecat_id"
-
# FYI the difference to "supplier_id" seems minimal
type: "transformColumn"
fromCol: "original_supplier_id"
toCol: "manufacturer_icecat_original_id"
-
# "long" manufacturer product ID (many of these identify the same icecat product)
type: "transformColumn"
fromCol: "prod_id"
toCol: "manufacturer_product_id"
-
# manufacturer product id that's aligned with icecat product ids
type: "transformColumn"
fromCol: "m_prod_id"
toCol: "manufacturer_product_id_normal"
-
type: "transformColumn"
fromCol: "ean_upcs"
toCol: "ean_upc_set"
-
# "images" is a built-in field that should contain a semicolon-separated list of image URLs in the biggest available size.
# Icecat: just one image (the biggest one)
type: "transformColumn"
fromCol: "High_res_img"
toCol: "images"
-
type: "transformColumn"
fromCol: "Low_res_img"
toCol: "image_url_small"
-
type: "transformColumn"
fromCol: "Thumbnail_img"
toCol: "image_url_thumb"
-
type: "transformColumn"
fromCol: "category_name.en"
toCol: "category_name.en"
-
type: "transformColumn"
fromCol: "Category_ID"
toCol: "category_icecat_id"
-
type: "transformColumn"
fromCol: "UNCATID"
toCol: "category_uncat_it"
-
# "categories" is a built-in field in the format "Category>SameSubCategory" OR the externalId OR the slug.
# Multiple semicolon-separated entries are possible (but icecat is a unique taxonomy).
type: "addColumn"
fromCol: "catid"
toCol: "categories"
#-
# "prices" is a built-in filed name. target value needs to be in "EUR 9999; EUR 8999 salePrice; EUR 12000 MSRP" format e.g. if 99,99 is the regular price and there are two more named prices.
#type: "addColumn"
#toCol: "prices"
#valueTransformers:
# -
# type: "multipartString"
# parts:
# -
# fromCol: "SKU_SellingPrice"
# valueTransformers:
# -
# type: "regexp"
# find: "^(\\d+),(\\d{2})"
# replace: "EUR $1$2"
-
# tax is a required and built-in field. generate with "default" if not in the source data
type: "addColumn"
toCol: "tax"
valueTransformers:
-
type: "constant"
value: "default"
-
type: "transformColumn"
fromCol: "Quality"
toCol: "icecat_data_quality"
# -
# # an always empty column
# type: "transformColumn"
# fromCol: "product_view"
# toCol: "icecat_product_view_xxx"
-
type: "transformColumn"
toCol: "icecat_factsheet_url"
valueTransformers:
-
type: "multipartString"
parts:
-
fromCol: "URL"
-
valueTransformers:
-
type: "constant"
value: ";shopname=nikolauskuehn"
-
type: "transformColumn"
toCol: "icecat_xml_data_url"
valueTransformers:
-
type: "multipartString"
parts:
-
valueTransformers:
-
type: "constant"
value: "http://data.icecat.biz/export/freexml/INT/" # in paid accounts "freexml" can be exchanged for "level4"
-
fromCol: "product_id"
-
valueTransformers:
-
type: "constant"
value: ".xml"
-
type: "transformColumn"
fromCol: "on_market"
toCol: "on_market"
# valueTransformers:
# -
# type: "lookup"
# values:
# -
# - "1"
# - "true"
# -
# - "0"
# - "false"
-
type: "transformColumn"
fromCol: "country_market_set"
toCol: "on_market_countries_set"
-
# date formats need to be converted to our IUSO format:
# Icecat format example: 20140527134728 2014 05 27 13:47:28
type: "transformColumn"
fromCol: "Updated"
toCol: "icecat_last_updated"
valueTransformers:
-
type: "regexp"
find: "\\s*(\\d{4})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})\\s*"
replace: "$1-$2-$3T$4:$5:$6.000Z"