Validate animal products based on the live animals present during the Cycle
New Validation
Validation
This validation uses the liveAnimal
lookup in the animalProduct
glossary to validate the animalProduct
recorded as a Product, considering the live animals recorded in the Animal node and in the Inputs section.
Validation Conditions
Requirements:
-
A cycle with:
- a list of
animals
blank nodes withtermType=liveAnimal
- a list of
products
blank nodes withtermType=animalProduct
- a list of
-
If one of the Cycle products with
termType=animalProduct
does not have a corresponding "allowed" liveAnimal, then show error
Note: the lookup allowedAnimalProductTermIds
should be used to determine if any of the animalProduct
should not be allowed (compute the list of all allowed terms from all animals first)
Validation Level
-
Warning: this might be an error, but we will still allow the upload to be validated. -
Error: this is an error and must be fixed to validate the upload.
Example
Input Data
{
"animals": [
{
"@type": "Animal",
"term": {
"@id": "dairyCattleCowLactating",
"@type": "Term",
"name": "Dairy cattle, cow (lactating)",
"units": "number",
"termType": "liveAnimal"
},
"value": [
20
]
},
{
"@type": "Animal",
"term": {
"@id": "dairyCattleBull",
"@type": "Term",
"name": "Dairy cattle, bull",
"units": "number",
"termType": "liveAnimal"
},
"value": [
1
]
}
],
"products": [
{
"@type": "Product",
"term": {
"@id": "milkSheepRaw",
"@type": "Term",
"name": "Milk, sheep, raw",
"units": "kg",
"termType": "animalProduct"
},
"value": [
7000
]
}
]
}
Output error/warning message
XXX is a Product of the Cycle, but the liveAnimal producing it is not recorded in the Animal or Input node. Either change the animalProduct or add the missing liveAnimal to the Animal or Input node.
```d
Edited by Guillaume