>HESTIA Data Validation>Cycle validation

Cycle validation


Here is the list of validations running on a Cycle.

Validate functionalUnit

This validation prevents using 1 ha as a functionalUnit when the siteType is:

  • agri-food processor;
  • retailer.

Validate total of above ground crop residue

If the Cycle contains aboveGroundCropResidueTotal and any of:

  • aboveGroundCropResidueBurnt
  • aboveGroundCropResidueIncorporated
  • aboveGroundCropResidueLeftOnField
  • aboveGroundCropResidueRemoved

Then the total must be euqal to the sun of the other terms.

Validate crop residue when it is marked as complete

When cropResidue is marked as complete, this validation will make sure that these conditions are true:

  • the "below ground crop residue" product is specified.
  • the sum of "above ground crop residue" products is > 0;
  • either: the sum of all cropResidueManagement practices is 100%,
    or the sum of "above ground crop residue" products is equal to the `Above ground crop residue total" product.

If any of these conditions fail, then the cropResidue should not be set as complete.

Validate crop residue when it is marked as incomplete

When cropResidue is marked as incomplete, this validation will check if these terms are specified:

  • at least one cropResidueManagement practice;
  • the sum of "above ground crop residue" products is > 0;
  • and the "below ground crop residue" is specified.

If any of these conditions apply, then the cropResidue should be set as complete, and a warning will be given.

Validate cycleDuration

When the startDate and endDate of the Cycle are provided, the cycleDuration must be equal to the difference in days. Validated to integer precision.

Validate harvestedArea compared to siteArea

If harvestedArea and siteArea are both provided, the harvestedArea must be lower or equal to siteArea.

Validate the cycleDuration

This validation verifies the cycleDuration provided in the Cycle is not greater than our maximumCycleDuration lookup. Validated to integer precision.

Validate "Rice, grain (in husk), flooded" has a plausible cycleDuration

Using the lookup Rice_croppingDuration_days_min, this validation will make sure that the cycleDuration specified in the Cycle is not below this minimum duration. Validated to integer precision.

Note: the minimum duration depends on the country specified on the Site.

Validate siteDuration for temporary crop only

This validation validates siteDuration for temporary crop production Cycles only. It uses the startDateDefinition to validate siteDuration compared to cycleDuration:

  • if startDateDefinition = harvest of previous crop, then siteDuration must be equal to cycleDuration.
  • if startDateDefinition = sowing date or soil preparation date or transplanting date, then siteDuration
    must be greater than cycleDuration.

Validate siteDuration for animal production Cycle

This validations validates siteDuration for animal production Cycle only:

  • if otherSites is set, it ensures siteDruation is less than cycleDuration,
    or equal to cycleDuration when accounting for otherSitesDuration.
  • if otherSites is not set, it ensures siteDuration is equal to cycleDuration.

Validate add otherSitesDuration and otherSitesArea

This validation will encourage the user to add the following fields, for a relative functionalUnit Cycle:

  • siteDuration
  • siteArea
  • otherSitesDuration (when otherSites is set)
  • otherSitesArea (when otherSites is set)

Validate using crop as a cover crop

This validation prevents using a crop Product, set as a "cover crop" (Practice), that can not be a crover crop. To fix this error, the Product or the Practice needs to be adjusted. This uses the lookup possibleCoverCrop on the Product to check if the Product can be a cover crop.

Validate using treatment with experimentDesign

When experimentDesign is used, this will encourage the user to set treatment as well.

Validate using both liveAnimal and animalProduct products

This validation will show a warning when both liveAnimal and animalProduct are added to the Cycle.

Validate Stocking density

Incite users to add the practice "Stocking density" when:

  • the functionalUnit is relative;
  • the Cycle occurs on permanent pasture;
  • the Cycle contains a list of animals as liveAnimal or animalProduct.

Validate that every product that should have an ImpactAssessment, actually has one.

In some cases, the same product could be added multiple times with different unique properties, in which case an ImpactAssessment should exist for each.

Note: on HESTIA, Impact Assessments are automatically generated during upload.

Validate mapping between the liveAnimal in the Animal blank nodes, and the Cycle Product as animalProduct.

This validation makes sure that the liveAnimal added as Animal have a corresponding animalProduct in the Cycle products.

Validate substrate inputs

This validation ensures that the substrate Inputs are added to the Cycle when the siteType = glass or high accessible cover, and a "substrate" practice has been set.

Validate that a certain date must be before the current date

Validate Dates

This validation ensures two things:

  1. The endDate must be later than startDate;
  2. The date format of endDate must be the same as startDate.

Validate the format of endDate and startDate

This validation is to ensure that the startDate and endDate formats match, for any blank node.

Validate dates and value items

This validation ensures that the number of items in value and dates are identical.

Validate blank node value between provided min and max

For any blank node, if the value is not between the min and max fields, an error will be given.

Validate blank node max is below provided min

For any blank node, if the max is not greater than the min field, an error will be given.

Validate blank node value between the lookup minimum and maximum

For some Terms, HESTIA has defined some minimum and maximum value. If the specified value does not fall within these, an error is raised.

Validate property value based on a lookup value

This validation checks if the property value provided is consistent with the value stored in a lookup table. For example, we can use the lookup region-liveAnimal-liveweightPerHead.csv file to determine if the liveweightPerHead value provided is within 75% of the high value contained in the lookup, for the country.

Validate duplicated nodes

This validation gives a warning when 2 identical nodes, with different id value`, are detected.

