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