<<

NAME

ProductOpener::DataQualityFood - check the quality of data for food products

DESCRIPTION

ProductOpener::DataQualityFood is a submodule of ProductOpener::DataQuality.

It implements quality checks that are specific to food products.

When the type of products is set to food, ProductOpener::DataQuality::check_quality() calls ProductOpener::DataQualityFood::check_quality(), which in turn calls all the functions of the submodule.

HARDCODED BRAND LISTS

The module has 4 hardcoded lists of brands: @baby_food_brands, @cigarette_brands, @petfood_brands and @beauty_brands

We will probably create a brands taxonomy at some point, which will allow us to remove those hardcoded lists.

FUNCTIONS

detect_categories( PRODUCT_REF )

Detects some categories like baby milk, baby food and cigarettes from other fields such as brands, product name, generic name and ingredients.

check_nutrition_grades( PRODUCT_REF )

Compares the nutrition score and nutrition grade (Nutri-Score) we have computed with the score and grade provided by manufacturers.

check_carbon_footprint( PRODUCT_REF )

Checks related to the carbon footprint computed from ingredients analysis.

check_nutrition_data_energy_computation ( PRODUCT_REF )

Checks related to the nutrition facts values.

In particular, checks for obviously invalid values (e.g. more than 105 g of any nutrient for 100 g / 100 ml). 105 g is used instead of 100 g, because for some liquids, 100 ml can weight more than 100 g.

check_nutrition_data( PRODUCT_REF )

Checks related to the nutrition facts values.

In particular, checks for obviously invalid values (e.g. more than 105 g of any nutrient for 100 g / 100 ml). 105 g is used instead of 100 g, because for some liquids, 100 ml can weight more than 100 g.

compare_nutrition_facts_with_products_from_the_same_category( PRODUCT_REF )

Check that the product nutrition facts are comparable to other products from the same category.

Compare with the most specific category that has enough products to compute stats.

check_ingredients( PRODUCT_REF )

Checks related to the ingredients list and ingredients analysis.

check_quantity( PRODUCT_REF )

Checks related to the quantity and serving quantity.

check_categories( PRODUCT_REF )

Checks related to specific product categories.

Alcoholic beverages: check that there is an alcohol value in the nutrients.

check_labels( PRODUCT_REF )

Checks related to specific product labels.

check_ingredients_percent_analysis( PRODUCT_REF )

Checks if we were able to analyze the minimum and maximum percent values for ingredients and sub-ingredients.

check_ingredients_with_specified_percent( PRODUCT_REF )

Check if all or almost all the ingredients have a specified percentage in the ingredients list.

check_ecoscore_data( PRODUCT_REF )

Checks for data needed to compute the Eco-score.

check_food_groups( PRODUCT_REF )

Add info tags about food groups.

check_incompatible_tags( PRODUCT_REF )

Checks if 2 incompatible tags are assigned to the product

To include more tags to this check, add the property "incompatible:en" at the end of code block in the taxonomy

Example: en:Non-fair trade, Not fair trade fr:Non issu du commerce équitable incompatible_with:en: en:fair-trade

check_quality_food( PRODUCT_REF )

Run all quality checks defined in the module.

<<