Validates the percentage of blank nodes

For all Terms that are in percentages, the value must be between 0 and 100.

Validate a group of blank nodes must sum to 100%

Some Terms are part of a group from the lookup sumIs100Group, meaning when summed up, their total value must be exactly 100% (with a 5% tolerance).

Validate the value of some blank nodes when the units is a percentage

For all Terms that are set as percentages, the value must be provided.

Validate the type of the value of blank nodes

Using the lookup "valueType", this validation will make sure the provided value is of the correct type. Example: a Term that should be either True or False will only accept True/False value.

Validate that some properties are specified for each blank nodes

Using the lookup recommendedPropertyTermIds on a blank node term, this validation will suggest the user to add any missing Property. These properties are necessary to run the models, and should be specified to prevent HESTIA from using default properties.

Validate that the region is not a Country

When using the region field, it must point to GADM Terms that are not countries. This can be identified with the gadmLevel field: it must be > 0 to be a region.

Validate that the region is within the country

When using both country and region, the region must be within the country specified.

Validate that the country is a Country

When using the country field, it must point to GADM Terms that are countries. This can be identified with the gadmLevel field: it must be == 0 to be a country.

Validate the coordinates are within the region or country

When providing longitude and latitude, the coordinates must fall within the region or country provided.

Validate area based on boundary

HESTIA will calculate the boundary area during upload, and this validation will show a warning when the area does not match. Please verify that the area provided is correct and in the correct unit.

Validate max boundary size

HESTIA will only gap-fill data from Geospatial datasets when the site area is less than 5000km2. If you see this warning, it means the calculation will be incomplete, and the measurements will need to be manually provided. Please provide a smaller polygon instead.

Validate max region/country size

HESTIA will only gap-fill data from Geospatial datasets when the site area is less than 5000km2. If you see this warning, it means the calculation will be incomplete, and the measurements will need to be manually provided. Please provide a smaller region/country instead.

Validates empty fields

This validation returns warnings when fields are added without a value (or using 'no data' for example).

Validate the privacy of 2 linked Nodes

When adding a Source to a Cycle or an ImpactAssessment, this validation ensures that the same level of privacy is used on both.

Example:

  • if the Cycle is set as dataPrivate=true, the Source it is linked to must also be dataPrivate=true;
  • if the Cycle is set as dataPrivate=false, the Source it is linked to must also be dataPrivate=false.

Validate private nodes are linked to a Source

It is recommended to always link a Cycle, Site, or ImpactAssessment, to a Source, even when private.

Validate a blank node value based on HESTIA's model

This validation will use the models library to recalculate the value of a blank node, and will give an error when the value too different from the models value. Note: the default tolerance is 5%, but we use the lookup valueToleranceToHestiaRecalculatedValue when available.

Validate multiple terms used with different units

Some of the terms in the Glossary have been added with different units, e.g., kg / kg N / kg VS. This validation returns a warning when those terms have been used together in the same Node.

Validate usage of "Other model"

The "Other model" Term has been added in the eventuality that HESTIA has not added the required model yet. However, to use this Term, the methodModelDescription must be set.

Validate when a non-indexed node references indexed nodes

