@hestia-earth/data-validation 0.41.16 → 0.41.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/file-errors/public-api.d.mts +1 -1
- package/file-errors/public-api.d.ts +1 -1
- package/file-errors/public-api.js +421 -361
- package/file-errors/public-api.mjs +421 -361
- package/index.js +378 -363
- package/index.mjs +378 -363
- package/package.json +1 -1
- package/validation.json +378 -363
|
@@ -6,169 +6,339 @@ import { toDashCase, keyToLabel, unique, toPrecision, isNumber } from '@hestia-e
|
|
|
6
6
|
// validation.json
|
|
7
7
|
var validations = [
|
|
8
8
|
{
|
|
9
|
-
function: "
|
|
9
|
+
function: "validate_id",
|
|
10
10
|
level: "error",
|
|
11
|
-
message: "must
|
|
11
|
+
message: "aggregation id must contain a product, region, start, end year, and a timestamp"
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
|
-
function: "
|
|
14
|
+
function: "validate_has_termType",
|
|
15
|
+
level: "warning",
|
|
16
|
+
message: "should contain at least one management node"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
function: "validate_fallow_dates",
|
|
15
20
|
level: "error",
|
|
16
|
-
message: "must be
|
|
21
|
+
message: "duration must be in specified interval"
|
|
17
22
|
},
|
|
18
23
|
{
|
|
19
|
-
function: "
|
|
24
|
+
function: "validate_cycles_overlap",
|
|
20
25
|
level: "error",
|
|
21
|
-
message: "must be
|
|
26
|
+
message: "management date must be before cycle start date"
|
|
22
27
|
},
|
|
23
28
|
{
|
|
24
|
-
function: "
|
|
29
|
+
function: "validate_functionalUnit_not_1_ha",
|
|
25
30
|
level: "error",
|
|
26
|
-
message: "must be
|
|
31
|
+
message: "must not be equal to 1 ha"
|
|
27
32
|
},
|
|
28
33
|
{
|
|
29
|
-
function: "
|
|
34
|
+
function: "validate_sum_aboveGroundCropResidue",
|
|
30
35
|
level: "error",
|
|
31
|
-
message: "must
|
|
36
|
+
message: "must be more than or equal to other crop residues"
|
|
32
37
|
},
|
|
33
38
|
{
|
|
34
|
-
function: "
|
|
39
|
+
function: "validate_crop_residue_complete",
|
|
35
40
|
level: "error",
|
|
36
|
-
message: "must
|
|
41
|
+
message: "must specify the fate of cropResidue"
|
|
37
42
|
},
|
|
38
43
|
{
|
|
39
|
-
function: "
|
|
44
|
+
function: "validate_crop_residue_incomplete",
|
|
45
|
+
level: "warning",
|
|
46
|
+
message: "should specify the fate of cropResidue"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
function: "validate_cycleDuration",
|
|
40
50
|
level: "error",
|
|
41
|
-
message: "must be
|
|
51
|
+
message: "must be one year prior to endDate"
|
|
42
52
|
},
|
|
43
53
|
{
|
|
44
|
-
function: "
|
|
54
|
+
function: "validate_cycleDuration",
|
|
45
55
|
level: "error",
|
|
46
|
-
message: "must
|
|
56
|
+
message: "must equal to endDate - startDate in days"
|
|
47
57
|
},
|
|
48
58
|
{
|
|
49
|
-
function: "
|
|
59
|
+
function: "validate_harvestedArea",
|
|
50
60
|
level: "error",
|
|
51
|
-
message: "must be
|
|
61
|
+
message: "must be lower or equal to siteArea"
|
|
52
62
|
},
|
|
53
63
|
{
|
|
54
|
-
function: "
|
|
64
|
+
function: "validate_maximum_cycleDuration",
|
|
55
65
|
level: "error",
|
|
56
|
-
message: "must be below
|
|
66
|
+
message: "must be below maximum cycleDuration"
|
|
57
67
|
},
|
|
58
68
|
{
|
|
59
|
-
function: "
|
|
69
|
+
function: "validate_riceGrainInHuskFlooded_minimum_cycleDuration",
|
|
60
70
|
level: "warning",
|
|
61
|
-
message: "should be
|
|
71
|
+
message: "should be more than the cropping duration"
|
|
62
72
|
},
|
|
63
73
|
{
|
|
64
|
-
function: "
|
|
74
|
+
function: "validate_crop_siteDuration",
|
|
75
|
+
level: "error",
|
|
76
|
+
message: "should be equal to cycleDuration for crop"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
function: "validate_crop_siteDuration",
|
|
80
|
+
level: "error",
|
|
81
|
+
message: "should be greater than cycleDuration for crop"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
function: "validate_animal_siteDuration",
|
|
85
|
+
level: "error",
|
|
86
|
+
message: "should be equal to cycleDuration for animals"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
function: "validate_animal_siteDuration",
|
|
90
|
+
level: "error",
|
|
91
|
+
message: "should be equal to cycleDuration - otherSitesDuration for animals"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
function: "validate_animal_siteDuration",
|
|
95
|
+
level: "error",
|
|
96
|
+
message: "should be less than cycleDuration for animals"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
function: "validate_durations",
|
|
65
100
|
level: "warning",
|
|
66
|
-
message: "
|
|
101
|
+
message: "should add the fields for a relative cycle"
|
|
67
102
|
},
|
|
68
103
|
{
|
|
69
|
-
function: "
|
|
104
|
+
function: "validate_possibleCoverCrop",
|
|
70
105
|
level: "error",
|
|
71
|
-
message: "
|
|
106
|
+
message: "cover crop cycle contains non cover crop product"
|
|
72
107
|
},
|
|
73
108
|
{
|
|
74
|
-
function: "
|
|
109
|
+
function: "validate_set_treatment",
|
|
110
|
+
level: "warning",
|
|
111
|
+
message: "should specify a treatment when experimentDesign is specified"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
function: "validate_products_animals",
|
|
115
|
+
level: "warning",
|
|
116
|
+
message: "should not specify both liveAnimal and animalProduct"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
function: "validate_stocking_density",
|
|
120
|
+
level: "warning",
|
|
121
|
+
message: "should add the term stockingDensityPermanentPastureAverage"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
function: "validate_linked_impact_assessment",
|
|
75
125
|
level: "error",
|
|
76
|
-
message: "
|
|
126
|
+
message: "multiple ImpactAssessment are associated with this Product"
|
|
77
127
|
},
|
|
78
128
|
{
|
|
79
|
-
function: "
|
|
129
|
+
function: "validate_linked_impact_assessment",
|
|
80
130
|
level: "error",
|
|
81
|
-
message: "
|
|
131
|
+
message: "no ImpactAssessment are associated with this Product"
|
|
82
132
|
},
|
|
83
133
|
{
|
|
84
|
-
function: "
|
|
134
|
+
function: "validate_animal_product_mapping",
|
|
135
|
+
level: "error",
|
|
136
|
+
message: "is not an allowed animalProduct"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
function: "validate_requires_substrate",
|
|
140
|
+
level: "error",
|
|
141
|
+
message: "must add substrate inputs"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
function: "_validate_previous_transformationId",
|
|
145
|
+
level: "error",
|
|
146
|
+
message: "must point to a previous transformation in the list"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
function: "_validate_previous_input",
|
|
150
|
+
level: "error",
|
|
151
|
+
message: "at least one Input must be a Product of the Cycle"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
function: "_validate_previous_input",
|
|
155
|
+
level: "error",
|
|
156
|
+
message: "at least one Input must be a Product of the previous Transformation"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
function: "_validate_previous_product_value",
|
|
160
|
+
level: "error",
|
|
161
|
+
message: "must be equal to previous product multiplied by the share"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
function: "validate_linked_emission",
|
|
85
165
|
level: "warning",
|
|
86
|
-
message: "should
|
|
166
|
+
message: "should be linked to an emission in the Cycle"
|
|
87
167
|
},
|
|
88
168
|
{
|
|
89
|
-
function: "
|
|
169
|
+
function: "validate_excreta_inputs_products",
|
|
90
170
|
level: "error",
|
|
91
|
-
message: "must
|
|
171
|
+
message: "must be included as an Input"
|
|
92
172
|
},
|
|
93
173
|
{
|
|
94
|
-
function: "
|
|
174
|
+
function: "validate_transformation_inputs_value",
|
|
95
175
|
level: "error",
|
|
96
|
-
message: "must be
|
|
176
|
+
message: "must be specified for multiple Inputs with the same term"
|
|
97
177
|
},
|
|
98
178
|
{
|
|
99
|
-
function: "
|
|
179
|
+
function: "validate_empty",
|
|
100
180
|
level: "error",
|
|
101
|
-
message: "
|
|
181
|
+
message: "should not be empty"
|
|
102
182
|
},
|
|
103
183
|
{
|
|
104
|
-
function: "
|
|
184
|
+
function: "validate_linked_cycle_product",
|
|
105
185
|
level: "error",
|
|
106
|
-
message: "
|
|
186
|
+
message: "should be included in the cycle products"
|
|
107
187
|
},
|
|
108
188
|
{
|
|
109
|
-
function: "
|
|
189
|
+
function: "validate_linked_cycle_endDate",
|
|
190
|
+
level: "error",
|
|
191
|
+
message: "must be equal to the Cycle endDate"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
function: "validate_value_follows_area",
|
|
110
195
|
level: "warning",
|
|
111
|
-
message: "should be
|
|
196
|
+
message: "should not be proportional to the site area"
|
|
112
197
|
},
|
|
113
198
|
{
|
|
114
|
-
function: "
|
|
199
|
+
function: "validate_fixed_nutrient_ratio",
|
|
115
200
|
level: "warning",
|
|
116
|
-
message: "
|
|
201
|
+
message: "should be the amount of nutrient, not of fertiliser"
|
|
117
202
|
},
|
|
118
203
|
{
|
|
119
|
-
function: "
|
|
204
|
+
function: "validate_lifespan",
|
|
205
|
+
level: "error",
|
|
206
|
+
message: "must equal to endDate - startDate in decimal years"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
function: "validate_functionalArea",
|
|
120
210
|
level: "warning",
|
|
121
|
-
message: "should
|
|
211
|
+
message: "should specify functionalArea or site area"
|
|
122
212
|
},
|
|
123
213
|
{
|
|
124
|
-
function: "
|
|
214
|
+
function: "validate_soilTexture",
|
|
215
|
+
level: "error",
|
|
216
|
+
message: "is outside the allowed range"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
function: "validate_soilTexture_depths",
|
|
125
220
|
level: "warning",
|
|
126
|
-
message: "
|
|
221
|
+
message: "should be given at the same depths as the soil content"
|
|
127
222
|
},
|
|
128
223
|
{
|
|
129
|
-
function: "
|
|
224
|
+
function: "validate_depths",
|
|
130
225
|
level: "error",
|
|
131
|
-
message: "
|
|
226
|
+
message: "must be greater than or equal to depthUpper"
|
|
132
227
|
},
|
|
133
228
|
{
|
|
134
|
-
function: "
|
|
229
|
+
function: "validate_required_depths",
|
|
230
|
+
level: "error",
|
|
231
|
+
message: "must set both depthUpper and depthLower"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
function: "validate_required_depths",
|
|
135
235
|
level: "warning",
|
|
136
|
-
message: "should
|
|
236
|
+
message: "should set both depthUpper and depthLower"
|
|
137
237
|
},
|
|
138
238
|
{
|
|
139
|
-
function: "
|
|
239
|
+
function: "validate_term_unique",
|
|
140
240
|
level: "error",
|
|
141
|
-
message: "
|
|
241
|
+
message: "must be unique"
|
|
142
242
|
},
|
|
143
243
|
{
|
|
144
|
-
function: "
|
|
244
|
+
function: "validate_term_unique",
|
|
245
|
+
level: "error",
|
|
246
|
+
message: "must provide value or min and max"
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
function: "validate_with_models",
|
|
145
250
|
level: "warning",
|
|
146
|
-
message: "
|
|
251
|
+
message: "the measurement provided might be in error"
|
|
147
252
|
},
|
|
148
253
|
{
|
|
149
|
-
function: "
|
|
254
|
+
function: "validate_value_length",
|
|
150
255
|
level: "error",
|
|
151
|
-
message: "
|
|
256
|
+
message: "must not contain more than 1 value"
|
|
152
257
|
},
|
|
153
258
|
{
|
|
154
|
-
function: "
|
|
259
|
+
function: "validate_water_measurements",
|
|
260
|
+
level: "error",
|
|
261
|
+
message: "must specify water type for ponds"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
function: "validate_water_salinity",
|
|
265
|
+
level: "error",
|
|
266
|
+
message: "invalid water salinity"
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
function: "validate_soil_type_consistency",
|
|
270
|
+
level: "error",
|
|
271
|
+
message: "measurements for the same termType must be consistent"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
function: "validate_must_include_id",
|
|
155
275
|
level: "warning",
|
|
156
|
-
message: "should
|
|
276
|
+
message: "should add missing inputs"
|
|
157
277
|
},
|
|
158
278
|
{
|
|
159
|
-
function: "
|
|
279
|
+
function: "validate_compound_fertiliser_composition",
|
|
160
280
|
level: "warning",
|
|
161
|
-
message: "should
|
|
281
|
+
message: "should match the nutrient ratio of the compound fertiliser"
|
|
162
282
|
},
|
|
163
283
|
{
|
|
164
|
-
function: "
|
|
284
|
+
function: "validate_related_impacts",
|
|
165
285
|
level: "error",
|
|
166
|
-
message: "
|
|
286
|
+
message: "can not be linked to the same type"
|
|
167
287
|
},
|
|
168
288
|
{
|
|
169
|
-
function: "
|
|
289
|
+
function: "validate_related_impact_product",
|
|
290
|
+
level: "error",
|
|
291
|
+
message: "can not be linked to a different term"
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
function: "_validate_input_value",
|
|
170
295
|
level: "warning",
|
|
171
|
-
message: "
|
|
296
|
+
message: "is outside confidence interval"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
function: "validate_animalFeed_requires_isAnimalFeed",
|
|
300
|
+
level: "error",
|
|
301
|
+
message: "must specify is it an animal feed"
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
function: "validate_isAnimalFeed_animal_cycle",
|
|
305
|
+
level: "error",
|
|
306
|
+
message: "isAnimalFeed not allowed on a non-animal cycle"
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
function: "validate_saplings",
|
|
310
|
+
level: "error",
|
|
311
|
+
message: "saplings cannot be used as an input here"
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
function: "validate_seed",
|
|
315
|
+
level: "error",
|
|
316
|
+
message: "seed cannot be used as an input here"
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
function: "validate_saplings_depreciated",
|
|
320
|
+
level: "error",
|
|
321
|
+
message: "saplingsDepreciatedAmountPerCycle cannot be used as an input here"
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
function: "validate_seed_correspondingSpecies",
|
|
325
|
+
level: "error",
|
|
326
|
+
message: "must specify correspondingSpecies in intercropping"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
function: "validate_material_depreciated",
|
|
330
|
+
level: "error",
|
|
331
|
+
message: "must use the depreciated term"
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
function: "validate_input_is_product",
|
|
335
|
+
level: "error",
|
|
336
|
+
message: "must be a product"
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
function: "validate_input_unspecified_term",
|
|
340
|
+
level: "warning",
|
|
341
|
+
message: "should use a specific term"
|
|
172
342
|
},
|
|
173
343
|
{
|
|
174
344
|
function: "validate_method_not_relevant",
|
|
@@ -195,6 +365,61 @@ var validations = [
|
|
|
195
365
|
level: "warning",
|
|
196
366
|
message: "should set the depth"
|
|
197
367
|
},
|
|
368
|
+
{
|
|
369
|
+
function: "validate_linked_impactAssessment",
|
|
370
|
+
level: "error",
|
|
371
|
+
message: "must be linked to a verified country-level Impact Assessment"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
function: "validate_plantation_practices",
|
|
375
|
+
level: "error",
|
|
376
|
+
message: "must include practices for plantation weighting"
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
function: "validate_characterisedIndicator_model",
|
|
380
|
+
level: "error",
|
|
381
|
+
message: "is not allowed for this characterisedIndicator"
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
function: "_below_occupation",
|
|
385
|
+
level: "error",
|
|
386
|
+
message: "must be less than or equal to land occupation"
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
function: "validate_inonising_compounds_waste",
|
|
390
|
+
level: "error",
|
|
391
|
+
message: "must be linked to waste input"
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
function: "validate_resourceUse_landCover",
|
|
395
|
+
level: "error",
|
|
396
|
+
message: "this field is required"
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
function: "validate_resourceUse_landCover",
|
|
400
|
+
level: "error",
|
|
401
|
+
message: "this field is required"
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
function: "validate_has_animals",
|
|
405
|
+
level: "warning",
|
|
406
|
+
message: "should specify the herd composition"
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
function: "validate_duplicated_feed_inputs",
|
|
410
|
+
level: "error",
|
|
411
|
+
message: "must not add the feed input to the Cycle as well"
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
function: "validate_has_milkYieldPractice",
|
|
415
|
+
level: "warning",
|
|
416
|
+
message: "should specify the a milkYield practice"
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
function: "validate_animal_has_recommended_products",
|
|
420
|
+
level: "warning",
|
|
421
|
+
message: "should specify a recommended product"
|
|
422
|
+
},
|
|
198
423
|
{
|
|
199
424
|
function: "validate_defaultValue",
|
|
200
425
|
level: "warning",
|
|
@@ -326,234 +551,184 @@ var validations = [
|
|
|
326
551
|
message: "cropResidue product is not accounted for by the cropResidueManagement practices"
|
|
327
552
|
},
|
|
328
553
|
{
|
|
329
|
-
function: "
|
|
330
|
-
level: "error",
|
|
331
|
-
message: "is outside the allowed range"
|
|
332
|
-
},
|
|
333
|
-
{
|
|
334
|
-
function: "validate_soilTexture_depths",
|
|
335
|
-
level: "warning",
|
|
336
|
-
message: "should be given at the same depths as the soil content"
|
|
337
|
-
},
|
|
338
|
-
{
|
|
339
|
-
function: "validate_depths",
|
|
340
|
-
level: "error",
|
|
341
|
-
message: "must be greater than or equal to depthUpper"
|
|
342
|
-
},
|
|
343
|
-
{
|
|
344
|
-
function: "validate_required_depths",
|
|
345
|
-
level: "error",
|
|
346
|
-
message: "must set both depthUpper and depthLower"
|
|
347
|
-
},
|
|
348
|
-
{
|
|
349
|
-
function: "validate_required_depths",
|
|
350
|
-
level: "warning",
|
|
351
|
-
message: "should set both depthUpper and depthLower"
|
|
352
|
-
},
|
|
353
|
-
{
|
|
354
|
-
function: "validate_term_unique",
|
|
554
|
+
function: "validate_property_valueType",
|
|
355
555
|
level: "error",
|
|
356
|
-
message: "
|
|
556
|
+
message: "the property value type is incorrect"
|
|
357
557
|
},
|
|
358
558
|
{
|
|
359
|
-
function: "
|
|
559
|
+
function: "validate_term_type",
|
|
360
560
|
level: "error",
|
|
361
|
-
message: "
|
|
561
|
+
message: "can not be used on this termType"
|
|
362
562
|
},
|
|
363
563
|
{
|
|
364
|
-
function: "
|
|
564
|
+
function: "validate_default_value",
|
|
365
565
|
level: "warning",
|
|
366
|
-
message: "
|
|
367
|
-
},
|
|
368
|
-
{
|
|
369
|
-
function: "validate_value_length",
|
|
370
|
-
level: "error",
|
|
371
|
-
message: "must not contain more than 1 value"
|
|
372
|
-
},
|
|
373
|
-
{
|
|
374
|
-
function: "validate_water_measurements",
|
|
375
|
-
level: "error",
|
|
376
|
-
message: "must specify water type for ponds"
|
|
377
|
-
},
|
|
378
|
-
{
|
|
379
|
-
function: "validate_water_salinity",
|
|
380
|
-
level: "error",
|
|
381
|
-
message: "invalid water salinity"
|
|
382
|
-
},
|
|
383
|
-
{
|
|
384
|
-
function: "validate_soil_type_consistency",
|
|
385
|
-
level: "error",
|
|
386
|
-
message: "measurements for the same termType must be consistent"
|
|
387
|
-
},
|
|
388
|
-
{
|
|
389
|
-
function: "validate_characterisedIndicator_model",
|
|
390
|
-
level: "error",
|
|
391
|
-
message: "is not allowed for this characterisedIndicator"
|
|
566
|
+
message: "should be within percentage of default value"
|
|
392
567
|
},
|
|
393
568
|
{
|
|
394
|
-
function: "
|
|
569
|
+
function: "validate_date_lt_today",
|
|
395
570
|
level: "error",
|
|
396
|
-
message: "must be
|
|
571
|
+
message: "must be before today"
|
|
397
572
|
},
|
|
398
573
|
{
|
|
399
|
-
function: "
|
|
574
|
+
function: "validate_node_dates",
|
|
400
575
|
level: "error",
|
|
401
|
-
message: "must be
|
|
576
|
+
message: "must be greater than startDate"
|
|
402
577
|
},
|
|
403
578
|
{
|
|
404
|
-
function: "
|
|
579
|
+
function: "validate_node_dates",
|
|
405
580
|
level: "error",
|
|
406
|
-
message: "
|
|
581
|
+
message: "must be in the same format as endDate"
|
|
407
582
|
},
|
|
408
583
|
{
|
|
409
|
-
function: "
|
|
584
|
+
function: "validate_list_dates",
|
|
410
585
|
level: "error",
|
|
411
|
-
message: "
|
|
586
|
+
message: "must be greater than startDate"
|
|
412
587
|
},
|
|
413
588
|
{
|
|
414
|
-
function: "
|
|
589
|
+
function: "validate_list_dates_format",
|
|
415
590
|
level: "error",
|
|
416
|
-
message: "
|
|
591
|
+
message: "must have the same length as endDate"
|
|
417
592
|
},
|
|
418
593
|
{
|
|
419
|
-
function: "
|
|
594
|
+
function: "validate_list_dates_length",
|
|
420
595
|
level: "error",
|
|
421
|
-
message: "
|
|
596
|
+
message: "must contain as many items as values"
|
|
422
597
|
},
|
|
423
598
|
{
|
|
424
|
-
function: "
|
|
599
|
+
function: "validate_list_value_between_min_max",
|
|
425
600
|
level: "error",
|
|
426
|
-
message: "must be
|
|
601
|
+
message: "must be between min and max"
|
|
427
602
|
},
|
|
428
603
|
{
|
|
429
|
-
function: "
|
|
604
|
+
function: "validate_list_min_below_max",
|
|
430
605
|
level: "error",
|
|
431
|
-
message: "must
|
|
606
|
+
message: "must be greater than min"
|
|
432
607
|
},
|
|
433
608
|
{
|
|
434
|
-
function: "
|
|
609
|
+
function: "validate_list_min_max_lookup",
|
|
435
610
|
level: "error",
|
|
436
|
-
message: "must be
|
|
611
|
+
message: "must be above the minimum"
|
|
437
612
|
},
|
|
438
613
|
{
|
|
439
|
-
function: "
|
|
614
|
+
function: "validate_list_min_max_lookup",
|
|
440
615
|
level: "error",
|
|
441
|
-
message: "must
|
|
616
|
+
message: "must be below the maximum"
|
|
442
617
|
},
|
|
443
618
|
{
|
|
444
|
-
function: "
|
|
619
|
+
function: "validate_region_list_value_diff_property_lookup",
|
|
445
620
|
level: "warning",
|
|
446
|
-
message: "should
|
|
621
|
+
message: "should be within acceptable range of the lookup value"
|
|
447
622
|
},
|
|
448
623
|
{
|
|
449
|
-
function: "
|
|
450
|
-
level: "
|
|
451
|
-
message: "
|
|
624
|
+
function: "validate_list_term_percent",
|
|
625
|
+
level: "warning",
|
|
626
|
+
message: "may be between 0 and 100"
|
|
452
627
|
},
|
|
453
628
|
{
|
|
454
|
-
function: "
|
|
629
|
+
function: "validate_list_term_percent",
|
|
455
630
|
level: "error",
|
|
456
|
-
message: "
|
|
631
|
+
message: "should be between 0 and 100 (percentage)"
|
|
457
632
|
},
|
|
458
633
|
{
|
|
459
|
-
function: "
|
|
634
|
+
function: "validate_list_percent_requires_value",
|
|
460
635
|
level: "error",
|
|
461
|
-
message: "
|
|
636
|
+
message: "should have required property 'value'"
|
|
462
637
|
},
|
|
463
638
|
{
|
|
464
|
-
function: "
|
|
639
|
+
function: "validate_list_valueType",
|
|
465
640
|
level: "error",
|
|
466
|
-
message: "
|
|
641
|
+
message: "the node value type is incorrect"
|
|
467
642
|
},
|
|
468
643
|
{
|
|
469
|
-
function: "
|
|
644
|
+
function: "validate_list_has_properties",
|
|
470
645
|
level: "warning",
|
|
471
|
-
message: "should
|
|
646
|
+
message: "should add missing properties"
|
|
472
647
|
},
|
|
473
648
|
{
|
|
474
|
-
function: "
|
|
649
|
+
function: "validate_is_region",
|
|
475
650
|
level: "error",
|
|
476
|
-
message: "
|
|
651
|
+
message: "must not be a country"
|
|
477
652
|
},
|
|
478
653
|
{
|
|
479
|
-
function: "
|
|
654
|
+
function: "validate_region_in_country",
|
|
480
655
|
level: "error",
|
|
481
|
-
message: "
|
|
656
|
+
message: "must be within the country"
|
|
482
657
|
},
|
|
483
658
|
{
|
|
484
|
-
function: "
|
|
659
|
+
function: "validate_country",
|
|
485
660
|
level: "error",
|
|
486
|
-
message: "
|
|
661
|
+
message: "must be a country"
|
|
487
662
|
},
|
|
488
663
|
{
|
|
489
|
-
function: "
|
|
664
|
+
function: "validate_coordinates",
|
|
490
665
|
level: "error",
|
|
491
|
-
message: "
|
|
666
|
+
message: "does not contain latitude and longitude"
|
|
492
667
|
},
|
|
493
668
|
{
|
|
494
|
-
function: "
|
|
495
|
-
level: "
|
|
496
|
-
message: "should be
|
|
669
|
+
function: "validate_area",
|
|
670
|
+
level: "warning",
|
|
671
|
+
message: "should be equal to boundary"
|
|
497
672
|
},
|
|
498
673
|
{
|
|
499
|
-
function: "
|
|
674
|
+
function: "validate_boundary_area",
|
|
500
675
|
level: "warning",
|
|
501
|
-
message: "should
|
|
676
|
+
message: "boundaryArea should be lower than max size"
|
|
502
677
|
},
|
|
503
678
|
{
|
|
504
|
-
function: "
|
|
505
|
-
level: "
|
|
506
|
-
message: "
|
|
679
|
+
function: "validate_region_size",
|
|
680
|
+
level: "warning",
|
|
681
|
+
message: "should be lower than max size"
|
|
507
682
|
},
|
|
508
683
|
{
|
|
509
|
-
function: "
|
|
684
|
+
function: "validate_empty_fields",
|
|
510
685
|
level: "warning",
|
|
511
|
-
message: "
|
|
686
|
+
message: "may not be empty"
|
|
512
687
|
},
|
|
513
688
|
{
|
|
514
|
-
function: "
|
|
515
|
-
level: "
|
|
516
|
-
message: "should
|
|
689
|
+
function: "validate_linked_source_privacy",
|
|
690
|
+
level: "error",
|
|
691
|
+
message: "should have the same privacy as the related source"
|
|
517
692
|
},
|
|
518
693
|
{
|
|
519
|
-
function: "
|
|
694
|
+
function: "validate_private_has_source",
|
|
520
695
|
level: "warning",
|
|
521
|
-
message: "should add
|
|
696
|
+
message: "should add a source"
|
|
522
697
|
},
|
|
523
698
|
{
|
|
524
|
-
function: "
|
|
699
|
+
function: "_validate_list_model",
|
|
525
700
|
level: "error",
|
|
526
|
-
message: "
|
|
701
|
+
message: "the value provided is not consistent with the model result"
|
|
527
702
|
},
|
|
528
703
|
{
|
|
529
|
-
function: "
|
|
530
|
-
level: "
|
|
531
|
-
message: "
|
|
704
|
+
function: "validate_duplicated_terms",
|
|
705
|
+
level: "warning",
|
|
706
|
+
message: "should not use several terms describing the same product"
|
|
532
707
|
},
|
|
533
708
|
{
|
|
534
|
-
function: "
|
|
709
|
+
function: "validate_other_model",
|
|
535
710
|
level: "error",
|
|
536
|
-
message: "is
|
|
711
|
+
message: "is required when using other model"
|
|
537
712
|
},
|
|
538
713
|
{
|
|
539
|
-
function: "
|
|
540
|
-
level: "
|
|
541
|
-
message: "
|
|
714
|
+
function: "validate_nested_existing_node",
|
|
715
|
+
level: "warning",
|
|
716
|
+
message: "should not link to an existing node"
|
|
542
717
|
},
|
|
543
718
|
{
|
|
544
|
-
function: "
|
|
545
|
-
level: "
|
|
546
|
-
message: "
|
|
719
|
+
function: "validate_nested_existing_node",
|
|
720
|
+
level: "warning",
|
|
721
|
+
message: "should not link to an existing node"
|
|
547
722
|
},
|
|
548
723
|
{
|
|
549
|
-
function: "
|
|
724
|
+
function: "validate_cycle_dates",
|
|
550
725
|
level: "error",
|
|
551
|
-
message: "
|
|
726
|
+
message: "multiple cycles on the same site cannot overlap"
|
|
552
727
|
},
|
|
553
728
|
{
|
|
554
|
-
function: "
|
|
555
|
-
level: "
|
|
556
|
-
message: "
|
|
729
|
+
function: "validate_cycles_linked_ia",
|
|
730
|
+
level: "error",
|
|
731
|
+
message: "cycles linked together cannot be added to the same site"
|
|
557
732
|
},
|
|
558
733
|
{
|
|
559
734
|
function: "validate_economicValueShare",
|
|
@@ -605,91 +780,6 @@ var validations = [
|
|
|
605
780
|
level: "error",
|
|
606
781
|
message: "requires a water salinity measurement"
|
|
607
782
|
},
|
|
608
|
-
{
|
|
609
|
-
function: "validate_has_animals",
|
|
610
|
-
level: "warning",
|
|
611
|
-
message: "should specify the herd composition"
|
|
612
|
-
},
|
|
613
|
-
{
|
|
614
|
-
function: "validate_duplicated_feed_inputs",
|
|
615
|
-
level: "error",
|
|
616
|
-
message: "must not add the feed input to the Cycle as well"
|
|
617
|
-
},
|
|
618
|
-
{
|
|
619
|
-
function: "validate_has_milkYieldPractice",
|
|
620
|
-
level: "warning",
|
|
621
|
-
message: "should specify the a milkYield practice"
|
|
622
|
-
},
|
|
623
|
-
{
|
|
624
|
-
function: "validate_animal_has_recommended_products",
|
|
625
|
-
level: "warning",
|
|
626
|
-
message: "should specify a recommended product"
|
|
627
|
-
},
|
|
628
|
-
{
|
|
629
|
-
function: "validate_must_include_id",
|
|
630
|
-
level: "warning",
|
|
631
|
-
message: "should add missing inputs"
|
|
632
|
-
},
|
|
633
|
-
{
|
|
634
|
-
function: "validate_compound_fertiliser_composition",
|
|
635
|
-
level: "warning",
|
|
636
|
-
message: "should match the nutrient ratio of the compound fertiliser"
|
|
637
|
-
},
|
|
638
|
-
{
|
|
639
|
-
function: "validate_related_impacts",
|
|
640
|
-
level: "error",
|
|
641
|
-
message: "can not be linked to the same type"
|
|
642
|
-
},
|
|
643
|
-
{
|
|
644
|
-
function: "validate_related_impact_product",
|
|
645
|
-
level: "error",
|
|
646
|
-
message: "can not be linked to a different term"
|
|
647
|
-
},
|
|
648
|
-
{
|
|
649
|
-
function: "_validate_input_value",
|
|
650
|
-
level: "warning",
|
|
651
|
-
message: "is outside confidence interval"
|
|
652
|
-
},
|
|
653
|
-
{
|
|
654
|
-
function: "validate_animalFeed_requires_isAnimalFeed",
|
|
655
|
-
level: "error",
|
|
656
|
-
message: "must specify is it an animal feed"
|
|
657
|
-
},
|
|
658
|
-
{
|
|
659
|
-
function: "validate_isAnimalFeed_animal_cycle",
|
|
660
|
-
level: "error",
|
|
661
|
-
message: "isAnimalFeed not allowed on a non-animal cycle"
|
|
662
|
-
},
|
|
663
|
-
{
|
|
664
|
-
function: "validate_saplings",
|
|
665
|
-
level: "error",
|
|
666
|
-
message: "saplings cannot be used as an input here"
|
|
667
|
-
},
|
|
668
|
-
{
|
|
669
|
-
function: "validate_seed",
|
|
670
|
-
level: "error",
|
|
671
|
-
message: "seed cannot be used as an input here"
|
|
672
|
-
},
|
|
673
|
-
{
|
|
674
|
-
function: "validate_saplings_depreciated",
|
|
675
|
-
level: "error",
|
|
676
|
-
message: "saplingsDepreciatedAmountPerCycle cannot be used as an input here"
|
|
677
|
-
},
|
|
678
|
-
{
|
|
679
|
-
function: "validate_material_depreciated",
|
|
680
|
-
level: "error",
|
|
681
|
-
message: "must use the depreciated term"
|
|
682
|
-
},
|
|
683
|
-
{
|
|
684
|
-
function: "validate_input_is_product",
|
|
685
|
-
level: "error",
|
|
686
|
-
message: "must be a product"
|
|
687
|
-
},
|
|
688
|
-
{
|
|
689
|
-
function: "validate_input_unspecified_term",
|
|
690
|
-
level: "warning",
|
|
691
|
-
message: "should use a specific term"
|
|
692
|
-
},
|
|
693
783
|
{
|
|
694
784
|
function: "_validate_all_values",
|
|
695
785
|
level: "warning",
|
|
@@ -734,81 +824,6 @@ var validations = [
|
|
|
734
824
|
function: "validate_coverage",
|
|
735
825
|
level: "warning",
|
|
736
826
|
message: "can not calculate all emissions"
|
|
737
|
-
},
|
|
738
|
-
{
|
|
739
|
-
function: "validate_has_termType",
|
|
740
|
-
level: "warning",
|
|
741
|
-
message: "should contain at least one management node"
|
|
742
|
-
},
|
|
743
|
-
{
|
|
744
|
-
function: "validate_fallow_dates",
|
|
745
|
-
level: "error",
|
|
746
|
-
message: "duration must be in specified interval"
|
|
747
|
-
},
|
|
748
|
-
{
|
|
749
|
-
function: "validate_cycles_overlap",
|
|
750
|
-
level: "error",
|
|
751
|
-
message: "management date must be before cycle start date"
|
|
752
|
-
},
|
|
753
|
-
{
|
|
754
|
-
function: "validate_cycle_dates",
|
|
755
|
-
level: "error",
|
|
756
|
-
message: "multiple cycles on the same site cannot overlap"
|
|
757
|
-
},
|
|
758
|
-
{
|
|
759
|
-
function: "validate_cycles_linked_ia",
|
|
760
|
-
level: "error",
|
|
761
|
-
message: "cycles linked together cannot be added to the same site"
|
|
762
|
-
},
|
|
763
|
-
{
|
|
764
|
-
function: "validate_linked_impactAssessment",
|
|
765
|
-
level: "error",
|
|
766
|
-
message: "must be linked to a verified country-level Impact Assessment"
|
|
767
|
-
},
|
|
768
|
-
{
|
|
769
|
-
function: "validate_plantation_practices",
|
|
770
|
-
level: "error",
|
|
771
|
-
message: "must include practices for plantation weighting"
|
|
772
|
-
},
|
|
773
|
-
{
|
|
774
|
-
function: "validate_id",
|
|
775
|
-
level: "error",
|
|
776
|
-
message: "aggregation id must contain a product, region, start, end year, and a timestamp"
|
|
777
|
-
},
|
|
778
|
-
{
|
|
779
|
-
function: "_validate_previous_transformationId",
|
|
780
|
-
level: "error",
|
|
781
|
-
message: "must point to a previous transformation in the list"
|
|
782
|
-
},
|
|
783
|
-
{
|
|
784
|
-
function: "_validate_previous_input",
|
|
785
|
-
level: "error",
|
|
786
|
-
message: "at least one Input must be a Product of the Cycle"
|
|
787
|
-
},
|
|
788
|
-
{
|
|
789
|
-
function: "_validate_previous_input",
|
|
790
|
-
level: "error",
|
|
791
|
-
message: "at least one Input must be a Product of the previous Transformation"
|
|
792
|
-
},
|
|
793
|
-
{
|
|
794
|
-
function: "_validate_previous_product_value",
|
|
795
|
-
level: "error",
|
|
796
|
-
message: "must be equal to previous product multiplied by the share"
|
|
797
|
-
},
|
|
798
|
-
{
|
|
799
|
-
function: "validate_linked_emission",
|
|
800
|
-
level: "warning",
|
|
801
|
-
message: "should be linked to an emission in the Cycle"
|
|
802
|
-
},
|
|
803
|
-
{
|
|
804
|
-
function: "validate_excreta_inputs_products",
|
|
805
|
-
level: "error",
|
|
806
|
-
message: "must be included as an Input"
|
|
807
|
-
},
|
|
808
|
-
{
|
|
809
|
-
function: "validate_transformation_inputs_value",
|
|
810
|
-
level: "error",
|
|
811
|
-
message: "must be specified for multiple Inputs with the same term"
|
|
812
827
|
}
|
|
813
828
|
];
|
|
814
829
|
|
|
@@ -2227,11 +2242,31 @@ var createErrorFormatter = ({ renderer: r, urls }) => {
|
|
|
2227
2242
|
name: "Cover crop"
|
|
2228
2243
|
}
|
|
2229
2244
|
)} Practice.`,
|
|
2230
|
-
"saplingsDepreciatedAmountPerCycle cannot be used as an input here": ({ params }) =>
|
|
2231
|
-
id:
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2245
|
+
"saplingsDepreciatedAmountPerCycle cannot be used as an input here": ({ params, dataPath }) => {
|
|
2246
|
+
const otherTerms = `a more suitable term, e.g. ${termLink({ id: "seed", name: "Seed" })} (in kg) or ${termLink({
|
|
2247
|
+
id: "seedlings",
|
|
2248
|
+
name: "Seedlings"
|
|
2249
|
+
})} (in number)`;
|
|
2250
|
+
return (dataPath == null ? void 0 : dataPath.endsWith(".correspondingSpecies")) ? `Only plantation crops can be grown from saplings, and the ${code("correspondingSpecies")} of this Input, ${termLink({
|
|
2251
|
+
id: String(params.current),
|
|
2252
|
+
name: humanizeTermId(String(params.current))
|
|
2253
|
+
})}, is not a plantation.
|
|
2254
|
+
Link the saplings to the plantation they were planted for, or record the planting material of ${code(
|
|
2255
|
+
params.current
|
|
2256
|
+
)} with ${otherTerms}.` : `Only plantation crops can be grown from saplings. If your Cycle has no plantation crops, replace ${code(
|
|
2257
|
+
params.current
|
|
2258
|
+
)} with ${otherTerms}.
|
|
2259
|
+
If this is a case of intercropping, add the relevant ${code(TermTermType.landCover)} Practices to the Cycle.`;
|
|
2260
|
+
},
|
|
2261
|
+
"must specify correspondingSpecies in intercropping": ({ params }) => {
|
|
2262
|
+
var _a, _b;
|
|
2263
|
+
return `${code(TermTermType.seed)} completeness is set to ${code(false)}, but this ${code(
|
|
2264
|
+
((_a = params.term) == null ? void 0 : _a.name) || ((_b = params.term) == null ? void 0 : _b["@id"])
|
|
2265
|
+
)} Input has a value and no ${code("correspondingSpecies")}, so it is counted as the seed of every intercropped species.
|
|
2266
|
+
If the value only refers to one species, set its ${code("correspondingSpecies")} to one of ${joinValues(
|
|
2267
|
+
params.expected
|
|
2268
|
+
)}. If it refers to the total seed planted, set ${code(TermTermType.seed)} completeness to ${code(true)}.`;
|
|
2269
|
+
},
|
|
2235
2270
|
"must use the depreciated term": ({ params }) => {
|
|
2236
2271
|
var _a, _b;
|
|
2237
2272
|
return `${code(
|
|
@@ -2314,6 +2349,31 @@ var createErrorFormatter = ({ renderer: r, urls }) => {
|
|
|
2314
2349
|
${(_b = causes[params == null ? void 0 : params.cause]) != null ? _b : ""}
|
|
2315
2350
|
Please check that both Inputs are the amounts of each nutrient applied with this fertiliser.`;
|
|
2316
2351
|
},
|
|
2352
|
+
"should not be proportional to the site area": ({ params }) => {
|
|
2353
|
+
var _a, _b;
|
|
2354
|
+
return `Across the ${code(params == null ? void 0 : params.count)} Cycles of this upload with the same source, country and primary Product (this one and the others after it), the value of ${termLink(
|
|
2355
|
+
{ id: (_a = params == null ? void 0 : params.term) == null ? void 0 : _a["@id"], name: (_b = params == null ? void 0 : params.term) == null ? void 0 : _b.name }
|
|
2356
|
+
)} rises with the ${schemaLink("Site#area", "area")} of the Site (a rank correlation of ${code(
|
|
2357
|
+
params == null ? void 0 : params.correlation
|
|
2358
|
+
)}), and dividing it by the area makes the values more consistent, with a median of ${code(
|
|
2359
|
+
params == null ? void 0 : params.expected
|
|
2360
|
+
)} per hectare.
|
|
2361
|
+
A value per hectare does not depend on the size of the field, so these values may be totals for each field.
|
|
2362
|
+
Please check they are given per hectare in every one of these Cycles, dividing them by the ${code(
|
|
2363
|
+
"area"
|
|
2364
|
+
)} of the Site if needed.`;
|
|
2365
|
+
},
|
|
2366
|
+
"should be the amount of nutrient, not of fertiliser": ({ params }) => {
|
|
2367
|
+
const nutrients = ["kg N", "kg P2O5", "kg K2O"];
|
|
2368
|
+
const amounts = (values) => (values != null ? values : []).map((value, index) => `${code(value)} ${nutrients[index]}`).join(r.inlineSeparator);
|
|
2369
|
+
return `This Cycle and ${code(
|
|
2370
|
+
(params == null ? void 0 : params.count) - 1
|
|
2371
|
+
)} others of this upload with the same source, country and primary Product give round amounts of nutrients in one fixed ratio, here ${amounts(
|
|
2372
|
+
params == null ? void 0 : params.current
|
|
2373
|
+
)} per hectare, far above the usual rates for this crop in this country (${amounts(params == null ? void 0 : params.expected)}).
|
|
2374
|
+
These may be the amounts of compound fertiliser recorded as amounts of each nutrient.
|
|
2375
|
+
Please convert the amount of fertiliser into the amount of each nutrient it contains, using its composition, in every one of these Cycles.`;
|
|
2376
|
+
},
|
|
2317
2377
|
"the property value type is incorrect": ({ params: { expected } }) => `The value must be a ${expected}.`,
|
|
2318
2378
|
"the node value type is incorrect": ({ params: { expected } }) => `The value must be a ${expected}.`,
|
|
2319
2379
|
"can not be linked to the same type": ({ params: { current } }) => `Cannot be linked to the same ${current}.`,
|