@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
package/index.js
CHANGED
|
@@ -14,384 +14,374 @@ __export(validation_exports, {
|
|
|
14
14
|
});
|
|
15
15
|
var validations = [
|
|
16
16
|
{
|
|
17
|
-
function: "
|
|
17
|
+
function: "validate_id",
|
|
18
18
|
level: "error",
|
|
19
|
-
message: "must
|
|
19
|
+
message: "aggregation id must contain a product, region, start, end year, and a timestamp"
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
|
-
function: "
|
|
23
|
-
level: "
|
|
24
|
-
message: "
|
|
22
|
+
function: "validate_has_termType",
|
|
23
|
+
level: "warning",
|
|
24
|
+
message: "should contain at least one management node"
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
|
-
function: "
|
|
27
|
+
function: "validate_fallow_dates",
|
|
28
28
|
level: "error",
|
|
29
|
-
message: "must be in
|
|
29
|
+
message: "duration must be in specified interval"
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
|
-
function: "
|
|
32
|
+
function: "validate_cycles_overlap",
|
|
33
33
|
level: "error",
|
|
34
|
-
message: "must be
|
|
34
|
+
message: "management date must be before cycle start date"
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
|
-
function: "
|
|
37
|
+
function: "validate_functionalUnit_not_1_ha",
|
|
38
38
|
level: "error",
|
|
39
|
-
message: "must
|
|
39
|
+
message: "must not be equal to 1 ha"
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
|
-
function: "
|
|
42
|
+
function: "validate_sum_aboveGroundCropResidue",
|
|
43
43
|
level: "error",
|
|
44
|
-
message: "must
|
|
44
|
+
message: "must be more than or equal to other crop residues"
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
|
-
function: "
|
|
47
|
+
function: "validate_crop_residue_complete",
|
|
48
48
|
level: "error",
|
|
49
|
-
message: "must
|
|
49
|
+
message: "must specify the fate of cropResidue"
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
|
-
function: "
|
|
52
|
+
function: "validate_crop_residue_incomplete",
|
|
53
|
+
level: "warning",
|
|
54
|
+
message: "should specify the fate of cropResidue"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
function: "validate_cycleDuration",
|
|
53
58
|
level: "error",
|
|
54
|
-
message: "must be
|
|
59
|
+
message: "must be one year prior to endDate"
|
|
55
60
|
},
|
|
56
61
|
{
|
|
57
|
-
function: "
|
|
62
|
+
function: "validate_cycleDuration",
|
|
58
63
|
level: "error",
|
|
59
|
-
message: "must
|
|
64
|
+
message: "must equal to endDate - startDate in days"
|
|
60
65
|
},
|
|
61
66
|
{
|
|
62
|
-
function: "
|
|
67
|
+
function: "validate_harvestedArea",
|
|
63
68
|
level: "error",
|
|
64
|
-
message: "must be
|
|
69
|
+
message: "must be lower or equal to siteArea"
|
|
65
70
|
},
|
|
66
71
|
{
|
|
67
|
-
function: "
|
|
68
|
-
level: "
|
|
69
|
-
message: "
|
|
72
|
+
function: "validate_maximum_cycleDuration",
|
|
73
|
+
level: "error",
|
|
74
|
+
message: "must be below maximum cycleDuration"
|
|
70
75
|
},
|
|
71
76
|
{
|
|
72
|
-
function: "
|
|
77
|
+
function: "validate_riceGrainInHuskFlooded_minimum_cycleDuration",
|
|
73
78
|
level: "warning",
|
|
74
|
-
message: "
|
|
79
|
+
message: "should be more than the cropping duration"
|
|
75
80
|
},
|
|
76
81
|
{
|
|
77
|
-
function: "
|
|
82
|
+
function: "validate_crop_siteDuration",
|
|
78
83
|
level: "error",
|
|
79
|
-
message: "should be
|
|
84
|
+
message: "should be equal to cycleDuration for crop"
|
|
80
85
|
},
|
|
81
86
|
{
|
|
82
|
-
function: "
|
|
87
|
+
function: "validate_crop_siteDuration",
|
|
83
88
|
level: "error",
|
|
84
|
-
message: "should
|
|
89
|
+
message: "should be greater than cycleDuration for crop"
|
|
85
90
|
},
|
|
86
91
|
{
|
|
87
|
-
function: "
|
|
92
|
+
function: "validate_animal_siteDuration",
|
|
88
93
|
level: "error",
|
|
89
|
-
message: "
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
function: "validate_list_has_properties",
|
|
93
|
-
level: "warning",
|
|
94
|
-
message: "should add missing properties"
|
|
94
|
+
message: "should be equal to cycleDuration for animals"
|
|
95
95
|
},
|
|
96
96
|
{
|
|
97
|
-
function: "
|
|
97
|
+
function: "validate_animal_siteDuration",
|
|
98
98
|
level: "error",
|
|
99
|
-
message: "
|
|
99
|
+
message: "should be equal to cycleDuration - otherSitesDuration for animals"
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
|
-
function: "
|
|
102
|
+
function: "validate_animal_siteDuration",
|
|
103
103
|
level: "error",
|
|
104
|
-
message: "
|
|
104
|
+
message: "should be less than cycleDuration for animals"
|
|
105
105
|
},
|
|
106
106
|
{
|
|
107
|
-
function: "
|
|
108
|
-
level: "
|
|
109
|
-
message: "
|
|
107
|
+
function: "validate_durations",
|
|
108
|
+
level: "warning",
|
|
109
|
+
message: "should add the fields for a relative cycle"
|
|
110
110
|
},
|
|
111
111
|
{
|
|
112
|
-
function: "
|
|
112
|
+
function: "validate_possibleCoverCrop",
|
|
113
113
|
level: "error",
|
|
114
|
-
message: "
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
function: "validate_area",
|
|
118
|
-
level: "warning",
|
|
119
|
-
message: "should be equal to boundary"
|
|
114
|
+
message: "cover crop cycle contains non cover crop product"
|
|
120
115
|
},
|
|
121
116
|
{
|
|
122
|
-
function: "
|
|
117
|
+
function: "validate_set_treatment",
|
|
123
118
|
level: "warning",
|
|
124
|
-
message: "
|
|
119
|
+
message: "should specify a treatment when experimentDesign is specified"
|
|
125
120
|
},
|
|
126
121
|
{
|
|
127
|
-
function: "
|
|
122
|
+
function: "validate_products_animals",
|
|
128
123
|
level: "warning",
|
|
129
|
-
message: "should
|
|
124
|
+
message: "should not specify both liveAnimal and animalProduct"
|
|
130
125
|
},
|
|
131
126
|
{
|
|
132
|
-
function: "
|
|
127
|
+
function: "validate_stocking_density",
|
|
133
128
|
level: "warning",
|
|
134
|
-
message: "
|
|
129
|
+
message: "should add the term stockingDensityPermanentPastureAverage"
|
|
135
130
|
},
|
|
136
131
|
{
|
|
137
|
-
function: "
|
|
132
|
+
function: "validate_linked_impact_assessment",
|
|
138
133
|
level: "error",
|
|
139
|
-
message: "
|
|
134
|
+
message: "multiple ImpactAssessment are associated with this Product"
|
|
140
135
|
},
|
|
141
136
|
{
|
|
142
|
-
function: "
|
|
143
|
-
level: "
|
|
144
|
-
message: "
|
|
137
|
+
function: "validate_linked_impact_assessment",
|
|
138
|
+
level: "error",
|
|
139
|
+
message: "no ImpactAssessment are associated with this Product"
|
|
145
140
|
},
|
|
146
141
|
{
|
|
147
|
-
function: "
|
|
142
|
+
function: "validate_animal_product_mapping",
|
|
148
143
|
level: "error",
|
|
149
|
-
message: "
|
|
144
|
+
message: "is not an allowed animalProduct"
|
|
150
145
|
},
|
|
151
146
|
{
|
|
152
|
-
function: "
|
|
153
|
-
level: "
|
|
154
|
-
message: "
|
|
147
|
+
function: "validate_requires_substrate",
|
|
148
|
+
level: "error",
|
|
149
|
+
message: "must add substrate inputs"
|
|
155
150
|
},
|
|
156
151
|
{
|
|
157
|
-
function: "
|
|
152
|
+
function: "_validate_previous_transformationId",
|
|
158
153
|
level: "error",
|
|
159
|
-
message: "
|
|
154
|
+
message: "must point to a previous transformation in the list"
|
|
160
155
|
},
|
|
161
156
|
{
|
|
162
|
-
function: "
|
|
163
|
-
level: "
|
|
164
|
-
message: "
|
|
157
|
+
function: "_validate_previous_input",
|
|
158
|
+
level: "error",
|
|
159
|
+
message: "at least one Input must be a Product of the Cycle"
|
|
165
160
|
},
|
|
166
161
|
{
|
|
167
|
-
function: "
|
|
168
|
-
level: "
|
|
169
|
-
message: "
|
|
162
|
+
function: "_validate_previous_input",
|
|
163
|
+
level: "error",
|
|
164
|
+
message: "at least one Input must be a Product of the previous Transformation"
|
|
170
165
|
},
|
|
171
166
|
{
|
|
172
|
-
function: "
|
|
167
|
+
function: "_validate_previous_product_value",
|
|
173
168
|
level: "error",
|
|
174
|
-
message: "must equal to
|
|
169
|
+
message: "must be equal to previous product multiplied by the share"
|
|
175
170
|
},
|
|
176
171
|
{
|
|
177
|
-
function: "
|
|
172
|
+
function: "validate_linked_emission",
|
|
178
173
|
level: "warning",
|
|
179
|
-
message: "should
|
|
174
|
+
message: "should be linked to an emission in the Cycle"
|
|
180
175
|
},
|
|
181
176
|
{
|
|
182
|
-
function: "
|
|
183
|
-
level: "
|
|
184
|
-
message: "
|
|
177
|
+
function: "validate_excreta_inputs_products",
|
|
178
|
+
level: "error",
|
|
179
|
+
message: "must be included as an Input"
|
|
185
180
|
},
|
|
186
181
|
{
|
|
187
|
-
function: "
|
|
188
|
-
level: "
|
|
189
|
-
message: "
|
|
182
|
+
function: "validate_transformation_inputs_value",
|
|
183
|
+
level: "error",
|
|
184
|
+
message: "must be specified for multiple Inputs with the same term"
|
|
190
185
|
},
|
|
191
186
|
{
|
|
192
|
-
function: "
|
|
187
|
+
function: "validate_empty",
|
|
193
188
|
level: "error",
|
|
194
|
-
message: "
|
|
189
|
+
message: "should not be empty"
|
|
195
190
|
},
|
|
196
191
|
{
|
|
197
|
-
function: "
|
|
192
|
+
function: "validate_linked_cycle_product",
|
|
198
193
|
level: "error",
|
|
199
|
-
message: "
|
|
194
|
+
message: "should be included in the cycle products"
|
|
200
195
|
},
|
|
201
196
|
{
|
|
202
|
-
function: "
|
|
197
|
+
function: "validate_linked_cycle_endDate",
|
|
198
|
+
level: "error",
|
|
199
|
+
message: "must be equal to the Cycle endDate"
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
function: "validate_value_follows_area",
|
|
203
203
|
level: "warning",
|
|
204
|
-
message: "should
|
|
204
|
+
message: "should not be proportional to the site area"
|
|
205
205
|
},
|
|
206
206
|
{
|
|
207
|
-
function: "
|
|
207
|
+
function: "validate_fixed_nutrient_ratio",
|
|
208
208
|
level: "warning",
|
|
209
|
-
message: "should
|
|
209
|
+
message: "should be the amount of nutrient, not of fertiliser"
|
|
210
210
|
},
|
|
211
211
|
{
|
|
212
|
-
function: "
|
|
212
|
+
function: "validate_lifespan",
|
|
213
213
|
level: "error",
|
|
214
|
-
message: "
|
|
214
|
+
message: "must equal to endDate - startDate in decimal years"
|
|
215
215
|
},
|
|
216
216
|
{
|
|
217
|
-
function: "
|
|
218
|
-
level: "
|
|
219
|
-
message: "
|
|
217
|
+
function: "validate_functionalArea",
|
|
218
|
+
level: "warning",
|
|
219
|
+
message: "should specify functionalArea or site area"
|
|
220
220
|
},
|
|
221
221
|
{
|
|
222
|
-
function: "
|
|
222
|
+
function: "validate_soilTexture",
|
|
223
223
|
level: "error",
|
|
224
|
-
message: "
|
|
224
|
+
message: "is outside the allowed range"
|
|
225
225
|
},
|
|
226
226
|
{
|
|
227
|
-
function: "
|
|
227
|
+
function: "validate_soilTexture_depths",
|
|
228
228
|
level: "warning",
|
|
229
|
-
message: "
|
|
229
|
+
message: "should be given at the same depths as the soil content"
|
|
230
230
|
},
|
|
231
231
|
{
|
|
232
|
-
function: "
|
|
232
|
+
function: "validate_depths",
|
|
233
233
|
level: "error",
|
|
234
|
-
message: "
|
|
234
|
+
message: "must be greater than or equal to depthUpper"
|
|
235
235
|
},
|
|
236
236
|
{
|
|
237
|
-
function: "
|
|
237
|
+
function: "validate_required_depths",
|
|
238
238
|
level: "error",
|
|
239
|
-
message: "
|
|
239
|
+
message: "must set both depthUpper and depthLower"
|
|
240
240
|
},
|
|
241
241
|
{
|
|
242
|
-
function: "
|
|
242
|
+
function: "validate_required_depths",
|
|
243
243
|
level: "warning",
|
|
244
|
-
message: "should
|
|
244
|
+
message: "should set both depthUpper and depthLower"
|
|
245
245
|
},
|
|
246
246
|
{
|
|
247
|
-
function: "
|
|
247
|
+
function: "validate_term_unique",
|
|
248
248
|
level: "error",
|
|
249
|
-
message: "
|
|
249
|
+
message: "must be unique"
|
|
250
250
|
},
|
|
251
251
|
{
|
|
252
|
-
function: "
|
|
252
|
+
function: "validate_term_unique",
|
|
253
253
|
level: "error",
|
|
254
|
-
message: "
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
function: "validate_liveAnimal_system",
|
|
258
|
-
level: "warning",
|
|
259
|
-
message: "should add an animal production system"
|
|
254
|
+
message: "must provide value or min and max"
|
|
260
255
|
},
|
|
261
256
|
{
|
|
262
|
-
function: "
|
|
257
|
+
function: "validate_with_models",
|
|
263
258
|
level: "warning",
|
|
264
|
-
message: "
|
|
259
|
+
message: "the measurement provided might be in error"
|
|
265
260
|
},
|
|
266
261
|
{
|
|
267
|
-
function: "
|
|
262
|
+
function: "validate_value_length",
|
|
268
263
|
level: "error",
|
|
269
|
-
message: "
|
|
264
|
+
message: "must not contain more than 1 value"
|
|
270
265
|
},
|
|
271
266
|
{
|
|
272
|
-
function: "
|
|
267
|
+
function: "validate_water_measurements",
|
|
273
268
|
level: "error",
|
|
274
|
-
message: "
|
|
269
|
+
message: "must specify water type for ponds"
|
|
275
270
|
},
|
|
276
271
|
{
|
|
277
|
-
function: "
|
|
272
|
+
function: "validate_water_salinity",
|
|
278
273
|
level: "error",
|
|
279
|
-
message: "
|
|
274
|
+
message: "invalid water salinity"
|
|
280
275
|
},
|
|
281
276
|
{
|
|
282
|
-
function: "
|
|
277
|
+
function: "validate_soil_type_consistency",
|
|
283
278
|
level: "error",
|
|
284
|
-
message: "
|
|
279
|
+
message: "measurements for the same termType must be consistent"
|
|
285
280
|
},
|
|
286
281
|
{
|
|
287
|
-
function: "
|
|
288
|
-
level: "
|
|
289
|
-
message: "
|
|
282
|
+
function: "validate_must_include_id",
|
|
283
|
+
level: "warning",
|
|
284
|
+
message: "should add missing inputs"
|
|
290
285
|
},
|
|
291
286
|
{
|
|
292
|
-
function: "
|
|
293
|
-
level: "
|
|
294
|
-
message: "
|
|
287
|
+
function: "validate_compound_fertiliser_composition",
|
|
288
|
+
level: "warning",
|
|
289
|
+
message: "should match the nutrient ratio of the compound fertiliser"
|
|
295
290
|
},
|
|
296
291
|
{
|
|
297
|
-
function: "
|
|
292
|
+
function: "validate_related_impacts",
|
|
298
293
|
level: "error",
|
|
299
|
-
message: "
|
|
294
|
+
message: "can not be linked to the same type"
|
|
300
295
|
},
|
|
301
296
|
{
|
|
302
|
-
function: "
|
|
297
|
+
function: "validate_related_impact_product",
|
|
303
298
|
level: "error",
|
|
304
|
-
message: "
|
|
299
|
+
message: "can not be linked to a different term"
|
|
305
300
|
},
|
|
306
301
|
{
|
|
307
|
-
function: "
|
|
308
|
-
level: "
|
|
309
|
-
message: "
|
|
302
|
+
function: "_validate_input_value",
|
|
303
|
+
level: "warning",
|
|
304
|
+
message: "is outside confidence interval"
|
|
310
305
|
},
|
|
311
306
|
{
|
|
312
|
-
function: "
|
|
307
|
+
function: "validate_animalFeed_requires_isAnimalFeed",
|
|
313
308
|
level: "error",
|
|
314
|
-
message: "
|
|
309
|
+
message: "must specify is it an animal feed"
|
|
315
310
|
},
|
|
316
311
|
{
|
|
317
|
-
function: "
|
|
312
|
+
function: "validate_isAnimalFeed_animal_cycle",
|
|
318
313
|
level: "error",
|
|
319
|
-
message: "
|
|
314
|
+
message: "isAnimalFeed not allowed on a non-animal cycle"
|
|
320
315
|
},
|
|
321
316
|
{
|
|
322
|
-
function: "
|
|
317
|
+
function: "validate_saplings",
|
|
323
318
|
level: "error",
|
|
324
|
-
message: "
|
|
325
|
-
},
|
|
326
|
-
{
|
|
327
|
-
function: "validate_irrigating_operation_rainfed_water_regime",
|
|
328
|
-
level: "warning",
|
|
329
|
-
message: "should use irrigated water regime"
|
|
319
|
+
message: "saplings cannot be used as an input here"
|
|
330
320
|
},
|
|
331
321
|
{
|
|
332
|
-
function: "
|
|
322
|
+
function: "validate_seed",
|
|
333
323
|
level: "error",
|
|
334
|
-
message: "
|
|
324
|
+
message: "seed cannot be used as an input here"
|
|
335
325
|
},
|
|
336
326
|
{
|
|
337
|
-
function: "
|
|
327
|
+
function: "validate_saplings_depreciated",
|
|
338
328
|
level: "error",
|
|
339
|
-
message: "
|
|
329
|
+
message: "saplingsDepreciatedAmountPerCycle cannot be used as an input here"
|
|
340
330
|
},
|
|
341
331
|
{
|
|
342
|
-
function: "
|
|
343
|
-
level: "
|
|
344
|
-
message: "
|
|
332
|
+
function: "validate_seed_correspondingSpecies",
|
|
333
|
+
level: "error",
|
|
334
|
+
message: "must specify correspondingSpecies in intercropping"
|
|
345
335
|
},
|
|
346
336
|
{
|
|
347
|
-
function: "
|
|
337
|
+
function: "validate_material_depreciated",
|
|
348
338
|
level: "error",
|
|
349
|
-
message: "must
|
|
339
|
+
message: "must use the depreciated term"
|
|
350
340
|
},
|
|
351
341
|
{
|
|
352
|
-
function: "
|
|
342
|
+
function: "validate_input_is_product",
|
|
353
343
|
level: "error",
|
|
354
|
-
message: "must
|
|
344
|
+
message: "must be a product"
|
|
355
345
|
},
|
|
356
346
|
{
|
|
357
|
-
function: "
|
|
347
|
+
function: "validate_input_unspecified_term",
|
|
358
348
|
level: "warning",
|
|
359
|
-
message: "should
|
|
360
|
-
},
|
|
361
|
-
{
|
|
362
|
-
function: "validate_term_unique",
|
|
363
|
-
level: "error",
|
|
364
|
-
message: "must be unique"
|
|
349
|
+
message: "should use a specific term"
|
|
365
350
|
},
|
|
366
351
|
{
|
|
367
|
-
function: "
|
|
368
|
-
level: "
|
|
369
|
-
message: "
|
|
352
|
+
function: "validate_method_not_relevant",
|
|
353
|
+
level: "warning",
|
|
354
|
+
message: "should not use not relevant model"
|
|
370
355
|
},
|
|
371
356
|
{
|
|
372
|
-
function: "
|
|
357
|
+
function: "validate_methodTier_not_relevant",
|
|
373
358
|
level: "warning",
|
|
374
|
-
message: "
|
|
359
|
+
message: "should not use not relevant methodTier"
|
|
375
360
|
},
|
|
376
361
|
{
|
|
377
|
-
function: "
|
|
362
|
+
function: "validate_methodTier_background",
|
|
378
363
|
level: "error",
|
|
379
|
-
message: "must not
|
|
364
|
+
message: "must not have background methodTier"
|
|
380
365
|
},
|
|
381
366
|
{
|
|
382
|
-
function: "
|
|
367
|
+
function: "validate_methodTier_background",
|
|
383
368
|
level: "error",
|
|
384
|
-
message: "must
|
|
369
|
+
message: "must be an existing term"
|
|
385
370
|
},
|
|
386
371
|
{
|
|
387
|
-
function: "
|
|
372
|
+
function: "validate_depth",
|
|
373
|
+
level: "warning",
|
|
374
|
+
message: "should set the depth"
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
function: "validate_linked_impactAssessment",
|
|
388
378
|
level: "error",
|
|
389
|
-
message: "
|
|
379
|
+
message: "must be linked to a verified country-level Impact Assessment"
|
|
390
380
|
},
|
|
391
381
|
{
|
|
392
|
-
function: "
|
|
382
|
+
function: "validate_plantation_practices",
|
|
393
383
|
level: "error",
|
|
394
|
-
message: "
|
|
384
|
+
message: "must include practices for plantation weighting"
|
|
395
385
|
},
|
|
396
386
|
{
|
|
397
387
|
function: "validate_characterisedIndicator_model",
|
|
@@ -419,134 +409,154 @@ var validations = [
|
|
|
419
409
|
message: "this field is required"
|
|
420
410
|
},
|
|
421
411
|
{
|
|
422
|
-
function: "
|
|
423
|
-
level: "
|
|
424
|
-
message: "should
|
|
412
|
+
function: "validate_has_animals",
|
|
413
|
+
level: "warning",
|
|
414
|
+
message: "should specify the herd composition"
|
|
425
415
|
},
|
|
426
416
|
{
|
|
427
|
-
function: "
|
|
417
|
+
function: "validate_duplicated_feed_inputs",
|
|
428
418
|
level: "error",
|
|
429
|
-
message: "
|
|
419
|
+
message: "must not add the feed input to the Cycle as well"
|
|
430
420
|
},
|
|
431
421
|
{
|
|
432
|
-
function: "
|
|
433
|
-
level: "
|
|
434
|
-
message: "
|
|
422
|
+
function: "validate_has_milkYieldPractice",
|
|
423
|
+
level: "warning",
|
|
424
|
+
message: "should specify the a milkYield practice"
|
|
435
425
|
},
|
|
436
426
|
{
|
|
437
|
-
function: "
|
|
427
|
+
function: "validate_animal_has_recommended_products",
|
|
428
|
+
level: "warning",
|
|
429
|
+
message: "should specify a recommended product"
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
function: "validate_defaultValue",
|
|
433
|
+
level: "warning",
|
|
434
|
+
message: "should specify a value when HESTIA has a default one"
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
function: "validate_longFallowDuration",
|
|
438
438
|
level: "error",
|
|
439
|
-
message: "must
|
|
439
|
+
message: "longFallowDuration must be lower than 5 years"
|
|
440
440
|
},
|
|
441
441
|
{
|
|
442
|
-
function: "
|
|
442
|
+
function: "validate_plantationLifespan",
|
|
443
443
|
level: "error",
|
|
444
|
-
message: "must be
|
|
444
|
+
message: "must be greater than or equal to plantationProductiveLifespan"
|
|
445
445
|
},
|
|
446
446
|
{
|
|
447
|
-
function: "
|
|
447
|
+
function: "validate_waterRegime_rice_products",
|
|
448
448
|
level: "error",
|
|
449
|
-
message: "
|
|
449
|
+
message: "rice products not allowed for this water regime practice"
|
|
450
450
|
},
|
|
451
451
|
{
|
|
452
|
-
function: "
|
|
452
|
+
function: "validate_croppingDuration_riceGrainInHuskFlooded",
|
|
453
453
|
level: "warning",
|
|
454
|
-
message: "
|
|
454
|
+
message: "croppingDuration must be between min and max"
|
|
455
455
|
},
|
|
456
456
|
{
|
|
457
|
-
function: "
|
|
457
|
+
function: "validate_excretaManagement",
|
|
458
458
|
level: "error",
|
|
459
|
-
message: "
|
|
459
|
+
message: "an excreta input is required when using an excretaManagement practice"
|
|
460
460
|
},
|
|
461
461
|
{
|
|
462
|
-
function: "
|
|
462
|
+
function: "validate_no_tillage",
|
|
463
463
|
level: "error",
|
|
464
|
-
message: "
|
|
464
|
+
message: "is not allowed in combination with noTillage"
|
|
465
465
|
},
|
|
466
466
|
{
|
|
467
|
-
function: "
|
|
467
|
+
function: "validate_tillage_site_type",
|
|
468
|
+
level: "warning",
|
|
469
|
+
message: "should contain a tillage practice"
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
function: "validate_tillage_values",
|
|
468
473
|
level: "error",
|
|
469
|
-
message: "
|
|
474
|
+
message: "cannot use no tillage if depth or number of tillages is not 0"
|
|
470
475
|
},
|
|
471
476
|
{
|
|
472
|
-
function: "
|
|
477
|
+
function: "validate_tillage_values",
|
|
473
478
|
level: "error",
|
|
474
|
-
message: "
|
|
479
|
+
message: "cannot use full tillage if depth or number of tillages is 0"
|
|
475
480
|
},
|
|
476
481
|
{
|
|
477
|
-
function: "
|
|
482
|
+
function: "validate_liveAnimal_system",
|
|
478
483
|
level: "warning",
|
|
479
|
-
message: "should
|
|
484
|
+
message: "should add an animal production system"
|
|
480
485
|
},
|
|
481
486
|
{
|
|
482
|
-
function: "
|
|
483
|
-
level: "
|
|
484
|
-
message: "should
|
|
487
|
+
function: "validate_has_pastureGrass",
|
|
488
|
+
level: "warning",
|
|
489
|
+
message: "should add the term pastureGrass"
|
|
485
490
|
},
|
|
486
491
|
{
|
|
487
|
-
function: "
|
|
492
|
+
function: "validate_pastureGrass_key_termType",
|
|
488
493
|
level: "error",
|
|
489
|
-
message: "
|
|
494
|
+
message: "pastureGrass key termType must be landCover"
|
|
490
495
|
},
|
|
491
496
|
{
|
|
492
|
-
function: "
|
|
497
|
+
function: "validate_pastureGrass_key_value",
|
|
493
498
|
level: "error",
|
|
494
|
-
message: "
|
|
499
|
+
message: "all values must be numbers"
|
|
495
500
|
},
|
|
496
501
|
{
|
|
497
|
-
function: "
|
|
502
|
+
function: "validate_pastureGrass_key_value",
|
|
498
503
|
level: "error",
|
|
499
|
-
message: "
|
|
504
|
+
message: "the sum of all pastureGrass values must be 100"
|
|
500
505
|
},
|
|
501
506
|
{
|
|
502
|
-
function: "
|
|
507
|
+
function: "validate_permanent_crop_productive_phase",
|
|
503
508
|
level: "error",
|
|
504
|
-
message: "
|
|
509
|
+
message: "must add the term productivePhasePermanentCrops"
|
|
505
510
|
},
|
|
506
511
|
{
|
|
507
|
-
function: "
|
|
508
|
-
level: "
|
|
509
|
-
message: "
|
|
512
|
+
function: "validate_primaryPercent",
|
|
513
|
+
level: "error",
|
|
514
|
+
message: "primaryPercent not allowed on this siteType"
|
|
510
515
|
},
|
|
511
516
|
{
|
|
512
|
-
function: "
|
|
517
|
+
function: "validate_primaryPercent",
|
|
513
518
|
level: "error",
|
|
514
|
-
message: "
|
|
519
|
+
message: "primaryPercent not allowed on this practice"
|
|
515
520
|
},
|
|
516
521
|
{
|
|
517
|
-
function: "
|
|
518
|
-
level: "
|
|
519
|
-
message: "
|
|
522
|
+
function: "validate_processing_operation",
|
|
523
|
+
level: "error",
|
|
524
|
+
message: "must have a primary processing operation"
|
|
520
525
|
},
|
|
521
526
|
{
|
|
522
|
-
function: "
|
|
523
|
-
level: "
|
|
524
|
-
message: "
|
|
527
|
+
function: "validate_landCover_match_products",
|
|
528
|
+
level: "error",
|
|
529
|
+
message: "at least one landCover practice must match an equivalent product"
|
|
525
530
|
},
|
|
526
531
|
{
|
|
527
|
-
function: "
|
|
528
|
-
level: "
|
|
529
|
-
message: "
|
|
532
|
+
function: "validate_coverCrop_landCover_primary_product",
|
|
533
|
+
level: "error",
|
|
534
|
+
message: "a cover crop can not be the land cover of the primary product"
|
|
530
535
|
},
|
|
531
536
|
{
|
|
532
|
-
function: "
|
|
537
|
+
function: "validate_practices_management",
|
|
533
538
|
level: "error",
|
|
534
|
-
message: "
|
|
539
|
+
message: "should match the site management node value"
|
|
535
540
|
},
|
|
536
541
|
{
|
|
537
|
-
function: "
|
|
542
|
+
function: "validate_irrigated_complete_has_inputs",
|
|
538
543
|
level: "error",
|
|
539
|
-
message: "
|
|
544
|
+
message: "must contain water inputs"
|
|
540
545
|
},
|
|
541
546
|
{
|
|
542
|
-
function: "
|
|
547
|
+
function: "validate_rainfed_water_inputs",
|
|
543
548
|
level: "error",
|
|
544
|
-
message: "
|
|
549
|
+
message: "must not set rainfed with water inputs"
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
function: "validate_irrigating_operation_rainfed_water_regime",
|
|
553
|
+
level: "warning",
|
|
554
|
+
message: "should use irrigated water regime"
|
|
545
555
|
},
|
|
546
556
|
{
|
|
547
|
-
function: "
|
|
557
|
+
function: "validate_cropResidueManagement_products",
|
|
548
558
|
level: "error",
|
|
549
|
-
message: "
|
|
559
|
+
message: "cropResidue product is not accounted for by the cropResidueManagement practices"
|
|
550
560
|
},
|
|
551
561
|
{
|
|
552
562
|
function: "validate_property_valueType",
|
|
@@ -564,259 +574,264 @@ var validations = [
|
|
|
564
574
|
message: "should be within percentage of default value"
|
|
565
575
|
},
|
|
566
576
|
{
|
|
567
|
-
function: "
|
|
577
|
+
function: "validate_date_lt_today",
|
|
568
578
|
level: "error",
|
|
569
|
-
message: "
|
|
579
|
+
message: "must be before today"
|
|
570
580
|
},
|
|
571
581
|
{
|
|
572
|
-
function: "
|
|
573
|
-
level: "
|
|
574
|
-
message: "
|
|
582
|
+
function: "validate_node_dates",
|
|
583
|
+
level: "error",
|
|
584
|
+
message: "must be greater than startDate"
|
|
575
585
|
},
|
|
576
586
|
{
|
|
577
|
-
function: "
|
|
587
|
+
function: "validate_node_dates",
|
|
578
588
|
level: "error",
|
|
579
|
-
message: "
|
|
589
|
+
message: "must be in the same format as endDate"
|
|
580
590
|
},
|
|
581
591
|
{
|
|
582
|
-
function: "
|
|
592
|
+
function: "validate_list_dates",
|
|
583
593
|
level: "error",
|
|
584
|
-
message: "
|
|
594
|
+
message: "must be greater than startDate"
|
|
585
595
|
},
|
|
586
596
|
{
|
|
587
|
-
function: "
|
|
597
|
+
function: "validate_list_dates_format",
|
|
588
598
|
level: "error",
|
|
589
|
-
message: "
|
|
599
|
+
message: "must have the same length as endDate"
|
|
590
600
|
},
|
|
591
601
|
{
|
|
592
|
-
function: "
|
|
602
|
+
function: "validate_list_dates_length",
|
|
593
603
|
level: "error",
|
|
594
|
-
message: "must
|
|
604
|
+
message: "must contain as many items as values"
|
|
595
605
|
},
|
|
596
606
|
{
|
|
597
|
-
function: "
|
|
598
|
-
level: "
|
|
599
|
-
message: "
|
|
607
|
+
function: "validate_list_value_between_min_max",
|
|
608
|
+
level: "error",
|
|
609
|
+
message: "must be between min and max"
|
|
600
610
|
},
|
|
601
611
|
{
|
|
602
|
-
function: "
|
|
603
|
-
level: "
|
|
604
|
-
message: "
|
|
612
|
+
function: "validate_list_min_below_max",
|
|
613
|
+
level: "error",
|
|
614
|
+
message: "must be greater than min"
|
|
605
615
|
},
|
|
606
616
|
{
|
|
607
|
-
function: "
|
|
617
|
+
function: "validate_list_min_max_lookup",
|
|
608
618
|
level: "error",
|
|
609
|
-
message: "
|
|
619
|
+
message: "must be above the minimum"
|
|
610
620
|
},
|
|
611
621
|
{
|
|
612
|
-
function: "
|
|
622
|
+
function: "validate_list_min_max_lookup",
|
|
613
623
|
level: "error",
|
|
614
|
-
message: "
|
|
624
|
+
message: "must be below the maximum"
|
|
615
625
|
},
|
|
616
626
|
{
|
|
617
|
-
function: "
|
|
627
|
+
function: "validate_region_list_value_diff_property_lookup",
|
|
618
628
|
level: "warning",
|
|
619
|
-
message: "should
|
|
629
|
+
message: "should be within acceptable range of the lookup value"
|
|
620
630
|
},
|
|
621
631
|
{
|
|
622
|
-
function: "
|
|
632
|
+
function: "validate_list_term_percent",
|
|
633
|
+
level: "warning",
|
|
634
|
+
message: "may be between 0 and 100"
|
|
635
|
+
},
|
|
636
|
+
{
|
|
637
|
+
function: "validate_list_term_percent",
|
|
623
638
|
level: "error",
|
|
624
|
-
message: "
|
|
639
|
+
message: "should be between 0 and 100 (percentage)"
|
|
625
640
|
},
|
|
626
641
|
{
|
|
627
|
-
function: "
|
|
628
|
-
level: "
|
|
629
|
-
message: "should
|
|
642
|
+
function: "validate_list_percent_requires_value",
|
|
643
|
+
level: "error",
|
|
644
|
+
message: "should have required property 'value'"
|
|
630
645
|
},
|
|
631
646
|
{
|
|
632
|
-
function: "
|
|
633
|
-
level: "
|
|
634
|
-
message: "
|
|
647
|
+
function: "validate_list_valueType",
|
|
648
|
+
level: "error",
|
|
649
|
+
message: "the node value type is incorrect"
|
|
635
650
|
},
|
|
636
651
|
{
|
|
637
|
-
function: "
|
|
652
|
+
function: "validate_list_has_properties",
|
|
638
653
|
level: "warning",
|
|
639
|
-
message: "should add missing
|
|
654
|
+
message: "should add missing properties"
|
|
640
655
|
},
|
|
641
656
|
{
|
|
642
|
-
function: "
|
|
643
|
-
level: "
|
|
644
|
-
message: "
|
|
657
|
+
function: "validate_is_region",
|
|
658
|
+
level: "error",
|
|
659
|
+
message: "must not be a country"
|
|
645
660
|
},
|
|
646
661
|
{
|
|
647
|
-
function: "
|
|
662
|
+
function: "validate_region_in_country",
|
|
648
663
|
level: "error",
|
|
649
|
-
message: "
|
|
664
|
+
message: "must be within the country"
|
|
650
665
|
},
|
|
651
666
|
{
|
|
652
|
-
function: "
|
|
667
|
+
function: "validate_country",
|
|
653
668
|
level: "error",
|
|
654
|
-
message: "
|
|
669
|
+
message: "must be a country"
|
|
655
670
|
},
|
|
656
671
|
{
|
|
657
|
-
function: "
|
|
672
|
+
function: "validate_coordinates",
|
|
673
|
+
level: "error",
|
|
674
|
+
message: "does not contain latitude and longitude"
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
function: "validate_area",
|
|
658
678
|
level: "warning",
|
|
659
|
-
message: "
|
|
679
|
+
message: "should be equal to boundary"
|
|
660
680
|
},
|
|
661
681
|
{
|
|
662
|
-
function: "
|
|
663
|
-
level: "
|
|
664
|
-
message: "
|
|
682
|
+
function: "validate_boundary_area",
|
|
683
|
+
level: "warning",
|
|
684
|
+
message: "boundaryArea should be lower than max size"
|
|
665
685
|
},
|
|
666
686
|
{
|
|
667
|
-
function: "
|
|
668
|
-
level: "
|
|
669
|
-
message: "
|
|
687
|
+
function: "validate_region_size",
|
|
688
|
+
level: "warning",
|
|
689
|
+
message: "should be lower than max size"
|
|
670
690
|
},
|
|
671
691
|
{
|
|
672
|
-
function: "
|
|
673
|
-
level: "
|
|
674
|
-
message: "
|
|
692
|
+
function: "validate_empty_fields",
|
|
693
|
+
level: "warning",
|
|
694
|
+
message: "may not be empty"
|
|
675
695
|
},
|
|
676
696
|
{
|
|
677
|
-
function: "
|
|
697
|
+
function: "validate_linked_source_privacy",
|
|
678
698
|
level: "error",
|
|
679
|
-
message: "
|
|
699
|
+
message: "should have the same privacy as the related source"
|
|
680
700
|
},
|
|
681
701
|
{
|
|
682
|
-
function: "
|
|
683
|
-
level: "
|
|
684
|
-
message: "
|
|
702
|
+
function: "validate_private_has_source",
|
|
703
|
+
level: "warning",
|
|
704
|
+
message: "should add a source"
|
|
685
705
|
},
|
|
686
706
|
{
|
|
687
|
-
function: "
|
|
707
|
+
function: "_validate_list_model",
|
|
688
708
|
level: "error",
|
|
689
|
-
message: "
|
|
709
|
+
message: "the value provided is not consistent with the model result"
|
|
690
710
|
},
|
|
691
711
|
{
|
|
692
|
-
function: "
|
|
712
|
+
function: "validate_duplicated_terms",
|
|
713
|
+
level: "warning",
|
|
714
|
+
message: "should not use several terms describing the same product"
|
|
715
|
+
},
|
|
716
|
+
{
|
|
717
|
+
function: "validate_other_model",
|
|
693
718
|
level: "error",
|
|
694
|
-
message: "
|
|
719
|
+
message: "is required when using other model"
|
|
695
720
|
},
|
|
696
721
|
{
|
|
697
|
-
function: "
|
|
722
|
+
function: "validate_nested_existing_node",
|
|
698
723
|
level: "warning",
|
|
699
|
-
message: "should
|
|
724
|
+
message: "should not link to an existing node"
|
|
700
725
|
},
|
|
701
726
|
{
|
|
702
|
-
function: "
|
|
727
|
+
function: "validate_nested_existing_node",
|
|
703
728
|
level: "warning",
|
|
704
|
-
message: "
|
|
729
|
+
message: "should not link to an existing node"
|
|
705
730
|
},
|
|
706
731
|
{
|
|
707
|
-
function: "
|
|
732
|
+
function: "validate_cycle_dates",
|
|
708
733
|
level: "error",
|
|
709
|
-
message: "
|
|
734
|
+
message: "multiple cycles on the same site cannot overlap"
|
|
710
735
|
},
|
|
711
736
|
{
|
|
712
|
-
function: "
|
|
737
|
+
function: "validate_cycles_linked_ia",
|
|
713
738
|
level: "error",
|
|
714
|
-
message: "
|
|
739
|
+
message: "cycles linked together cannot be added to the same site"
|
|
715
740
|
},
|
|
716
741
|
{
|
|
717
|
-
function: "
|
|
742
|
+
function: "validate_economicValueShare",
|
|
718
743
|
level: "error",
|
|
719
|
-
message: "
|
|
744
|
+
message: "economicValueShare should sum to 100 or less across all products"
|
|
720
745
|
},
|
|
721
746
|
{
|
|
722
|
-
function: "
|
|
723
|
-
level: "
|
|
724
|
-
message: "
|
|
747
|
+
function: "validate_value_empty",
|
|
748
|
+
level: "warning",
|
|
749
|
+
message: "may not be 0"
|
|
725
750
|
},
|
|
726
751
|
{
|
|
727
|
-
function: "
|
|
752
|
+
function: "validate_value_0",
|
|
728
753
|
level: "error",
|
|
729
|
-
message: "
|
|
754
|
+
message: "economicValueShare must be 0 for product value 0"
|
|
730
755
|
},
|
|
731
756
|
{
|
|
732
|
-
function: "
|
|
757
|
+
function: "validate_value_0",
|
|
733
758
|
level: "error",
|
|
734
|
-
message: "must
|
|
759
|
+
message: "revenue must be 0 for product value 0"
|
|
735
760
|
},
|
|
736
761
|
{
|
|
737
|
-
function: "
|
|
762
|
+
function: "validate_primary",
|
|
738
763
|
level: "error",
|
|
739
|
-
message: "
|
|
764
|
+
message: "only 1 primary product allowed"
|
|
740
765
|
},
|
|
741
766
|
{
|
|
742
|
-
function: "
|
|
743
|
-
level: "
|
|
744
|
-
message: "
|
|
767
|
+
function: "validate_product_ha_functional_unit_ha",
|
|
768
|
+
level: "error",
|
|
769
|
+
message: "must be below or equal to 1 for unit in ha"
|
|
745
770
|
},
|
|
746
771
|
{
|
|
747
|
-
function: "
|
|
772
|
+
function: "_validate_product_yield",
|
|
748
773
|
level: "warning",
|
|
749
|
-
message: "
|
|
774
|
+
message: "is outside confidence interval"
|
|
750
775
|
},
|
|
751
776
|
{
|
|
752
|
-
function: "
|
|
753
|
-
level: "
|
|
754
|
-
message: "
|
|
777
|
+
function: "validate_excreta_product",
|
|
778
|
+
level: "warning",
|
|
779
|
+
message: "should add an excreta product"
|
|
755
780
|
},
|
|
756
781
|
{
|
|
757
|
-
function: "
|
|
782
|
+
function: "validate_excreta_product",
|
|
758
783
|
level: "error",
|
|
759
|
-
message: "
|
|
784
|
+
message: "is not an allowed excreta product"
|
|
760
785
|
},
|
|
761
786
|
{
|
|
762
|
-
function: "
|
|
787
|
+
function: "validate_requires_water_salinity",
|
|
763
788
|
level: "error",
|
|
764
|
-
message: "
|
|
789
|
+
message: "requires a water salinity measurement"
|
|
765
790
|
},
|
|
766
791
|
{
|
|
767
|
-
function: "
|
|
768
|
-
level: "
|
|
769
|
-
message: "
|
|
792
|
+
function: "_validate_all_values",
|
|
793
|
+
level: "warning",
|
|
794
|
+
message: "may not all be set to false"
|
|
770
795
|
},
|
|
771
796
|
{
|
|
772
|
-
function: "
|
|
797
|
+
function: "_validate_material",
|
|
773
798
|
level: "error",
|
|
774
|
-
message: "must be
|
|
799
|
+
message: "must be set to false when specifying fuel use"
|
|
775
800
|
},
|
|
776
801
|
{
|
|
777
|
-
function: "
|
|
802
|
+
function: "_validate_freshForage",
|
|
778
803
|
level: "error",
|
|
779
|
-
message: "must
|
|
804
|
+
message: "must have inputs representing the forage when set to true"
|
|
780
805
|
},
|
|
781
806
|
{
|
|
782
|
-
function: "
|
|
807
|
+
function: "_validate_ingredient",
|
|
783
808
|
level: "error",
|
|
784
|
-
message: "
|
|
809
|
+
message: "must have inputs to represent ingredients"
|
|
785
810
|
},
|
|
786
811
|
{
|
|
787
|
-
function: "
|
|
812
|
+
function: "_validate_ingredient",
|
|
788
813
|
level: "error",
|
|
789
|
-
message: "
|
|
814
|
+
message: "ingredients should be complete"
|
|
790
815
|
},
|
|
791
816
|
{
|
|
792
|
-
function: "
|
|
817
|
+
function: "_validate_animalPopulation",
|
|
793
818
|
level: "error",
|
|
794
|
-
message: "
|
|
819
|
+
message: "animal population must not be complete"
|
|
795
820
|
},
|
|
796
821
|
{
|
|
797
|
-
function: "
|
|
822
|
+
function: "_validate_completeness_blank_nodes_key",
|
|
798
823
|
level: "error",
|
|
799
|
-
message: "
|
|
824
|
+
message: "must not be blank if complete"
|
|
800
825
|
},
|
|
801
826
|
{
|
|
802
|
-
function: "
|
|
827
|
+
function: "validate_completeness_transport",
|
|
803
828
|
level: "error",
|
|
804
|
-
message: "must
|
|
829
|
+
message: "must have a value or a distance if complete"
|
|
805
830
|
},
|
|
806
831
|
{
|
|
807
|
-
function: "
|
|
832
|
+
function: "validate_coverage",
|
|
808
833
|
level: "warning",
|
|
809
|
-
message: "
|
|
810
|
-
},
|
|
811
|
-
{
|
|
812
|
-
function: "validate_excreta_inputs_products",
|
|
813
|
-
level: "error",
|
|
814
|
-
message: "must be included as an Input"
|
|
815
|
-
},
|
|
816
|
-
{
|
|
817
|
-
function: "validate_transformation_inputs_value",
|
|
818
|
-
level: "error",
|
|
819
|
-
message: "must be specified for multiple Inputs with the same term"
|
|
834
|
+
message: "can not calculate all emissions"
|
|
820
835
|
}
|
|
821
836
|
];
|
|
822
837
|
var validation_default = {
|