When uploading Cycle, Site, etc., the referenced nodes must also be uploaded. Example:

  • if the uploaded Cycle references an existing Site, a warning will be given;
  • if the uploaded Cycle references an uploaded Site, no warning is given.

Validate inputs impactAssessment links

This validation makes sure that some inputs, mapped by the lookup aggregationInputTermIds on the primary product, have a corresponding impactAssessment linked to them. This validation can throw an error in the following cases:

  • no Impact Assessment has been found for this Input;
  • some Impact Assessment exist for the Input, but it has not been verified;
  • the lookup aggregationInputTermIds has not been set correctly. Please verify the primary product of the Cycle,
    and make sure the lookup aggregationInputTermIds has been set correctly.

Validate practices for permanent crops in aggregated cycles

If the Cycle is an aggregated cycle and the primary Product is a plantation, the Cycle must include the following practices: plantationLifespan and plantationProductiveLifespan.

Validate aggregated node id

Validate the node id has been correctly formatted. If this validation fails, it indicates an error in the aggregation engine, and an issue must be raised.

Validate Cycle contains animals blank node

For liveAnimal production Cycles, it is recommended to include animal blank nodes.

Validate feed inputs are not duplicated for Animals

This validation ensures that the same Input marked with isAnimalFeed are not added in both inputs and animals.

Validate specifying a "Milk yield" practice for Animals

Using the lookup milkYieldPracticeTermIds on the Animal term, this validation will recommend the user to add any Practice that matches one of the Term, if none has been set.

Validate specifying products for Animals

Using the lookup recommendedProductTermIds on the Animal term, this validation will recommend the user to add any Product that matches one of the Term, if none has been set.

Validate using the emissionNotRelevant model

The model emissionNotRelevant is reserved for the model emissionNotRelevant. This validation will therefore raise a warning when it is being used, and the methodModel should be replaced.

Validate using the not relevant methodTier

The methodTier not relevant is reserved for the model emissionNotRelevant. This validation will therefore raise a warning when it is being used, and the methodTier should be replaced.

Validate methodTier for background emissions

Only specific emissions can use the methodTier=background. For all emissions that are not allowed to use it, this validation will throw an error, and another methodTier must be used instead. Example of emission that can use it: CO2, to air, inputs production.

Validate depthUpper and depthLower for emissions

Certain emissions are depth dependent, and depthUpper and depthLower fields should be provided. This validation will show a warning if the depthUpper and depthLower fields are missing for these emissions.

Validate inorganic fertilisers nutrients

Some fertilizers contain more than one nutrient. For example Monoammonium Phosphate has the formula (NH4)(H2PO4) and therefore contains both nitrogen (N) and phosphorus (P). If only Monoammonium Phosphate (as N) is added, HESTIA will underrepresent the amount of nutrients added.

Validation of related Impact Assessment is not the Cycle itself

This validation ensures that no loop is being created, such as Cycle -> ImpactAssessment -> Cycle, e.g., that it is not possible to link a Cycle back to itself through the inputs.impactAssessment field.

Validate that the linked impact assessment product, of an input, is correct

This validation will make sure that the Product linked to the Input via an ImpactAssessment is correct. We either use the lookup linkedImpactAssessmentTermId if set, or we default to only allow the Input term itself.

Validate isAnimalFeed

This validation returns an error when:

  • the siteType is cropland, permanent pasture, animal housing,
    river or stream, lake, sea or ocean, tank, or pond;
  • the primary product is an animal;
  • some of the Cycle or animal inputs do not have isAnimalFeed set.

To fix this error, please set isAnimalFeed on all relevant inputs.

Validate saplings

This validation will force using the input saplingsDepreciatedAmountPerCycle when:

  • the Cycle functionalUnit is equal to 1 ha;
  • and the primary Product termType is Crop;
  • and the lookup is_Plantation is TRUE for the Crop;
  • and there is a Saplings input.

Validate input must be used a a product

Some Terms can only be used a Product. When any of these terms are used as Input, an error will be given.

Validate longFallowDuration value

This validation ensures the longFallowDuration value is not longer than 5 years.

Validate corresponding waterRegime practices with Rice products

This validation ensures that the correct waterRegime practice can be used with the specified Rice product.

Validate "Rice, grain (in husk), flooded" cropping duration

When "Rice, grain (in husk), flooded" is used as a product, this validation will check the practice croppingDuration, and make sure the value is between Rice_croppingDuration_days_min and Rice_croppingDuration_days_max lookup values.

