Skip to content

Commit

Permalink
taxonomy: new ciqual associations for ingredients (#9523)
Browse files Browse the repository at this point in the history
* taxonomy: new ciqual associations for ingredients

* update tests

* remove tags before recreating them
  • Loading branch information
stephanegigandet authored Dec 15, 2023
1 parent c9a51df commit 15e8cea
Show file tree
Hide file tree
Showing 62 changed files with 4,005 additions and 1,009 deletions.
5 changes: 5 additions & 0 deletions lib/ProductOpener/Ingredients.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3149,6 +3149,11 @@ sub estimate_ingredients_percent_service ($product_ref, $updated_product_fields_
$product_ref->{ingredients_percent_analysis} = 1;
}

remove_tag($product_ref, "misc", "en:some-ingredients-with-specified-percent");
remove_tag($product_ref, "misc", "en:all-ingredients-with-specified-percent");
remove_tag($product_ref, "misc", "en:at-least-5-ingredients-with-specified-percent");
remove_tag($product_ref, "misc", "en:at-least-10-ingredients-with-specified-percent");

# Count ingredients with specified percent
my ($ingredients_n, $ingredients_with_specified_percent_n, $total_specified_percent)
= count_ingredients_with_specified_percent($product_ref->{ingredients});
Expand Down
22 changes: 21 additions & 1 deletion taxonomies/ingredients.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2624,6 +2624,9 @@ vegan:en:no
vegetarian:en:yes
carbon_footprint_fr_foodges_ingredient:fr:Lait semi-écrémé, pasteurisé
carbon_footprint_fr_foodges_value:fr:1.2
ciqual_proxy_food_code:en:19051
ciqual_proxy_food_name:en:Milk, skimmed, pasteurised
ciqual_proxy_food_name:fr:Lait écrémé, pasteurisé

<en:milk
en:milk enriched with cream
Expand Down Expand Up @@ -2842,6 +2845,9 @@ zh:脱脂牛奶
# yue:脫脂奶
wikidata:en:Q2352187
wikipedia:en:https://en.wikipedia.org/wiki/Skimmed_milk
ciqual_proxy_food_code:en:19051
ciqual_proxy_food_name:en:Milk, skimmed, pasteurised
ciqual_proxy_food_name:fr:Lait écrémé, pasteurisé

#kept due to ciqual
<en:skimmed milk
Expand Down Expand Up @@ -2926,6 +2932,9 @@ pt:leite meio gordo
sv:mellanmjölk
wikidata:en:Q10572454
wikipedia:fr:https://fr.wikipedia.org/wiki/Lait_demi-écrémé
ciqual_proxy_food_code:en:19041
ciqual_proxy_food_name:en:Milk, semi-skimmed, UHT
ciqual_proxy_food_name:fr:Lait demi-écrémé, UHT

<en:semi-skimmed milk
fr:lait demi écrémé uht, lait stérilisé u h t demi-écrémé, lait demi-écrémé stérilisé uht, lait stérilisé uht demi-écrémé, lait demi-écrémé stérilisé u.h.t
Expand Down Expand Up @@ -3066,6 +3075,9 @@ pt:leite enteiro, leite integral
ro:lapte integral
sv:Helmjölk, sötmjölk
zh:全脂牛奶
ciqual_food_code:en:19023
ciqual_food_name:en:Milk, whole, UHT
ciqual_food_name:fr:Lait entier, UHT

<en:whole milk
<en:fresh milk
Expand Down Expand Up @@ -12392,6 +12404,8 @@ carbon_footprint_fr_foodges_value:fr:7.4
carbon_footprint_fr_foodges_ingredient_for_net_weight:en:5.9
# Facteur GES kg CO2 eq / kg d'ingrédient ingéré
carbon_footprint_fr_foodges_ingredient_for_ingested_weight:en:7.4
ciqual_proxy_food_code:en:28205
ciqual_proxy_food_name:en:Pork, meat, cooked (average)

#process:en: en:mechanically separated
<en:pork meat
Expand Down Expand Up @@ -15039,7 +15053,8 @@ wikipedia:en:https://en.wikipedia.org/wiki/Butterfat
vegan:en:no
vegetarian:en:yes
# ingredient/butterfat has 9828 products in 35 languages @2019-07-10

ciqual_food_code:en:16401
ciqual_food_name:en:Butter oil or concentrated butter

# decription:en:CLARIFIED BUTTER is milk fat rendered from butter to separate the milk solids and water from the butterfat
# comment:en:Not sure if this is really different from butterfat. Maybe the clarification is a special process.
Expand Down Expand Up @@ -32823,6 +32838,8 @@ wikipedia:en:https://en.wikipedia.org/wiki/Dark_chocolate
# category/dark-chocolates has 3311 products @2019-05-25
carbon_footprint_fr_foodges_ingredient:fr:Chocolat en morceau (noir)
carbon_footprint_fr_foodges_value:fr:4.9
ciqual_proxy_food_code:en:31074
ciqual_proxy_food_name:en:Dark chocolate bar, more than 70% cocoa

<en:dark chocolate
en:belgian dark chocolate, dark belgian chocolate
Expand Down Expand Up @@ -51635,6 +51652,9 @@ wikidata:en:Q61046162
wikipedia:en:https://en.wikipedia.org/wiki/Chives
# 4350 in 20 @2021-10-19
eurocode_2_group_3:en: 8.30.50
ciqual_food_code:en:11003
ciqual_food_name:en:Chive or spring onion, fresh
ciqual_food_name:fr:Ciboule ou Ciboulette, fraîche

<en:chives
en:chive seasoning
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
"attributes" : [
{
"description" : "",
"description_short" : "Données manquantes pour calculer le Nutri-Score",
"grade" : "unknown",
"icon_url" : "http://static.openfoodfacts.localhost/images/attributes/dist/nutriscore-unknown.svg",
"description_short" : "Qualité nutritionnelle moyenne",
"grade" : "c",
"icon_url" : "http://static.openfoodfacts.localhost/images/attributes/dist/nutriscore-c.svg",
"id" : "nutriscore",
"match" : 0,
"match" : 57.8888888888889,
"name" : "Nutri-Score",
"panel_id" : "nutriscore",
"status" : "unknown",
"title" : "Nutri-Score inconnu"
"status" : "known",
"title" : "Nutri-Score C"
},
{
"grade" : "unknown",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
"attributes" : [
{
"description" : "",
"description_short" : "Missing data to compute the Nutri-Score",
"grade" : "unknown",
"icon_url" : "http://static.openfoodfacts.localhost/images/attributes/dist/nutriscore-unknown.svg",
"description_short" : "Average nutritional quality",
"grade" : "c",
"icon_url" : "http://static.openfoodfacts.localhost/images/attributes/dist/nutriscore-c.svg",
"id" : "nutriscore",
"match" : 0,
"match" : 57.8888888888889,
"name" : "Nutri-Score",
"panel_id" : "nutriscore",
"status" : "unknown",
"title" : "Nutri-Score unknown"
"status" : "known",
"title" : "Nutri-Score C"
},
{
"grade" : "unknown",
Expand Down
Loading

0 comments on commit 15e8cea

Please sign in to comment.