Validate excreta management and input

If there is a Practice of termType = excretaManagement, there must be an Input of termType = excreta.

Validate using noTillage

Some practices require tillage, and adding the practice noTillage is not allowed.

Validate set tillage on cropland

For cropland, it is preferable to set the tillage type.

Validate tillage values

Validate these 2 cases:

  • if noTillage is set, the number of tillages must be 0;
  • if fullTillage is set, the number of tillages can not be 0.

To fix this error, you either need to change the tillage, or add the correct number of tillages.

Validate animal production has a system practice

For animal production Cycles, it is recommended to add a system Practice. We are using the lookup recommendedSystemTermIds to determine which Practice should be set, according to the primary Product.

Validate pastureGrass is specified

This validation encourages the user to specify the pastureGrass practice, when production occurs on a permanent pasture.

Validate pastureGrass practice has a landCover key

When adding the pastureGrass practice, you must specify a key using a Term from the landCover glossary.

Validate sum of pastureGrass

This validation ensures that the sum of all pastureGrass.value is equal to 100%.

Validate productive phase of permanent crops

This validation makes sure the following term is adding for pemanent crops, when the primary product value is 0: productivePhasePermanentCrops.

Validate using primaryPercent based on the siteType

This validation:

  • prevents using primaryPercent on practices when the siteType is not agri-food processor.
  • prevents using primaryPercent on non-processing practices when the siteType is agri-food processor.

Validate requires primaryPercent

When the siteType=agri-food processor, at least one operation Practice with primaryPercent must be set. Note: we also use the lookup isProcessingOperation on the operation to know if they qualify.

Validate that at least one landCover practice matches an equivalent Product

When adding a landCover Practice to a Cycle, the Practice must match a Product. We use the lookup landCoverTermId on existing Products to match the 2 together. If no correspondance is found, an error is shown.

Validate Cycle Practices and Site Management

This validation is to ensure that the same Management and Practices added on the Site and related Cycles, with the same term and startDate + endDate, have the same value. Since HESTIA will automatically gap-fill the Management node from the Cycle, removing them will fix this error.

Validate irrigated Cycles with complete water have water inputs

When the Cycle water completeness is set to True, and "irrigation" practices are used, there must be at least 1 Input of termType=water. Otherwise, the completeness should be marked as False.

Validate rainfed Cycles have more than 250 m3 of water

When "rainfed" practices are used, there must not be more than 250 m3 of water added to the Cycle. If more than 250 m3 of water was used, an "irrigated" practice must be used instead.

Validate irrigated Cycles have an irrigated waterRegime

Validates that Cycles with an irrigating operation must have an irrigated waterRegime.

Keep the cropResidueManagement practices which state a share of a known crop residue fate.

Total the cropResidueManagement practices sharing the same "above ground crop residue" product.

Only the fates with at least one practice specifying a value are included, so that a missing practice is never treated as a 0 share.

A fate is excluded when the practices give it a 0 share, either explicitly or by leaving

nothing for it once every other fate is accounted for.

Validate cropResidue products against cropResidueManagement practices

A cropResidueManagement practice states the share of the above ground crop residue which took that fate, so a fate given a 0 share cannot also have produced crop residue. A fate is given a 0 share either explicitly, or implicitly when the other practices already share out all of the crop residue.

Practices which are not specified leave the fate unknown, and never contradict a product.

Validate sum of economicValueShare

The sum of the economicValueShare must be equal or less than 100% across all products.

Validate no product value

This raises a warning for any product that does not have a non-zero value.

Validate product fields when value is 0

When the Product value is 0:

  • the economicValueShare must also be 0;
  • the revenue must also be 0.

Validate single primary product

It is not allowed in HESTIA to add multiple primary product.

Validate the product value for 1 ha functional unit

When using a 1 ha functionalUnit, all products with units=ha must have a value of 0 or 1. To fix this error, use a different product or change the functionalUnit.

Validate the excreta Products

For animal production cycles, it is recommended to specify the excreta product as well. This validation will:

  • check if the excreta specified is allowed for the products specify;
  • give a warning if no excreta is set.

In case of doubt, it is recommended to only set the system, and HESTIA will gap-fill the excreta.

Validate completeness fields are all set to False

When all completeness fields are set to False, this might be an error. This validation will give a warning.

Validate completeness material

This validation will give an error when:

  • material is set as complete;
  • and the Cycle contains fuel inputs (like gasoline or petrol);
  • but the Cycle does not contain any material inputs.

To fix the error, set the completeness to false, or add any missing material inputs.

Validate completeness freshForage

This validation will give an error when:

  • freshForage is set as complete;
  • the siteType is cropland or permanent pasture;
  • the Cycle contains grazing animals (see the lookup isGrazingAnimal on the animal products);
  • the Cycle does not contain any forage inputs.

To fix this error, set the completeness to false, or add any missing forage inputs.

Validate completeness ingredient

This validation will give an error when:

  • ingredient is set as complete, and siteType = agri-food processor, but there are no inputs;
  • or ingredient is set as incomplete, but the siteType is not agri-food processor.

To fix this error, either change the siteType, or only set as complete if ingredients have been specified as inputs.

Validate completeness animalPopulation

This validation will give an error when:

  • animalPopulation is set as complete;
  • there are Products with termType = liveAnimal or liveAquaticSpecies;
  • and there are no animal blank nodes.

To fix this error, set the completeness to false, or add any missing animal blank nodes.

Validate blank nodes value when complete

This validation uses a mapping from a completeness field to a list of blank nodes, and gives an error when any corresponding blank node has been added without a value.

For example:

  • if cropResidue is set as complete, then all cropResidue products or cropResidueManagement practices
    must contain a value;
  • if animalFeed is complete, then all animalProduct, crop, or processedFood inputs must contain a value.

The mapping can be found in the Completeness yaml source file.

To fix this error, make sure all blank nodes with matching completeness have a value, when set as complete.

Validate previousTransformationId

The field previousTransformationId must point to a transformation that has been included before the current transformation. To fix this error, either change the index of the current transformation so it is after the previous one, or set the correct previousTransformationId.

Validate transformation Input matches Product

This validation will ensure that the current transformation contains at least one Product that matches an Input of the previous transformation. Example:

  • the current transformation has previousTransformationId=tr1, and contains a single Input=wheatGrain;
  • the transformation with transformationId=tr1 must therefore contain a Product wheatGrain,
    or the transformation is incorrect.

Validate the transformation product value from the previous transformation

This validation uses the transformedShare field to validate that the Input value is correct, using the previous transformation matching Product, and the transformedShare. To fix this error, make sure the Input/Product value is correct, or change the transformedShare.

Validate the transformation emissions

Each emissions added on a transformation must also be present on the Cycle itself. HESTIA will automatically gap-fill the emissions, so this only returns a warning. Note: if you manually add the emissions on the Cycle, you must also set the correct transformation.

Validate the transformation excreta products

This validation ensures that the excreta products used are the correct ones, base on the inputs. It is not possible to start with excreta from one animal and get excreta from another. E.g., you cannot go from Excreta, dairy cattle (kg ...) to Excreta, pigs (kg ...). However there are three exceptions. You can get: Excreta (kg ...), Excreta mixtures (kg ...), and Processed excreta (kg ...) from any Inputs.

Validate the Property value type

This validation checks the type of the Property value, according to the lookup "valueType". To fix this error, you need to change the type of the value, according to the expected type.

Validate the termType used with this property

Some properties can only be used on some term types. When the termType is not allowed, an error is given. To fix this error, you either need to use a different property, or you need to change the term of the blank node. Note: this validation uses the lookup termTypesAllowed on the property.

Validate the property value based on HESTIA's default value

For some properties, HESTIA has set a default value. This validation will give a warning when the provided value is more than 25% different that HESTIA's default value.

Validate Volatile solids content Property for Excreta terms

This validation validates these cases:

  • for Excreta terms with units kg mass, Volatile solids content must be between 0% and 100%;
  • for Excreta terms with units kg VS, Volatile solids content must be 100%;
  • for Excreta terms with units kg N, Volatile solids content must be above 0%.

Validate the property value based on minimum and maximum from the Property or lookups

This validation uses the min and max fields of the Property, or the lookups minimum and maximum, to validate the value.

Resolve (mu, sd) preferring the posterior, and report which distribution was used.

Outcome of checking values against the (mu, sd) of a distribution.

mu and sd are carried alongside the interval because the interval does not determine them: min is clamped at 0, so any distribution whose lower bound is negative - common for the deliberately wide priors - cannot be reconstructed from min/max alone. Consumers that want to draw the curve need the parameters themselves.