From 44cf54507fb8f2a4eb494afd5433147236819834 Mon Sep 17 00:00:00 2001 From: Martin Ces Date: Wed, 9 Oct 2024 15:03:12 +0200 Subject: [PATCH 01/18] taxonomy: a new function assign_property_to_ingredients has been added to get ecobalyse ids --- lib/ProductOpener/Ingredients.pm | 92 ++++++++++++++++++++++++++++---- 1 file changed, 83 insertions(+), 9 deletions(-) diff --git a/lib/ProductOpener/Ingredients.pm b/lib/ProductOpener/Ingredients.pm index fdeb5eb515520..bc14121d6e745 100644 --- a/lib/ProductOpener/Ingredients.pm +++ b/lib/ProductOpener/Ingredients.pm @@ -97,7 +97,7 @@ BEGIN { &match_ingredient_origin &parse_origins_from_text - &assign_ciqual_codes + &assign_property_to_ingredients &get_ingredients_with_property_value ); # symbols to export on request @@ -3013,7 +3013,7 @@ sub extend_ingredients_service ($product_ref, $updated_product_fields_ref) { # Add Ciqual codes # Used in particular for ingredients estimation from nutrients - assign_ciqual_codes($product_ref); + assign_property_to_ingredients($product_ref); return; } @@ -3225,7 +3225,7 @@ sub extract_ingredients_from_text ($product_ref) { remove_fields( $product_ref, [ - # assign_ciqual_codes - may have been introduced in previous version + # assign_property_to_ingredients - may have been introduced in previous version "ingredients_without_ciqual_codes", "ingredients_without_ciqual_codes_n", ] @@ -3264,14 +3264,31 @@ sub extract_ingredients_from_text ($product_ref) { return; } -sub assign_ciqual_codes ($product_ref) { +sub assign_property_to_ingredients ($product_ref) { + # If the ingredient list is not defined, the function immediately returns + return if not defined $product_ref->{ingredients}; - return if not defined $product_ref->{ingredients}; + # ------------------------------------ PART 1 : Getting CIQUAL codes ------------------------------------ # + # Retrieves a unique and sorted list of ingredients missing Ciqual codes + my @ingredients_without_ciqual_codes = uniq(sort(get_missing_ciqual_codes($product_ref->{ingredients}))); - my @ingredients_without_ciqual_codes = uniq(sort(get_missing_ciqual_codes($product_ref->{ingredients}))); - $product_ref->{ingredients_without_ciqual_codes} = \@ingredients_without_ciqual_codes; - $product_ref->{ingredients_without_ciqual_codes_n} = @ingredients_without_ciqual_codes + 0.0; - return; + # Stores this list in the product under the key 'ingredients_without_ciqual_codes' + $product_ref->{ingredients_without_ciqual_codes} = \@ingredients_without_ciqual_codes; + + # Also stores the total number of ingredients without Ciqual codes + $product_ref->{ingredients_without_ciqual_codes_n} = @ingredients_without_ciqual_codes + 0.0; + + # ------------------------------------ PART 2 : Getting Ecobalyse ids ------------------------------------ # + # Retrieves a unique and sorted list of ingredients missing Ecobalyse ids + my @ingredients_without_ecobalyse_ids = uniq(sort(get_missing_ecobalyse_ids($product_ref->{ingredients}))); + + # Stores this list in the product under the key 'ingredients_without_ecobalyse_ids' + $product_ref->{ingredients_without_ecobalyse_ids} = \@ingredients_without_ecobalyse_ids; + + # Also stores the total number of ingredients without Ecobalyse ids + $product_ref->{ingredients_without_ecobalyse_ids_n} = @ingredients_without_ecobalyse_ids + 0.0; + + return; } =head2 get_missing_ciqual_codes ($ingredients_ref) @@ -3322,6 +3339,63 @@ sub get_missing_ciqual_codes ($ingredients_ref) { return @ingredients_without_ciqual_codes; } +=head2 get_missing_ecobalyse_ids ($ingredients_ref) + +Assign a ecobalyse_id or a ciqual_proxy_food_code to ingredients and sub ingredients. (NOTE : this is a first version that'll soon be improved) + +=head3 Arguments + +=head4 $ingredients_ref + +reference to an array of ingredients + +=head3 Return values + +=head4 @ingredients_without_ecobalyse_ids + +=cut + +sub get_missing_ecobalyse_ids ($ingredients_ref) { + my @ingredients_without_ecobalyse_ids = (); + foreach my $ingredient_ref (@{$ingredients_ref}) { + + # Also add sub-ingredients + if (defined $ingredient_ref->{ingredients}) { + push(@ingredients_without_ecobalyse_ids, get_missing_ecobalyse_ids($ingredient_ref->{ingredients})); + } + + # Assign a ecobalyse_code or a ecoalyse_proxy_code to the ingredient + delete $ingredient_ref->{ecobalyse_code}; + delete $ingredient_ref->{ecobalyse_proxy_code}; + + # Getting properties from product + #my $product_origin = has_specific_ingredient_property() + + # Getting the correct ecobalyse comake devde + my $ecobalyse_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse:en"); + if (defined $ecobalyse_code) { + $ingredient_ref->{ecobalyse_code} = $ecobalyse_code; + } + else { + my $ecobalyse_proxy_code + = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_proxy:en"); + if (defined $ecobalyse_proxy_code) { + $ingredient_ref->{ecobalyse_proxy_code} = $ecobalyse_proxy_code; + } + else { + push(@ingredients_without_ecobalyse_ids, $ingredient_ref->{id}); + } + } + + #ecobalyse:en + #ecobalyse_labels_en_organic:en + #ecobalyse_origins_en_france:en + #ecobalyse_origins_en_european_union:en + #ecobalyse_labels_en_organic_origins_en_france:en + } + return @ingredients_without_ecobalyse_ids; +} + =head2 estimate_ingredients_percent_service ( $product_ref, $updated_product_fields_ref ) Compute minimum and maximum percent ranges and percent estimates for each ingredient and sub ingredient. From b5ab63e43b5b4cfe7c9b3ed3af5a57d42183b887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Gigandet?= Date: Fri, 11 Oct 2024 11:29:20 +0200 Subject: [PATCH 02/18] updated tests --- .../get-existing-product.json | 6 +++ .../get-fields-all-knowledge-panels.json | 6 +++ .../api_v2_product_read/get-fields-all.json | 6 +++ ...attribute-groups-all-knowledge-panels.json | 6 +++ .../api_v2_product_read/get-fields-raw.json | 6 +++ .../get-product-auth-good-password.json | 7 +++ ...uct-ingredients-text-without-language.json | 5 +++ .../api_v2_product_write/get-product.json | 7 +++ .../get-existing-product-gs1-ai-data-str.json | 6 +++ .../get-existing-product-gs1-caret.json | 6 +++ .../get-existing-product-gs1-data-uri.json | 6 +++ .../get-existing-product-gs1-fnc1.json | 6 +++ .../get-existing-product-gs1-gs.json | 6 +++ .../get-existing-product.json | 6 +++ .../get-fields-all-knowledge-panels.json | 6 +++ .../api_v3_product_read/get-fields-all.json | 6 +++ ...attribute-groups-all-knowledge-panels.json | 6 +++ .../api_v3_product_read/get-fields-raw.json | 6 +++ ...redients-categories-to-get-nutriscore.json | 2 + .../patch-language-fields.json | 2 + .../test/products/3270190128403.json | 3 ++ .../test/products/4270190128403.json | 5 +++ .../test/products/5270190128403.json | 3 ++ ...ed-protected-product-api-v2-moderator.json | 6 +++ .../get-edited-protected-product-api-v2.json | 6 +++ ...-protected-product-web-form-moderator.json | 6 +++ ...get-edited-protected-product-web-form.json | 6 +++ ...get-edited-unprotected-product-api-v2.json | 6 +++ ...t-edited-unprotected-product-web-form.json | 6 +++ .../search_v1/search-no-filter.json | 29 ++++++++++++ .../attributes/en-attributes.json | 14 ++++++ .../attributes/en-maybe-vegan.json | 6 +++ .../attributes/en-nova-groups-markers.json | 10 +++++ .../attributes/en-nutriscore.json | 4 ++ .../attributes/en-unknown-ingredients.json | 4 ++ .../attributes/fr-palm-kernel-fat.json | 4 ++ .../attributes/fr-palm-oil-free.json | 7 +++ .../attributes/fr-palm-oil.json | 4 ++ .../attributes/fr-vegetable-oils.json | 6 +++ .../calvados-ingredients-no-origins.json | 4 ++ .../ecoscore/carrots-plastic.json | 3 ++ .../ecoscore/carrots.json | 3 ++ .../category-without-ecoscore-sodas.json | 4 ++ .../ecoscore/energy-drink.json | 5 +++ .../ecoscore/foie-gras.json | 4 ++ .../ecoscore/fr-verseur-en-plastique.json | 3 ++ .../ecoscore/fr-viande-porcine-francaise.json | 7 +++ .../ecoscore/fresh-vegetable.json | 3 ++ .../ecoscore/frozen-vegetable.json | 3 ++ .../grade-a-with-non-recyclable-label.json | 5 +++ .../grade-a-with-recyclable-label.json | 5 +++ .../ecoscore/lamb-leg.json | 4 ++ .../expected_test_results/ecoscore/milk.json | 3 ++ ...ingredients-in-origins-field-multiple.json | 6 +++ ...igins-of-ingredients-in-origins-field.json | 6 +++ .../origins-of-ingredients-nested-2.json | 10 +++++ .../origins-of-ingredients-nested.json | 7 +++ .../origins-of-ingredients-not-specified.json | 6 +++ ...igins-of-ingredients-partly-specified.json | 6 +++ ...ins-of-ingredients-specified-multiple.json | 6 +++ .../origins-of-ingredients-specified.json | 6 +++ ...origins-of-ingredients-unknown-origin.json | 3 ++ ...ins-of-ingredients-unspecified-origin.json | 3 ++ .../ecoscore/packaging-fr-new-shapes.json | 4 ++ .../packaging-unspecified-no-a-eco-score.json | 4 ++ .../sum-of-bonuses-greater-than-25.json | 4 ++ .../ecoscore/track-ecoscore-changes.json | 4 ++ .../ecoscore/track-ecoscore-no-change.json | 4 ++ .../ecoscore/track-ecoscore-same-grade.json | 4 ++ .../track-ecoscore-tags-retained.json | 4 ++ .../ecoscore/uk-milk.json | 3 ++ ...bio-oeuf-label-rouge-os-de-poulet-igp.json | 6 +++ .../fr-ingredients-filet-de-poulet-bio.json | 4 ++ .../forest_footprint/fr-ingredients-lait.json | 3 ++ ...ngredients-nested-matching-ingredient.json | 7 +++ ...dients-nested-matching-sub-ingredient.json | 7 +++ .../fr-ingredients-poulet-du-gers.json | 4 ++ .../fr-ingredients-poulet.json | 4 ++ .../ingredients/ca-middle-dot.json | 10 +++++ .../en-allergens-in-parenthesis.json | 11 +++++ .../ingredients/en-category-types.json | 7 +++ .../ingredients/en-comma-and-pepper.json | 6 +++ .../ingredients/en-content-of-ingredient.json | 2 + .../ingredients/en-emulsifier-synonyms.json | 9 ++++ .../ingredients/en-flavour-synonyms.json | 5 +++ .../en-fruits-sub-ingredients.json | 9 ++++ .../en-illegal-division-by-zero.json | 5 +++ ...-ing1-and-ing2-processing-parenthesis.json | 10 +++++ .../en-ing1-and-ing2-processing.json | 21 +++++++++ .../ingredients/en-ingredient-content.json | 2 + ...redients-analysis-unknown-ingredients.json | 11 +++++ ...is-that-are-in-the-allergens-taxonomy.json | 6 +++ .../ingredients/en-kosher.json | 6 +++ .../en-mechanicaly-separated-meat.json | 4 ++ .../en-nova-4-fruit-juice-concentrates.json | 3 ++ .../ingredients/en-origin-and.json | 3 ++ .../en-origin-field-with-commas-and.json | 4 ++ .../en-origin-field-with-commas.json | 4 ++ ...in-field-with-not-taxonomized-entries.json | 6 +++ .../ingredients/en-origin-field.json | 9 ++++ .../en-origin-ingredient-from-origin.json | 4 ++ ...n-origin-ingredient-origin-and-origin.json | 4 ++ .../ingredients/en-origins-u.json | 5 +++ .../ingredients/en-origins.json | 9 ++++ .../ingredients/en-prepared-with.json | 2 + .../en-quantity-of-ingredient.json | 7 +++ .../ingredients/en-quantity-per-100g.json | 5 +++ .../en-some-unknown-ingredient-and-salt.json | 5 +++ ...ts-multiple-strings-of-one-ingredient.json | 6 +++ .../ingredients/en-specific-ingredients.json | 6 +++ .../ingredients/en-vegetal-ingredients.json | 8 ++++ .../ingredients/en-vitamin.json | 5 +++ .../en-wheat-flour-organic-gluten-free.json | 5 +++ .../ingredients/es-percent-loop.json | 14 ++++++ ...es-procedente-e-agricultura-biologica.json | 5 +++ .../ingredients/fi-additive.json | 5 +++ .../ingredients/fi-additives-origins.json | 8 ++++ .../ingredients/fi-additives-percents.json | 22 +++++++++ .../ingredients/fi-do-not-match-myanmar.json | 10 +++++ .../ingredients/fi-labels.json | 5 +++ .../fi-organic-label-part-of-ingredient.json | 6 +++ .../ingredients/fi-origins.json | 9 ++++ .../ingredients/fi-percents.json | 5 +++ .../ingredients/fr-additive.json | 5 +++ ...-agriculture-biologique-de-madagascar.json | 4 ++ .../ingredients/fr-chocolate-cake.json | 22 +++++++++ .../ingredients/fr-content-of-ingredient.json | 2 + .../ingredients/fr-epices-irradiees.json | 6 +++ .../fr-farines-labels-and-processes.json | 7 +++ .../ingredients/fr-halal.json | 7 +++ .../fr-huile-de-palme-certifiee-durable.json | 6 +++ .../fr-illegal-division-by-zero.json | 5 +++ .../fr-infinite-loop-allergens.json | 15 +++++++ ...is-that-are-in-the-allergens-taxonomy.json | 6 +++ .../fr-label-and-multiple-origins.json | 7 +++ .../ingredients/fr-labels.json | 5 +++ ...egumes-issus-de-l-agriculture-durable.json | 4 ++ .../ingredients/fr-marmelade.json | 45 ++++++++++++++++++- .../fr-mechanicaly-separated-meat.json | 6 +++ .../fr-oignon-francais-tomate-francaise.json | 5 +++ .../ingredients/fr-origin-and.json | 3 ++ .../ingredients/fr-origin-field.json | 14 ++++++ ...r-origin-ingredient-origin-and-origin.json | 16 +++++++ .../fr-origins-agriculture-ue-non-ue.json | 3 ++ ...lemagne-france-pays-bas-contient-lait.json | 3 ++ .../ingredients/fr-origins-labels.json | 12 +++++ .../ingredients/fr-origins.json | 6 +++ .../ingredients/fr-palm-kernel-fat.json | 4 ++ .../ingredients/fr-percents-origins-2.json | 9 ++++ .../ingredients/fr-percents-origins.json | 7 +++ .../ingredients/fr-percents.json | 5 +++ .../ingredients/fr-prepared-with.json | 2 + .../ingredients/fr-processing-multi.json | 9 ++++ .../fr-quantity-of-ingredient.json | 7 +++ .../ingredients/fr-quantity-per-100g.json | 5 +++ .../ingredients/fr-semi.json | 4 ++ .../ingredients/fr-specific-ingredients.json | 8 ++++ .../ingredients/fr-starred-label.json | 6 +++ .../ingredients/fr-truncated-puree.json | 7 +++ .../ingredients/fr-vegetal-origin.json | 6 +++ ...oeuf-issue-d-animaux-nourris-sans-ogm.json | 4 ++ .../fr-viande-porcine-francaise.json | 7 +++ .../ingredients/ja-additives.json | 16 +++++++ .../ja-allergens-in-parenthesis.json | 7 +++ .../ingredients/ja-origin-and.json | 5 +++ .../ingredients/ja-origins.json | 14 ++++++ .../ingredients/ja-parenthesis.json | 18 ++++++++ .../ingredients/ja-slash.json | 18 ++++++++ .../ingredients/nl-e471-niet-dierlijk.json | 4 ++ .../ingredients/ru-russian-oil.json | 5 +++ .../ingredients/xx-single-letters.json | 39 ++++++++++++++++ .../fruits-water-sugar.json | 7 +++ .../ingredients_contents/vegetable-oils.json | 7 +++ ...-percent-sugar-and-unknown-ingredient.json | 5 +++ .../beverage-with-80-percent-milk.json | 4 ++ .../dairy-drink-with-80-percent-milk.json | 4 ++ ...-drink-with-less-than-80-percent-milk.json | 4 ++ .../nutriscore/dairy-drinks-without-milk.json | 4 ++ .../en-apple-estimated-nutrients.json | 3 ++ .../nutriscore/en-avocado-oil.json | 3 ++ ...n-beverage-preparation-flavored-syrup.json | 7 +++ .../nutriscore/en-cherry-tomatoes.json | 3 ++ ...en-olive-oil-unrecognized-ingredients.json | 4 ++ .../nutriscore/en-olive-oil.json | 3 ++ ...orange-juice-category-and-ingredients.json | 5 +++ ...ategory-ingredients-with-lots-of-meat.json | 7 +++ ...ous-category-ingredients-with-no-meat.json | 6 +++ ...ory-ingredients-with-very-little-meat.json | 9 ++++ ...n-soy-beans-processed-and-unprocessed.json | 4 ++ .../en-sugar-estimated-nutrients.json | 3 ++ .../nutriscore/en-sweeteners-erythritol.json | 7 +++ .../nutriscore/en-sweeteners.json | 7 +++ .../nutriscore/en-tofu.json | 6 +++ .../nutriscore/en-vegetable-crisps.json | 5 +++ .../nutriscore/fr-canned-green-beans.json | 5 +++ .../nutriscore/fr-canned-pineapple.json | 5 +++ .../nutriscore/fr-coconut-milk.json | 5 +++ .../nutriscore/fr-gaspacho.json | 14 ++++++ .../nutriscore/fr-green-beans-beverage.json | 5 +++ .../nutriscore/fr-ice-tea-with-sweetener.json | 19 ++++++++ .../fr-mixed-oils-with-olive-oil.json | 8 ++++ .../nutriscore/fr-orange-nectar-0-fat.json | 6 +++ .../fr-plant-beverages-soy-milk.json | 5 +++ .../nutriscore/fr-rapeseed-oil.json | 3 ++ .../nutriscore/milk.json | 3 ++ .../nutriscore/mushrooms.json | 5 +++ ...rgherita-pizzas.fr-margherita-pizza-1.json | 12 +++++ ...rgherita-pizza-2-compound-ingredients.json | 11 +++++ .../recipes/nectars.guava-nectar.json | 8 ++++ .../nectars.impossible-ingredients.json | 5 +++ .../recipes/nectars.strawberry-nectar.json | 5 +++ 211 files changed, 1411 insertions(+), 2 deletions(-) diff --git a/tests/integration/expected_test_results/api_v2_product_read/get-existing-product.json b/tests/integration/expected_test_results/api_v2_product_read/get-existing-product.json index 91c4d1f0bb073..b86bcbb81862f 100644 --- a/tests/integration/expected_test_results/api_v2_product_read/get-existing-product.json +++ b/tests/integration/expected_test_results/api_v2_product_read/get-existing-product.json @@ -592,6 +592,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent_estimate" : 62.5, @@ -603,6 +604,7 @@ }, { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 18.75, @@ -614,6 +616,7 @@ }, { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg", "is_in_taxonomy" : 1, "percent_estimate" : 9.375, @@ -625,6 +628,7 @@ }, { "ciqual_food_code" : "16129", + "ecobalyse_code" : "refined-palm-oil", "from_palm_oil" : "yes", "id" : "en:palm-oil", "is_in_taxonomy" : 1, @@ -699,6 +703,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "interface_version_created" : "20150316.jqm2", "interface_version_modified" : "20150316.jqm2", "known_ingredients_n" : 10, diff --git a/tests/integration/expected_test_results/api_v2_product_read/get-fields-all-knowledge-panels.json b/tests/integration/expected_test_results/api_v2_product_read/get-fields-all-knowledge-panels.json index 9134226de65f1..08d020e9bc959 100644 --- a/tests/integration/expected_test_results/api_v2_product_read/get-fields-all-knowledge-panels.json +++ b/tests/integration/expected_test_results/api_v2_product_read/get-fields-all-knowledge-panels.json @@ -592,6 +592,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent_estimate" : 62.5, @@ -603,6 +604,7 @@ }, { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 18.75, @@ -614,6 +616,7 @@ }, { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg", "is_in_taxonomy" : 1, "percent_estimate" : 9.375, @@ -625,6 +628,7 @@ }, { "ciqual_food_code" : "16129", + "ecobalyse_code" : "refined-palm-oil", "from_palm_oil" : "yes", "id" : "en:palm-oil", "is_in_taxonomy" : 1, @@ -699,6 +703,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "interface_version_created" : "20150316.jqm2", "interface_version_modified" : "20150316.jqm2", "knowledge_panels" : { diff --git a/tests/integration/expected_test_results/api_v2_product_read/get-fields-all.json b/tests/integration/expected_test_results/api_v2_product_read/get-fields-all.json index 52d575c8d224c..37bd1bd5ec107 100644 --- a/tests/integration/expected_test_results/api_v2_product_read/get-fields-all.json +++ b/tests/integration/expected_test_results/api_v2_product_read/get-fields-all.json @@ -592,6 +592,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent_estimate" : 62.5, @@ -603,6 +604,7 @@ }, { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 18.75, @@ -614,6 +616,7 @@ }, { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg", "is_in_taxonomy" : 1, "percent_estimate" : 9.375, @@ -625,6 +628,7 @@ }, { "ciqual_food_code" : "16129", + "ecobalyse_code" : "refined-palm-oil", "from_palm_oil" : "yes", "id" : "en:palm-oil", "is_in_taxonomy" : 1, @@ -699,6 +703,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "interface_version_created" : "20150316.jqm2", "interface_version_modified" : "20150316.jqm2", "known_ingredients_n" : 10, diff --git a/tests/integration/expected_test_results/api_v2_product_read/get-fields-attribute-groups-all-knowledge-panels.json b/tests/integration/expected_test_results/api_v2_product_read/get-fields-attribute-groups-all-knowledge-panels.json index 03a19d9617b5b..25d23ad60abcd 100644 --- a/tests/integration/expected_test_results/api_v2_product_read/get-fields-attribute-groups-all-knowledge-panels.json +++ b/tests/integration/expected_test_results/api_v2_product_read/get-fields-attribute-groups-all-knowledge-panels.json @@ -1248,6 +1248,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent_estimate" : 62.5, @@ -1259,6 +1260,7 @@ }, { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 18.75, @@ -1270,6 +1272,7 @@ }, { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg", "is_in_taxonomy" : 1, "percent_estimate" : 9.375, @@ -1281,6 +1284,7 @@ }, { "ciqual_food_code" : "16129", + "ecobalyse_code" : "refined-palm-oil", "from_palm_oil" : "yes", "id" : "en:palm-oil", "is_in_taxonomy" : 1, @@ -1355,6 +1359,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "interface_version_created" : "20150316.jqm2", "interface_version_modified" : "20150316.jqm2", "knowledge_panels" : { diff --git a/tests/integration/expected_test_results/api_v2_product_read/get-fields-raw.json b/tests/integration/expected_test_results/api_v2_product_read/get-fields-raw.json index 4141e76663a04..6af0aad5a4e90 100644 --- a/tests/integration/expected_test_results/api_v2_product_read/get-fields-raw.json +++ b/tests/integration/expected_test_results/api_v2_product_read/get-fields-raw.json @@ -587,6 +587,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent_estimate" : 62.5, @@ -598,6 +599,7 @@ }, { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 18.75, @@ -609,6 +611,7 @@ }, { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg", "is_in_taxonomy" : 1, "percent_estimate" : 9.375, @@ -620,6 +623,7 @@ }, { "ciqual_food_code" : "16129", + "ecobalyse_code" : "refined-palm-oil", "from_palm_oil" : "yes", "id" : "en:palm-oil", "is_in_taxonomy" : 1, @@ -694,6 +698,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "interface_version_created" : "20150316.jqm2", "interface_version_modified" : "20150316.jqm2", "known_ingredients_n" : 10, diff --git a/tests/integration/expected_test_results/api_v2_product_write/get-product-auth-good-password.json b/tests/integration/expected_test_results/api_v2_product_write/get-product-auth-good-password.json index 31bb160923001..be54a5375e7c8 100644 --- a/tests/integration/expected_test_results/api_v2_product_write/get-product-auth-good-password.json +++ b/tests/integration/expected_test_results/api_v2_product_write/get-product-auth-good-password.json @@ -523,6 +523,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "9410", + "ecobalyse_code" : "flour", "id" : "en:wheat-flour", "is_in_taxonomy" : 1, "percent_estimate" : 62.5, @@ -534,6 +535,7 @@ }, { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent_estimate" : 18.75, @@ -556,6 +558,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 9.375, @@ -621,6 +624,10 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:salt" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "interface_version_created" : "20150316.jqm2", "interface_version_modified" : "20150316.jqm2", "known_ingredients_n" : 10, diff --git a/tests/integration/expected_test_results/api_v2_product_write/get-product-ingredients-text-without-language.json b/tests/integration/expected_test_results/api_v2_product_write/get-product-ingredients-text-without-language.json index 2aea2f4c09ac1..5496e216ef4bd 100644 --- a/tests/integration/expected_test_results/api_v2_product_write/get-product-ingredients-text-without-language.json +++ b/tests/integration/expected_test_results/api_v2_product_write/get-product-ingredients-text-without-language.json @@ -428,6 +428,11 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:pork-meat", + "en:salt" + ], + "ingredients_without_ecobalyse_ids_n" : 2, "interface_version_created" : "20150316.jqm2", "interface_version_modified" : "20150316.jqm2", "known_ingredients_n" : 5, diff --git a/tests/integration/expected_test_results/api_v2_product_write/get-product.json b/tests/integration/expected_test_results/api_v2_product_write/get-product.json index c556cc3673fcc..c8ef2e1d5e6b4 100644 --- a/tests/integration/expected_test_results/api_v2_product_write/get-product.json +++ b/tests/integration/expected_test_results/api_v2_product_write/get-product.json @@ -523,6 +523,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "9410", + "ecobalyse_code" : "flour", "id" : "en:wheat-flour", "is_in_taxonomy" : 1, "percent_estimate" : 62.5, @@ -534,6 +535,7 @@ }, { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent_estimate" : 18.75, @@ -556,6 +558,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 9.375, @@ -621,6 +624,10 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:salt" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "interface_version_created" : "20150316.jqm2", "interface_version_modified" : "20150316.jqm2", "known_ingredients_n" : 10, diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-ai-data-str.json b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-ai-data-str.json index 59f6a90bed2f1..7a973c3850ca4 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-ai-data-str.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-ai-data-str.json @@ -586,6 +586,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent_estimate" : 62.5, @@ -597,6 +598,7 @@ }, { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 18.75, @@ -608,6 +610,7 @@ }, { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg", "is_in_taxonomy" : 1, "percent_estimate" : 9.375, @@ -619,6 +622,7 @@ }, { "ciqual_food_code" : "16129", + "ecobalyse_code" : "refined-palm-oil", "from_palm_oil" : "yes", "id" : "en:palm-oil", "is_in_taxonomy" : 1, @@ -693,6 +697,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "interface_version_created" : "20150316.jqm2", "interface_version_modified" : "20150316.jqm2", "known_ingredients_n" : 10, diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-caret.json b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-caret.json index 79efa8eda8a66..c2fd3e7eeccf4 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-caret.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-caret.json @@ -586,6 +586,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent_estimate" : 62.5, @@ -597,6 +598,7 @@ }, { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 18.75, @@ -608,6 +610,7 @@ }, { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg", "is_in_taxonomy" : 1, "percent_estimate" : 9.375, @@ -619,6 +622,7 @@ }, { "ciqual_food_code" : "16129", + "ecobalyse_code" : "refined-palm-oil", "from_palm_oil" : "yes", "id" : "en:palm-oil", "is_in_taxonomy" : 1, @@ -693,6 +697,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "interface_version_created" : "20150316.jqm2", "interface_version_modified" : "20150316.jqm2", "known_ingredients_n" : 10, diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-data-uri.json b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-data-uri.json index 79efa8eda8a66..c2fd3e7eeccf4 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-data-uri.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-data-uri.json @@ -586,6 +586,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent_estimate" : 62.5, @@ -597,6 +598,7 @@ }, { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 18.75, @@ -608,6 +610,7 @@ }, { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg", "is_in_taxonomy" : 1, "percent_estimate" : 9.375, @@ -619,6 +622,7 @@ }, { "ciqual_food_code" : "16129", + "ecobalyse_code" : "refined-palm-oil", "from_palm_oil" : "yes", "id" : "en:palm-oil", "is_in_taxonomy" : 1, @@ -693,6 +697,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "interface_version_created" : "20150316.jqm2", "interface_version_modified" : "20150316.jqm2", "known_ingredients_n" : 10, diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-fnc1.json b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-fnc1.json index 59f6a90bed2f1..7a973c3850ca4 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-fnc1.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-fnc1.json @@ -586,6 +586,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent_estimate" : 62.5, @@ -597,6 +598,7 @@ }, { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 18.75, @@ -608,6 +610,7 @@ }, { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg", "is_in_taxonomy" : 1, "percent_estimate" : 9.375, @@ -619,6 +622,7 @@ }, { "ciqual_food_code" : "16129", + "ecobalyse_code" : "refined-palm-oil", "from_palm_oil" : "yes", "id" : "en:palm-oil", "is_in_taxonomy" : 1, @@ -693,6 +697,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "interface_version_created" : "20150316.jqm2", "interface_version_modified" : "20150316.jqm2", "known_ingredients_n" : 10, diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-gs.json b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-gs.json index 79efa8eda8a66..c2fd3e7eeccf4 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-gs.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-gs.json @@ -586,6 +586,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent_estimate" : 62.5, @@ -597,6 +598,7 @@ }, { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 18.75, @@ -608,6 +610,7 @@ }, { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg", "is_in_taxonomy" : 1, "percent_estimate" : 9.375, @@ -619,6 +622,7 @@ }, { "ciqual_food_code" : "16129", + "ecobalyse_code" : "refined-palm-oil", "from_palm_oil" : "yes", "id" : "en:palm-oil", "is_in_taxonomy" : 1, @@ -693,6 +697,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "interface_version_created" : "20150316.jqm2", "interface_version_modified" : "20150316.jqm2", "known_ingredients_n" : 10, diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product.json b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product.json index 439d9c7276177..2bbefe1f2cc4c 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product.json @@ -586,6 +586,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent_estimate" : 62.5, @@ -597,6 +598,7 @@ }, { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 18.75, @@ -608,6 +610,7 @@ }, { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg", "is_in_taxonomy" : 1, "percent_estimate" : 9.375, @@ -619,6 +622,7 @@ }, { "ciqual_food_code" : "16129", + "ecobalyse_code" : "refined-palm-oil", "from_palm_oil" : "yes", "id" : "en:palm-oil", "is_in_taxonomy" : 1, @@ -693,6 +697,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "interface_version_created" : "20150316.jqm2", "interface_version_modified" : "20150316.jqm2", "known_ingredients_n" : 10, diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-fields-all-knowledge-panels.json b/tests/integration/expected_test_results/api_v3_product_read/get-fields-all-knowledge-panels.json index 80763d7fd81c5..03cd6b177e254 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-fields-all-knowledge-panels.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-fields-all-knowledge-panels.json @@ -586,6 +586,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent_estimate" : 62.5, @@ -597,6 +598,7 @@ }, { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 18.75, @@ -608,6 +610,7 @@ }, { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg", "is_in_taxonomy" : 1, "percent_estimate" : 9.375, @@ -619,6 +622,7 @@ }, { "ciqual_food_code" : "16129", + "ecobalyse_code" : "refined-palm-oil", "from_palm_oil" : "yes", "id" : "en:palm-oil", "is_in_taxonomy" : 1, @@ -693,6 +697,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "interface_version_created" : "20150316.jqm2", "interface_version_modified" : "20150316.jqm2", "knowledge_panels" : { diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-fields-all.json b/tests/integration/expected_test_results/api_v3_product_read/get-fields-all.json index 8dd7c7c15bcf3..df12eea5f4964 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-fields-all.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-fields-all.json @@ -586,6 +586,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent_estimate" : 62.5, @@ -597,6 +598,7 @@ }, { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 18.75, @@ -608,6 +610,7 @@ }, { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg", "is_in_taxonomy" : 1, "percent_estimate" : 9.375, @@ -619,6 +622,7 @@ }, { "ciqual_food_code" : "16129", + "ecobalyse_code" : "refined-palm-oil", "from_palm_oil" : "yes", "id" : "en:palm-oil", "is_in_taxonomy" : 1, @@ -693,6 +697,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "interface_version_created" : "20150316.jqm2", "interface_version_modified" : "20150316.jqm2", "known_ingredients_n" : 10, diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-fields-attribute-groups-all-knowledge-panels.json b/tests/integration/expected_test_results/api_v3_product_read/get-fields-attribute-groups-all-knowledge-panels.json index 70c2a0fe05045..e93588609b569 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-fields-attribute-groups-all-knowledge-panels.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-fields-attribute-groups-all-knowledge-panels.json @@ -1234,6 +1234,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent_estimate" : 62.5, @@ -1245,6 +1246,7 @@ }, { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 18.75, @@ -1256,6 +1258,7 @@ }, { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg", "is_in_taxonomy" : 1, "percent_estimate" : 9.375, @@ -1267,6 +1270,7 @@ }, { "ciqual_food_code" : "16129", + "ecobalyse_code" : "refined-palm-oil", "from_palm_oil" : "yes", "id" : "en:palm-oil", "is_in_taxonomy" : 1, @@ -1341,6 +1345,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "interface_version_created" : "20150316.jqm2", "interface_version_modified" : "20150316.jqm2", "knowledge_panels" : { diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-fields-raw.json b/tests/integration/expected_test_results/api_v3_product_read/get-fields-raw.json index 8fae953dcdcf3..67b6788176774 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-fields-raw.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-fields-raw.json @@ -581,6 +581,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent_estimate" : 62.5, @@ -592,6 +593,7 @@ }, { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 18.75, @@ -603,6 +605,7 @@ }, { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg", "is_in_taxonomy" : 1, "percent_estimate" : 9.375, @@ -614,6 +617,7 @@ }, { "ciqual_food_code" : "16129", + "ecobalyse_code" : "refined-palm-oil", "from_palm_oil" : "yes", "id" : "en:palm-oil", "is_in_taxonomy" : 1, @@ -688,6 +692,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "interface_version_created" : "20150316.jqm2", "interface_version_modified" : "20150316.jqm2", "known_ingredients_n" : 10, diff --git a/tests/integration/expected_test_results/api_v3_product_write/patch-ingredients-categories-to-get-nutriscore.json b/tests/integration/expected_test_results/api_v3_product_write/patch-ingredients-categories-to-get-nutriscore.json index 2181765c9a6c8..c0dfeff5b18fb 100644 --- a/tests/integration/expected_test_results/api_v3_product_write/patch-ingredients-categories-to-get-nutriscore.json +++ b/tests/integration/expected_test_results/api_v3_product_write/patch-ingredients-categories-to-get-nutriscore.json @@ -35,6 +35,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent" : 75, @@ -49,6 +50,7 @@ }, { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent" : 25, diff --git a/tests/integration/expected_test_results/api_v3_product_write/patch-language-fields.json b/tests/integration/expected_test_results/api_v3_product_write/patch-language-fields.json index 7364a1330b56e..5403caca8eab9 100644 --- a/tests/integration/expected_test_results/api_v3_product_write/patch-language-fields.json +++ b/tests/integration/expected_test_results/api_v3_product_write/patch-language-fields.json @@ -4,6 +4,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent" : 80, @@ -16,6 +17,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 15, diff --git a/tests/integration/expected_test_results/convert_and_import_excel_file/test/products/3270190128403.json b/tests/integration/expected_test_results/convert_and_import_excel_file/test/products/3270190128403.json index fc9bb2f1d432d..5e316d035dc12 100644 --- a/tests/integration/expected_test_results/convert_and_import_excel_file/test/products/3270190128403.json +++ b/tests/integration/expected_test_results/convert_and_import_excel_file/test/products/3270190128403.json @@ -630,6 +630,7 @@ "ingredients" : [ { "ciqual_food_code" : "20505", + "ecobalyse_code" : "lentils-uncooked-eu", "id" : "en:green-lentils", "is_in_taxonomy" : 1, "labels" : "en:organic", @@ -684,6 +685,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "interface_version_created" : "import_csv_file - version 2019/09/17", "known_ingredients_n" : 5, "labels" : "Organic, EU Organic, FR-BIO-01, AB Agriculture Biologique, Agriculture France", diff --git a/tests/integration/expected_test_results/convert_and_import_excel_file/test/products/4270190128403.json b/tests/integration/expected_test_results/convert_and_import_excel_file/test/products/4270190128403.json index 923d03e68b0d1..74824a9d66b71 100644 --- a/tests/integration/expected_test_results/convert_and_import_excel_file/test/products/4270190128403.json +++ b/tests/integration/expected_test_results/convert_and_import_excel_file/test/products/4270190128403.json @@ -428,6 +428,11 @@ "fr:white-peaches" ], "ingredients_without_ciqual_codes_n" : 2, + "ingredients_without_ecobalyse_ids" : [ + "fr:high-fructose-corn-syrup", + "fr:white-peaches" + ], + "ingredients_without_ecobalyse_ids_n" : 2, "interface_version_created" : "import_csv_file - version 2019/09/17", "known_ingredients_n" : 0, "lang" : "en", diff --git a/tests/integration/expected_test_results/convert_and_import_excel_file/test/products/5270190128403.json b/tests/integration/expected_test_results/convert_and_import_excel_file/test/products/5270190128403.json index 7b540205725d5..93bf340869be8 100644 --- a/tests/integration/expected_test_results/convert_and_import_excel_file/test/products/5270190128403.json +++ b/tests/integration/expected_test_results/convert_and_import_excel_file/test/products/5270190128403.json @@ -348,6 +348,7 @@ "ingredients" : [ { "ciqual_food_code" : "13005", + "ecobalyse_code" : "banana-non-eu", "id" : "en:banana", "is_in_taxonomy" : 1, "percent_estimate" : 100, @@ -395,6 +396,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "interface_version_created" : "import_csv_file - version 2019/09/17", "known_ingredients_n" : 2, "lang" : "fr", diff --git a/tests/integration/expected_test_results/protected_product/get-edited-protected-product-api-v2-moderator.json b/tests/integration/expected_test_results/protected_product/get-edited-protected-product-api-v2-moderator.json index f23e9f73500e0..39a03df1935bf 100644 --- a/tests/integration/expected_test_results/protected_product/get-edited-protected-product-api-v2-moderator.json +++ b/tests/integration/expected_test_results/protected_product/get-edited-protected-product-api-v2-moderator.json @@ -431,6 +431,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent_estimate" : 62.5, @@ -442,6 +443,7 @@ }, { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 18.75, @@ -453,6 +455,7 @@ }, { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg", "is_in_taxonomy" : 1, "percent_estimate" : 9.375, @@ -464,6 +467,7 @@ }, { "ciqual_food_code" : "16129", + "ecobalyse_code" : "refined-palm-oil", "from_palm_oil" : "yes", "id" : "en:palm-oil", "is_in_taxonomy" : 1, @@ -540,6 +544,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "interface_version_created" : "20150316.jqm2", "interface_version_modified" : "20150316.jqm2", "known_ingredients_n" : 10, diff --git a/tests/integration/expected_test_results/protected_product/get-edited-protected-product-api-v2.json b/tests/integration/expected_test_results/protected_product/get-edited-protected-product-api-v2.json index 15a57934a751d..5dcffb42ebc4b 100644 --- a/tests/integration/expected_test_results/protected_product/get-edited-protected-product-api-v2.json +++ b/tests/integration/expected_test_results/protected_product/get-edited-protected-product-api-v2.json @@ -431,6 +431,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent_estimate" : 62.5, @@ -442,6 +443,7 @@ }, { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 18.75, @@ -453,6 +455,7 @@ }, { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg", "is_in_taxonomy" : 1, "percent_estimate" : 9.375, @@ -464,6 +467,7 @@ }, { "ciqual_food_code" : "16129", + "ecobalyse_code" : "refined-palm-oil", "from_palm_oil" : "yes", "id" : "en:palm-oil", "is_in_taxonomy" : 1, @@ -540,6 +544,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "interface_version_created" : "20150316.jqm2", "interface_version_modified" : "20150316.jqm2", "known_ingredients_n" : 10, diff --git a/tests/integration/expected_test_results/protected_product/get-edited-protected-product-web-form-moderator.json b/tests/integration/expected_test_results/protected_product/get-edited-protected-product-web-form-moderator.json index 449929efcb993..39777e4cfd925 100644 --- a/tests/integration/expected_test_results/protected_product/get-edited-protected-product-web-form-moderator.json +++ b/tests/integration/expected_test_results/protected_product/get-edited-protected-product-web-form-moderator.json @@ -435,6 +435,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent_estimate" : 62.5, @@ -446,6 +447,7 @@ }, { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 18.75, @@ -457,6 +459,7 @@ }, { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg", "is_in_taxonomy" : 1, "percent_estimate" : 9.375, @@ -468,6 +471,7 @@ }, { "ciqual_food_code" : "16129", + "ecobalyse_code" : "refined-palm-oil", "from_palm_oil" : "yes", "id" : "en:palm-oil", "is_in_taxonomy" : 1, @@ -544,6 +548,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "interface_version_created" : "20150316.jqm2", "interface_version_modified" : "20190830", "known_ingredients_n" : 10, diff --git a/tests/integration/expected_test_results/protected_product/get-edited-protected-product-web-form.json b/tests/integration/expected_test_results/protected_product/get-edited-protected-product-web-form.json index ef2f438b15ca4..a805766712453 100644 --- a/tests/integration/expected_test_results/protected_product/get-edited-protected-product-web-form.json +++ b/tests/integration/expected_test_results/protected_product/get-edited-protected-product-web-form.json @@ -435,6 +435,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent_estimate" : 62.5, @@ -446,6 +447,7 @@ }, { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 18.75, @@ -457,6 +459,7 @@ }, { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg", "is_in_taxonomy" : 1, "percent_estimate" : 9.375, @@ -468,6 +471,7 @@ }, { "ciqual_food_code" : "16129", + "ecobalyse_code" : "refined-palm-oil", "from_palm_oil" : "yes", "id" : "en:palm-oil", "is_in_taxonomy" : 1, @@ -544,6 +548,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "interface_version_created" : "20150316.jqm2", "interface_version_modified" : "20190830", "known_ingredients_n" : 10, diff --git a/tests/integration/expected_test_results/protected_product/get-edited-unprotected-product-api-v2.json b/tests/integration/expected_test_results/protected_product/get-edited-unprotected-product-api-v2.json index 7164501d48230..abf6a3d060ca8 100644 --- a/tests/integration/expected_test_results/protected_product/get-edited-unprotected-product-api-v2.json +++ b/tests/integration/expected_test_results/protected_product/get-edited-unprotected-product-api-v2.json @@ -429,6 +429,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent_estimate" : 62.5, @@ -440,6 +441,7 @@ }, { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 18.75, @@ -451,6 +453,7 @@ }, { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg", "is_in_taxonomy" : 1, "percent_estimate" : 9.375, @@ -462,6 +465,7 @@ }, { "ciqual_food_code" : "16129", + "ecobalyse_code" : "refined-palm-oil", "from_palm_oil" : "yes", "id" : "en:palm-oil", "is_in_taxonomy" : 1, @@ -538,6 +542,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "interface_version_created" : "20150316.jqm2", "interface_version_modified" : "20150316.jqm2", "known_ingredients_n" : 10, diff --git a/tests/integration/expected_test_results/protected_product/get-edited-unprotected-product-web-form.json b/tests/integration/expected_test_results/protected_product/get-edited-unprotected-product-web-form.json index 805a5f42637bc..cca9d5b2372ba 100644 --- a/tests/integration/expected_test_results/protected_product/get-edited-unprotected-product-web-form.json +++ b/tests/integration/expected_test_results/protected_product/get-edited-unprotected-product-web-form.json @@ -433,6 +433,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent_estimate" : 62.5, @@ -444,6 +445,7 @@ }, { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 18.75, @@ -455,6 +457,7 @@ }, { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg", "is_in_taxonomy" : 1, "percent_estimate" : 9.375, @@ -466,6 +469,7 @@ }, { "ciqual_food_code" : "16129", + "ecobalyse_code" : "refined-palm-oil", "from_palm_oil" : "yes", "id" : "en:palm-oil", "is_in_taxonomy" : 1, @@ -542,6 +546,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "interface_version_created" : "20150316.jqm2", "interface_version_modified" : "20190830", "known_ingredients_n" : 10, diff --git a/tests/integration/expected_test_results/search_v1/search-no-filter.json b/tests/integration/expected_test_results/search_v1/search-no-filter.json index 0891487fa45f4..a5609047fa673 100644 --- a/tests/integration/expected_test_results/search_v1/search-no-filter.json +++ b/tests/integration/expected_test_results/search_v1/search-no-filter.json @@ -404,6 +404,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent_estimate" : 62.5, @@ -416,6 +417,7 @@ }, { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 18.75, @@ -428,6 +430,7 @@ }, { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg", "is_in_taxonomy" : 1, "percent_estimate" : 9.375, @@ -440,6 +443,7 @@ }, { "ciqual_food_code" : "16129", + "ecobalyse_code" : "refined-palm-oil", "from_palm_oil" : "yes", "id" : "en:palm-oil", "is_in_taxonomy" : 1, @@ -515,6 +519,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "interface_version_created" : "20150316.jqm2", "interface_version_modified" : "20150316.jqm2", "known_ingredients_n" : 10, @@ -1332,6 +1338,11 @@ "en:fruit" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:fruit", + "en:rice" + ], + "ingredients_without_ecobalyse_ids_n" : 2, "interface_version_created" : "20150316.jqm2", "interface_version_modified" : "20150316.jqm2", "known_ingredients_n" : 2, @@ -1918,6 +1929,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent_estimate" : 66.6666666666667, @@ -1930,6 +1942,7 @@ }, { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 16.6666666666667, @@ -1942,6 +1955,7 @@ }, { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg", "is_in_taxonomy" : 1, "percent_estimate" : 16.6666666666667, @@ -2004,6 +2018,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "interface_version_created" : "20150316.jqm2", "interface_version_modified" : "20150316.jqm2", "known_ingredients_n" : 6, @@ -2722,6 +2738,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent_estimate" : 66.6666666666667, @@ -2734,6 +2751,7 @@ }, { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent_estimate" : 16.6666666666667, @@ -2746,6 +2764,7 @@ }, { "ciqual_food_code" : "16129", + "ecobalyse_code" : "refined-palm-oil", "from_palm_oil" : "yes", "id" : "en:palm-oil", "is_in_taxonomy" : 1, @@ -2812,6 +2831,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "interface_version_created" : "20150316.jqm2", "interface_version_modified" : "20150316.jqm2", "known_ingredients_n" : 8, @@ -3688,6 +3709,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent_estimate" : 75, @@ -3700,6 +3722,7 @@ }, { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent_estimate" : 25, @@ -3752,6 +3775,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "interface_version_created" : "20150316.jqm2", "interface_version_modified" : "20150316.jqm2", "known_ingredients_n" : 4, @@ -4661,6 +4686,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent_estimate" : 75, @@ -4673,6 +4699,7 @@ }, { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent_estimate" : 25, @@ -4725,6 +4752,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "interface_version_created" : "20150316.jqm2", "interface_version_modified" : "20150316.jqm2", "known_ingredients_n" : 4, diff --git a/tests/unit/expected_test_results/attributes/en-attributes.json b/tests/unit/expected_test_results/attributes/en-attributes.json index 9afdf3c908ea9..00d23c6a5d086 100644 --- a/tests/unit/expected_test_results/attributes/en-attributes.json +++ b/tests/unit/expected_test_results/attributes/en-attributes.json @@ -851,6 +851,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "9410", + "ecobalyse_code" : "flour", "id" : "en:wheat-flour", "is_in_taxonomy" : 1, "origins" : "en:united-kingdom", @@ -863,6 +864,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "origins" : "en:paraguay", @@ -875,6 +877,7 @@ }, { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg", "is_in_taxonomy" : 1, "percent_estimate" : 12.5, @@ -886,6 +889,7 @@ }, { "ciqual_food_code" : "13014", + "ecobalyse_code" : "strawberry-non-eu", "id" : "en:strawberry", "is_in_taxonomy" : 1, "percent_estimate" : 10.2272727272727, @@ -908,6 +912,7 @@ }, { "ciqual_food_code" : "17130", + "ecobalyse_code" : "rapeseed-oil", "from_palm_oil" : "no", "id" : "en:rapeseed-oil", "is_in_taxonomy" : 1, @@ -1083,6 +1088,15 @@ "en:milk-proteins" ], "ingredients_without_ciqual_codes_n" : 3, + "ingredients_without_ecobalyse_ids" : [ + "en:e102", + "en:e120", + "en:high-fructose-corn-syrup", + "en:macadamia-nut", + "en:milk-proteins", + "en:salt" + ], + "ingredients_without_ecobalyse_ids_n" : 6, "known_ingredients_n" : 30, "labels_tags" : [ "en:organic", diff --git a/tests/unit/expected_test_results/attributes/en-maybe-vegan.json b/tests/unit/expected_test_results/attributes/en-maybe-vegan.json index 547ddc7584c14..22cc307d5b70f 100644 --- a/tests/unit/expected_test_results/attributes/en-maybe-vegan.json +++ b/tests/unit/expected_test_results/attributes/en-maybe-vegan.json @@ -637,6 +637,7 @@ }, { "ciqual_food_code" : "16129", + "ecobalyse_code" : "refined-palm-oil", "from_palm_oil" : "yes", "id" : "en:palm-oil", "is_in_taxonomy" : 1, @@ -715,6 +716,11 @@ "en:enzyme" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:enzyme", + "en:tapioca" + ], + "ingredients_without_ecobalyse_ids_n" : 2, "known_ingredients_n" : 7, "languages" : {}, "languages_codes" : {}, diff --git a/tests/unit/expected_test_results/attributes/en-nova-groups-markers.json b/tests/unit/expected_test_results/attributes/en-nova-groups-markers.json index cdb2b1a54cdd0..caf28e5f24320 100644 --- a/tests/unit/expected_test_results/attributes/en-nova-groups-markers.json +++ b/tests/unit/expected_test_results/attributes/en-nova-groups-markers.json @@ -794,6 +794,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:cow-s-milk", "is_in_taxonomy" : 1, "percent_estimate" : 57.1428571428571, @@ -846,6 +847,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 2.5, @@ -950,6 +952,14 @@ "en:microbial-culture" ], "ingredients_without_ciqual_codes_n" : 3, + "ingredients_without_ecobalyse_ids" : [ + "en:e412", + "en:garlic-flavouring", + "en:high-fructose-corn-syrup", + "en:microbial-culture", + "en:salt" + ], + "ingredients_without_ecobalyse_ids_n" : 5, "known_ingredients_n" : 18, "languages" : {}, "languages_codes" : {}, diff --git a/tests/unit/expected_test_results/attributes/en-nutriscore.json b/tests/unit/expected_test_results/attributes/en-nutriscore.json index ae812be189a5f..09ab33df1cb76 100644 --- a/tests/unit/expected_test_results/attributes/en-nutriscore.json +++ b/tests/unit/expected_test_results/attributes/en-nutriscore.json @@ -831,6 +831,10 @@ "en:fruit" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:fruit" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 1, "languages" : {}, "languages_codes" : {}, diff --git a/tests/unit/expected_test_results/attributes/en-unknown-ingredients.json b/tests/unit/expected_test_results/attributes/en-unknown-ingredients.json index 1590ab85e67c4..d51dc1c884bd5 100644 --- a/tests/unit/expected_test_results/attributes/en-unknown-ingredients.json +++ b/tests/unit/expected_test_results/attributes/en-unknown-ingredients.json @@ -839,6 +839,10 @@ "en:some-ingredient-that-we-do-not-recognize" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:some-ingredient-that-we-do-not-recognize" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 0, "languages" : {}, "languages_codes" : {}, diff --git a/tests/unit/expected_test_results/attributes/fr-palm-kernel-fat.json b/tests/unit/expected_test_results/attributes/fr-palm-kernel-fat.json index bdb5d9140701d..41e275277ac15 100644 --- a/tests/unit/expected_test_results/attributes/fr-palm-kernel-fat.json +++ b/tests/unit/expected_test_results/attributes/fr-palm-kernel-fat.json @@ -677,6 +677,10 @@ "en:palm-kernel-fat" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:palm-kernel-fat" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 4, "languages" : {}, "languages_codes" : {}, diff --git a/tests/unit/expected_test_results/attributes/fr-palm-oil-free.json b/tests/unit/expected_test_results/attributes/fr-palm-oil-free.json index 5368e36282b83..52f21b0481384 100644 --- a/tests/unit/expected_test_results/attributes/fr-palm-oil-free.json +++ b/tests/unit/expected_test_results/attributes/fr-palm-oil-free.json @@ -619,6 +619,7 @@ "ingredients" : [ { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent_estimate" : 62.5, @@ -630,6 +631,7 @@ }, { "ciqual_proxy_food_code" : "9410", + "ecobalyse_proxy_code" : "flour", "id" : "en:flour", "is_in_taxonomy" : 1, "percent_estimate" : 18.75, @@ -641,6 +643,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 9.375, @@ -711,6 +714,10 @@ "en:chocolate" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:chocolate" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 6, "languages" : {}, "languages_codes" : {}, diff --git a/tests/unit/expected_test_results/attributes/fr-palm-oil.json b/tests/unit/expected_test_results/attributes/fr-palm-oil.json index 8734bd30ba492..6fec5e830ccb0 100644 --- a/tests/unit/expected_test_results/attributes/fr-palm-oil.json +++ b/tests/unit/expected_test_results/attributes/fr-palm-oil.json @@ -622,6 +622,7 @@ "ingredients" : [ { "ciqual_food_code" : "4003", + "ecobalyse_code" : "potato-industry-fr", "id" : "en:potato", "is_in_taxonomy" : 1, "percent_estimate" : 75, @@ -633,6 +634,7 @@ }, { "ciqual_food_code" : "16129", + "ecobalyse_code" : "refined-palm-oil", "from_palm_oil" : "yes", "id" : "en:palm-oil", "is_in_taxonomy" : 1, @@ -694,6 +696,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 8, "languages" : {}, "languages_codes" : {}, diff --git a/tests/unit/expected_test_results/attributes/fr-vegetable-oils.json b/tests/unit/expected_test_results/attributes/fr-vegetable-oils.json index e1a2eef7b4a5a..91c52f42cbfd1 100644 --- a/tests/unit/expected_test_results/attributes/fr-vegetable-oils.json +++ b/tests/unit/expected_test_results/attributes/fr-vegetable-oils.json @@ -619,6 +619,7 @@ "ingredients" : [ { "ciqual_food_code" : "9545", + "ecobalyse_proxy_code" : "flour", "id" : "en:corn-flour", "is_in_taxonomy" : 1, "percent_estimate" : 66.6666666666667, @@ -704,6 +705,11 @@ "en:vegetable-oil" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:salt", + "en:vegetable-oil" + ], + "ingredients_without_ecobalyse_ids_n" : 2, "known_ingredients_n" : 8, "languages" : {}, "languages_codes" : {}, diff --git a/tests/unit/expected_test_results/ecoscore/calvados-ingredients-no-origins.json b/tests/unit/expected_test_results/ecoscore/calvados-ingredients-no-origins.json index f71a7e1061b15..423e25c1a0305 100644 --- a/tests/unit/expected_test_results/ecoscore/calvados-ingredients-no-origins.json +++ b/tests/unit/expected_test_results/ecoscore/calvados-ingredients-no-origins.json @@ -290,6 +290,10 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:wine" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 2, "lc" : "en", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ecoscore/carrots-plastic.json b/tests/unit/expected_test_results/ecoscore/carrots-plastic.json index aff1d0f11ae9b..a94e47ca45eb9 100644 --- a/tests/unit/expected_test_results/ecoscore/carrots-plastic.json +++ b/tests/unit/expected_test_results/ecoscore/carrots-plastic.json @@ -405,6 +405,7 @@ "ingredients" : [ { "ciqual_food_code" : "20009", + "ecobalyse_code" : "carrot-non-eu", "id" : "en:carrot", "is_in_taxonomy" : 1, "origins" : "en:france", @@ -450,6 +451,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 4, "labels_tags" : [ "en:demeter" diff --git a/tests/unit/expected_test_results/ecoscore/carrots.json b/tests/unit/expected_test_results/ecoscore/carrots.json index bbbb463f01d30..51eb5210f22d3 100644 --- a/tests/unit/expected_test_results/ecoscore/carrots.json +++ b/tests/unit/expected_test_results/ecoscore/carrots.json @@ -407,6 +407,7 @@ "ingredients" : [ { "ciqual_food_code" : "20009", + "ecobalyse_code" : "carrot-non-eu", "id" : "en:carrot", "is_in_taxonomy" : 1, "origins" : "en:france", @@ -452,6 +453,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 4, "labels_tags" : [ "en:demeter" diff --git a/tests/unit/expected_test_results/ecoscore/category-without-ecoscore-sodas.json b/tests/unit/expected_test_results/ecoscore/category-without-ecoscore-sodas.json index f0eaa0563ce80..e3e13a21b394e 100644 --- a/tests/unit/expected_test_results/ecoscore/category-without-ecoscore-sodas.json +++ b/tests/unit/expected_test_results/ecoscore/category-without-ecoscore-sodas.json @@ -244,6 +244,7 @@ "ingredients" : [ { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent_estimate" : 75, @@ -255,6 +256,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 25, @@ -300,6 +302,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 4, "lc" : "en", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ecoscore/energy-drink.json b/tests/unit/expected_test_results/ecoscore/energy-drink.json index 8615402e0bf62..90dcd1ff8f9d7 100644 --- a/tests/unit/expected_test_results/ecoscore/energy-drink.json +++ b/tests/unit/expected_test_results/ecoscore/energy-drink.json @@ -262,6 +262,7 @@ "ingredients" : [ { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent_estimate" : 75, @@ -315,6 +316,10 @@ "en:caffeine" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:caffeine" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 2, "lc" : "fr", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ecoscore/foie-gras.json b/tests/unit/expected_test_results/ecoscore/foie-gras.json index 8ea411432dec2..5aaf352817051 100644 --- a/tests/unit/expected_test_results/ecoscore/foie-gras.json +++ b/tests/unit/expected_test_results/ecoscore/foie-gras.json @@ -466,6 +466,10 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:duck-foie-gras" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 4, "lc" : "fr", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ecoscore/fr-verseur-en-plastique.json b/tests/unit/expected_test_results/ecoscore/fr-verseur-en-plastique.json index d2f41026f3b6c..05cbba720a8c0 100644 --- a/tests/unit/expected_test_results/ecoscore/fr-verseur-en-plastique.json +++ b/tests/unit/expected_test_results/ecoscore/fr-verseur-en-plastique.json @@ -433,6 +433,7 @@ "ingredients" : [ { "ciqual_food_code" : "17270", + "ecobalyse_code" : "extra-virgin-olive-oil", "from_palm_oil" : "no", "id" : "en:extra-virgin-olive-oil", "is_in_taxonomy" : 1, @@ -482,6 +483,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 6, "lc" : "fr", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ecoscore/fr-viande-porcine-francaise.json b/tests/unit/expected_test_results/ecoscore/fr-viande-porcine-francaise.json index da6c5b0c9797f..f77573b779586 100644 --- a/tests/unit/expected_test_results/ecoscore/fr-viande-porcine-francaise.json +++ b/tests/unit/expected_test_results/ecoscore/fr-viande-porcine-francaise.json @@ -410,6 +410,7 @@ "ingredients" : [ { "ciqual_food_code" : "20026", + "ecobalyse_code" : "endive-eu", "id" : "en:belgian-endive", "is_in_taxonomy" : 1, "percent" : 40, @@ -422,6 +423,7 @@ }, { "ciqual_proxy_food_code" : "28205", + "ecobalyse_code" : "cooked-ham", "id" : "en:cooked-ham", "is_in_taxonomy" : 1, "origins" : "en:france", @@ -434,6 +436,7 @@ }, { "ciqual_food_code" : "22002", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg-yolk", "is_in_taxonomy" : 1, "origins" : "en:france", @@ -517,6 +520,10 @@ "ingredients_with_unspecified_percent_sum" : 60, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:salt" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 12, "labels" : "viande porcine française, oeufs de France", "labels_hierarchy" : [ diff --git a/tests/unit/expected_test_results/ecoscore/fresh-vegetable.json b/tests/unit/expected_test_results/ecoscore/fresh-vegetable.json index 1c334fdd758bb..ab341264d76d2 100644 --- a/tests/unit/expected_test_results/ecoscore/fresh-vegetable.json +++ b/tests/unit/expected_test_results/ecoscore/fresh-vegetable.json @@ -254,6 +254,7 @@ "ingredients" : [ { "ciqual_food_code" : "20047", + "ecobalyse_code" : "tomato-heated-greenhouse-eu", "id" : "en:tomato", "is_in_taxonomy" : 1, "percent_estimate" : 100, @@ -296,6 +297,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 3, "lc" : "en", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ecoscore/frozen-vegetable.json b/tests/unit/expected_test_results/ecoscore/frozen-vegetable.json index 3d7b2fa03fd93..adaf911abb8bd 100644 --- a/tests/unit/expected_test_results/ecoscore/frozen-vegetable.json +++ b/tests/unit/expected_test_results/ecoscore/frozen-vegetable.json @@ -411,6 +411,7 @@ "ingredients" : [ { "ciqual_food_code" : "20009", + "ecobalyse_code" : "carrot-non-eu", "id" : "en:carrot", "is_in_taxonomy" : 1, "percent_estimate" : 100, @@ -455,6 +456,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 4, "lc" : "en", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ecoscore/grade-a-with-non-recyclable-label.json b/tests/unit/expected_test_results/ecoscore/grade-a-with-non-recyclable-label.json index b191b938722b8..91d5d730acc40 100644 --- a/tests/unit/expected_test_results/ecoscore/grade-a-with-non-recyclable-label.json +++ b/tests/unit/expected_test_results/ecoscore/grade-a-with-non-recyclable-label.json @@ -421,6 +421,7 @@ "ingredients" : [ { "ciqual_food_code" : "20053", + "ecobalyse_code" : "eggplant-eu", "id" : "en:aubergine", "is_in_taxonomy" : 1, "percent" : 60, @@ -433,6 +434,7 @@ }, { "ciqual_food_code" : "4003", + "ecobalyse_code" : "potato-industry-fr", "id" : "en:potato", "is_in_taxonomy" : 1, "percent" : 39, @@ -445,6 +447,7 @@ }, { "ciqual_food_code" : "17130", + "ecobalyse_code" : "rapeseed-oil", "from_palm_oil" : "no", "id" : "en:colza-oil", "is_in_taxonomy" : 1, @@ -505,6 +508,8 @@ "ingredients_with_unspecified_percent_sum" : 0, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 10, "labels_tags" : [ "en:eu-organic" diff --git a/tests/unit/expected_test_results/ecoscore/grade-a-with-recyclable-label.json b/tests/unit/expected_test_results/ecoscore/grade-a-with-recyclable-label.json index 5872895b373a2..0a90626969afb 100644 --- a/tests/unit/expected_test_results/ecoscore/grade-a-with-recyclable-label.json +++ b/tests/unit/expected_test_results/ecoscore/grade-a-with-recyclable-label.json @@ -421,6 +421,7 @@ "ingredients" : [ { "ciqual_food_code" : "20053", + "ecobalyse_code" : "eggplant-eu", "id" : "en:aubergine", "is_in_taxonomy" : 1, "percent" : 60, @@ -433,6 +434,7 @@ }, { "ciqual_food_code" : "4003", + "ecobalyse_code" : "potato-industry-fr", "id" : "en:potato", "is_in_taxonomy" : 1, "percent" : 39, @@ -445,6 +447,7 @@ }, { "ciqual_food_code" : "17130", + "ecobalyse_code" : "rapeseed-oil", "from_palm_oil" : "no", "id" : "en:colza-oil", "is_in_taxonomy" : 1, @@ -505,6 +508,8 @@ "ingredients_with_unspecified_percent_sum" : 0, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 10, "labels_tags" : [ "en:eu-organic" diff --git a/tests/unit/expected_test_results/ecoscore/lamb-leg.json b/tests/unit/expected_test_results/ecoscore/lamb-leg.json index 3f520540aff8a..814cb01f15992 100644 --- a/tests/unit/expected_test_results/ecoscore/lamb-leg.json +++ b/tests/unit/expected_test_results/ecoscore/lamb-leg.json @@ -450,6 +450,10 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:lamb-leg" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 4, "lc" : "en", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ecoscore/milk.json b/tests/unit/expected_test_results/ecoscore/milk.json index b1d38de8133b3..6b32f044319c4 100644 --- a/tests/unit/expected_test_results/ecoscore/milk.json +++ b/tests/unit/expected_test_results/ecoscore/milk.json @@ -414,6 +414,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "origins" : "en:brittany", @@ -459,6 +460,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 2, "labels_tags" : [ "en:eu-organic" diff --git a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-in-origins-field-multiple.json b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-in-origins-field-multiple.json index 2e668a1c00e3e..bd99087feff96 100644 --- a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-in-origins-field-multiple.json +++ b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-in-origins-field-multiple.json @@ -408,6 +408,7 @@ "ingredients" : [ { "ciqual_food_code" : "13000", + "ecobalyse_code" : "apricot-eu", "id" : "en:apricot", "is_in_taxonomy" : 1, "percent" : 60, @@ -420,6 +421,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:cane-sugar", "is_in_taxonomy" : 1, "origins" : "en:martinique", @@ -491,6 +493,10 @@ "ingredients_with_unspecified_percent_sum" : 10, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:lemon-juice" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 10, "lc" : "en", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-in-origins-field.json b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-in-origins-field.json index 926db6d7a4bfc..81d0b6decf7aa 100644 --- a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-in-origins-field.json +++ b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-in-origins-field.json @@ -405,6 +405,7 @@ "ingredients" : [ { "ciqual_food_code" : "13000", + "ecobalyse_code" : "apricot-eu", "id" : "en:apricot", "is_in_taxonomy" : 1, "percent" : 60, @@ -417,6 +418,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:cane-sugar", "is_in_taxonomy" : 1, "origins" : "en:martinique", @@ -488,6 +490,10 @@ "ingredients_with_unspecified_percent_sum" : 10, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:lemon-juice" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 10, "lc" : "en", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-nested-2.json b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-nested-2.json index 5e758dcb892f1..23ba495d16cb9 100644 --- a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-nested-2.json +++ b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-nested-2.json @@ -401,6 +401,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 66.6666666666667, @@ -534,6 +535,15 @@ "en:sweetener" ], "ingredients_without_ciqual_codes_n" : 3, + "ingredients_without_ecobalyse_ids" : [ + "en:chocolate", + "en:cocoa", + "en:cocoa-butter", + "en:e951", + "en:salt", + "en:sweetener" + ], + "ingredients_without_ecobalyse_ids_n" : 6, "known_ingredients_n" : 9, "lc" : "en", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-nested.json b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-nested.json index c1e52da4456c7..535f4eb8fcbad 100644 --- a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-nested.json +++ b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-nested.json @@ -401,6 +401,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 66.6666666666667, @@ -488,6 +489,12 @@ "en:e160b" ], "ingredients_without_ciqual_codes_n" : 2, + "ingredients_without_ecobalyse_ids" : [ + "en:colour", + "en:e160b", + "en:salt" + ], + "ingredients_without_ecobalyse_ids_n" : 3, "known_ingredients_n" : 5, "lc" : "en", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-not-specified.json b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-not-specified.json index 43386b520355f..d09f7bb015d50 100644 --- a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-not-specified.json +++ b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-not-specified.json @@ -401,6 +401,7 @@ "ingredients" : [ { "ciqual_food_code" : "13000", + "ecobalyse_code" : "apricot-eu", "id" : "en:apricot", "is_in_taxonomy" : 1, "percent" : 60, @@ -413,6 +414,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:cane-sugar", "is_in_taxonomy" : 1, "percent" : 30, @@ -483,6 +485,10 @@ "ingredients_with_unspecified_percent_sum" : 10, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:lemon-juice" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 10, "lc" : "en", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-partly-specified.json b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-partly-specified.json index 9aa3a5de168e4..71c6acfd1a3d6 100644 --- a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-partly-specified.json +++ b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-partly-specified.json @@ -403,6 +403,7 @@ "ingredients" : [ { "ciqual_food_code" : "13000", + "ecobalyse_code" : "apricot-eu", "id" : "en:apricot", "is_in_taxonomy" : 1, "origins" : "en:france", @@ -416,6 +417,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:cane-sugar", "is_in_taxonomy" : 1, "percent" : 30, @@ -486,6 +488,10 @@ "ingredients_with_unspecified_percent_sum" : 10, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:lemon-juice" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 10, "lc" : "en", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-specified-multiple.json b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-specified-multiple.json index 059ac44dd8214..01a19f675cfca 100644 --- a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-specified-multiple.json +++ b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-specified-multiple.json @@ -419,6 +419,7 @@ "ingredients" : [ { "ciqual_food_code" : "13000", + "ecobalyse_code" : "apricot-eu", "id" : "en:apricot", "is_in_taxonomy" : 1, "origins" : "en:france,en:spain", @@ -432,6 +433,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:cane-sugar", "is_in_taxonomy" : 1, "origins" : "en:martinique,en:guadeloupe,en:dominican-republic", @@ -503,6 +505,10 @@ "ingredients_with_unspecified_percent_sum" : 10, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:lemon-juice" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 10, "lc" : "en", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-specified.json b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-specified.json index 4938d2c629bfc..841a4e1d19fa4 100644 --- a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-specified.json +++ b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-specified.json @@ -409,6 +409,7 @@ "ingredients" : [ { "ciqual_food_code" : "13000", + "ecobalyse_code" : "apricot-eu", "id" : "en:apricot", "is_in_taxonomy" : 1, "origins" : "en:france", @@ -422,6 +423,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:cane-sugar", "is_in_taxonomy" : 1, "origins" : "en:martinique", @@ -494,6 +496,10 @@ "ingredients_with_unspecified_percent_sum" : 10, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:lemon-juice" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 10, "lc" : "en", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-unknown-origin.json b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-unknown-origin.json index 52577e4b21c89..bcafafbf1dc3b 100644 --- a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-unknown-origin.json +++ b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-unknown-origin.json @@ -401,6 +401,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "origins" : "en:Milky way", @@ -446,6 +447,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 2, "lc" : "en", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-unspecified-origin.json b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-unspecified-origin.json index 5b6cc0198386d..ea9f5dd58985d 100644 --- a/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-unspecified-origin.json +++ b/tests/unit/expected_test_results/ecoscore/origins-of-ingredients-unspecified-origin.json @@ -399,6 +399,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 100, @@ -443,6 +444,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 2, "lc" : "en", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ecoscore/packaging-fr-new-shapes.json b/tests/unit/expected_test_results/ecoscore/packaging-fr-new-shapes.json index ebf42054406b7..c6388f4ca6609 100644 --- a/tests/unit/expected_test_results/ecoscore/packaging-fr-new-shapes.json +++ b/tests/unit/expected_test_results/ecoscore/packaging-fr-new-shapes.json @@ -480,6 +480,10 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:wheat" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 2, "lc" : "fr", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ecoscore/packaging-unspecified-no-a-eco-score.json b/tests/unit/expected_test_results/ecoscore/packaging-unspecified-no-a-eco-score.json index 81f83b381a222..c1cb6a02662de 100644 --- a/tests/unit/expected_test_results/ecoscore/packaging-unspecified-no-a-eco-score.json +++ b/tests/unit/expected_test_results/ecoscore/packaging-unspecified-no-a-eco-score.json @@ -442,6 +442,10 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:wheat" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 2, "labels_tags" : [ "fr:ab-agriculture-biologique" diff --git a/tests/unit/expected_test_results/ecoscore/sum-of-bonuses-greater-than-25.json b/tests/unit/expected_test_results/ecoscore/sum-of-bonuses-greater-than-25.json index a218ad1e2e74f..a0e24b25e392a 100644 --- a/tests/unit/expected_test_results/ecoscore/sum-of-bonuses-greater-than-25.json +++ b/tests/unit/expected_test_results/ecoscore/sum-of-bonuses-greater-than-25.json @@ -455,6 +455,10 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:chicken" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 2, "labels_tags" : [ "en:demeter" diff --git a/tests/unit/expected_test_results/ecoscore/track-ecoscore-changes.json b/tests/unit/expected_test_results/ecoscore/track-ecoscore-changes.json index ad160bac5cea8..1c5e7050374b0 100644 --- a/tests/unit/expected_test_results/ecoscore/track-ecoscore-changes.json +++ b/tests/unit/expected_test_results/ecoscore/track-ecoscore-changes.json @@ -473,6 +473,10 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:duck-foie-gras" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 4, "lc" : "fr", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ecoscore/track-ecoscore-no-change.json b/tests/unit/expected_test_results/ecoscore/track-ecoscore-no-change.json index cee0faac2da50..b0a4d6ddd6410 100644 --- a/tests/unit/expected_test_results/ecoscore/track-ecoscore-no-change.json +++ b/tests/unit/expected_test_results/ecoscore/track-ecoscore-no-change.json @@ -466,6 +466,10 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:duck-foie-gras" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 4, "lc" : "fr", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ecoscore/track-ecoscore-same-grade.json b/tests/unit/expected_test_results/ecoscore/track-ecoscore-same-grade.json index 58480021fcd71..8fe7ea6f2052b 100644 --- a/tests/unit/expected_test_results/ecoscore/track-ecoscore-same-grade.json +++ b/tests/unit/expected_test_results/ecoscore/track-ecoscore-same-grade.json @@ -473,6 +473,10 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:duck-foie-gras" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 4, "lc" : "fr", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ecoscore/track-ecoscore-tags-retained.json b/tests/unit/expected_test_results/ecoscore/track-ecoscore-tags-retained.json index 928551bcdcb00..76f5bd566fb5f 100644 --- a/tests/unit/expected_test_results/ecoscore/track-ecoscore-tags-retained.json +++ b/tests/unit/expected_test_results/ecoscore/track-ecoscore-tags-retained.json @@ -471,6 +471,10 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:duck-foie-gras" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 4, "lc" : "fr", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ecoscore/uk-milk.json b/tests/unit/expected_test_results/ecoscore/uk-milk.json index 8fd70b8efa111..6690f146a31b7 100644 --- a/tests/unit/expected_test_results/ecoscore/uk-milk.json +++ b/tests/unit/expected_test_results/ecoscore/uk-milk.json @@ -417,6 +417,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "origins" : "en:england", @@ -462,6 +463,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 2, "lc" : "en", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/forest_footprint/fr-ingredients-filet-de-poulet-bio-oeuf-label-rouge-os-de-poulet-igp.json b/tests/unit/expected_test_results/forest_footprint/fr-ingredients-filet-de-poulet-bio-oeuf-label-rouge-os-de-poulet-igp.json index bd2ac21a9949b..45b41f050df80 100644 --- a/tests/unit/expected_test_results/forest_footprint/fr-ingredients-filet-de-poulet-bio-oeuf-label-rouge-os-de-poulet-igp.json +++ b/tests/unit/expected_test_results/forest_footprint/fr-ingredients-filet-de-poulet-bio-oeuf-label-rouge-os-de-poulet-igp.json @@ -83,6 +83,7 @@ }, { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg", "is_in_taxonomy" : 1, "labels" : "fr:label-rouge", @@ -158,6 +159,11 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:chicken-bone", + "en:chicken-fillet" + ], + "ingredients_without_ecobalyse_ids_n" : 2, "known_ingredients_n" : 7, "lc" : "fr", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/forest_footprint/fr-ingredients-filet-de-poulet-bio.json b/tests/unit/expected_test_results/forest_footprint/fr-ingredients-filet-de-poulet-bio.json index d782bf115fc7e..fd5ab0e2235c3 100644 --- a/tests/unit/expected_test_results/forest_footprint/fr-ingredients-filet-de-poulet-bio.json +++ b/tests/unit/expected_test_results/forest_footprint/fr-ingredients-filet-de-poulet-bio.json @@ -81,6 +81,10 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:chicken-fillet" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 4, "lc" : "fr", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/forest_footprint/fr-ingredients-lait.json b/tests/unit/expected_test_results/forest_footprint/fr-ingredients-lait.json index 14a0ccea4d49e..3230bfd9455a8 100644 --- a/tests/unit/expected_test_results/forest_footprint/fr-ingredients-lait.json +++ b/tests/unit/expected_test_results/forest_footprint/fr-ingredients-lait.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 100, @@ -46,6 +47,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 2, "lc" : "fr", "nutriments" : { diff --git a/tests/unit/expected_test_results/forest_footprint/fr-ingredients-nested-matching-ingredient.json b/tests/unit/expected_test_results/forest_footprint/fr-ingredients-nested-matching-ingredient.json index 393af80a42069..6a65319f0c59f 100644 --- a/tests/unit/expected_test_results/forest_footprint/fr-ingredients-nested-matching-ingredient.json +++ b/tests/unit/expected_test_results/forest_footprint/fr-ingredients-nested-matching-ingredient.json @@ -38,6 +38,7 @@ }, { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent_estimate" : 16.6666666666667, @@ -130,6 +131,12 @@ "en:kangaroo" ], "ingredients_without_ciqual_codes_n" : 2, + "ingredients_without_ecobalyse_ids" : [ + "en:brine", + "en:kangaroo", + "fr:viande-de-poulet-traitee-en-salaison" + ], + "ingredients_without_ecobalyse_ids_n" : 3, "known_ingredients_n" : 9, "lc" : "fr", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/forest_footprint/fr-ingredients-nested-matching-sub-ingredient.json b/tests/unit/expected_test_results/forest_footprint/fr-ingredients-nested-matching-sub-ingredient.json index b0bfd7701cd34..68cf72ba0f44a 100644 --- a/tests/unit/expected_test_results/forest_footprint/fr-ingredients-nested-matching-sub-ingredient.json +++ b/tests/unit/expected_test_results/forest_footprint/fr-ingredients-nested-matching-sub-ingredient.json @@ -45,6 +45,7 @@ }, { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent_estimate" : 16.6666666666667, @@ -132,6 +133,12 @@ "en:brine" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:brine", + "en:chicken-meat", + "fr:viande-de-poulet-traitee-en-salaison" + ], + "ingredients_without_ecobalyse_ids_n" : 3, "known_ingredients_n" : 7, "lc" : "fr", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/forest_footprint/fr-ingredients-poulet-du-gers.json b/tests/unit/expected_test_results/forest_footprint/fr-ingredients-poulet-du-gers.json index 3c76a9b1355bb..61c3b04590925 100644 --- a/tests/unit/expected_test_results/forest_footprint/fr-ingredients-poulet-du-gers.json +++ b/tests/unit/expected_test_results/forest_footprint/fr-ingredients-poulet-du-gers.json @@ -77,6 +77,10 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:chicken" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 2, "lc" : "fr", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/forest_footprint/fr-ingredients-poulet.json b/tests/unit/expected_test_results/forest_footprint/fr-ingredients-poulet.json index 96386b34bfd04..aa906338d0766 100644 --- a/tests/unit/expected_test_results/forest_footprint/fr-ingredients-poulet.json +++ b/tests/unit/expected_test_results/forest_footprint/fr-ingredients-poulet.json @@ -71,6 +71,10 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:chicken" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 2, "lc" : "fr", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ingredients/ca-middle-dot.json b/tests/unit/expected_test_results/ingredients/ca-middle-dot.json index 1c2aab97f50a9..e51c9c66a16d8 100644 --- a/tests/unit/expected_test_results/ingredients/ca-middle-dot.json +++ b/tests/unit/expected_test_results/ingredients/ca-middle-dot.json @@ -2,10 +2,12 @@ "ingredients" : [ { "ciqual_food_code" : "19590", + "ecobalyse_code" : "mozzarella", "id" : "en:mozzarella", "ingredients" : [ { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:pasteurised-cow-s-milk", "is_in_taxonomy" : 1, "percent_estimate" : 43.75, @@ -153,6 +155,14 @@ "en:rennet" ], "ingredients_without_ciqual_codes_n" : 4, + "ingredients_without_ecobalyse_ids" : [ + "en:anti-caking-agent", + "en:e460", + "en:lactic-ferments", + "en:rennet", + "en:salt" + ], + "ingredients_without_ecobalyse_ids_n" : 5, "known_ingredients_n" : 16, "lc" : "ca", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-allergens-in-parenthesis.json b/tests/unit/expected_test_results/ingredients/en-allergens-in-parenthesis.json index 45f173ceee8bf..615bb22edb73b 100644 --- a/tests/unit/expected_test_results/ingredients/en-allergens-in-parenthesis.json +++ b/tests/unit/expected_test_results/ingredients/en-allergens-in-parenthesis.json @@ -3,6 +3,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "16400", + "ecobalyse_code" : "butter", "id" : "en:butter", "is_in_taxonomy" : 1, "percent_estimate" : 62.5, @@ -25,6 +26,7 @@ }, { "ciqual_proxy_food_code" : "9410", + "ecobalyse_code" : "flour", "id" : "en:wheat-flour", "is_in_taxonomy" : 1, "percent_estimate" : 9.375, @@ -39,6 +41,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "9410", + "ecobalyse_proxy_code" : "flour", "id" : "en:flour", "is_in_taxonomy" : 1, "percent_estimate" : 4.6875, @@ -71,6 +74,7 @@ }, { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent_estimate" : 1.171875, @@ -164,6 +168,13 @@ "en:gluten" ], "ingredients_without_ciqual_codes_n" : 2, + "ingredients_without_ecobalyse_ids" : [ + "en:dough", + "en:gluten", + "en:salt", + "en:surimi" + ], + "ingredients_without_ecobalyse_ids_n" : 4, "known_ingredients_n" : 13, "lc" : "en", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-category-types.json b/tests/unit/expected_test_results/ingredients/en-category-types.json index c85a7d63b8440..3c65885a49cb5 100644 --- a/tests/unit/expected_test_results/ingredients/en-category-types.json +++ b/tests/unit/expected_test_results/ingredients/en-category-types.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "17130", + "ecobalyse_code" : "rapeseed-oil", "from_palm_oil" : "no", "id" : "en:rapeseed-oil", "is_in_taxonomy" : 1, @@ -14,6 +15,7 @@ }, { "ciqual_proxy_food_code" : "16129", + "ecobalyse_code" : "refined-palm-oil", "from_palm_oil" : "yes", "id" : "en:palm-fat", "is_in_taxonomy" : 1, @@ -99,6 +101,11 @@ "en:sunflower-fat" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:shea-butter", + "en:sunflower-fat" + ], + "ingredients_without_ecobalyse_ids_n" : 2, "known_ingredients_n" : 8, "lc" : "de", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-comma-and-pepper.json b/tests/unit/expected_test_results/ingredients/en-comma-and-pepper.json index b660de28df68d..fb4b4b44021b3 100644 --- a/tests/unit/expected_test_results/ingredients/en-comma-and-pepper.json +++ b/tests/unit/expected_test_results/ingredients/en-comma-and-pepper.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 66.6666666666667, @@ -74,6 +75,11 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:pepper", + "en:salt" + ], + "ingredients_without_ecobalyse_ids_n" : 2, "known_ingredients_n" : 6, "lc" : "en", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-content-of-ingredient.json b/tests/unit/expected_test_results/ingredients/en-content-of-ingredient.json index c3aa6d065749d..56de8a7940381 100644 --- a/tests/unit/expected_test_results/ingredients/en-content-of-ingredient.json +++ b/tests/unit/expected_test_results/ingredients/en-content-of-ingredient.json @@ -16,6 +16,8 @@ "ingredients_with_unspecified_percent_sum" : 0, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 0, "lc" : "en", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-emulsifier-synonyms.json b/tests/unit/expected_test_results/ingredients/en-emulsifier-synonyms.json index 5a6298b89b9f7..23118fd8c557a 100644 --- a/tests/unit/expected_test_results/ingredients/en-emulsifier-synonyms.json +++ b/tests/unit/expected_test_results/ingredients/en-emulsifier-synonyms.json @@ -124,6 +124,15 @@ "en:stabiliser" ], "ingredients_without_ciqual_codes_n" : 6, + "ingredients_without_ecobalyse_ids" : [ + "en:e410", + "en:e412", + "en:e471", + "en:e477", + "en:emulsifier", + "en:stabiliser" + ], + "ingredients_without_ecobalyse_ids_n" : 6, "known_ingredients_n" : 6, "lc" : "en", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-flavour-synonyms.json b/tests/unit/expected_test_results/ingredients/en-flavour-synonyms.json index e63c6403ea711..0ac92aafa012a 100644 --- a/tests/unit/expected_test_results/ingredients/en-flavour-synonyms.json +++ b/tests/unit/expected_test_results/ingredients/en-flavour-synonyms.json @@ -68,6 +68,11 @@ "en:natural-orange-flavouring" ], "ingredients_without_ciqual_codes_n" : 2, + "ingredients_without_ecobalyse_ids" : [ + "en:lemon-flavouring", + "en:natural-orange-flavouring" + ], + "ingredients_without_ecobalyse_ids_n" : 2, "known_ingredients_n" : 4, "lc" : "en", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-fruits-sub-ingredients.json b/tests/unit/expected_test_results/ingredients/en-fruits-sub-ingredients.json index 57efd6d5dc23e..b87d495ca0187 100644 --- a/tests/unit/expected_test_results/ingredients/en-fruits-sub-ingredients.json +++ b/tests/unit/expected_test_results/ingredients/en-fruits-sub-ingredients.json @@ -5,6 +5,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent" : 20, @@ -16,6 +17,7 @@ "vegetarian" : "yes" }, { + "ecobalyse_code" : "pear-eu", "id" : "en:pear", "is_in_taxonomy" : 1, "percent" : 15, @@ -39,6 +41,7 @@ }, { "ciqual_proxy_food_code" : "13009", + "ecobalyse_code" : "lemon-eu", "id" : "en:lemon", "is_in_taxonomy" : 1, "percent_estimate" : 3.75, @@ -60,6 +63,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 50, @@ -124,6 +128,11 @@ "en:pear" ], "ingredients_without_ciqual_codes_n" : 2, + "ingredients_without_ecobalyse_ids" : [ + "en:cranberry", + "en:fruit" + ], + "ingredients_without_ecobalyse_ids_n" : 2, "known_ingredients_n" : 10, "lc" : "en", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ingredients/en-illegal-division-by-zero.json b/tests/unit/expected_test_results/ingredients/en-illegal-division-by-zero.json index a223e2b6e68be..02db941a5f05c 100644 --- a/tests/unit/expected_test_results/ingredients/en-illegal-division-by-zero.json +++ b/tests/unit/expected_test_results/ingredients/en-illegal-division-by-zero.json @@ -68,6 +68,11 @@ "en:paracetamol-500-m-5-060198-790" ], "ingredients_without_ciqual_codes_n" : 2, + "ingredients_without_ecobalyse_ids" : [ + "en:each-capsule-contains", + "en:paracetamol-500-m-5-060198-790" + ], + "ingredients_without_ecobalyse_ids_n" : 2, "known_ingredients_n" : 0, "lc" : "en", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-ing1-and-ing2-processing-parenthesis.json b/tests/unit/expected_test_results/ingredients/en-ing1-and-ing2-processing-parenthesis.json index adf6068872b89..67e31b1fad811 100644 --- a/tests/unit/expected_test_results/ingredients/en-ing1-and-ing2-processing-parenthesis.json +++ b/tests/unit/expected_test_results/ingredients/en-ing1-and-ing2-processing-parenthesis.json @@ -5,6 +5,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent_estimate" : 45.8333333333333, @@ -16,6 +17,7 @@ }, { "ciqual_food_code" : "13005", + "ecobalyse_code" : "banana-non-eu", "id" : "en:banana", "is_in_taxonomy" : 1, "percent_estimate" : 14.5833333333333, @@ -27,6 +29,7 @@ }, { "ciqual_food_code" : "13008", + "ecobalyse_code" : "cherry-tr", "id" : "en:cherry", "is_in_taxonomy" : 1, "percent_estimate" : 14.5833333333333, @@ -51,6 +54,7 @@ "ingredients" : [ { "ciqual_food_code" : "13004", + "ecobalyse_code" : "avocado-non-eu", "id" : "en:avocado", "is_in_taxonomy" : 1, "percent_estimate" : 12.5, @@ -63,6 +67,7 @@ }, { "ciqual_food_code" : "20089", + "ecobalyse_code" : "radish-organic", "id" : "en:black-radish", "is_in_taxonomy" : 1, "percent_estimate" : 12.5, @@ -144,6 +149,11 @@ "en:vegetable" ], "ingredients_without_ciqual_codes_n" : 2, + "ingredients_without_ecobalyse_ids" : [ + "en:fruit", + "en:vegetable" + ], + "ingredients_without_ecobalyse_ids_n" : 2, "known_ingredients_n" : 13, "lc" : "en", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-ing1-and-ing2-processing.json b/tests/unit/expected_test_results/ingredients/en-ing1-and-ing2-processing.json index e74c833a00966..f4b012877d8ef 100644 --- a/tests/unit/expected_test_results/ingredients/en-ing1-and-ing2-processing.json +++ b/tests/unit/expected_test_results/ingredients/en-ing1-and-ing2-processing.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent_estimate" : 52.7777777777778, @@ -13,6 +14,7 @@ }, { "ciqual_food_code" : "13005", + "ecobalyse_code" : "banana-non-eu", "id" : "en:banana", "is_in_taxonomy" : 1, "percent_estimate" : 23.6111111111111, @@ -25,6 +27,7 @@ }, { "ciqual_food_code" : "13008", + "ecobalyse_code" : "cherry-tr", "id" : "en:cherry", "is_in_taxonomy" : 1, "percent_estimate" : 11.8055555555556, @@ -81,6 +84,7 @@ }, { "ciqual_food_code" : "13028", + "ecobalyse_code" : "blueberry-non-eu", "id" : "en:bilberry", "is_in_taxonomy" : 1, "percent_estimate" : 0.368923611111114, @@ -104,6 +108,7 @@ }, { "ciqual_food_code" : "13021", + "ecobalyse_code" : "kiwi-non-eu", "id" : "en:kiwi", "is_in_taxonomy" : 1, "percent_estimate" : 0.0922309027777786, @@ -116,6 +121,7 @@ }, { "ciqual_proxy_food_code" : "13009", + "ecobalyse_code" : "lemon-eu", "id" : "en:lemon", "is_in_taxonomy" : 1, "percent_estimate" : 0.0461154513888857, @@ -135,6 +141,7 @@ }, { "ciqual_food_code" : "13025", + "ecobalyse_code" : "mango-non-eu", "id" : "en:mango", "is_in_taxonomy" : 1, "percent_estimate" : 0.0115288628472214, @@ -174,6 +181,7 @@ }, { "ciqual_proxy_food_code" : "13034", + "ecobalyse_code" : "orange-non-eu", "id" : "en:orange", "is_in_taxonomy" : 1, "percent_estimate" : 0.000720553927948231, @@ -311,6 +319,19 @@ "en:unknown-fruit2" ], "ingredients_without_ciqual_codes_n" : 5, + "ingredients_without_ecobalyse_ids" : [ + "en:caramelized-unknown-fruit4", + "en:date", + "en:elderberry", + "en:fig", + "en:fried-unknown-fruit3", + "en:grape", + "en:jackfruit", + "en:nectarine", + "en:unknown-fruit", + "en:unknown-fruit2" + ], + "ingredients_without_ecobalyse_ids_n" : 10, "known_ingredients_n" : 21, "lc" : "en", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-ingredient-content.json b/tests/unit/expected_test_results/ingredients/en-ingredient-content.json index 8304a63134093..63c2cbb58972d 100644 --- a/tests/unit/expected_test_results/ingredients/en-ingredient-content.json +++ b/tests/unit/expected_test_results/ingredients/en-ingredient-content.json @@ -16,6 +16,8 @@ "ingredients_with_unspecified_percent_sum" : 0, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 0, "lc" : "en", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-ingredients-analysis-unknown-ingredients.json b/tests/unit/expected_test_results/ingredients/en-ingredients-analysis-unknown-ingredients.json index 40c60dee485ed..75b1872c31ed1 100644 --- a/tests/unit/expected_test_results/ingredients/en-ingredients-analysis-unknown-ingredients.json +++ b/tests/unit/expected_test_results/ingredients/en-ingredients-analysis-unknown-ingredients.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 56.25, @@ -40,6 +41,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 2.734375, @@ -72,6 +74,7 @@ }, { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent_estimate" : 0.68359375, @@ -161,6 +164,14 @@ "en:spice" ], "ingredients_without_ciqual_codes_n" : 3, + "ingredients_without_ecobalyse_ids" : [ + "en:another-unknown-ingredient", + "en:pepper", + "en:salt", + "en:some-unknown-ingredient", + "en:spice" + ], + "ingredients_without_ecobalyse_ids_n" : 5, "known_ingredients_n" : 11, "lc" : "en", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-ingredients-in-parenthesis-that-are-in-the-allergens-taxonomy.json b/tests/unit/expected_test_results/ingredients/en-ingredients-in-parenthesis-that-are-in-the-allergens-taxonomy.json index 93a0b97eb07ee..5e41f24bbb82f 100644 --- a/tests/unit/expected_test_results/ingredients/en-ingredients-in-parenthesis-that-are-in-the-allergens-taxonomy.json +++ b/tests/unit/expected_test_results/ingredients/en-ingredients-in-parenthesis-that-are-in-the-allergens-taxonomy.json @@ -3,6 +3,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "16400", + "ecobalyse_code" : "butter", "id" : "en:butter", "is_in_taxonomy" : 1, "percent_estimate" : 75, @@ -82,6 +83,11 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:cheese", + "en:parmigiano-reggiano" + ], + "ingredients_without_ecobalyse_ids_n" : 2, "known_ingredients_n" : 4, "lc" : "en", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-kosher.json b/tests/unit/expected_test_results/ingredients/en-kosher.json index a65bcc66b010b..d0a4be892442d 100644 --- a/tests/unit/expected_test_results/ingredients/en-kosher.json +++ b/tests/unit/expected_test_results/ingredients/en-kosher.json @@ -92,6 +92,12 @@ "en:beef-gelatin" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:american-cheese", + "en:beef-gelatin", + "en:sea-salt" + ], + "ingredients_without_ecobalyse_ids_n" : 3, "known_ingredients_n" : 9, "lc" : "en", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-mechanicaly-separated-meat.json b/tests/unit/expected_test_results/ingredients/en-mechanicaly-separated-meat.json index 01eb5087e842f..34d7b1639fb02 100644 --- a/tests/unit/expected_test_results/ingredients/en-mechanicaly-separated-meat.json +++ b/tests/unit/expected_test_results/ingredients/en-mechanicaly-separated-meat.json @@ -49,6 +49,10 @@ "en:mechanicaly-separated-poultry-meat" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:mechanicaly-separated-poultry-meat" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 0, "lc" : "en", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-nova-4-fruit-juice-concentrates.json b/tests/unit/expected_test_results/ingredients/en-nova-4-fruit-juice-concentrates.json index abb2dd21d8aaf..aab9d69cb8074 100644 --- a/tests/unit/expected_test_results/ingredients/en-nova-4-fruit-juice-concentrates.json +++ b/tests/unit/expected_test_results/ingredients/en-nova-4-fruit-juice-concentrates.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "2074", + "ecobalyse_code" : "apple-fr", "id" : "en:apple-juice", "is_in_taxonomy" : 1, "percent_estimate" : 100, @@ -51,6 +52,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 6, "lc" : "en", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-origin-and.json b/tests/unit/expected_test_results/ingredients/en-origin-and.json index c28800e50ac35..82073a34c30f8 100644 --- a/tests/unit/expected_test_results/ingredients/en-origin-and.json +++ b/tests/unit/expected_test_results/ingredients/en-origin-and.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "20047", + "ecobalyse_code" : "tomato-heated-greenhouse-eu", "id" : "en:tomato", "is_in_taxonomy" : 1, "origins" : "en:france,en:italy", @@ -45,6 +46,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 3, "lc" : "en", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-origin-field-with-commas-and.json b/tests/unit/expected_test_results/ingredients/en-origin-field-with-commas-and.json index 55c4c6f993b70..8d5b77028fcb0 100644 --- a/tests/unit/expected_test_results/ingredients/en-origin-field-with-commas-and.json +++ b/tests/unit/expected_test_results/ingredients/en-origin-field-with-commas-and.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "origins" : "en:united-kingdom,en:european-union", @@ -14,6 +15,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "origins" : "en:paraguay,en:uruguay,en:costa-rica", @@ -66,6 +68,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 5, "lc" : "en", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-origin-field-with-commas.json b/tests/unit/expected_test_results/ingredients/en-origin-field-with-commas.json index 6eed74d45421c..b125c498f8175 100644 --- a/tests/unit/expected_test_results/ingredients/en-origin-field-with-commas.json +++ b/tests/unit/expected_test_results/ingredients/en-origin-field-with-commas.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "origins" : "en:belgium,en:spain", @@ -14,6 +15,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 25, @@ -65,6 +67,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 5, "lc" : "en", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-origin-field-with-not-taxonomized-entries.json b/tests/unit/expected_test_results/ingredients/en-origin-field-with-not-taxonomized-entries.json index 8cb22237e5cb0..9d747d6d4a7d1 100644 --- a/tests/unit/expected_test_results/ingredients/en-origin-field-with-not-taxonomized-entries.json +++ b/tests/unit/expected_test_results/ingredients/en-origin-field-with-not-taxonomized-entries.json @@ -1,6 +1,7 @@ { "ingredients" : [ { + "ecobalyse_code" : "peach-eu", "id" : "en:peach", "is_in_taxonomy" : 1, "origins" : "en:spain", @@ -85,6 +86,11 @@ "en:some-unknown-ingredient" ], "ingredients_without_ciqual_codes_n" : 3, + "ingredients_without_ecobalyse_ids" : [ + "en:another-unknown-ingredient", + "en:some-unknown-ingredient" + ], + "ingredients_without_ecobalyse_ids_n" : 2, "known_ingredients_n" : 3, "lc" : "en", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-origin-field.json b/tests/unit/expected_test_results/ingredients/en-origin-field.json index 9673f28ffee72..23b2b5b1a9d30 100644 --- a/tests/unit/expected_test_results/ingredients/en-origin-field.json +++ b/tests/unit/expected_test_results/ingredients/en-origin-field.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "13014", + "ecobalyse_code" : "strawberry-non-eu", "id" : "en:strawberry", "is_in_taxonomy" : 1, "origins" : "en:spain", @@ -14,6 +15,7 @@ }, { "ciqual_food_code" : "13015", + "ecobalyse_code" : "raspberry-eu", "id" : "en:raspberry", "is_in_taxonomy" : 1, "origins" : "en:new-caledonia", @@ -26,6 +28,7 @@ }, { "ciqual_food_code" : "13028", + "ecobalyse_code" : "blueberry-non-eu", "id" : "en:blueberry", "is_in_taxonomy" : 1, "origins" : "en:canada", @@ -48,6 +51,7 @@ "vegetarian" : "yes" }, { + "ecobalyse_code" : "peach-eu", "id" : "en:white-peach", "is_in_taxonomy" : 1, "origins" : "en:mexico", @@ -60,6 +64,7 @@ }, { "ciqual_food_code" : "20041", + "ecobalyse_code" : "bellpepper-unheated-greehouse", "id" : "en:bell-pepper", "is_in_taxonomy" : 1, "origins" : "en:guatemala", @@ -128,6 +133,10 @@ "en:white-peach" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:gooseberry" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 12, "lc" : "en", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-origin-ingredient-from-origin.json b/tests/unit/expected_test_results/ingredients/en-origin-ingredient-from-origin.json index 962fcb3330771..f3d6e303ff464 100644 --- a/tests/unit/expected_test_results/ingredients/en-origin-ingredient-from-origin.json +++ b/tests/unit/expected_test_results/ingredients/en-origin-ingredient-from-origin.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "20087", + "ecobalyse_code" : "bellpepper-unheated-greehouse", "id" : "en:red-bell-pepper", "is_in_taxonomy" : 1, "origins" : "en:spain,en:italy,en:france", @@ -14,6 +15,7 @@ }, { "ciqual_food_code" : "20168", + "ecobalyse_code" : "bellpepper-unheated-greehouse", "id" : "en:yellow-bell-pepper", "is_in_taxonomy" : 1, "origins" : "en:south-america", @@ -62,6 +64,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 5, "lc" : "en", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-origin-ingredient-origin-and-origin.json b/tests/unit/expected_test_results/ingredients/en-origin-ingredient-origin-and-origin.json index 106a75bb2c1a9..bb3eb43740871 100644 --- a/tests/unit/expected_test_results/ingredients/en-origin-ingredient-origin-and-origin.json +++ b/tests/unit/expected_test_results/ingredients/en-origin-ingredient-origin-and-origin.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "20087", + "ecobalyse_code" : "bellpepper-unheated-greehouse", "id" : "en:red-bell-pepper", "is_in_taxonomy" : 1, "origins" : "en:spain,en:south-america", @@ -14,6 +15,7 @@ }, { "ciqual_food_code" : "20168", + "ecobalyse_code" : "bellpepper-unheated-greehouse", "id" : "en:yellow-bell-pepper", "is_in_taxonomy" : 1, "origins" : "en:mexico,en:canada,en:california", @@ -62,6 +64,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 5, "lc" : "en", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-origins-u.json b/tests/unit/expected_test_results/ingredients/en-origins-u.json index 79d8eecbddbae..edc4d55a6d2ad 100644 --- a/tests/unit/expected_test_results/ingredients/en-origins-u.json +++ b/tests/unit/expected_test_results/ingredients/en-origins-u.json @@ -66,6 +66,11 @@ "en:u" ], "ingredients_without_ciqual_codes_n" : 2, + "ingredients_without_ecobalyse_ids" : [ + "en:something", + "en:u" + ], + "ingredients_without_ecobalyse_ids_n" : 2, "known_ingredients_n" : 0, "lc" : "en", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-origins.json b/tests/unit/expected_test_results/ingredients/en-origins.json index 49c9333a8f912..306731a616e40 100644 --- a/tests/unit/expected_test_results/ingredients/en-origins.json +++ b/tests/unit/expected_test_results/ingredients/en-origins.json @@ -13,6 +13,7 @@ "vegetarian" : "yes" }, { + "ecobalyse_code" : "peach-eu", "id" : "en:peach", "is_in_taxonomy" : 1, "origins" : "en:south-carolina", @@ -25,6 +26,7 @@ }, { "ciqual_food_code" : "13186", + "ecobalyse_code" : "olive-eu", "id" : "en:black-olive", "is_in_taxonomy" : 1, "origins" : "en:south-carolina", @@ -37,6 +39,7 @@ }, { "ciqual_food_code" : "20047", + "ecobalyse_code" : "tomato-heated-greenhouse-eu", "id" : "en:fresh-tomatoes", "is_in_taxonomy" : 1, "origins" : "en:california", @@ -49,6 +52,7 @@ }, { "ciqual_proxy_food_code" : "13034", + "ecobalyse_code" : "orange-non-eu", "id" : "en:orange", "is_in_taxonomy" : 1, "origins" : "en:florida,en:united-states", @@ -61,6 +65,7 @@ }, { "ciqual_proxy_food_code" : "2070", + "ecobalyse_code" : "orange-non-eu", "id" : "en:orange-juice", "is_in_taxonomy" : 1, "origins" : "en:florida", @@ -140,6 +145,10 @@ "en:peach" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:almond" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 17, "lc" : "en", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-prepared-with.json b/tests/unit/expected_test_results/ingredients/en-prepared-with.json index 1ff7a56574e1d..b85e13b978af2 100644 --- a/tests/unit/expected_test_results/ingredients/en-prepared-with.json +++ b/tests/unit/expected_test_results/ingredients/en-prepared-with.json @@ -16,6 +16,8 @@ "ingredients_with_unspecified_percent_sum" : 0, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 0, "lc" : "en", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-quantity-of-ingredient.json b/tests/unit/expected_test_results/ingredients/en-quantity-of-ingredient.json index 5a07dd4d80686..b65cd1fe74d52 100644 --- a/tests/unit/expected_test_results/ingredients/en-quantity-of-ingredient.json +++ b/tests/unit/expected_test_results/ingredients/en-quantity-of-ingredient.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "20047", + "ecobalyse_code" : "tomato-heated-greenhouse-eu", "id" : "en:tomato", "is_in_taxonomy" : 1, "percent_estimate" : 50, @@ -27,6 +28,7 @@ }, { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent_estimate" : 7.5, @@ -40,6 +42,7 @@ }, { "ciqual_food_code" : "17130", + "ecobalyse_code" : "rapeseed-oil", "from_palm_oil" : "no", "id" : "en:rapeseed-oil", "is_in_taxonomy" : 1, @@ -102,6 +105,10 @@ "ingredients_with_unspecified_percent_sum" : 65, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:garlic" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 10, "lc" : "en", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ingredients/en-quantity-per-100g.json b/tests/unit/expected_test_results/ingredients/en-quantity-per-100g.json index ba0e619bc801f..05df853fcb079 100644 --- a/tests/unit/expected_test_results/ingredients/en-quantity-per-100g.json +++ b/tests/unit/expected_test_results/ingredients/en-quantity-per-100g.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "20047", + "ecobalyse_code" : "tomato-heated-greenhouse-eu", "id" : "en:tomato", "is_in_taxonomy" : 1, "percent" : 42.5287356321839, @@ -70,6 +71,10 @@ "en:pork" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:pork" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 5, "lc" : "en", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ingredients/en-some-unknown-ingredient-and-salt.json b/tests/unit/expected_test_results/ingredients/en-some-unknown-ingredient-and-salt.json index cc3215bac07cd..dde39ee61041c 100644 --- a/tests/unit/expected_test_results/ingredients/en-some-unknown-ingredient-and-salt.json +++ b/tests/unit/expected_test_results/ingredients/en-some-unknown-ingredient-and-salt.json @@ -63,6 +63,11 @@ "en:some-unknown-ingredient" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:salt", + "en:some-unknown-ingredient" + ], + "ingredients_without_ecobalyse_ids_n" : 2, "known_ingredients_n" : 1, "lc" : "en", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-specific-ingredients-multiple-strings-of-one-ingredient.json b/tests/unit/expected_test_results/ingredients/en-specific-ingredients-multiple-strings-of-one-ingredient.json index f2ea106a69918..d8f90cab80ce1 100644 --- a/tests/unit/expected_test_results/ingredients/en-specific-ingredients-multiple-strings-of-one-ingredient.json +++ b/tests/unit/expected_test_results/ingredients/en-specific-ingredients-multiple-strings-of-one-ingredient.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "origins" : "en:united-kingdom", @@ -25,6 +26,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 16.6666666666667, @@ -80,6 +82,10 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:cream" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 6, "lc" : "en", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-specific-ingredients.json b/tests/unit/expected_test_results/ingredients/en-specific-ingredients.json index 4be7ede66e735..d0bd23fbb8d0c 100644 --- a/tests/unit/expected_test_results/ingredients/en-specific-ingredients.json +++ b/tests/unit/expected_test_results/ingredients/en-specific-ingredients.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 66.6666666666667, @@ -24,6 +25,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 16.6666666666667, @@ -79,6 +81,10 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:cream" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 6, "lc" : "en", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-vegetal-ingredients.json b/tests/unit/expected_test_results/ingredients/en-vegetal-ingredients.json index ef6985332b129..3e3bbf5da1c28 100644 --- a/tests/unit/expected_test_results/ingredients/en-vegetal-ingredients.json +++ b/tests/unit/expected_test_results/ingredients/en-vegetal-ingredients.json @@ -110,6 +110,14 @@ "en:rennet" ], "ingredients_without_ciqual_codes_n" : 5, + "ingredients_without_ecobalyse_ids" : [ + "en:charcoal", + "en:e428", + "en:ferment", + "en:flavouring", + "en:rennet" + ], + "ingredients_without_ecobalyse_ids_n" : 5, "known_ingredients_n" : 6, "lc" : "en", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-vitamin.json b/tests/unit/expected_test_results/ingredients/en-vitamin.json index ecf1a7b7af629..50e9ea8fa886e 100644 --- a/tests/unit/expected_test_results/ingredients/en-vitamin.json +++ b/tests/unit/expected_test_results/ingredients/en-vitamin.json @@ -57,6 +57,11 @@ "en:vitamin-a" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:salt", + "en:vitamin-a" + ], + "ingredients_without_ecobalyse_ids_n" : 2, "known_ingredients_n" : 3, "lc" : "en", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/en-wheat-flour-organic-gluten-free.json b/tests/unit/expected_test_results/ingredients/en-wheat-flour-organic-gluten-free.json index 7681c2691ca34..ae9870794aae3 100644 --- a/tests/unit/expected_test_results/ingredients/en-wheat-flour-organic-gluten-free.json +++ b/tests/unit/expected_test_results/ingredients/en-wheat-flour-organic-gluten-free.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "9410", + "ecobalyse_code" : "flour", "id" : "en:wheat-flour", "is_in_taxonomy" : 1, "percent_estimate" : 75, @@ -70,6 +71,10 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:fish" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 6, "labels" : "Organic, en:no-gluten", "labels_hierarchy" : [ diff --git a/tests/unit/expected_test_results/ingredients/es-percent-loop.json b/tests/unit/expected_test_results/ingredients/es-percent-loop.json index cb22a20ab78b4..4f587089a9eac 100644 --- a/tests/unit/expected_test_results/ingredients/es-percent-loop.json +++ b/tests/unit/expected_test_results/ingredients/es-percent-loop.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "20047", + "ecobalyse_code" : "tomato-heated-greenhouse-eu", "id" : "en:tomato", "is_in_taxonomy" : 1, "percent_estimate" : 62.125, @@ -13,6 +14,7 @@ }, { "ciqual_food_code" : "20041", + "ecobalyse_code" : "bellpepper-unheated-greehouse", "id" : "en:bell-pepper", "is_in_taxonomy" : 1, "percent" : 12, @@ -37,6 +39,7 @@ }, { "ciqual_food_code" : "17270", + "ecobalyse_code" : "extra-virgin-olive-oil", "from_palm_oil" : "no", "id" : "en:extra-virgin-olive-oil", "is_in_taxonomy" : 1, @@ -50,6 +53,7 @@ }, { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg", "is_in_taxonomy" : 1, "percent" : 3, @@ -62,6 +66,7 @@ }, { "ciqual_food_code" : "20034", + "ecobalyse_code" : "onion-non-eu", "id" : "en:onion", "is_in_taxonomy" : 1, "percent" : 3, @@ -74,6 +79,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 1.5, @@ -221,6 +227,14 @@ "en:e330" ], "ingredients_without_ciqual_codes_n" : 2, + "ingredients_without_ecobalyse_ids" : [ + "en:acid", + "en:corn-starch", + "en:e330", + "en:salt", + "en:tuna" + ], + "ingredients_without_ecobalyse_ids_n" : 5, "known_ingredients_n" : 24, "lc" : "es", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ingredients/es-procedente-e-agricultura-biologica.json b/tests/unit/expected_test_results/ingredients/es-procedente-e-agricultura-biologica.json index aecd6bd8b0f4b..6995763784727 100644 --- a/tests/unit/expected_test_results/ingredients/es-procedente-e-agricultura-biologica.json +++ b/tests/unit/expected_test_results/ingredients/es-procedente-e-agricultura-biologica.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "19023", + "ecobalyse_code" : "milk", "id" : "en:pasteurised-whole-cow-s-milk", "is_in_taxonomy" : 1, "labels" : "en:organic", @@ -78,6 +79,10 @@ "en:kefir-lactic-ferments" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:kefir-lactic-ferments" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 11, "lc" : "es", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fi-additive.json b/tests/unit/expected_test_results/ingredients/fi-additive.json index 0d0c3651081de..26e9892c0804e 100644 --- a/tests/unit/expected_test_results/ingredients/fi-additive.json +++ b/tests/unit/expected_test_results/ingredients/fi-additive.json @@ -55,6 +55,11 @@ "en:gelling-agent" ], "ingredients_without_ciqual_codes_n" : 2, + "ingredients_without_ecobalyse_ids" : [ + "en:e440a", + "en:gelling-agent" + ], + "ingredients_without_ecobalyse_ids_n" : 2, "known_ingredients_n" : 2, "lc" : "fi", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fi-additives-origins.json b/tests/unit/expected_test_results/ingredients/fi-additives-origins.json index 3e33f158b7019..5156924684181 100644 --- a/tests/unit/expected_test_results/ingredients/fi-additives-origins.json +++ b/tests/unit/expected_test_results/ingredients/fi-additives-origins.json @@ -33,6 +33,7 @@ }, { "ciqual_proxy_food_code" : "9410", + "ecobalyse_code" : "flour", "id" : "en:wheat-flour", "is_in_taxonomy" : 1, "origins" : "en:france", @@ -46,6 +47,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 0.25, @@ -123,6 +125,12 @@ "en:sunflower-lecithin" ], "ingredients_without_ciqual_codes_n" : 3, + "ingredients_without_ecobalyse_ids" : [ + "en:emulsifier", + "en:flavouring", + "en:sunflower-lecithin" + ], + "ingredients_without_ecobalyse_ids_n" : 3, "known_ingredients_n" : 13, "lc" : "fi", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ingredients/fi-additives-percents.json b/tests/unit/expected_test_results/ingredients/fi-additives-percents.json index 89e89a5434bb8..0eacf2c1a8f08 100644 --- a/tests/unit/expected_test_results/ingredients/fi-additives-percents.json +++ b/tests/unit/expected_test_results/ingredients/fi-additives-percents.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "9410", + "ecobalyse_proxy_code" : "flour", "id" : "en:flour", "is_in_taxonomy" : 1, "percent" : 12, @@ -24,6 +25,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 11, @@ -41,6 +43,7 @@ }, { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:chicken-egg", "is_in_taxonomy" : 1, "percent_estimate" : 5.5, @@ -290,6 +293,25 @@ "en:milk-proteins" ], "ingredients_without_ciqual_codes_n" : 14, + "ingredients_without_ecobalyse_ids" : [ + "en:acid", + "en:acidity-regulator", + "en:chocolate", + "en:cocoa-butter", + "en:e322", + "en:e330", + "en:e333", + "en:e338", + "en:e432", + "en:e463", + "en:e472", + "en:e474", + "en:e475", + "en:emulsifier", + "en:milk-proteins", + "en:salt" + ], + "ingredients_without_ecobalyse_ids_n" : 16, "known_ingredients_n" : 26, "lc" : "fi", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ingredients/fi-do-not-match-myanmar.json b/tests/unit/expected_test_results/ingredients/fi-do-not-match-myanmar.json index 8528f68186474..c8874577395c7 100644 --- a/tests/unit/expected_test_results/ingredients/fi-do-not-match-myanmar.json +++ b/tests/unit/expected_test_results/ingredients/fi-do-not-match-myanmar.json @@ -141,6 +141,16 @@ "en:spice-or-bell-pepper" ], "ingredients_without_ciqual_codes_n" : 3, + "ingredients_without_ecobalyse_ids" : [ + "en:coriander", + "en:garlic", + "en:ginger", + "en:mustard-seed", + "en:spice", + "en:spice-or-bell-pepper", + "en:turmeric" + ], + "ingredients_without_ecobalyse_ids_n" : 7, "known_ingredients_n" : 14, "lc" : "fi", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fi-labels.json b/tests/unit/expected_test_results/ingredients/fi-labels.json index bcb2c99197b65..fae53fd37aabe 100644 --- a/tests/unit/expected_test_results/ingredients/fi-labels.json +++ b/tests/unit/expected_test_results/ingredients/fi-labels.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "2070", + "ecobalyse_code" : "orange-non-eu", "id" : "en:orange-juice", "is_in_taxonomy" : 1, "labels" : "en:no-preservatives", @@ -77,6 +78,10 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:salmon" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 9, "labels" : "en:no-gluten", "labels_hierarchy" : [ diff --git a/tests/unit/expected_test_results/ingredients/fi-organic-label-part-of-ingredient.json b/tests/unit/expected_test_results/ingredients/fi-organic-label-part-of-ingredient.json index b77b4218301b8..e210f57785792 100644 --- a/tests/unit/expected_test_results/ingredients/fi-organic-label-part-of-ingredient.json +++ b/tests/unit/expected_test_results/ingredients/fi-organic-label-part-of-ingredient.json @@ -14,6 +14,7 @@ }, { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "labels" : "en:organic", @@ -86,6 +87,11 @@ "en:malted-barley" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:green-tea", + "en:malted-barley" + ], + "ingredients_without_ecobalyse_ids_n" : 2, "known_ingredients_n" : 8, "lc" : "fi", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fi-origins.json b/tests/unit/expected_test_results/ingredients/fi-origins.json index 4258a18b2c28f..eda4565d74e88 100644 --- a/tests/unit/expected_test_results/ingredients/fi-origins.json +++ b/tests/unit/expected_test_results/ingredients/fi-origins.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "13014", + "ecobalyse_code" : "strawberry-non-eu", "id" : "en:strawberry", "is_in_taxonomy" : 1, "origins" : "en:finland", @@ -26,6 +27,7 @@ }, { "ciqual_food_code" : "13015", + "ecobalyse_code" : "raspberry-eu", "id" : "en:raspberry", "is_in_taxonomy" : 1, "origins" : "en:sweden", @@ -38,6 +40,7 @@ }, { "ciqual_proxy_food_code" : "13034", + "ecobalyse_code" : "orange-non-eu", "id" : "en:orange", "is_in_taxonomy" : 1, "labels" : "en:organic", @@ -124,6 +127,12 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:blackcurrant", + "en:cocoa", + "en:cocoa-butter" + ], + "ingredients_without_ecobalyse_ids_n" : 3, "known_ingredients_n" : 10, "lc" : "fi", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fi-percents.json b/tests/unit/expected_test_results/ingredients/fi-percents.json index 21c7630022569..c629e47e5487c 100644 --- a/tests/unit/expected_test_results/ingredients/fi-percents.json +++ b/tests/unit/expected_test_results/ingredients/fi-percents.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "13014", + "ecobalyse_code" : "strawberry-non-eu", "id" : "en:strawberry", "is_in_taxonomy" : 1, "percent" : 55.1569506726457, @@ -14,6 +15,7 @@ }, { "ciqual_proxy_food_code" : "13034", + "ecobalyse_code" : "orange-non-eu", "id" : "en:orange", "is_in_taxonomy" : 1, "percent" : 29.1479820627803, @@ -26,6 +28,7 @@ }, { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent" : 15.695067264574, @@ -79,6 +82,8 @@ "ingredients_with_unspecified_percent_sum" : 0, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 7, "lc" : "fi", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ingredients/fr-additive.json b/tests/unit/expected_test_results/ingredients/fr-additive.json index ea5031c0c5006..a29675332262c 100644 --- a/tests/unit/expected_test_results/ingredients/fr-additive.json +++ b/tests/unit/expected_test_results/ingredients/fr-additive.json @@ -55,6 +55,11 @@ "en:gelling-agent" ], "ingredients_without_ciqual_codes_n" : 2, + "ingredients_without_ecobalyse_ids" : [ + "en:e440a", + "en:gelling-agent" + ], + "ingredients_without_ecobalyse_ids_n" : 2, "known_ingredients_n" : 2, "lc" : "fr", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fr-cacao-issu-de-l-agriculture-biologique-de-madagascar.json b/tests/unit/expected_test_results/ingredients/fr-cacao-issu-de-l-agriculture-biologique-de-madagascar.json index fed1026f31099..99f6c3c37bdfb 100644 --- a/tests/unit/expected_test_results/ingredients/fr-cacao-issu-de-l-agriculture-biologique-de-madagascar.json +++ b/tests/unit/expected_test_results/ingredients/fr-cacao-issu-de-l-agriculture-biologique-de-madagascar.json @@ -44,6 +44,10 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:cocoa" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 2, "lc" : "fr", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fr-chocolate-cake.json b/tests/unit/expected_test_results/ingredients/fr-chocolate-cake.json index 358ab042e2175..0a0b69ad5d278 100644 --- a/tests/unit/expected_test_results/ingredients/fr-chocolate-cake.json +++ b/tests/unit/expected_test_results/ingredients/fr-chocolate-cake.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "9410", + "ecobalyse_proxy_code" : "flour", "id" : "en:flour", "is_in_taxonomy" : 1, "percent" : 12, @@ -24,6 +25,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 11, @@ -41,6 +43,7 @@ }, { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg", "is_in_taxonomy" : 1, "percent_estimate" : 5.5, @@ -288,6 +291,25 @@ "en:milk-proteins" ], "ingredients_without_ciqual_codes_n" : 14, + "ingredients_without_ecobalyse_ids" : [ + "en:acid", + "en:acidity-regulator", + "en:chocolate", + "en:cocoa-butter", + "en:e322", + "en:e330", + "en:e333", + "en:e338", + "en:e432", + "en:e463", + "en:e472", + "en:e474", + "en:e475", + "en:emulsifier", + "en:milk-proteins", + "en:salt" + ], + "ingredients_without_ecobalyse_ids_n" : 16, "known_ingredients_n" : 25, "lc" : "fr", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ingredients/fr-content-of-ingredient.json b/tests/unit/expected_test_results/ingredients/fr-content-of-ingredient.json index 75d7a6f04a5cc..596589b2a5fe9 100644 --- a/tests/unit/expected_test_results/ingredients/fr-content-of-ingredient.json +++ b/tests/unit/expected_test_results/ingredients/fr-content-of-ingredient.json @@ -16,6 +16,8 @@ "ingredients_with_unspecified_percent_sum" : 0, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 0, "lc" : "fr", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fr-epices-irradiees.json b/tests/unit/expected_test_results/ingredients/fr-epices-irradiees.json index cd6bfdf84eaf5..859ab71158b5b 100644 --- a/tests/unit/expected_test_results/ingredients/fr-epices-irradiees.json +++ b/tests/unit/expected_test_results/ingredients/fr-epices-irradiees.json @@ -78,6 +78,12 @@ "en:spice" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:sesame", + "en:spice", + "en:thyme" + ], + "ingredients_without_ecobalyse_ids_n" : 3, "known_ingredients_n" : 6, "lc" : "fr", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fr-farines-labels-and-processes.json b/tests/unit/expected_test_results/ingredients/fr-farines-labels-and-processes.json index ee91112e8b368..6db858a10d789 100644 --- a/tests/unit/expected_test_results/ingredients/fr-farines-labels-and-processes.json +++ b/tests/unit/expected_test_results/ingredients/fr-farines-labels-and-processes.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "9410", + "ecobalyse_code" : "flour", "id" : "en:wheat-flour", "is_in_taxonomy" : 1, "labels" : "fr:crc", @@ -26,6 +27,7 @@ }, { "ciqual_proxy_food_code" : "9410", + "ecobalyse_proxy_code" : "flour", "id" : "en:flour", "is_in_taxonomy" : 1, "labels" : "en:no-gluten", @@ -92,6 +94,11 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:corn", + "en:einkorn-wheat" + ], + "ingredients_without_ecobalyse_ids_n" : 2, "known_ingredients_n" : 7, "lc" : "fr", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fr-halal.json b/tests/unit/expected_test_results/ingredients/fr-halal.json index 5116cc80e370a..73d4fdd64b059 100644 --- a/tests/unit/expected_test_results/ingredients/fr-halal.json +++ b/tests/unit/expected_test_results/ingredients/fr-halal.json @@ -112,6 +112,13 @@ "en:meat" ], "ingredients_without_ciqual_codes_n" : 3, + "ingredients_without_ecobalyse_ids" : [ + "en:beef-gelatin", + "en:collagen", + "en:duck-foie-gras", + "en:meat" + ], + "ingredients_without_ecobalyse_ids_n" : 4, "known_ingredients_n" : 10, "lc" : "fr", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fr-huile-de-palme-certifiee-durable.json b/tests/unit/expected_test_results/ingredients/fr-huile-de-palme-certifiee-durable.json index 54506a9b09af4..66addfdb464d6 100644 --- a/tests/unit/expected_test_results/ingredients/fr-huile-de-palme-certifiee-durable.json +++ b/tests/unit/expected_test_results/ingredients/fr-huile-de-palme-certifiee-durable.json @@ -6,6 +6,7 @@ "ingredients" : [ { "ciqual_food_code" : "16129", + "ecobalyse_code" : "refined-palm-oil", "from_palm_oil" : "yes", "id" : "en:palm-oil", "is_in_taxonomy" : 1, @@ -19,6 +20,7 @@ }, { "ciqual_food_code" : "17130", + "ecobalyse_code" : "rapeseed-oil", "from_palm_oil" : "no", "id" : "en:colza-oil", "is_in_taxonomy" : 1, @@ -89,6 +91,10 @@ "en:non-hydrogenated-vegetable-oils" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:non-hydrogenated-vegetable-oils" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 8, "labels" : "en:sustainable-palm-oil", "labels_hierarchy" : [ diff --git a/tests/unit/expected_test_results/ingredients/fr-illegal-division-by-zero.json b/tests/unit/expected_test_results/ingredients/fr-illegal-division-by-zero.json index 26686a46866fa..5f0e6712e4d73 100644 --- a/tests/unit/expected_test_results/ingredients/fr-illegal-division-by-zero.json +++ b/tests/unit/expected_test_results/ingredients/fr-illegal-division-by-zero.json @@ -68,6 +68,11 @@ "fr:analyse-moyenne-pour-1" ], "ingredients_without_ciqual_codes_n" : 2, + "ingredients_without_ecobalyse_ids" : [ + "fr:1472-kj", + "fr:analyse-moyenne-pour-1" + ], + "ingredients_without_ecobalyse_ids_n" : 2, "known_ingredients_n" : 0, "lc" : "fr", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fr-infinite-loop-allergens.json b/tests/unit/expected_test_results/ingredients/fr-infinite-loop-allergens.json index 7c615421383d8..89e5cb2288bbb 100644 --- a/tests/unit/expected_test_results/ingredients/fr-infinite-loop-allergens.json +++ b/tests/unit/expected_test_results/ingredients/fr-infinite-loop-allergens.json @@ -3,6 +3,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 50, @@ -12,6 +13,7 @@ }, { "ciqual_food_code" : "19021", + "ecobalyse_code" : "milk-powder", "id" : "en:whole-milk-powder", "is_in_taxonomy" : 1, "percent" : 25, @@ -22,6 +24,7 @@ }, { "ciqual_proxy_food_code" : "16129", + "ecobalyse_code" : "refined-palm-oil", "from_palm_oil" : "yes", "id" : "en:palm-fat", "is_in_taxonomy" : 1, @@ -53,6 +56,7 @@ }, { "ciqual_food_code" : "19054", + "ecobalyse_code" : "milk-powder", "id" : "en:skimmed-milk-powder", "is_in_taxonomy" : 1, "percent" : 3, @@ -63,6 +67,7 @@ }, { "ciqual_food_code" : "17440", + "ecobalyse_code" : "sunflower-oil", "from_palm_oil" : "no", "id" : "en:sunflower-oil", "is_in_taxonomy" : 1, @@ -213,6 +218,16 @@ "fr:pate-de-cacao1" ], "ingredients_without_ciqual_codes_n" : 6, + "ingredients_without_ecobalyse_ids" : [ + "en:cocoa", + "en:e322", + "en:emulsifier", + "en:palm-kernel-fat", + "en:vanilla-flavouring", + "fr:beurre-de-cacao1", + "fr:pate-de-cacao1" + ], + "ingredients_without_ecobalyse_ids_n" : 7, "known_ingredients_n" : 21, "lc" : "fr", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ingredients/fr-ingredients-in-parenthesis-that-are-in-the-allergens-taxonomy.json b/tests/unit/expected_test_results/ingredients/fr-ingredients-in-parenthesis-that-are-in-the-allergens-taxonomy.json index ae2dfab604b03..81e258ce68c64 100644 --- a/tests/unit/expected_test_results/ingredients/fr-ingredients-in-parenthesis-that-are-in-the-allergens-taxonomy.json +++ b/tests/unit/expected_test_results/ingredients/fr-ingredients-in-parenthesis-that-are-in-the-allergens-taxonomy.json @@ -3,6 +3,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "16400", + "ecobalyse_code" : "butter", "id" : "en:butter", "is_in_taxonomy" : 1, "percent_estimate" : 75, @@ -82,6 +83,11 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:cheese", + "en:parmigiano-reggiano" + ], + "ingredients_without_ecobalyse_ids_n" : 2, "known_ingredients_n" : 4, "lc" : "fr", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fr-label-and-multiple-origins.json b/tests/unit/expected_test_results/ingredients/fr-label-and-multiple-origins.json index ae126de95902a..0d06335d554c0 100644 --- a/tests/unit/expected_test_results/ingredients/fr-label-and-multiple-origins.json +++ b/tests/unit/expected_test_results/ingredients/fr-label-and-multiple-origins.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg", "ingredients" : [ { @@ -98,6 +99,12 @@ "fr:suisse" ], "ingredients_without_ciqual_codes_n" : 3, + "ingredients_without_ecobalyse_ids" : [ + "fr:d-elevage-au-sol", + "fr:france", + "fr:suisse" + ], + "ingredients_without_ecobalyse_ids_n" : 3, "known_ingredients_n" : 1, "lc" : "fr", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fr-labels.json b/tests/unit/expected_test_results/ingredients/fr-labels.json index fd6ee746dec2d..ba8c323d7e08c 100644 --- a/tests/unit/expected_test_results/ingredients/fr-labels.json +++ b/tests/unit/expected_test_results/ingredients/fr-labels.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "2070", + "ecobalyse_code" : "orange-non-eu", "id" : "en:orange-juice", "is_in_taxonomy" : 1, "labels" : "en:no-preservatives", @@ -77,6 +78,10 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:salmon" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 9, "labels" : "en:no-gluten", "labels_hierarchy" : [ diff --git a/tests/unit/expected_test_results/ingredients/fr-legumes-issus-de-l-agriculture-durable.json b/tests/unit/expected_test_results/ingredients/fr-legumes-issus-de-l-agriculture-durable.json index 13b6cd99ca3cc..79c080335e3e7 100644 --- a/tests/unit/expected_test_results/ingredients/fr-legumes-issus-de-l-agriculture-durable.json +++ b/tests/unit/expected_test_results/ingredients/fr-legumes-issus-de-l-agriculture-durable.json @@ -42,6 +42,10 @@ "en:vegetable" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:vegetable" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 1, "lc" : "fr", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fr-marmelade.json b/tests/unit/expected_test_results/ingredients/fr-marmelade.json index 11e3f28a5bb10..4ff9f62c49373 100644 --- a/tests/unit/expected_test_results/ingredients/fr-marmelade.json +++ b/tests/unit/expected_test_results/ingredients/fr-marmelade.json @@ -15,6 +15,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 10.25, @@ -24,6 +25,7 @@ }, { "ciqual_food_code" : "13034", + "ecobalyse_code" : "orange-non-eu", "id" : "en:orange-pulp", "is_in_taxonomy" : 1, "percent" : 4.5, @@ -34,6 +36,7 @@ }, { "ciqual_proxy_food_code" : "2070", + "ecobalyse_code" : "orange-non-eu", "id" : "en:concentrated-orange-juice", "ingredients" : [], "is_in_taxonomy" : 1, @@ -45,6 +48,7 @@ }, { "ciqual_proxy_food_code" : "13034", + "ecobalyse_code" : "orange-non-eu", "id" : "en:orange", "ingredients" : [], "is_in_taxonomy" : 1, @@ -138,14 +142,15 @@ "percent" : 41, "percent_estimate" : 41, "text" : "Marmelade d'oranges", - "vegan": "maybe", - "vegetarian": "maybe" + "vegan" : "maybe", + "vegetarian" : "maybe" }, { "id" : "en:chocolate", "ingredients" : [ { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 12.45, @@ -210,6 +215,7 @@ }, { "ciqual_proxy_food_code" : "16129", + "ecobalyse_code" : "refined-palm-oil", "from_palm_oil" : "yes", "id" : "en:palm-fat", "is_in_taxonomy" : 1, @@ -261,6 +267,7 @@ }, { "ciqual_proxy_food_code" : "9410", + "ecobalyse_code" : "flour", "id" : "en:wheat-flour", "is_in_taxonomy" : 1, "percent_estimate" : 17.05, @@ -270,6 +277,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 8.525, @@ -279,6 +287,7 @@ }, { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg", "is_in_taxonomy" : 1, "percent_estimate" : 4.2625, @@ -297,6 +306,7 @@ }, { "ciqual_food_code" : "17130", + "ecobalyse_code" : "rapeseed-oil", "from_palm_oil" : "no", "id" : "en:colza-oil", "is_in_taxonomy" : 1, @@ -612,6 +622,37 @@ "en:thickener" ], "ingredients_without_ciqual_codes_n" : 21, + "ingredients_without_ecobalyse_ids" : [ + "en:acid", + "en:acidity-regulator", + "en:chocolate", + "en:cocoa-butter", + "en:cocoa-paste", + "en:e330", + "en:e333", + "en:e415", + "en:e440a", + "en:e450i", + "en:e500ii", + "en:e503ii", + "en:emulsifier", + "en:flavouring", + "en:gelling-agent", + "en:glucose-fructose-syrup", + "en:illipe-oil", + "en:lactose-and-milk-proteins", + "en:mango-kernel-oil", + "en:natural-orange-flavouring", + "en:orange-marmalade", + "en:raising-agent", + "en:salt", + "en:shea-butter", + "en:shorea-robusta-seed-oil", + "en:sodium-citrate", + "en:soya-lecithin", + "en:thickener" + ], + "ingredients_without_ecobalyse_ids_n" : 28, "known_ingredients_n" : 73, "lc" : "fr", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ingredients/fr-mechanicaly-separated-meat.json b/tests/unit/expected_test_results/ingredients/fr-mechanicaly-separated-meat.json index c150e64489dbe..1238276e63f7f 100644 --- a/tests/unit/expected_test_results/ingredients/fr-mechanicaly-separated-meat.json +++ b/tests/unit/expected_test_results/ingredients/fr-mechanicaly-separated-meat.json @@ -100,6 +100,12 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:mechanically-separated-meat-of-chicken", + "en:mechanically-separated-meat-of-pork", + "en:mechanically-separated-meat-of-turkey" + ], + "ingredients_without_ecobalyse_ids_n" : 3, "known_ingredients_n" : 13, "lc" : "fr", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fr-oignon-francais-tomate-francaise.json b/tests/unit/expected_test_results/ingredients/fr-oignon-francais-tomate-francaise.json index d630d9da23d4a..567a27737e667 100644 --- a/tests/unit/expected_test_results/ingredients/fr-oignon-francais-tomate-francaise.json +++ b/tests/unit/expected_test_results/ingredients/fr-oignon-francais-tomate-francaise.json @@ -64,6 +64,11 @@ "fr:tomate-francaise" ], "ingredients_without_ciqual_codes_n" : 2, + "ingredients_without_ecobalyse_ids" : [ + "fr:oignon-francais", + "fr:tomate-francaise" + ], + "ingredients_without_ecobalyse_ids_n" : 2, "known_ingredients_n" : 0, "lc" : "fr", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fr-origin-and.json b/tests/unit/expected_test_results/ingredients/fr-origin-and.json index 49138fbfe7af6..712a26ba4e83f 100644 --- a/tests/unit/expected_test_results/ingredients/fr-origin-and.json +++ b/tests/unit/expected_test_results/ingredients/fr-origin-and.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "4003", + "ecobalyse_code" : "potato-industry-fr", "id" : "en:potato", "is_in_taxonomy" : 1, "origins" : "en:france,en:italy", @@ -47,6 +48,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 4, "lc" : "fr", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fr-origin-field.json b/tests/unit/expected_test_results/ingredients/fr-origin-field.json index 0f9975993b741..861949fca1569 100644 --- a/tests/unit/expected_test_results/ingredients/fr-origin-field.json +++ b/tests/unit/expected_test_results/ingredients/fr-origin-field.json @@ -11,6 +11,7 @@ }, { "ciqual_food_code" : "12110", + "ecobalyse_code" : "comte-aop", "id" : "en:comte", "is_in_taxonomy" : 1, "percent_estimate" : 22.7272727272727, @@ -43,6 +44,7 @@ }, { "ciqual_food_code" : "5214", + "ecobalyse_code" : "red-wine", "id" : "en:red-wine", "is_in_taxonomy" : 1, "origins" : "en:italy", @@ -216,6 +218,18 @@ "fr:jambon-superieur" ], "ingredients_without_ciqual_codes_n" : 2, + "ingredients_without_ecobalyse_ids" : [ + "en:parmigiano-reggiano", + "en:pepper", + "en:ricotta", + "en:rose-wine", + "en:salt", + "en:uht-cream", + "en:white-wine", + "fr:coquillettes", + "fr:jambon-superieur" + ], + "ingredients_without_ecobalyse_ids_n" : 9, "known_ingredients_n" : 15, "lc" : "fr", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fr-origin-ingredient-origin-and-origin.json b/tests/unit/expected_test_results/ingredients/fr-origin-ingredient-origin-and-origin.json index 8bf4dbd558cf0..9b08a98c898a8 100644 --- a/tests/unit/expected_test_results/ingredients/fr-origin-ingredient-origin-and-origin.json +++ b/tests/unit/expected_test_results/ingredients/fr-origin-ingredient-origin-and-origin.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "4003", + "ecobalyse_code" : "potato-industry-fr", "id" : "en:potato", "is_in_taxonomy" : 1, "origins" : "en:france", @@ -23,6 +24,7 @@ }, { "ciqual_proxy_food_code" : "19041", + "ecobalyse_code" : "milk", "id" : "en:semi-skimmed-milk", "is_in_taxonomy" : 1, "origins" : "en:france", @@ -45,6 +47,7 @@ }, { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "origins" : "en:france", @@ -56,6 +59,7 @@ }, { "ciqual_proxy_food_code" : "16400", + "ecobalyse_code" : "butter", "id" : "en:butter", "is_in_taxonomy" : 1, "origins" : "en:france", @@ -250,6 +254,18 @@ "en:spice" ], "ingredients_without_ciqual_codes_n" : 3, + "ingredients_without_ecobalyse_ids" : [ + "en:broth", + "en:cream", + "en:dijon-mustard", + "en:finegrained-salt", + "en:flower-honey", + "en:pork", + "en:single-cream", + "en:spice", + "fr:moutarde-a-l-ancienne" + ], + "ingredients_without_ecobalyse_ids_n" : 9, "known_ingredients_n" : 24, "lc" : "fr", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ingredients/fr-origins-agriculture-ue-non-ue.json b/tests/unit/expected_test_results/ingredients/fr-origins-agriculture-ue-non-ue.json index 0132cf9361c04..643757fda2656 100644 --- a/tests/unit/expected_test_results/ingredients/fr-origins-agriculture-ue-non-ue.json +++ b/tests/unit/expected_test_results/ingredients/fr-origins-agriculture-ue-non-ue.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "13014", + "ecobalyse_code" : "strawberry-non-eu", "id" : "en:strawberry", "is_in_taxonomy" : 1, "origins" : "en:european-union-and-non-european-union", @@ -45,6 +46,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 3, "lc" : "fr", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fr-origins-emmental-allemagne-france-pays-bas-contient-lait.json b/tests/unit/expected_test_results/ingredients/fr-origins-emmental-allemagne-france-pays-bas-contient-lait.json index d0a70496d1777..7f6673f0fcfee 100644 --- a/tests/unit/expected_test_results/ingredients/fr-origins-emmental-allemagne-france-pays-bas-contient-lait.json +++ b/tests/unit/expected_test_results/ingredients/fr-origins-emmental-allemagne-france-pays-bas-contient-lait.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "12115", + "ecobalyse_code" : "emmental", "id" : "en:emmental", "is_in_taxonomy" : 1, "origins" : "en:germany,en:france,en:netherlands", @@ -52,6 +53,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 3, "lc" : "fr", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fr-origins-labels.json b/tests/unit/expected_test_results/ingredients/fr-origins-labels.json index 1c537f407099d..2f5697cfaef6e 100644 --- a/tests/unit/expected_test_results/ingredients/fr-origins-labels.json +++ b/tests/unit/expected_test_results/ingredients/fr-origins-labels.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "13014", + "ecobalyse_code" : "strawberry-non-eu", "id" : "en:strawberry", "is_in_taxonomy" : 1, "origins" : "en:france", @@ -26,6 +27,7 @@ }, { "ciqual_food_code" : "13015", + "ecobalyse_code" : "raspberry-eu", "id" : "en:raspberry", "is_in_taxonomy" : 1, "origins" : "en:belgium", @@ -50,6 +52,7 @@ }, { "ciqual_proxy_food_code" : "13034", + "ecobalyse_code" : "orange-non-eu", "id" : "en:orange", "is_in_taxonomy" : 1, "labels" : "en:organic", @@ -62,6 +65,7 @@ }, { "ciqual_proxy_food_code" : "13009", + "ecobalyse_code" : "lemon-eu", "id" : "en:lemon", "is_in_taxonomy" : 1, "labels" : "en:organic", @@ -98,6 +102,7 @@ }, { "ciqual_food_code" : "13008", + "ecobalyse_code" : "cherry-tr", "id" : "en:cherry", "is_in_taxonomy" : 1, "labels" : "en:organic", @@ -171,6 +176,13 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:blackcurrant", + "en:cocoa", + "en:cocoa-butter", + "en:grapefruit" + ], + "ingredients_without_ecobalyse_ids_n" : 4, "known_ingredients_n" : 14, "lc" : "fr", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fr-origins.json b/tests/unit/expected_test_results/ingredients/fr-origins.json index 81bf2076b3d8c..34e672582e1d8 100644 --- a/tests/unit/expected_test_results/ingredients/fr-origins.json +++ b/tests/unit/expected_test_results/ingredients/fr-origins.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "13014", + "ecobalyse_code" : "strawberry-non-eu", "id" : "en:strawberry", "is_in_taxonomy" : 1, "origins" : "en:brittany", @@ -14,6 +15,7 @@ }, { "ciqual_food_code" : "16400", + "ecobalyse_code" : "butter", "id" : "en:unsalted-butter", "is_in_taxonomy" : 1, "origins" : "en:normandy", @@ -26,6 +28,7 @@ }, { "ciqual_food_code" : "20172", + "ecobalyse_code" : "tomato-heated-greenhouse-eu", "id" : "en:cherry-tomato", "is_in_taxonomy" : 1, "origins" : "en:brittany", @@ -38,6 +41,7 @@ }, { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "origins" : "en:normandy", @@ -106,6 +110,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 12, "lc" : "fr", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fr-palm-kernel-fat.json b/tests/unit/expected_test_results/ingredients/fr-palm-kernel-fat.json index 75280881668ce..4faf69adf625b 100644 --- a/tests/unit/expected_test_results/ingredients/fr-palm-kernel-fat.json +++ b/tests/unit/expected_test_results/ingredients/fr-palm-kernel-fat.json @@ -52,6 +52,10 @@ "en:palm-kernel-fat" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:palm-kernel-fat" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 4, "lc" : "fr", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fr-percents-origins-2.json b/tests/unit/expected_test_results/ingredients/fr-percents-origins-2.json index 4be82abff723f..8cccd422a7caa 100644 --- a/tests/unit/expected_test_results/ingredients/fr-percents-origins-2.json +++ b/tests/unit/expected_test_results/ingredients/fr-percents-origins-2.json @@ -27,6 +27,7 @@ }, { "ciqual_proxy_food_code" : "9410", + "ecobalyse_code" : "flour", "id" : "en:wheat-flour", "is_in_taxonomy" : 1, "origins" : "en:france", @@ -38,6 +39,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 0, @@ -136,6 +138,13 @@ "en:sunflower-lecithin" ], "ingredients_without_ciqual_codes_n" : 3, + "ingredients_without_ecobalyse_ids" : [ + "en:butterfat", + "en:emulsifier", + "en:flavouring", + "en:sunflower-lecithin" + ], + "ingredients_without_ecobalyse_ids_n" : 4, "known_ingredients_n" : 18, "lc" : "fr", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ingredients/fr-percents-origins.json b/tests/unit/expected_test_results/ingredients/fr-percents-origins.json index d61f7eae46f76..f07488c6a59ac 100644 --- a/tests/unit/expected_test_results/ingredients/fr-percents-origins.json +++ b/tests/unit/expected_test_results/ingredients/fr-percents-origins.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "2074", + "ecobalyse_code" : "apple-fr", "id" : "en:apple-juice", "is_in_taxonomy" : 1, "labels" : "en:organic", @@ -102,6 +103,12 @@ "en:sodium-chloride" ], "ingredients_without_ciqual_codes_n" : 2, + "ingredients_without_ecobalyse_ids" : [ + "en:quince", + "en:sea-salt", + "en:sodium-chloride" + ], + "ingredients_without_ecobalyse_ids_n" : 3, "known_ingredients_n" : 12, "lc" : "fr", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ingredients/fr-percents.json b/tests/unit/expected_test_results/ingredients/fr-percents.json index 24d1a54a9dbee..daa7c130c6e76 100644 --- a/tests/unit/expected_test_results/ingredients/fr-percents.json +++ b/tests/unit/expected_test_results/ingredients/fr-percents.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "13014", + "ecobalyse_code" : "strawberry-non-eu", "id" : "en:strawberry", "is_in_taxonomy" : 1, "percent" : 55.1569506726457, @@ -14,6 +15,7 @@ }, { "ciqual_proxy_food_code" : "13034", + "ecobalyse_code" : "orange-non-eu", "id" : "en:orange", "is_in_taxonomy" : 1, "percent" : 29.1479820627803, @@ -26,6 +28,7 @@ }, { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent" : 15.695067264574, @@ -79,6 +82,8 @@ "ingredients_with_unspecified_percent_sum" : 0, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 7, "lc" : "fr", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ingredients/fr-prepared-with.json b/tests/unit/expected_test_results/ingredients/fr-prepared-with.json index 2abb776f42bf3..9f626574a4c07 100644 --- a/tests/unit/expected_test_results/ingredients/fr-prepared-with.json +++ b/tests/unit/expected_test_results/ingredients/fr-prepared-with.json @@ -16,6 +16,8 @@ "ingredients_with_unspecified_percent_sum" : 0, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 0, "lc" : "fr", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fr-processing-multi.json b/tests/unit/expected_test_results/ingredients/fr-processing-multi.json index c6b681b152821..8ea6929dcd11e 100644 --- a/tests/unit/expected_test_results/ingredients/fr-processing-multi.json +++ b/tests/unit/expected_test_results/ingredients/fr-processing-multi.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "20047", + "ecobalyse_code" : "tomato-heated-greenhouse-eu", "id" : "en:peeled-tomatoes", "is_in_taxonomy" : 1, "percent_estimate" : 58.3333333333333, @@ -14,6 +15,7 @@ }, { "ciqual_proxy_food_code" : "13009", + "ecobalyse_code" : "lemon-eu", "id" : "en:lemon", "is_in_taxonomy" : 1, "percent_estimate" : 20.8333333333333, @@ -26,6 +28,7 @@ }, { "ciqual_food_code" : "20020", + "ecobalyse_code" : "zucchini-eu", "id" : "en:courgette", "is_in_taxonomy" : 1, "percent_estimate" : 10.4166666666667, @@ -38,6 +41,7 @@ }, { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:raw-milk", "is_in_taxonomy" : 1, "percent_estimate" : 5.20833333333333, @@ -49,6 +53,7 @@ }, { "ciqual_food_code" : "20053", + "ecobalyse_code" : "eggplant-eu", "id" : "en:aubergine", "is_in_taxonomy" : 1, "percent_estimate" : 2.60416666666666, @@ -147,6 +152,10 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:raw-ham" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 18, "lc" : "fr", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fr-quantity-of-ingredient.json b/tests/unit/expected_test_results/ingredients/fr-quantity-of-ingredient.json index 3c2c196ede3cc..c24c5b658c20a 100644 --- a/tests/unit/expected_test_results/ingredients/fr-quantity-of-ingredient.json +++ b/tests/unit/expected_test_results/ingredients/fr-quantity-of-ingredient.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "20047", + "ecobalyse_code" : "tomato-heated-greenhouse-eu", "id" : "en:tomato", "is_in_taxonomy" : 1, "percent_estimate" : 50, @@ -27,6 +28,7 @@ }, { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent_estimate" : 7.5, @@ -40,6 +42,7 @@ }, { "ciqual_food_code" : "17130", + "ecobalyse_code" : "rapeseed-oil", "from_palm_oil" : "no", "id" : "en:colza-oil", "is_in_taxonomy" : 1, @@ -104,6 +107,10 @@ "ingredients_with_unspecified_percent_sum" : 65, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:garlic" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 11, "lc" : "fr", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ingredients/fr-quantity-per-100g.json b/tests/unit/expected_test_results/ingredients/fr-quantity-per-100g.json index 1ff587570a67a..c3854d70472d0 100644 --- a/tests/unit/expected_test_results/ingredients/fr-quantity-per-100g.json +++ b/tests/unit/expected_test_results/ingredients/fr-quantity-per-100g.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "20047", + "ecobalyse_code" : "tomato-heated-greenhouse-eu", "id" : "en:tomato", "is_in_taxonomy" : 1, "percent" : 42.5287356321839, @@ -70,6 +71,10 @@ "en:pork" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:pork" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 5, "lc" : "fr", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ingredients/fr-semi.json b/tests/unit/expected_test_results/ingredients/fr-semi.json index 8338d74a2eda1..8e5189f909a9f 100644 --- a/tests/unit/expected_test_results/ingredients/fr-semi.json +++ b/tests/unit/expected_test_results/ingredients/fr-semi.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "9520", + "ecobalyse_proxy_code" : "flour", "id" : "en:semi-wholemeal-rice-flour", "is_in_taxonomy" : 1, "percent_estimate" : 75, @@ -13,6 +14,7 @@ }, { "ciqual_proxy_food_code" : "9410", + "ecobalyse_code" : "flour", "id" : "en:semi-wholemeal-wheat-flour", "is_in_taxonomy" : 1, "percent_estimate" : 25, @@ -70,6 +72,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 10, "lc" : "fr", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fr-specific-ingredients.json b/tests/unit/expected_test_results/ingredients/fr-specific-ingredients.json index 9225621dc04b7..67536dab7947a 100644 --- a/tests/unit/expected_test_results/ingredients/fr-specific-ingredients.json +++ b/tests/unit/expected_test_results/ingredients/fr-specific-ingredients.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:cane-sugar", "is_in_taxonomy" : 1, "labels" : "en:organic", @@ -14,6 +15,7 @@ }, { "ciqual_food_code" : "13000", + "ecobalyse_code" : "apricot-eu", "id" : "en:apricot", "is_in_taxonomy" : 1, "labels" : "en:organic", @@ -119,6 +121,12 @@ "en:gelling-agent" ], "ingredients_without_ciqual_codes_n" : 2, + "ingredients_without_ecobalyse_ids" : [ + "en:concentrated-lemon-juice", + "en:fruit-pectin", + "en:gelling-agent" + ], + "ingredients_without_ecobalyse_ids_n" : 3, "known_ingredients_n" : 14, "lc" : "fr", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fr-starred-label.json b/tests/unit/expected_test_results/ingredients/fr-starred-label.json index 76068df1835f0..881af2eee4274 100644 --- a/tests/unit/expected_test_results/ingredients/fr-starred-label.json +++ b/tests/unit/expected_test_results/ingredients/fr-starred-label.json @@ -16,6 +16,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:cane-sugar", "is_in_taxonomy" : 1, "labels" : "en:fair-trade, en:organic", @@ -83,6 +84,11 @@ "ingredients_with_unspecified_percent_sum" : 25, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:cocoa-butter", + "en:cocoa-paste" + ], + "ingredients_without_ecobalyse_ids_n" : 2, "known_ingredients_n" : 8, "lc" : "fr", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ingredients/fr-truncated-puree.json b/tests/unit/expected_test_results/ingredients/fr-truncated-puree.json index ee6ed19b00c3e..2732bef51a159 100644 --- a/tests/unit/expected_test_results/ingredients/fr-truncated-puree.json +++ b/tests/unit/expected_test_results/ingredients/fr-truncated-puree.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "20170", + "ecobalyse_code" : "tomato-heated-greenhouse-eu", "id" : "en:tomato-puree", "is_in_taxonomy" : 1, "percent" : 7.48031496062992, @@ -103,6 +104,12 @@ "en:oil-and-fat" ], "ingredients_without_ciqual_codes_n" : 3, + "ingredients_without_ecobalyse_ids" : [ + "en:beef", + "en:fruit-juice", + "en:oil-and-fat" + ], + "ingredients_without_ecobalyse_ids_n" : 3, "known_ingredients_n" : 10, "lc" : "fr", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ingredients/fr-vegetal-origin.json b/tests/unit/expected_test_results/ingredients/fr-vegetal-origin.json index 3768ed2a5396c..c4ca1318d47b6 100644 --- a/tests/unit/expected_test_results/ingredients/fr-vegetal-origin.json +++ b/tests/unit/expected_test_results/ingredients/fr-vegetal-origin.json @@ -78,6 +78,12 @@ "en:oil" ], "ingredients_without_ciqual_codes_n" : 3, + "ingredients_without_ecobalyse_ids" : [ + "en:e428", + "en:e471", + "en:oil" + ], + "ingredients_without_ecobalyse_ids_n" : 3, "known_ingredients_n" : 4, "lc" : "fr", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fr-viande-de-boeuf-issue-d-animaux-nourris-sans-ogm.json b/tests/unit/expected_test_results/ingredients/fr-viande-de-boeuf-issue-d-animaux-nourris-sans-ogm.json index 81e2e6d78bc39..5592f28f6e7d4 100644 --- a/tests/unit/expected_test_results/ingredients/fr-viande-de-boeuf-issue-d-animaux-nourris-sans-ogm.json +++ b/tests/unit/expected_test_results/ingredients/fr-viande-de-boeuf-issue-d-animaux-nourris-sans-ogm.json @@ -54,6 +54,10 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:beef-meat" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 4, "lc" : "fr", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fr-viande-porcine-francaise.json b/tests/unit/expected_test_results/ingredients/fr-viande-porcine-francaise.json index 9750bcbc5f900..d7b8dde32ca4f 100644 --- a/tests/unit/expected_test_results/ingredients/fr-viande-porcine-francaise.json +++ b/tests/unit/expected_test_results/ingredients/fr-viande-porcine-francaise.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "20026", + "ecobalyse_code" : "endive-eu", "id" : "en:belgian-endive", "is_in_taxonomy" : 1, "percent" : 40, @@ -14,6 +15,7 @@ }, { "ciqual_proxy_food_code" : "28205", + "ecobalyse_code" : "cooked-ham", "id" : "en:cooked-ham", "is_in_taxonomy" : 1, "origins" : "en:france", @@ -26,6 +28,7 @@ }, { "ciqual_food_code" : "22002", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg-yolk", "is_in_taxonomy" : 1, "origins" : "en:france", @@ -109,6 +112,10 @@ "ingredients_with_unspecified_percent_sum" : 60, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:salt" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 12, "labels" : "viande porcine française, oeufs de France", "labels_hierarchy" : [ diff --git a/tests/unit/expected_test_results/ingredients/ja-additives.json b/tests/unit/expected_test_results/ingredients/ja-additives.json index cde683f1c213e..569da06f39937 100644 --- a/tests/unit/expected_test_results/ingredients/ja-additives.json +++ b/tests/unit/expected_test_results/ingredients/ja-additives.json @@ -43,6 +43,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:trehalose", "is_in_taxonomy" : 1, "percent_estimate" : 10.9375, @@ -236,6 +237,21 @@ "en:vitamin-e" ], "ingredients_without_ciqual_codes_n" : 11, + "ingredients_without_ecobalyse_ids" : [ + "en:amino-acids", + "en:antioxidant", + "en:colour", + "en:condiment", + "en:e262", + "en:e415", + "en:e640i", + "en:modified-starch", + "en:thickener", + "en:vegetable-pigment", + "en:vitamin-c", + "en:vitamin-e" + ], + "ingredients_without_ecobalyse_ids_n" : 12, "known_ingredients_n" : 18, "lc" : "ja", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/ja-allergens-in-parenthesis.json b/tests/unit/expected_test_results/ingredients/ja-allergens-in-parenthesis.json index 8f01c20bce678..a8669e59f749a 100644 --- a/tests/unit/expected_test_results/ingredients/ja-allergens-in-parenthesis.json +++ b/tests/unit/expected_test_results/ingredients/ja-allergens-in-parenthesis.json @@ -5,6 +5,7 @@ "ingredients" : [ { "ciqual_food_code" : "15001", + "ecobalyse_code" : "peanut-non-eu", "id" : "en:peanut", "is_in_taxonomy" : 1, "percent_estimate" : 66.6666666666667, @@ -92,6 +93,12 @@ "en:nut" ], "ingredients_without_ciqual_codes_n" : 2, + "ingredients_without_ecobalyse_ids" : [ + "en:fish", + "en:flavouring", + "en:nut" + ], + "ingredients_without_ecobalyse_ids_n" : 3, "known_ingredients_n" : 4, "lc" : "ja", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/ja-origin-and.json b/tests/unit/expected_test_results/ingredients/ja-origin-and.json index 74c24227cf86d..c9726b2b18641 100644 --- a/tests/unit/expected_test_results/ingredients/ja-origin-and.json +++ b/tests/unit/expected_test_results/ingredients/ja-origin-and.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "20047", + "ecobalyse_code" : "tomato-heated-greenhouse-eu", "id" : "en:tomato", "ingredients" : [ { @@ -69,6 +70,10 @@ "ja:ときがわ町" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "ja:ときがわ町" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 3, "lc" : "ja", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/ja-origins.json b/tests/unit/expected_test_results/ingredients/ja-origins.json index dfaa15d6998a3..5ba5d43d08c7a 100644 --- a/tests/unit/expected_test_results/ingredients/ja-origins.json +++ b/tests/unit/expected_test_results/ingredients/ja-origins.json @@ -37,6 +37,7 @@ }, { "ciqual_proxy_food_code" : "17270", + "ecobalyse_code" : "olive-oil-eu", "from_palm_oil" : "no", "id" : "en:olive-oil", "is_in_taxonomy" : 1, @@ -73,6 +74,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "origins" : "en:outside-japan,en:japan", @@ -120,6 +122,7 @@ }, { "ciqual_food_code" : "13082", + "ecobalyse_code" : "clementine-non-eu", "id" : "en:clementine", "is_in_taxonomy" : 1, "origins" : "en:kyushu", @@ -241,6 +244,17 @@ "en:meat" ], "ingredients_without_ciqual_codes_n" : 3, + "ingredients_without_ecobalyse_ids" : [ + "en:breadfruit", + "en:cocoa", + "en:creme-fraiche", + "en:edamame", + "en:malt", + "en:meat", + "en:salt", + "en:white-wine-vinegar" + ], + "ingredients_without_ecobalyse_ids_n" : 8, "known_ingredients_n" : 31, "lc" : "ja", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/ja-parenthesis.json b/tests/unit/expected_test_results/ingredients/ja-parenthesis.json index 9bf93f5bd4881..2a4040805abe3 100644 --- a/tests/unit/expected_test_results/ingredients/ja-parenthesis.json +++ b/tests/unit/expected_test_results/ingredients/ja-parenthesis.json @@ -26,6 +26,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "ingredients" : [ { @@ -52,6 +53,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 5.625, @@ -282,6 +284,22 @@ "ja:たん白加水分解物混合物" ], "ingredients_without_ciqual_codes_n" : 5, + "ingredients_without_ecobalyse_ids" : [ + "en:alcohol", + "en:amino-acids", + "en:condiment", + "en:glucose-syrup", + "en:high-fructose-corn-syrup", + "en:honjozo", + "en:katsuobushi", + "en:kombu", + "en:mirin", + "en:salt", + "en:soy-sauce", + "ja:さば節", + "ja:たん白加水分解物混合物" + ], + "ingredients_without_ecobalyse_ids_n" : 13, "known_ingredients_n" : 26, "lc" : "ja", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/ja-slash.json b/tests/unit/expected_test_results/ingredients/ja-slash.json index bbfaf3f38dfb1..0c1a8de6a78ee 100644 --- a/tests/unit/expected_test_results/ingredients/ja-slash.json +++ b/tests/unit/expected_test_results/ingredients/ja-slash.json @@ -3,6 +3,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 53.3333333333333, @@ -14,6 +15,7 @@ }, { "ciqual_proxy_food_code" : "9410", + "ecobalyse_code" : "flour", "id" : "en:wheat-flour", "is_in_taxonomy" : 1, "percent_estimate" : 23.3333333333333, @@ -25,6 +27,7 @@ }, { "ciqual_food_code" : "19021", + "ecobalyse_code" : "milk-powder", "id" : "en:whole-milk-powder", "is_in_taxonomy" : 1, "percent_estimate" : 11.6666666666667, @@ -80,6 +83,7 @@ }, { "ciqual_proxy_food_code" : "9410", + "ecobalyse_code" : "flour", "id" : "en:whole-wheat-flour", "is_in_taxonomy" : 1, "percent_estimate" : 0.364583333333329, @@ -274,6 +278,20 @@ "ja:小麦胚芽" ], "ingredients_without_ciqual_codes_n" : 6, + "ingredients_without_ecobalyse_ids" : [ + "en:cocoa-butter", + "en:cocoa-paste", + "en:emulsifier", + "en:fat", + "en:flavouring", + "en:modified-starch", + "en:raising-agent", + "en:salt", + "en:vegetable-oil-and-fat", + "en:wheat-bran", + "ja:小麦胚芽" + ], + "ingredients_without_ecobalyse_ids_n" : 11, "known_ingredients_n" : 27, "lc" : "ja", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/nl-e471-niet-dierlijk.json b/tests/unit/expected_test_results/ingredients/nl-e471-niet-dierlijk.json index 35c7af35fbc0f..347828f8e04dc 100644 --- a/tests/unit/expected_test_results/ingredients/nl-e471-niet-dierlijk.json +++ b/tests/unit/expected_test_results/ingredients/nl-e471-niet-dierlijk.json @@ -47,6 +47,10 @@ "en:e471" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:e471" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 1, "lc" : "nl", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/ru-russian-oil.json b/tests/unit/expected_test_results/ingredients/ru-russian-oil.json index 424e0ecbe95b5..1c00c37bfe2c7 100644 --- a/tests/unit/expected_test_results/ingredients/ru-russian-oil.json +++ b/tests/unit/expected_test_results/ingredients/ru-russian-oil.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "17440", + "ecobalyse_code" : "sunflower-oil", "from_palm_oil" : "no", "id" : "en:sunflower-oil", "is_in_taxonomy" : 1, @@ -75,6 +76,10 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:soya-oil" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 5, "lc" : "ru", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/xx-single-letters.json b/tests/unit/expected_test_results/ingredients/xx-single-letters.json index 0291a4c004603..cf18a1f04ab06 100644 --- a/tests/unit/expected_test_results/ingredients/xx-single-letters.json +++ b/tests/unit/expected_test_results/ingredients/xx-single-letters.json @@ -594,6 +594,45 @@ "fr:z" ], "ingredients_without_ciqual_codes_n" : 36, + "ingredients_without_ecobalyse_ids" : [ + "en:bone", + "fr:0-1", + "fr:10-100-1000", + "fr:2-3", + "fr:4-5", + "fr:6-7", + "fr:8-9", + "fr:a", + "fr:b", + "fr:c", + "fr:d", + "fr:e", + "fr:f", + "fr:g", + "fr:h", + "fr:i", + "fr:j", + "fr:k", + "fr:l", + "fr:leaf", + "fr:m", + "fr:n", + "fr:p", + "fr:q", + "fr:r", + "fr:s", + "fr:something", + "fr:somethingelse", + "fr:t", + "fr:u", + "fr:v", + "fr:vt", + "fr:w", + "fr:x", + "fr:y", + "fr:z" + ], + "ingredients_without_ecobalyse_ids_n" : 36, "known_ingredients_n" : 1, "lc" : "fr", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients_contents/fruits-water-sugar.json b/tests/unit/expected_test_results/ingredients_contents/fruits-water-sugar.json index 1228291ea2bf8..8694a8e6eec93 100644 --- a/tests/unit/expected_test_results/ingredients_contents/fruits-water-sugar.json +++ b/tests/unit/expected_test_results/ingredients_contents/fruits-water-sugar.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent" : 50, @@ -14,6 +15,7 @@ }, { "ciqual_food_code" : "13005", + "ecobalyse_code" : "banana-non-eu", "id" : "en:banana", "is_in_taxonomy" : 1, "percent" : 30, @@ -26,6 +28,7 @@ }, { "ciqual_food_code" : "13014", + "ecobalyse_code" : "strawberry-non-eu", "id" : "en:strawberry", "is_in_taxonomy" : 1, "percent" : 10, @@ -38,6 +41,7 @@ }, { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent" : 5, @@ -50,6 +54,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent" : 5, @@ -111,6 +116,8 @@ "ingredients_with_unspecified_percent_sum" : 0, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 10, "lc" : "en", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/ingredients_contents/vegetable-oils.json b/tests/unit/expected_test_results/ingredients_contents/vegetable-oils.json index 1a47b5ee59a18..336c8128f4ee2 100644 --- a/tests/unit/expected_test_results/ingredients_contents/vegetable-oils.json +++ b/tests/unit/expected_test_results/ingredients_contents/vegetable-oils.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "17270", + "ecobalyse_code" : "olive-oil-eu", "from_palm_oil" : "no", "id" : "en:olive-oil", "is_in_taxonomy" : 1, @@ -15,6 +16,7 @@ }, { "ciqual_food_code" : "17130", + "ecobalyse_code" : "rapeseed-oil", "from_palm_oil" : "no", "id" : "en:rapeseed-oil", "is_in_taxonomy" : 1, @@ -28,6 +30,7 @@ }, { "ciqual_food_code" : "17440", + "ecobalyse_code" : "sunflower-oil", "from_palm_oil" : "no", "id" : "en:sunflower-oil", "is_in_taxonomy" : 1, @@ -96,6 +99,10 @@ "ingredients_with_unspecified_percent_sum" : 0, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:walnut-oil" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 7, "lc" : "en", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/nutriscore/94-percent-sugar-and-unknown-ingredient.json b/tests/unit/expected_test_results/nutriscore/94-percent-sugar-and-unknown-ingredient.json index a5eb10c0ab815..1efb0afe70838 100644 --- a/tests/unit/expected_test_results/nutriscore/94-percent-sugar-and-unknown-ingredient.json +++ b/tests/unit/expected_test_results/nutriscore/94-percent-sugar-and-unknown-ingredient.json @@ -39,6 +39,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent" : 94, @@ -108,6 +109,10 @@ "en:strange-ingredient" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:strange-ingredient" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 3, "lc" : "en", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/beverage-with-80-percent-milk.json b/tests/unit/expected_test_results/nutriscore/beverage-with-80-percent-milk.json index c9a6b432ba774..d969265d91d04 100644 --- a/tests/unit/expected_test_results/nutriscore/beverage-with-80-percent-milk.json +++ b/tests/unit/expected_test_results/nutriscore/beverage-with-80-percent-milk.json @@ -35,6 +35,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:fresh-milk", "is_in_taxonomy" : 1, "percent" : 80, @@ -47,6 +48,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 20, @@ -103,6 +105,8 @@ "ingredients_with_unspecified_percent_sum" : 20, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 6, "lc" : "en", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/dairy-drink-with-80-percent-milk.json b/tests/unit/expected_test_results/nutriscore/dairy-drink-with-80-percent-milk.json index 65557fd8887bf..b13b61e3f3989 100644 --- a/tests/unit/expected_test_results/nutriscore/dairy-drink-with-80-percent-milk.json +++ b/tests/unit/expected_test_results/nutriscore/dairy-drink-with-80-percent-milk.json @@ -43,6 +43,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:fresh-milk", "is_in_taxonomy" : 1, "percent" : 80, @@ -55,6 +56,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 20, @@ -111,6 +113,8 @@ "ingredients_with_unspecified_percent_sum" : 20, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 6, "lc" : "en", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/dairy-drink-with-less-than-80-percent-milk.json b/tests/unit/expected_test_results/nutriscore/dairy-drink-with-less-than-80-percent-milk.json index 665a4cb56755d..4fcac3b8b2772 100644 --- a/tests/unit/expected_test_results/nutriscore/dairy-drink-with-less-than-80-percent-milk.json +++ b/tests/unit/expected_test_results/nutriscore/dairy-drink-with-less-than-80-percent-milk.json @@ -43,6 +43,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 90, @@ -54,6 +55,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 10, @@ -108,6 +110,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 5, "lc" : "en", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/dairy-drinks-without-milk.json b/tests/unit/expected_test_results/nutriscore/dairy-drinks-without-milk.json index 815603eb34f0b..273d7c1da2e83 100644 --- a/tests/unit/expected_test_results/nutriscore/dairy-drinks-without-milk.json +++ b/tests/unit/expected_test_results/nutriscore/dairy-drinks-without-milk.json @@ -39,6 +39,7 @@ "ingredients" : [ { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent_estimate" : 95, @@ -50,6 +51,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 5, @@ -98,6 +100,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 4, "lc" : "en", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/en-apple-estimated-nutrients.json b/tests/unit/expected_test_results/nutriscore/en-apple-estimated-nutrients.json index c9d39a4f47648..a162eb953b73f 100644 --- a/tests/unit/expected_test_results/nutriscore/en-apple-estimated-nutrients.json +++ b/tests/unit/expected_test_results/nutriscore/en-apple-estimated-nutrients.json @@ -47,6 +47,7 @@ "ingredients" : [ { "ciqual_food_code" : "13050", + "ecobalyse_code" : "apple-fr", "id" : "en:apple", "is_in_taxonomy" : 1, "percent_estimate" : 100, @@ -92,6 +93,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 3, "lc" : "en", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/en-avocado-oil.json b/tests/unit/expected_test_results/nutriscore/en-avocado-oil.json index 6cf411de85a5e..921874f518d5e 100644 --- a/tests/unit/expected_test_results/nutriscore/en-avocado-oil.json +++ b/tests/unit/expected_test_results/nutriscore/en-avocado-oil.json @@ -51,6 +51,7 @@ "ingredients" : [ { "ciqual_food_code" : "13004", + "ecobalyse_code" : "avocado-non-eu", "id" : "en:avocado", "is_in_taxonomy" : 1, "percent_estimate" : 100, @@ -96,6 +97,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 3, "lc" : "en", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/en-beverage-preparation-flavored-syrup.json b/tests/unit/expected_test_results/nutriscore/en-beverage-preparation-flavored-syrup.json index c39b255faeaf5..611930a017d70 100644 --- a/tests/unit/expected_test_results/nutriscore/en-beverage-preparation-flavored-syrup.json +++ b/tests/unit/expected_test_results/nutriscore/en-beverage-preparation-flavored-syrup.json @@ -47,6 +47,7 @@ "ingredients" : [ { "ciqual_food_code" : "2074", + "ecobalyse_code" : "apple-fr", "id" : "en:apple-juice", "is_in_taxonomy" : 1, "percent_estimate" : 62.5, @@ -58,6 +59,7 @@ }, { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent_estimate" : 18.75, @@ -69,6 +71,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 9.375, @@ -145,6 +148,10 @@ "en:e951" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:e951" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 11, "lc" : "en", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/en-cherry-tomatoes.json b/tests/unit/expected_test_results/nutriscore/en-cherry-tomatoes.json index 1bd3cf90f9e8b..0dd2267b8d14d 100644 --- a/tests/unit/expected_test_results/nutriscore/en-cherry-tomatoes.json +++ b/tests/unit/expected_test_results/nutriscore/en-cherry-tomatoes.json @@ -53,6 +53,7 @@ "ingredients" : [ { "ciqual_food_code" : "20172", + "ecobalyse_code" : "tomato-heated-greenhouse-eu", "id" : "en:cherry-tomato", "is_in_taxonomy" : 1, "percent_estimate" : 100, @@ -100,6 +101,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 4, "lc" : "en", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/en-olive-oil-unrecognized-ingredients.json b/tests/unit/expected_test_results/nutriscore/en-olive-oil-unrecognized-ingredients.json index 8379640a4920e..d9356cba5cef6 100644 --- a/tests/unit/expected_test_results/nutriscore/en-olive-oil-unrecognized-ingredients.json +++ b/tests/unit/expected_test_results/nutriscore/en-olive-oil-unrecognized-ingredients.json @@ -101,6 +101,10 @@ "en:some-very-fancy-but-unrecognized-way-of-writing-olive-oil" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:some-very-fancy-but-unrecognized-way-of-writing-olive-oil" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 0, "lc" : "en", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/en-olive-oil.json b/tests/unit/expected_test_results/nutriscore/en-olive-oil.json index 97e876179a409..2c93aaa78cd95 100644 --- a/tests/unit/expected_test_results/nutriscore/en-olive-oil.json +++ b/tests/unit/expected_test_results/nutriscore/en-olive-oil.json @@ -51,6 +51,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "17270", + "ecobalyse_code" : "olive-oil-eu", "from_palm_oil" : "no", "id" : "en:olive-oil", "is_in_taxonomy" : 1, @@ -99,6 +100,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 4, "lc" : "en", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/en-orange-juice-category-and-ingredients.json b/tests/unit/expected_test_results/nutriscore/en-orange-juice-category-and-ingredients.json index 216ccf791f2cd..b62989238e729 100644 --- a/tests/unit/expected_test_results/nutriscore/en-orange-juice-category-and-ingredients.json +++ b/tests/unit/expected_test_results/nutriscore/en-orange-juice-category-and-ingredients.json @@ -66,6 +66,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "2070", + "ecobalyse_code" : "orange-non-eu", "id" : "en:orange-juice", "is_in_taxonomy" : 1, "percent" : 50, @@ -78,6 +79,7 @@ }, { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent_estimate" : 45.55, @@ -89,6 +91,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 4.45, @@ -150,6 +153,8 @@ "ingredients_with_unspecified_percent_sum" : 50, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 10, "lc" : "en", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-ingredients-with-lots-of-meat.json b/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-ingredients-with-lots-of-meat.json index 9c0db621f17c9..e6a5ee0278349 100644 --- a/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-ingredients-with-lots-of-meat.json +++ b/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-ingredients-with-lots-of-meat.json @@ -51,6 +51,7 @@ }, { "ciqual_food_code" : "21523", + "ecobalyse_code" : "lamb-meat-without-bone", "id" : "en:lamb-meat", "is_in_taxonomy" : 1, "percent_estimate" : 20, @@ -149,6 +150,12 @@ "ingredients_with_unspecified_percent_sum" : 91, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:chicken-meat", + "en:pork-meat", + "en:salt" + ], + "ingredients_without_ecobalyse_ids_n" : 3, "known_ingredients_n" : 11, "lc" : "en", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-ingredients-with-no-meat.json b/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-ingredients-with-no-meat.json index b4976c98b6eb1..e560b4de2d084 100644 --- a/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-ingredients-with-no-meat.json +++ b/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-ingredients-with-no-meat.json @@ -57,6 +57,7 @@ }, { "ciqual_proxy_food_code" : "9410", + "ecobalyse_code" : "flour", "id" : "en:wheat-flour", "is_in_taxonomy" : 1, "percent_estimate" : 13.625, @@ -135,6 +136,11 @@ "ingredients_with_unspecified_percent_sum" : 87.375, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:salmon", + "en:salt" + ], + "ingredients_without_ecobalyse_ids_n" : 2, "known_ingredients_n" : 9, "lc" : "en", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-ingredients-with-very-little-meat.json b/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-ingredients-with-very-little-meat.json index d67b739380b77..551c685a04777 100644 --- a/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-ingredients-with-very-little-meat.json +++ b/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-ingredients-with-very-little-meat.json @@ -46,6 +46,7 @@ "ingredients" : [ { "ciqual_food_code" : "22000", + "ecobalyse_code" : "egg-indoor-code3", "id" : "en:egg", "is_in_taxonomy" : 1, "percent_estimate" : 53.8333333333333, @@ -57,6 +58,7 @@ }, { "ciqual_proxy_food_code" : "9410", + "ecobalyse_code" : "flour", "id" : "en:wheat-flour", "is_in_taxonomy" : 1, "percent_estimate" : 24.0833333333333, @@ -68,6 +70,7 @@ }, { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent_estimate" : 12.0416666666667, @@ -79,6 +82,7 @@ }, { "ciqual_food_code" : "9520", + "ecobalyse_proxy_code" : "flour", "id" : "en:rice-flour", "is_in_taxonomy" : 1, "percent_estimate" : 6.02083333333333, @@ -182,6 +186,11 @@ "en:lamb" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:lamb", + "en:salt" + ], + "ingredients_without_ecobalyse_ids_n" : 2, "known_ingredients_n" : 13, "lc" : "en", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/en-soy-beans-processed-and-unprocessed.json b/tests/unit/expected_test_results/nutriscore/en-soy-beans-processed-and-unprocessed.json index 4d6199e451460..5d335a32a626c 100644 --- a/tests/unit/expected_test_results/nutriscore/en-soy-beans-processed-and-unprocessed.json +++ b/tests/unit/expected_test_results/nutriscore/en-soy-beans-processed-and-unprocessed.json @@ -148,6 +148,10 @@ "ingredients_with_unspecified_percent_sum" : 0, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:soya-bean" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 5, "lc" : "en", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/en-sugar-estimated-nutrients.json b/tests/unit/expected_test_results/nutriscore/en-sugar-estimated-nutrients.json index 8fa6840f4b682..5b17532655ef1 100644 --- a/tests/unit/expected_test_results/nutriscore/en-sugar-estimated-nutrients.json +++ b/tests/unit/expected_test_results/nutriscore/en-sugar-estimated-nutrients.json @@ -39,6 +39,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 100, @@ -84,6 +85,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 3, "lc" : "en", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/en-sweeteners-erythritol.json b/tests/unit/expected_test_results/nutriscore/en-sweeteners-erythritol.json index 3dd5e6d6d0b7b..32a99f480a995 100644 --- a/tests/unit/expected_test_results/nutriscore/en-sweeteners-erythritol.json +++ b/tests/unit/expected_test_results/nutriscore/en-sweeteners-erythritol.json @@ -47,6 +47,7 @@ "ingredients" : [ { "ciqual_food_code" : "2074", + "ecobalyse_code" : "apple-fr", "id" : "en:apple-juice", "is_in_taxonomy" : 1, "percent_estimate" : 70.5, @@ -58,6 +59,7 @@ }, { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent_estimate" : 14.75, @@ -69,6 +71,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 2.25, @@ -145,6 +148,10 @@ "en:e968" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:e968" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 11, "lc" : "en", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/en-sweeteners.json b/tests/unit/expected_test_results/nutriscore/en-sweeteners.json index 70233c642c866..318826734df02 100644 --- a/tests/unit/expected_test_results/nutriscore/en-sweeteners.json +++ b/tests/unit/expected_test_results/nutriscore/en-sweeteners.json @@ -60,6 +60,7 @@ "ingredients" : [ { "ciqual_food_code" : "2074", + "ecobalyse_code" : "apple-fr", "id" : "en:apple-juice", "is_in_taxonomy" : 1, "percent_estimate" : 70.5, @@ -71,6 +72,7 @@ }, { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent_estimate" : 14.75, @@ -82,6 +84,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 2.25, @@ -158,6 +161,10 @@ "en:e951" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:e951" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 11, "lc" : "en", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/en-tofu.json b/tests/unit/expected_test_results/nutriscore/en-tofu.json index c98023b86494d..033141ebceb9f 100644 --- a/tests/unit/expected_test_results/nutriscore/en-tofu.json +++ b/tests/unit/expected_test_results/nutriscore/en-tofu.json @@ -63,6 +63,7 @@ }, { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent" : 9, @@ -131,6 +132,11 @@ "ingredients_with_unspecified_percent_sum" : 0, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:salt", + "en:soya-bean" + ], + "ingredients_without_ecobalyse_ids_n" : 2, "known_ingredients_n" : 7, "lc" : "en", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/en-vegetable-crisps.json b/tests/unit/expected_test_results/nutriscore/en-vegetable-crisps.json index 0fd2c2fc82b27..b2a46d701e56b 100644 --- a/tests/unit/expected_test_results/nutriscore/en-vegetable-crisps.json +++ b/tests/unit/expected_test_results/nutriscore/en-vegetable-crisps.json @@ -55,6 +55,7 @@ }, { "ciqual_food_code" : "20091", + "ecobalyse_code" : "beetroot-fr", "id" : "en:red-beetroot", "is_in_taxonomy" : 1, "percent" : 30, @@ -108,6 +109,10 @@ "ingredients_with_unspecified_percent_sum" : 0, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:parsnip" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 6, "lc" : "en", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/fr-canned-green-beans.json b/tests/unit/expected_test_results/nutriscore/fr-canned-green-beans.json index e2724c3118ecc..601425fe051b0 100644 --- a/tests/unit/expected_test_results/nutriscore/fr-canned-green-beans.json +++ b/tests/unit/expected_test_results/nutriscore/fr-canned-green-beans.json @@ -63,6 +63,7 @@ "ingredients" : [ { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent" : 80, @@ -75,6 +76,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent" : 10, @@ -87,6 +89,7 @@ }, { "ciqual_food_code" : "20061", + "ecobalyse_code" : "french-bean-non-eu", "id" : "en:green-bean", "is_in_taxonomy" : 1, "percent" : 10, @@ -145,6 +148,8 @@ "ingredients_with_unspecified_percent_sum" : 0, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 8, "lc" : "fr", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/fr-canned-pineapple.json b/tests/unit/expected_test_results/nutriscore/fr-canned-pineapple.json index 103a4ef948d65..4e3a436c1954d 100644 --- a/tests/unit/expected_test_results/nutriscore/fr-canned-pineapple.json +++ b/tests/unit/expected_test_results/nutriscore/fr-canned-pineapple.json @@ -61,6 +61,7 @@ "ingredients" : [ { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent" : 80, @@ -73,6 +74,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent" : 10, @@ -84,6 +86,7 @@ "vegetarian" : "yes" }, { + "ecobalyse_code" : "pineapple-non-eu", "id" : "en:pineapple", "is_in_taxonomy" : 1, "percent" : 10, @@ -140,6 +143,8 @@ "en:pineapple" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 6, "lc" : "fr", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/fr-coconut-milk.json b/tests/unit/expected_test_results/nutriscore/fr-coconut-milk.json index fb35e95407d4e..23b47fe0991a9 100644 --- a/tests/unit/expected_test_results/nutriscore/fr-coconut-milk.json +++ b/tests/unit/expected_test_results/nutriscore/fr-coconut-milk.json @@ -55,6 +55,7 @@ }, { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent_estimate" : 40, @@ -101,6 +102,10 @@ "ingredients_with_unspecified_percent_sum" : 40, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:coconut" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 3, "lc" : "fr", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/fr-gaspacho.json b/tests/unit/expected_test_results/nutriscore/fr-gaspacho.json index 90fbc13457297..6ae8203939374 100644 --- a/tests/unit/expected_test_results/nutriscore/fr-gaspacho.json +++ b/tests/unit/expected_test_results/nutriscore/fr-gaspacho.json @@ -55,6 +55,7 @@ "ingredients" : [ { "ciqual_food_code" : "20047", + "ecobalyse_code" : "tomato-heated-greenhouse-eu", "id" : "en:tomato", "is_in_taxonomy" : 1, "percent_estimate" : 51.7954545454545, @@ -66,6 +67,7 @@ }, { "ciqual_proxy_food_code" : "20019", + "ecobalyse_code" : "cucumber-eu", "id" : "en:cucumber", "is_in_taxonomy" : 1, "percent_estimate" : 24.45, @@ -77,6 +79,7 @@ }, { "ciqual_food_code" : "20041", + "ecobalyse_code" : "bellpepper-unheated-greehouse", "id" : "en:bell-pepper", "is_in_taxonomy" : 1, "percent_estimate" : 12.4272727272727, @@ -88,6 +91,7 @@ }, { "ciqual_food_code" : "20034", + "ecobalyse_code" : "onion-non-eu", "id" : "en:onion", "is_in_taxonomy" : 1, "percent_estimate" : 6.21363636363636, @@ -99,6 +103,7 @@ }, { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent_estimate" : 3.10681818181818, @@ -110,6 +115,7 @@ }, { "ciqual_food_code" : "17270", + "ecobalyse_code" : "extra-virgin-olive-oil", "from_palm_oil" : "no", "id" : "en:extra-virgin-olive-oil", "is_in_taxonomy" : 1, @@ -273,6 +279,14 @@ "fr:pain-de-riz" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:garlic", + "en:lemon-juice", + "en:salt", + "en:wine-vinegar", + "fr:pain-de-riz" + ], + "ingredients_without_ecobalyse_ids_n" : 5, "known_ingredients_n" : 23, "lc" : "fr", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/fr-green-beans-beverage.json b/tests/unit/expected_test_results/nutriscore/fr-green-beans-beverage.json index c925fc22c831a..dc935f02c02c9 100644 --- a/tests/unit/expected_test_results/nutriscore/fr-green-beans-beverage.json +++ b/tests/unit/expected_test_results/nutriscore/fr-green-beans-beverage.json @@ -33,6 +33,7 @@ "ingredients" : [ { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent" : 80, @@ -45,6 +46,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent" : 10, @@ -57,6 +59,7 @@ }, { "ciqual_food_code" : "20061", + "ecobalyse_code" : "french-bean-non-eu", "id" : "en:green-bean", "is_in_taxonomy" : 1, "percent" : 10, @@ -115,6 +118,8 @@ "ingredients_with_unspecified_percent_sum" : 0, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 8, "lc" : "fr", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/fr-ice-tea-with-sweetener.json b/tests/unit/expected_test_results/nutriscore/fr-ice-tea-with-sweetener.json index 2383388208247..89074c2ee1d00 100644 --- a/tests/unit/expected_test_results/nutriscore/fr-ice-tea-with-sweetener.json +++ b/tests/unit/expected_test_results/nutriscore/fr-ice-tea-with-sweetener.json @@ -58,6 +58,7 @@ "ingredients" : [ { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent_estimate" : 89.95, @@ -69,6 +70,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 2.85, @@ -142,6 +144,7 @@ "vegetarian" : "yes" }, { + "ecobalyse_code" : "peach-eu", "id" : "en:peach", "is_in_taxonomy" : 1, "percent" : 0.1, @@ -343,6 +346,22 @@ "fr:l" ], "ingredients_without_ciqual_codes_n" : 12, + "ingredients_without_ecobalyse_ids" : [ + "en:acid", + "en:acidity-regulator", + "en:antioxidant", + "en:black-tea-extract", + "en:e296", + "en:e300", + "en:e330", + "en:e960", + "en:flavouring", + "en:fructose", + "en:sodium-citrate", + "en:sweetener", + "fr:l" + ], + "ingredients_without_ecobalyse_ids_n" : 13, "known_ingredients_n" : 25, "lc" : "fr", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/fr-mixed-oils-with-olive-oil.json b/tests/unit/expected_test_results/nutriscore/fr-mixed-oils-with-olive-oil.json index 7c27f2d9996bf..63aa240ef5af9 100644 --- a/tests/unit/expected_test_results/nutriscore/fr-mixed-oils-with-olive-oil.json +++ b/tests/unit/expected_test_results/nutriscore/fr-mixed-oils-with-olive-oil.json @@ -57,6 +57,7 @@ "ingredients" : [ { "ciqual_food_code" : "17130", + "ecobalyse_code" : "rapeseed-oil", "from_palm_oil" : "no", "id" : "en:colza-oil", "is_in_taxonomy" : 1, @@ -70,6 +71,7 @@ }, { "ciqual_food_code" : "17440", + "ecobalyse_code" : "sunflower-oil", "from_palm_oil" : "no", "id" : "en:sunflower-oil", "is_in_taxonomy" : 1, @@ -83,6 +85,7 @@ }, { "ciqual_food_code" : "17270", + "ecobalyse_code" : "extra-virgin-olive-oil", "from_palm_oil" : "no", "id" : "en:extra-virgin-olive-oil", "is_in_taxonomy" : 1, @@ -96,6 +99,7 @@ }, { "ciqual_food_code" : "17180", + "ecobalyse_code" : "refined-linseed-oil", "from_palm_oil" : "no", "id" : "en:linseed-oil", "is_in_taxonomy" : 1, @@ -180,6 +184,10 @@ "en:vitamin-d" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:vitamin-d" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 11, "lc" : "fr", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/fr-orange-nectar-0-fat.json b/tests/unit/expected_test_results/nutriscore/fr-orange-nectar-0-fat.json index 31a5c9f626f1b..aa7c9e02a3b0f 100644 --- a/tests/unit/expected_test_results/nutriscore/fr-orange-nectar-0-fat.json +++ b/tests/unit/expected_test_results/nutriscore/fr-orange-nectar-0-fat.json @@ -49,6 +49,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "13034", + "ecobalyse_code" : "orange-non-eu", "id" : "en:orange", "is_in_taxonomy" : 1, "percent" : 47, @@ -61,6 +62,7 @@ }, { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent_estimate" : 32, @@ -72,6 +74,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent_estimate" : 11, @@ -83,6 +86,7 @@ }, { "ciqual_food_code" : "20009", + "ecobalyse_code" : "carrot-non-eu", "id" : "en:carrot", "is_in_taxonomy" : 1, "percent" : 10, @@ -148,6 +152,8 @@ "ingredients_with_unspecified_percent_sum" : 43, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 11, "lc" : "en", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/fr-plant-beverages-soy-milk.json b/tests/unit/expected_test_results/nutriscore/fr-plant-beverages-soy-milk.json index cf69008924094..3f6ca5081be3c 100644 --- a/tests/unit/expected_test_results/nutriscore/fr-plant-beverages-soy-milk.json +++ b/tests/unit/expected_test_results/nutriscore/fr-plant-beverages-soy-milk.json @@ -63,6 +63,7 @@ "ingredients" : [ { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent_estimate" : 92, @@ -127,6 +128,10 @@ "ingredients_with_unspecified_percent_sum" : 92, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:soya-bean" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 6, "lc" : "fr", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/fr-rapeseed-oil.json b/tests/unit/expected_test_results/nutriscore/fr-rapeseed-oil.json index 0e2e3a6d2bd77..b9bd2312c5d6a 100644 --- a/tests/unit/expected_test_results/nutriscore/fr-rapeseed-oil.json +++ b/tests/unit/expected_test_results/nutriscore/fr-rapeseed-oil.json @@ -49,6 +49,7 @@ "ingredients" : [ { "ciqual_food_code" : "17130", + "ecobalyse_code" : "rapeseed-oil", "from_palm_oil" : "no", "id" : "en:colza-oil", "is_in_taxonomy" : 1, @@ -97,6 +98,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 4, "lc" : "fr", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/milk.json b/tests/unit/expected_test_results/nutriscore/milk.json index d68bdcdafd681..43542b829bd68 100644 --- a/tests/unit/expected_test_results/nutriscore/milk.json +++ b/tests/unit/expected_test_results/nutriscore/milk.json @@ -45,6 +45,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "19051", + "ecobalyse_code" : "milk", "id" : "en:milk", "is_in_taxonomy" : 1, "percent_estimate" : 100, @@ -92,6 +93,8 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 2, "lc" : "en", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/nutriscore/mushrooms.json b/tests/unit/expected_test_results/nutriscore/mushrooms.json index c25a19be8c5f9..eb88cd0f47ed0 100644 --- a/tests/unit/expected_test_results/nutriscore/mushrooms.json +++ b/tests/unit/expected_test_results/nutriscore/mushrooms.json @@ -33,6 +33,7 @@ "ingredients" : [ { "ciqual_food_code" : "20114", + "ecobalyse_code" : "mushroom-eu", "id" : "en:oyster-mushroom", "is_in_taxonomy" : 1, "origins" : "en:european-union", @@ -103,6 +104,10 @@ "fr:chapelure-de-mais" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "fr:chapelure-de-mais" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "known_ingredients_n" : 3, "lc" : "fr", "minerals_tags" : [], diff --git a/tests/unit/expected_test_results/recipes/fr-margherita-pizzas.fr-margherita-pizza-1.json b/tests/unit/expected_test_results/recipes/fr-margherita-pizzas.fr-margherita-pizza-1.json index 410b3028ad183..9befd174885bc 100644 --- a/tests/unit/expected_test_results/recipes/fr-margherita-pizzas.fr-margherita-pizza-1.json +++ b/tests/unit/expected_test_results/recipes/fr-margherita-pizzas.fr-margherita-pizza-1.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "9410", + "ecobalyse_code" : "flour", "id" : "en:wheat-flour", "is_in_taxonomy" : 1, "labels" : "en:organic", @@ -14,6 +15,7 @@ }, { "ciqual_food_code" : "20170", + "ecobalyse_code" : "tomato-heated-greenhouse-eu", "id" : "en:tomato-puree", "is_in_taxonomy" : 1, "labels" : "en:organic", @@ -27,6 +29,7 @@ }, { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent_estimate" : 21.5, @@ -38,6 +41,7 @@ }, { "ciqual_food_code" : "19590", + "ecobalyse_code" : "mozzarella", "id" : "en:mozzarella", "is_in_taxonomy" : 1, "labels" : "en:organic", @@ -52,6 +56,7 @@ }, { "ciqual_food_code" : "17440", + "ecobalyse_code" : "sunflower-oil", "from_palm_oil" : "no", "id" : "en:sunflower-oil", "is_in_taxonomy" : 1, @@ -196,6 +201,13 @@ "en:spice" ], "ingredients_without_ciqual_codes_n" : 2, + "ingredients_without_ecobalyse_ids" : [ + "en:herb", + "en:salt", + "en:spice", + "en:yeast" + ], + "ingredients_without_ecobalyse_ids_n" : 4, "known_ingredients_n" : 22, "lc" : "fr", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/recipes/fr-margherita-pizzas.fr-margherita-pizza-2-compound-ingredients.json b/tests/unit/expected_test_results/recipes/fr-margherita-pizzas.fr-margherita-pizza-2-compound-ingredients.json index e01ee52298ad3..d7860b150da7e 100644 --- a/tests/unit/expected_test_results/recipes/fr-margherita-pizzas.fr-margherita-pizza-2-compound-ingredients.json +++ b/tests/unit/expected_test_results/recipes/fr-margherita-pizzas.fr-margherita-pizza-2-compound-ingredients.json @@ -5,6 +5,7 @@ "ingredients" : [ { "ciqual_food_code" : "20047", + "ecobalyse_code" : "tomato-heated-greenhouse-eu", "id" : "en:chopped-tomatoes", "is_in_taxonomy" : 1, "percent_estimate" : 46.6666666666667, @@ -53,6 +54,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "9410", + "ecobalyse_code" : "flour", "id" : "en:wheat-flour", "is_in_taxonomy" : 1, "percent_estimate" : 20, @@ -64,6 +66,7 @@ }, { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent_estimate" : 5, @@ -176,6 +179,14 @@ "en:filling" ], "ingredients_without_ciqual_codes_n" : 1, + "ingredients_without_ecobalyse_ids" : [ + "en:basil-leaf", + "en:cheese", + "en:filling", + "en:pizza-dough", + "en:salt" + ], + "ingredients_without_ecobalyse_ids_n" : 5, "known_ingredients_n" : 19, "lc" : "fr", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/recipes/nectars.guava-nectar.json b/tests/unit/expected_test_results/recipes/nectars.guava-nectar.json index 0956e0df068e6..a63ac040c3500 100644 --- a/tests/unit/expected_test_results/recipes/nectars.guava-nectar.json +++ b/tests/unit/expected_test_results/recipes/nectars.guava-nectar.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent_estimate" : 62, @@ -25,6 +26,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:cane-sugar", "is_in_taxonomy" : 1, "percent" : 10, @@ -118,6 +120,12 @@ "en:some-unknown-ingredient" ], "ingredients_without_ciqual_codes_n" : 3, + "ingredients_without_ecobalyse_ids" : [ + "en:e330", + "en:guava", + "en:some-unknown-ingredient" + ], + "ingredients_without_ecobalyse_ids_n" : 3, "known_ingredients_n" : 8, "lc" : "en", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/recipes/nectars.impossible-ingredients.json b/tests/unit/expected_test_results/recipes/nectars.impossible-ingredients.json index b2a49606e129b..a400b3a087aac 100644 --- a/tests/unit/expected_test_results/recipes/nectars.impossible-ingredients.json +++ b/tests/unit/expected_test_results/recipes/nectars.impossible-ingredients.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "2070", + "ecobalyse_code" : "orange-non-eu", "id" : "en:orange-juice", "is_in_taxonomy" : 1, "percent" : 50, @@ -12,6 +13,7 @@ }, { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent_estimate" : 25, @@ -21,6 +23,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent" : 30, @@ -78,6 +81,8 @@ "ingredients_with_unspecified_percent_sum" : 25, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 10, "lc" : "en", "misc_tags" : [ diff --git a/tests/unit/expected_test_results/recipes/nectars.strawberry-nectar.json b/tests/unit/expected_test_results/recipes/nectars.strawberry-nectar.json index 3a393f2a4b271..3c42f675c9025 100644 --- a/tests/unit/expected_test_results/recipes/nectars.strawberry-nectar.json +++ b/tests/unit/expected_test_results/recipes/nectars.strawberry-nectar.json @@ -2,6 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "18066", + "ecobalyse_code" : "tap-water", "id" : "en:water", "is_in_taxonomy" : 1, "percent_estimate" : 75, @@ -13,6 +14,7 @@ }, { "ciqual_food_code" : "13014", + "ecobalyse_code" : "strawberry-non-eu", "id" : "en:strawberry-juice", "is_in_taxonomy" : 1, "percent" : 20, @@ -25,6 +27,7 @@ }, { "ciqual_proxy_food_code" : "31016", + "ecobalyse_code" : "sugar", "id" : "en:sugar", "is_in_taxonomy" : 1, "percent" : 5, @@ -84,6 +87,8 @@ "ingredients_with_unspecified_percent_sum" : 75, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, + "ingredients_without_ecobalyse_ids" : [], + "ingredients_without_ecobalyse_ids_n" : 0, "known_ingredients_n" : 10, "lc" : "en", "misc_tags" : [ From 49c07ef05220cf077143ed253a657d7fb33727de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Gigandet?= Date: Fri, 11 Oct 2024 11:29:38 +0200 Subject: [PATCH 03/18] lint --- lib/ProductOpener/Ingredients.pm | 40 ++++++++++++++++---------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/lib/ProductOpener/Ingredients.pm b/lib/ProductOpener/Ingredients.pm index bc14121d6e745..72ace9f4810a5 100644 --- a/lib/ProductOpener/Ingredients.pm +++ b/lib/ProductOpener/Ingredients.pm @@ -3265,30 +3265,30 @@ sub extract_ingredients_from_text ($product_ref) { } sub assign_property_to_ingredients ($product_ref) { - # If the ingredient list is not defined, the function immediately returns - return if not defined $product_ref->{ingredients}; + # If the ingredient list is not defined, the function immediately returns + return if not defined $product_ref->{ingredients}; - # ------------------------------------ PART 1 : Getting CIQUAL codes ------------------------------------ # - # Retrieves a unique and sorted list of ingredients missing Ciqual codes - my @ingredients_without_ciqual_codes = uniq(sort(get_missing_ciqual_codes($product_ref->{ingredients}))); + # ------------------------------------ PART 1 : Getting CIQUAL codes ------------------------------------ # + # Retrieves a unique and sorted list of ingredients missing Ciqual codes + my @ingredients_without_ciqual_codes = uniq(sort(get_missing_ciqual_codes($product_ref->{ingredients}))); - # Stores this list in the product under the key 'ingredients_without_ciqual_codes' - $product_ref->{ingredients_without_ciqual_codes} = \@ingredients_without_ciqual_codes; + # Stores this list in the product under the key 'ingredients_without_ciqual_codes' + $product_ref->{ingredients_without_ciqual_codes} = \@ingredients_without_ciqual_codes; - # Also stores the total number of ingredients without Ciqual codes - $product_ref->{ingredients_without_ciqual_codes_n} = @ingredients_without_ciqual_codes + 0.0; + # Also stores the total number of ingredients without Ciqual codes + $product_ref->{ingredients_without_ciqual_codes_n} = @ingredients_without_ciqual_codes + 0.0; - # ------------------------------------ PART 2 : Getting Ecobalyse ids ------------------------------------ # - # Retrieves a unique and sorted list of ingredients missing Ecobalyse ids - my @ingredients_without_ecobalyse_ids = uniq(sort(get_missing_ecobalyse_ids($product_ref->{ingredients}))); + # ------------------------------------ PART 2 : Getting Ecobalyse ids ------------------------------------ # + # Retrieves a unique and sorted list of ingredients missing Ecobalyse ids + my @ingredients_without_ecobalyse_ids = uniq(sort(get_missing_ecobalyse_ids($product_ref->{ingredients}))); - # Stores this list in the product under the key 'ingredients_without_ecobalyse_ids' - $product_ref->{ingredients_without_ecobalyse_ids} = \@ingredients_without_ecobalyse_ids; + # Stores this list in the product under the key 'ingredients_without_ecobalyse_ids' + $product_ref->{ingredients_without_ecobalyse_ids} = \@ingredients_without_ecobalyse_ids; - # Also stores the total number of ingredients without Ecobalyse ids - $product_ref->{ingredients_without_ecobalyse_ids_n} = @ingredients_without_ecobalyse_ids + 0.0; + # Also stores the total number of ingredients without Ecobalyse ids + $product_ref->{ingredients_without_ecobalyse_ids_n} = @ingredients_without_ecobalyse_ids + 0.0; - return; + return; } =head2 get_missing_ciqual_codes ($ingredients_ref) @@ -3371,7 +3371,7 @@ sub get_missing_ecobalyse_ids ($ingredients_ref) { # Getting properties from product #my $product_origin = has_specific_ingredient_property() - # Getting the correct ecobalyse comake devde + # Getting the correct ecobalyse comake devde my $ecobalyse_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse:en"); if (defined $ecobalyse_code) { $ingredient_ref->{ecobalyse_code} = $ecobalyse_code; @@ -3380,13 +3380,13 @@ sub get_missing_ecobalyse_ids ($ingredients_ref) { my $ecobalyse_proxy_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_proxy:en"); if (defined $ecobalyse_proxy_code) { - $ingredient_ref->{ecobalyse_proxy_code} = $ecobalyse_proxy_code; + $ingredient_ref->{ecobalyse_proxy_code} = $ecobalyse_proxy_code; } else { push(@ingredients_without_ecobalyse_ids, $ingredient_ref->{id}); } } - + #ecobalyse:en #ecobalyse_labels_en_organic:en #ecobalyse_origins_en_france:en From 98560d537370d3bc27cdfc19fc1777ea6f9c85c5 Mon Sep 17 00:00:00 2001 From: Martin Ces Date: Mon, 21 Oct 2024 16:56:59 +0200 Subject: [PATCH 04/18] taxonomy: a new key has been added in country.txt in order to know if the country is part of Europe (For Ecobalyse) --- Makefile | 2 +- taxonomies/countries.txt | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c33cf08bfe7dd..dab8b7d2db4d5 100644 --- a/Makefile +++ b/Makefile @@ -126,7 +126,7 @@ create_folders: clone_deps # args variable may be use to eg. "--progress plain" option and keep logs on a failing build build: @echo "🥫 Building containers …" - ${DOCKER_COMPOSE} build ${args} ${container} 2>&1 + ${DOCKER_COMPOSE} build --no-cache ${args} ${container} 2>&1 _up:run_deps @echo "🥫 Starting containers …" diff --git a/taxonomies/countries.txt b/taxonomies/countries.txt index 5e69b11c585fe..341bdd6bf5b5f 100644 --- a/taxonomies/countries.txt +++ b/taxonomies/countries.txt @@ -3332,6 +3332,7 @@ country_code_3:en: AUT language_codes:en: de osm_relation:en: 16239 wikidata:en: Q40 +ecobalyse_is_part_of_eu: true en: Azerbaijan, Republic of Azerbaijan, AZ, AZE ab: Азербаиџьан @@ -4634,6 +4635,7 @@ country_code_3:en: BEL language_codes:en: nl,fr,de osm_relation:en: 52411 wikidata:en: Q31 +ecobalyse_is_part_of_eu: true en: Belize, BZ, BLZ ace: Belize @@ -7022,6 +7024,7 @@ country_code_3:en: BGR language_codes:en: bg osm_relation:en: 186382 wikidata:en: Q219 +ecobalyse_is_part_of_eu: true en: Burkina Faso, BF, BFA ace: Burkina Faso @@ -10433,6 +10436,7 @@ country_code_3:en: HRV language_codes:en: hr osm_relation:en: 214885 wikidata:en: Q224 +ecobalyse_is_part_of_eu: true en: Cuba, Republic of Cuba, CU, CUB ace: Kuba @@ -10953,6 +10957,7 @@ country_code_2:en: CY country_code_3:en: CYP language_codes:en: el,tr osm_relation:en: 307787 +ecobalyse_is_part_of_eu: true en: Czech Republic, Czechia, CZ, CZE ab: Чехиа @@ -11192,6 +11197,7 @@ country_code_2:en: CZ country_code_3:en: CZE language_codes:en: cs osm_relation:en: 51684 +ecobalyse_is_part_of_eu: true en: Côte d'Ivoire, Ivory Coast, Republic of Côte d'Ivoire, CI, CIV ace: Panté Gadéng @@ -11826,6 +11832,7 @@ zu: IDenimaki country_code_2:en: DK country_code_3:en: DNK language_codes:en: da +ecobalyse_is_part_of_eu: true en: Djibouti, Republic of Djibouti, DJ, DJI ace: Djibouti @@ -13700,6 +13707,7 @@ zu: I-Estoniya country_code_2:en: EE country_code_3:en: EST language_codes:en: et +ecobalyse_is_part_of_eu: true en: Ethiopia, ET, ETH ace: Ethiopia @@ -14969,6 +14977,7 @@ zu: IFinlandi country_code_2:en: FI country_code_3:en: FIN language_codes:en: fi,sv +ecobalyse_is_part_of_eu: true en: France, The Hexagon, French Republic, FR, FRA ace: Peurancih @@ -15238,6 +15247,7 @@ zu: IFulansi country_code_2:en: FR country_code_3:en: FRA language_codes:en: fr +ecobalyse_is_part_of_eu: true en: French Guiana, GF, GUF ace: Guyana Peurancih @@ -16468,6 +16478,7 @@ zu: IJalimani country_code_2:en: DE country_code_3:en: DEU language_codes:en: de +ecobalyse_is_part_of_eu: true en: Ghana, Republic of Ghana, GH, GHA ace: Ghana @@ -17069,6 +17080,7 @@ zu: IGreki country_code_2:en: GR country_code_3:en: GRC language_codes:en: el +ecobalyse_is_part_of_eu: true en: Greenland, Greenland (country), GL, GRL af: Groenland @@ -19326,6 +19338,7 @@ zh-yue:匈牙利 country_code_2:en: HU country_code_3:en: HUN language_codes:en: hu +ecobalyse_is_part_of_eu: true en: Iceland, Republic of Iceland, IS, ISL ace: Islandia @@ -21169,6 +21182,7 @@ zu: ITaliya country_code_2:en: IT country_code_3:en: ITA language_codes:en: it +ecobalyse_is_part_of_eu: true en: Jamaica, JA, Commonwealth of Jamaica, Jamdung, JM, JAM ace: Jamaika @@ -23402,6 +23416,7 @@ zu: ILatviya country_code_2:en: LV country_code_3:en: LVA language_codes:en: lv +ecobalyse_is_part_of_eu: true en: Lebanon, Lebanese Republic, LB, LBN ace: Lebanon @@ -24667,6 +24682,7 @@ zu: ILithuwaniya country_code_2:en: LT country_code_3:en: LTU language_codes:en: lt +ecobalyse_is_part_of_eu: true en: Luxembourg, Luxemburg, Grand Duchy of Luxembourg, LU, LU, LUX ace: Luksèmburg, Luxemburg @@ -24910,6 +24926,7 @@ zh-yue:盧森堡 country_code_2:en: LU country_code_3:en: LUX language_codes:en: fr,de,lb,en +ecobalyse_is_part_of_eu: true en: Macau, Macao, Macau Special Administrative Region, Macau Special Administrative Region of the People's Republic of China, Aomen, MO, MAC ace: Makèë @@ -26228,6 +26245,7 @@ zu: IMalta country_code_2:en: MT country_code_3:en: MLT language_codes:en: en,mt +ecobalyse_is_part_of_eu: true en: Marshall Islands, Republic of the Marshall Islands, Aolepān Aorōkin M̧ajeļ, MH, MHL ace: Pulo-pulo Marshall @@ -29666,6 +29684,7 @@ zu: Netherlands country_code_2:en: NL country_code_3:en: NLD language_codes:en: nl +ecobalyse_is_part_of_eu: true en: New Caledonia, NC, NCL ace: Kaledonia Barô @@ -33459,6 +33478,7 @@ zu: IPolandi country_code_2:en: PL country_code_3:en: POL language_codes:en: pl +ecobalyse_is_part_of_eu: true en: Portugal, Portuguese Republic, PT, PT, PRT ace: Portugéh @@ -33712,6 +33732,7 @@ zu: IPhothugali country_code_2:en: PT country_code_3:en: PRT language_codes:en: pt +ecobalyse_is_part_of_eu: true en: Puerto Rico, Commonwealth of Puerto Rico, PR, PRI af: Puerto Rico @@ -34460,6 +34481,7 @@ zu: I-Ayilendi, Celts, I-Ayilandi country_code_2:en: IE country_code_3:en: IRL language_codes:en: en,ga +ecobalyse_is_part_of_eu: true en: Republic of the Congo, Congo-Brazzaville, CG, COG, Congo Republic af: Republiek van die Kongo @@ -34936,6 +34958,7 @@ zh-yue:羅馬尼亞 country_code_2:en: RO country_code_3:en: ROU language_codes:en: ro +ecobalyse_is_part_of_eu: true en: Russia, Russian Federation, Russian federation, Rossiyskaya Federatsiya, Россия, Rossijskaja Federatsija, Российская Федерация, 🇷🇺, RU, RUS ab: Урыстәыла @@ -38446,6 +38469,7 @@ zu: ISlovaki country_code_2:en: SK country_code_3:en: SVK language_codes:en: sk +ecobalyse_is_part_of_eu: true en: Slovenia, Republic of Slovenia, Slovenija, Republika Slovenija, SI, SVN ace: Slovenia @@ -38671,6 +38695,7 @@ zh-yue:斯洛文尼亞 country_code_2:en: SI country_code_3:en: SVN language_codes:en: sl +ecobalyse_is_part_of_eu: true en: Solomon Islands, SB, SLB ace: Pulo-pulo Solomon @@ -40178,6 +40203,7 @@ zu: ISpeyini country_code_2:en: ES country_code_3:en: ESP language_codes:en: es,ca,eu,gl +ecobalyse_is_part_of_eu: true en: Sri Lanka, Democratic Socialist Republic of Sri Lanka, LK, LKA ace: Srilanka @@ -41306,6 +41332,7 @@ zu: ISwidi country_code_2:en: SE country_code_3:en: SWE language_codes:en: sv +ecobalyse_is_part_of_eu: true en: Switzerland, Swiss Confederation, CH, CH, CHE ace: Swiss @@ -45113,6 +45140,7 @@ country_code_2:en: UK country_code_3:en: GBR language_codes:en: en,cy,ga,gd official_country_code_2:en: GB +ecobalyse_is_part_of_eu: true en: United States Minor Outlying Islands, UM, UMI af: Klein afgeleë eilande van die Verenigde State van Amerika From ebb3add818a4fc26055d36c9529342b209ebd082 Mon Sep 17 00:00:00 2001 From: Martin Ces Date: Mon, 21 Oct 2024 16:58:55 +0200 Subject: [PATCH 05/18] Erratum in MakeFile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index dab8b7d2db4d5..c33cf08bfe7dd 100644 --- a/Makefile +++ b/Makefile @@ -126,7 +126,7 @@ create_folders: clone_deps # args variable may be use to eg. "--progress plain" option and keep logs on a failing build build: @echo "🥫 Building containers …" - ${DOCKER_COMPOSE} build --no-cache ${args} ${container} 2>&1 + ${DOCKER_COMPOSE} build ${args} ${container} 2>&1 _up:run_deps @echo "🥫 Starting containers …" From 9b2741b66ef8be37ce16e38e99b92d9e1d69392b Mon Sep 17 00:00:00 2001 From: Martin Ces Date: Thu, 24 Oct 2024 10:04:36 +0200 Subject: [PATCH 06/18] ecobalyse: a boolean has been added in the country taxonomy for european countries, the ecobalyse id is adapted for organic ingredients --- lib/ProductOpener/Ingredients.pm | 45 ++++++++++++++++++------- taxonomies/countries.txt | 56 ++++++++++++++++---------------- 2 files changed, 62 insertions(+), 39 deletions(-) diff --git a/lib/ProductOpener/Ingredients.pm b/lib/ProductOpener/Ingredients.pm index 72ace9f4810a5..00bbb667cdea2 100644 --- a/lib/ProductOpener/Ingredients.pm +++ b/lib/ProductOpener/Ingredients.pm @@ -3371,20 +3371,43 @@ sub get_missing_ecobalyse_ids ($ingredients_ref) { # Getting properties from product #my $product_origin = has_specific_ingredient_property() - # Getting the correct ecobalyse comake devde - my $ecobalyse_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse:en"); - if (defined $ecobalyse_code) { - $ingredient_ref->{ecobalyse_code} = $ecobalyse_code; - } - else { - my $ecobalyse_proxy_code - = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_proxy:en"); - if (defined $ecobalyse_proxy_code) { - $ingredient_ref->{ecobalyse_proxy_code} = $ecobalyse_proxy_code; + # If the ingredient is biological, the id 'ecobalyse_labels_en_organic:en' is taken + if ("en:organic" in $ingredient_ref->{labels}) { + + # Getting the correct ecobalyse comake devde + my $ecobalyse_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_labels_en_organic:en"); + if (defined $ecobalyse_code) { + $ingredient_ref->{ecobalyse_code} = $ecobalyse_code; + } + else { + my $ecobalyse_proxy_code + = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_proxy:en"); + if (defined $ecobalyse_proxy_code) { + $ingredient_ref->{ecobalyse_proxy_code} = $ecobalyse_proxy_code; + } + else { + push(@ingredients_without_ecobalyse_ids, $ingredient_ref->{id}); + } + } + + } else { + + # Getting the correct ecobalyse comake devde + my $ecobalyse_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse:en"); + if (defined $ecobalyse_code) { + $ingredient_ref->{ecobalyse_code} = $ecobalyse_code; } else { - push(@ingredients_without_ecobalyse_ids, $ingredient_ref->{id}); + my $ecobalyse_proxy_code + = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_proxy:en"); + if (defined $ecobalyse_proxy_code) { + $ingredient_ref->{ecobalyse_proxy_code} = $ecobalyse_proxy_code; + } + else { + push(@ingredients_without_ecobalyse_ids, $ingredient_ref->{id}); + } } + } #ecobalyse:en diff --git a/taxonomies/countries.txt b/taxonomies/countries.txt index 341bdd6bf5b5f..271814ee05807 100644 --- a/taxonomies/countries.txt +++ b/taxonomies/countries.txt @@ -3332,7 +3332,7 @@ country_code_3:en: AUT language_codes:en: de osm_relation:en: 16239 wikidata:en: Q40 -ecobalyse_is_part_of_eu: true +ecobalyse_is_part_of_eu: 1 en: Azerbaijan, Republic of Azerbaijan, AZ, AZE ab: Азербаиџьан @@ -4635,7 +4635,7 @@ country_code_3:en: BEL language_codes:en: nl,fr,de osm_relation:en: 52411 wikidata:en: Q31 -ecobalyse_is_part_of_eu: true +ecobalyse_is_part_of_eu: 1 en: Belize, BZ, BLZ ace: Belize @@ -7024,7 +7024,7 @@ country_code_3:en: BGR language_codes:en: bg osm_relation:en: 186382 wikidata:en: Q219 -ecobalyse_is_part_of_eu: true +ecobalyse_is_part_of_eu: 1 en: Burkina Faso, BF, BFA ace: Burkina Faso @@ -10436,7 +10436,7 @@ country_code_3:en: HRV language_codes:en: hr osm_relation:en: 214885 wikidata:en: Q224 -ecobalyse_is_part_of_eu: true +ecobalyse_is_part_of_eu: 1 en: Cuba, Republic of Cuba, CU, CUB ace: Kuba @@ -10957,7 +10957,7 @@ country_code_2:en: CY country_code_3:en: CYP language_codes:en: el,tr osm_relation:en: 307787 -ecobalyse_is_part_of_eu: true +ecobalyse_is_part_of_eu: 1 en: Czech Republic, Czechia, CZ, CZE ab: Чехиа @@ -11197,7 +11197,7 @@ country_code_2:en: CZ country_code_3:en: CZE language_codes:en: cs osm_relation:en: 51684 -ecobalyse_is_part_of_eu: true +ecobalyse_is_part_of_eu: 1 en: Côte d'Ivoire, Ivory Coast, Republic of Côte d'Ivoire, CI, CIV ace: Panté Gadéng @@ -11832,7 +11832,7 @@ zu: IDenimaki country_code_2:en: DK country_code_3:en: DNK language_codes:en: da -ecobalyse_is_part_of_eu: true +ecobalyse_is_part_of_eu: 1 en: Djibouti, Republic of Djibouti, DJ, DJI ace: Djibouti @@ -13707,7 +13707,7 @@ zu: I-Estoniya country_code_2:en: EE country_code_3:en: EST language_codes:en: et -ecobalyse_is_part_of_eu: true +ecobalyse_is_part_of_eu: 1 en: Ethiopia, ET, ETH ace: Ethiopia @@ -14977,7 +14977,7 @@ zu: IFinlandi country_code_2:en: FI country_code_3:en: FIN language_codes:en: fi,sv -ecobalyse_is_part_of_eu: true +ecobalyse_is_part_of_eu: 1 en: France, The Hexagon, French Republic, FR, FRA ace: Peurancih @@ -15247,7 +15247,7 @@ zu: IFulansi country_code_2:en: FR country_code_3:en: FRA language_codes:en: fr -ecobalyse_is_part_of_eu: true +ecobalyse_is_part_of_eu: 1 en: French Guiana, GF, GUF ace: Guyana Peurancih @@ -16478,7 +16478,7 @@ zu: IJalimani country_code_2:en: DE country_code_3:en: DEU language_codes:en: de -ecobalyse_is_part_of_eu: true +ecobalyse_is_part_of_eu: 1 en: Ghana, Republic of Ghana, GH, GHA ace: Ghana @@ -17080,7 +17080,7 @@ zu: IGreki country_code_2:en: GR country_code_3:en: GRC language_codes:en: el -ecobalyse_is_part_of_eu: true +ecobalyse_is_part_of_eu: 1 en: Greenland, Greenland (country), GL, GRL af: Groenland @@ -19338,7 +19338,7 @@ zh-yue:匈牙利 country_code_2:en: HU country_code_3:en: HUN language_codes:en: hu -ecobalyse_is_part_of_eu: true +ecobalyse_is_part_of_eu: 1 en: Iceland, Republic of Iceland, IS, ISL ace: Islandia @@ -21182,7 +21182,7 @@ zu: ITaliya country_code_2:en: IT country_code_3:en: ITA language_codes:en: it -ecobalyse_is_part_of_eu: true +ecobalyse_is_part_of_eu: 1 en: Jamaica, JA, Commonwealth of Jamaica, Jamdung, JM, JAM ace: Jamaika @@ -23416,7 +23416,7 @@ zu: ILatviya country_code_2:en: LV country_code_3:en: LVA language_codes:en: lv -ecobalyse_is_part_of_eu: true +ecobalyse_is_part_of_eu: 1 en: Lebanon, Lebanese Republic, LB, LBN ace: Lebanon @@ -24682,7 +24682,7 @@ zu: ILithuwaniya country_code_2:en: LT country_code_3:en: LTU language_codes:en: lt -ecobalyse_is_part_of_eu: true +ecobalyse_is_part_of_eu: 1 en: Luxembourg, Luxemburg, Grand Duchy of Luxembourg, LU, LU, LUX ace: Luksèmburg, Luxemburg @@ -24926,7 +24926,7 @@ zh-yue:盧森堡 country_code_2:en: LU country_code_3:en: LUX language_codes:en: fr,de,lb,en -ecobalyse_is_part_of_eu: true +ecobalyse_is_part_of_eu: 1 en: Macau, Macao, Macau Special Administrative Region, Macau Special Administrative Region of the People's Republic of China, Aomen, MO, MAC ace: Makèë @@ -26245,7 +26245,7 @@ zu: IMalta country_code_2:en: MT country_code_3:en: MLT language_codes:en: en,mt -ecobalyse_is_part_of_eu: true +ecobalyse_is_part_of_eu: 1 en: Marshall Islands, Republic of the Marshall Islands, Aolepān Aorōkin M̧ajeļ, MH, MHL ace: Pulo-pulo Marshall @@ -29684,7 +29684,7 @@ zu: Netherlands country_code_2:en: NL country_code_3:en: NLD language_codes:en: nl -ecobalyse_is_part_of_eu: true +ecobalyse_is_part_of_eu: 1 en: New Caledonia, NC, NCL ace: Kaledonia Barô @@ -33478,7 +33478,7 @@ zu: IPolandi country_code_2:en: PL country_code_3:en: POL language_codes:en: pl -ecobalyse_is_part_of_eu: true +ecobalyse_is_part_of_eu: 1 en: Portugal, Portuguese Republic, PT, PT, PRT ace: Portugéh @@ -33732,7 +33732,7 @@ zu: IPhothugali country_code_2:en: PT country_code_3:en: PRT language_codes:en: pt -ecobalyse_is_part_of_eu: true +ecobalyse_is_part_of_eu: 1 en: Puerto Rico, Commonwealth of Puerto Rico, PR, PRI af: Puerto Rico @@ -34481,7 +34481,7 @@ zu: I-Ayilendi, Celts, I-Ayilandi country_code_2:en: IE country_code_3:en: IRL language_codes:en: en,ga -ecobalyse_is_part_of_eu: true +ecobalyse_is_part_of_eu: 1 en: Republic of the Congo, Congo-Brazzaville, CG, COG, Congo Republic af: Republiek van die Kongo @@ -34958,7 +34958,7 @@ zh-yue:羅馬尼亞 country_code_2:en: RO country_code_3:en: ROU language_codes:en: ro -ecobalyse_is_part_of_eu: true +ecobalyse_is_part_of_eu: 1 en: Russia, Russian Federation, Russian federation, Rossiyskaya Federatsiya, Россия, Rossijskaja Federatsija, Российская Федерация, 🇷🇺, RU, RUS ab: Урыстәыла @@ -38469,7 +38469,7 @@ zu: ISlovaki country_code_2:en: SK country_code_3:en: SVK language_codes:en: sk -ecobalyse_is_part_of_eu: true +ecobalyse_is_part_of_eu: 1 en: Slovenia, Republic of Slovenia, Slovenija, Republika Slovenija, SI, SVN ace: Slovenia @@ -38695,7 +38695,7 @@ zh-yue:斯洛文尼亞 country_code_2:en: SI country_code_3:en: SVN language_codes:en: sl -ecobalyse_is_part_of_eu: true +ecobalyse_is_part_of_eu: 1 en: Solomon Islands, SB, SLB ace: Pulo-pulo Solomon @@ -40203,7 +40203,7 @@ zu: ISpeyini country_code_2:en: ES country_code_3:en: ESP language_codes:en: es,ca,eu,gl -ecobalyse_is_part_of_eu: true +ecobalyse_is_part_of_eu: 1 en: Sri Lanka, Democratic Socialist Republic of Sri Lanka, LK, LKA ace: Srilanka @@ -41332,7 +41332,7 @@ zu: ISwidi country_code_2:en: SE country_code_3:en: SWE language_codes:en: sv -ecobalyse_is_part_of_eu: true +ecobalyse_is_part_of_eu: 1 en: Switzerland, Swiss Confederation, CH, CH, CHE ace: Swiss @@ -45140,7 +45140,7 @@ country_code_2:en: UK country_code_3:en: GBR language_codes:en: en,cy,ga,gd official_country_code_2:en: GB -ecobalyse_is_part_of_eu: true +ecobalyse_is_part_of_eu: 1 en: United States Minor Outlying Islands, UM, UMI af: Klein afgeleë eilande van die Verenigde State van Amerika From 2458c0c0e2486d04fdf7e143b6cafac7420bab40 Mon Sep 17 00:00:00 2001 From: Martin Ces Date: Thu, 24 Oct 2024 10:40:18 +0200 Subject: [PATCH 07/18] ecobalyse: a boolean has been added in the country taxonomy for european countries, marked as 'yes' --- lib/ProductOpener/Ingredients.pm | 67 ++++++++++++++++---------------- taxonomies/countries.txt | 56 +++++++++++++------------- 2 files changed, 61 insertions(+), 62 deletions(-) diff --git a/lib/ProductOpener/Ingredients.pm b/lib/ProductOpener/Ingredients.pm index 00bbb667cdea2..15850f4f8327f 100644 --- a/lib/ProductOpener/Ingredients.pm +++ b/lib/ProductOpener/Ingredients.pm @@ -3371,43 +3371,42 @@ sub get_missing_ecobalyse_ids ($ingredients_ref) { # Getting properties from product #my $product_origin = has_specific_ingredient_property() - # If the ingredient is biological, the id 'ecobalyse_labels_en_organic:en' is taken - if ("en:organic" in $ingredient_ref->{labels}) { - - # Getting the correct ecobalyse comake devde - my $ecobalyse_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_labels_en_organic:en"); - if (defined $ecobalyse_code) { - $ingredient_ref->{ecobalyse_code} = $ecobalyse_code; - } - else { - my $ecobalyse_proxy_code - = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_proxy:en"); - if (defined $ecobalyse_proxy_code) { - $ingredient_ref->{ecobalyse_proxy_code} = $ecobalyse_proxy_code; - } - else { - push(@ingredients_without_ecobalyse_ids, $ingredient_ref->{id}); - } - } + # If the ingredient is organic, the 'ecobalyse_labels_en_organic:en' id is used + if ($ingredient_ref->{labels} =~ /\ben:organic\b/) { + + # Retrieve the correct ecobalyse code + my $ecobalyse_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_labels_en_organic:en"); + if (defined $ecobalyse_code) { + $ingredient_ref->{ecobalyse_code} = $ecobalyse_code; + } + else { + my $ecobalyse_proxy_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_proxy:en"); + if (defined $ecobalyse_proxy_code) { + $ingredient_ref->{ecobalyse_proxy_code} = $ecobalyse_proxy_code; + } + else { + # Add to the list of ingredients without ecobalyse code + push(@ingredients_without_ecobalyse_ids, $ingredient_ref->{id}); + } + } } else { - # Getting the correct ecobalyse comake devde - my $ecobalyse_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse:en"); - if (defined $ecobalyse_code) { - $ingredient_ref->{ecobalyse_code} = $ecobalyse_code; - } - else { - my $ecobalyse_proxy_code - = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_proxy:en"); - if (defined $ecobalyse_proxy_code) { - $ingredient_ref->{ecobalyse_proxy_code} = $ecobalyse_proxy_code; - } - else { - push(@ingredients_without_ecobalyse_ids, $ingredient_ref->{id}); - } - } - + # Retrieve the correct ecobalyse code if the ingredient is not organic + my $ecobalyse_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse:en"); + if (defined $ecobalyse_code) { + $ingredient_ref->{ecobalyse_code} = $ecobalyse_code; + } + else { + my $ecobalyse_proxy_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_proxy:en"); + if (defined $ecobalyse_proxy_code) { + $ingredient_ref->{ecobalyse_proxy_code} = $ecobalyse_proxy_code; + } + else { + # Add to the list of ingredients without ecobalyse code + push(@ingredients_without_ecobalyse_ids, $ingredient_ref->{id}); + } + } } #ecobalyse:en diff --git a/taxonomies/countries.txt b/taxonomies/countries.txt index 271814ee05807..e878a88e5427b 100644 --- a/taxonomies/countries.txt +++ b/taxonomies/countries.txt @@ -3332,7 +3332,7 @@ country_code_3:en: AUT language_codes:en: de osm_relation:en: 16239 wikidata:en: Q40 -ecobalyse_is_part_of_eu: 1 +ecobalyse_is_part_of_eu: yes en: Azerbaijan, Republic of Azerbaijan, AZ, AZE ab: Азербаиџьан @@ -4635,7 +4635,7 @@ country_code_3:en: BEL language_codes:en: nl,fr,de osm_relation:en: 52411 wikidata:en: Q31 -ecobalyse_is_part_of_eu: 1 +ecobalyse_is_part_of_eu: yes en: Belize, BZ, BLZ ace: Belize @@ -7024,7 +7024,7 @@ country_code_3:en: BGR language_codes:en: bg osm_relation:en: 186382 wikidata:en: Q219 -ecobalyse_is_part_of_eu: 1 +ecobalyse_is_part_of_eu: yes en: Burkina Faso, BF, BFA ace: Burkina Faso @@ -10436,7 +10436,7 @@ country_code_3:en: HRV language_codes:en: hr osm_relation:en: 214885 wikidata:en: Q224 -ecobalyse_is_part_of_eu: 1 +ecobalyse_is_part_of_eu: yes en: Cuba, Republic of Cuba, CU, CUB ace: Kuba @@ -10957,7 +10957,7 @@ country_code_2:en: CY country_code_3:en: CYP language_codes:en: el,tr osm_relation:en: 307787 -ecobalyse_is_part_of_eu: 1 +ecobalyse_is_part_of_eu: yes en: Czech Republic, Czechia, CZ, CZE ab: Чехиа @@ -11197,7 +11197,7 @@ country_code_2:en: CZ country_code_3:en: CZE language_codes:en: cs osm_relation:en: 51684 -ecobalyse_is_part_of_eu: 1 +ecobalyse_is_part_of_eu: yes en: Côte d'Ivoire, Ivory Coast, Republic of Côte d'Ivoire, CI, CIV ace: Panté Gadéng @@ -11832,7 +11832,7 @@ zu: IDenimaki country_code_2:en: DK country_code_3:en: DNK language_codes:en: da -ecobalyse_is_part_of_eu: 1 +ecobalyse_is_part_of_eu: yes en: Djibouti, Republic of Djibouti, DJ, DJI ace: Djibouti @@ -13707,7 +13707,7 @@ zu: I-Estoniya country_code_2:en: EE country_code_3:en: EST language_codes:en: et -ecobalyse_is_part_of_eu: 1 +ecobalyse_is_part_of_eu: yes en: Ethiopia, ET, ETH ace: Ethiopia @@ -14977,7 +14977,7 @@ zu: IFinlandi country_code_2:en: FI country_code_3:en: FIN language_codes:en: fi,sv -ecobalyse_is_part_of_eu: 1 +ecobalyse_is_part_of_eu: yes en: France, The Hexagon, French Republic, FR, FRA ace: Peurancih @@ -15247,7 +15247,7 @@ zu: IFulansi country_code_2:en: FR country_code_3:en: FRA language_codes:en: fr -ecobalyse_is_part_of_eu: 1 +ecobalyse_is_part_of_eu: yes en: French Guiana, GF, GUF ace: Guyana Peurancih @@ -16478,7 +16478,7 @@ zu: IJalimani country_code_2:en: DE country_code_3:en: DEU language_codes:en: de -ecobalyse_is_part_of_eu: 1 +ecobalyse_is_part_of_eu: yes en: Ghana, Republic of Ghana, GH, GHA ace: Ghana @@ -17080,7 +17080,7 @@ zu: IGreki country_code_2:en: GR country_code_3:en: GRC language_codes:en: el -ecobalyse_is_part_of_eu: 1 +ecobalyse_is_part_of_eu: yes en: Greenland, Greenland (country), GL, GRL af: Groenland @@ -19338,7 +19338,7 @@ zh-yue:匈牙利 country_code_2:en: HU country_code_3:en: HUN language_codes:en: hu -ecobalyse_is_part_of_eu: 1 +ecobalyse_is_part_of_eu: yes en: Iceland, Republic of Iceland, IS, ISL ace: Islandia @@ -21182,7 +21182,7 @@ zu: ITaliya country_code_2:en: IT country_code_3:en: ITA language_codes:en: it -ecobalyse_is_part_of_eu: 1 +ecobalyse_is_part_of_eu: yes en: Jamaica, JA, Commonwealth of Jamaica, Jamdung, JM, JAM ace: Jamaika @@ -23416,7 +23416,7 @@ zu: ILatviya country_code_2:en: LV country_code_3:en: LVA language_codes:en: lv -ecobalyse_is_part_of_eu: 1 +ecobalyse_is_part_of_eu: yes en: Lebanon, Lebanese Republic, LB, LBN ace: Lebanon @@ -24682,7 +24682,7 @@ zu: ILithuwaniya country_code_2:en: LT country_code_3:en: LTU language_codes:en: lt -ecobalyse_is_part_of_eu: 1 +ecobalyse_is_part_of_eu: yes en: Luxembourg, Luxemburg, Grand Duchy of Luxembourg, LU, LU, LUX ace: Luksèmburg, Luxemburg @@ -24926,7 +24926,7 @@ zh-yue:盧森堡 country_code_2:en: LU country_code_3:en: LUX language_codes:en: fr,de,lb,en -ecobalyse_is_part_of_eu: 1 +ecobalyse_is_part_of_eu: yes en: Macau, Macao, Macau Special Administrative Region, Macau Special Administrative Region of the People's Republic of China, Aomen, MO, MAC ace: Makèë @@ -26245,7 +26245,7 @@ zu: IMalta country_code_2:en: MT country_code_3:en: MLT language_codes:en: en,mt -ecobalyse_is_part_of_eu: 1 +ecobalyse_is_part_of_eu: yes en: Marshall Islands, Republic of the Marshall Islands, Aolepān Aorōkin M̧ajeļ, MH, MHL ace: Pulo-pulo Marshall @@ -29684,7 +29684,7 @@ zu: Netherlands country_code_2:en: NL country_code_3:en: NLD language_codes:en: nl -ecobalyse_is_part_of_eu: 1 +ecobalyse_is_part_of_eu: yes en: New Caledonia, NC, NCL ace: Kaledonia Barô @@ -33478,7 +33478,7 @@ zu: IPolandi country_code_2:en: PL country_code_3:en: POL language_codes:en: pl -ecobalyse_is_part_of_eu: 1 +ecobalyse_is_part_of_eu: yes en: Portugal, Portuguese Republic, PT, PT, PRT ace: Portugéh @@ -33732,7 +33732,7 @@ zu: IPhothugali country_code_2:en: PT country_code_3:en: PRT language_codes:en: pt -ecobalyse_is_part_of_eu: 1 +ecobalyse_is_part_of_eu: yes en: Puerto Rico, Commonwealth of Puerto Rico, PR, PRI af: Puerto Rico @@ -34481,7 +34481,7 @@ zu: I-Ayilendi, Celts, I-Ayilandi country_code_2:en: IE country_code_3:en: IRL language_codes:en: en,ga -ecobalyse_is_part_of_eu: 1 +ecobalyse_is_part_of_eu: yes en: Republic of the Congo, Congo-Brazzaville, CG, COG, Congo Republic af: Republiek van die Kongo @@ -34958,7 +34958,7 @@ zh-yue:羅馬尼亞 country_code_2:en: RO country_code_3:en: ROU language_codes:en: ro -ecobalyse_is_part_of_eu: 1 +ecobalyse_is_part_of_eu: yes en: Russia, Russian Federation, Russian federation, Rossiyskaya Federatsiya, Россия, Rossijskaja Federatsija, Российская Федерация, 🇷🇺, RU, RUS ab: Урыстәыла @@ -38469,7 +38469,7 @@ zu: ISlovaki country_code_2:en: SK country_code_3:en: SVK language_codes:en: sk -ecobalyse_is_part_of_eu: 1 +ecobalyse_is_part_of_eu: yes en: Slovenia, Republic of Slovenia, Slovenija, Republika Slovenija, SI, SVN ace: Slovenia @@ -38695,7 +38695,7 @@ zh-yue:斯洛文尼亞 country_code_2:en: SI country_code_3:en: SVN language_codes:en: sl -ecobalyse_is_part_of_eu: 1 +ecobalyse_is_part_of_eu: yes en: Solomon Islands, SB, SLB ace: Pulo-pulo Solomon @@ -40203,7 +40203,7 @@ zu: ISpeyini country_code_2:en: ES country_code_3:en: ESP language_codes:en: es,ca,eu,gl -ecobalyse_is_part_of_eu: 1 +ecobalyse_is_part_of_eu: yes en: Sri Lanka, Democratic Socialist Republic of Sri Lanka, LK, LKA ace: Srilanka @@ -41332,7 +41332,7 @@ zu: ISwidi country_code_2:en: SE country_code_3:en: SWE language_codes:en: sv -ecobalyse_is_part_of_eu: 1 +ecobalyse_is_part_of_eu: yes en: Switzerland, Swiss Confederation, CH, CH, CHE ace: Swiss @@ -45140,7 +45140,7 @@ country_code_2:en: UK country_code_3:en: GBR language_codes:en: en,cy,ga,gd official_country_code_2:en: GB -ecobalyse_is_part_of_eu: 1 +ecobalyse_is_part_of_eu: yes en: United States Minor Outlying Islands, UM, UMI af: Klein afgeleë eilande van die Verenigde State van Amerika From fed86f15ddf9810ae47e8624df282ef1aa948e7d Mon Sep 17 00:00:00 2001 From: Open Food Facts Bot Date: Thu, 24 Oct 2024 09:23:26 +0000 Subject: [PATCH 08/18] test: Update tests results --- .../test/products/3270190128403.json | 7 ++++--- .../es-procedente-e-agricultura-biologica.json | 2 +- .../fi-organic-label-part-of-ingredient.json | 2 +- .../expected_test_results/ingredients/fi-origins.json | 6 +++--- .../ingredients/fr-origins-labels.json | 10 +++++----- .../ingredients/fr-percents-origins.json | 2 +- .../ingredients/fr-specific-ingredients.json | 4 ++-- .../ingredients/fr-starred-label.json | 2 +- .../fr-margherita-pizzas.fr-margherita-pizza-1.json | 10 +++++----- 9 files changed, 23 insertions(+), 22 deletions(-) diff --git a/tests/integration/expected_test_results/convert_and_import_excel_file/test/products/3270190128403.json b/tests/integration/expected_test_results/convert_and_import_excel_file/test/products/3270190128403.json index a2066a09fab86..07ff668ed4c51 100644 --- a/tests/integration/expected_test_results/convert_and_import_excel_file/test/products/3270190128403.json +++ b/tests/integration/expected_test_results/convert_and_import_excel_file/test/products/3270190128403.json @@ -630,7 +630,6 @@ "ingredients" : [ { "ciqual_food_code" : "20505", - "ecobalyse_code" : "lentils-uncooked-eu", "id" : "en:green-lentils", "is_in_taxonomy" : 1, "labels" : "en:organic", @@ -685,8 +684,10 @@ "ingredients_with_unspecified_percent_sum" : 100, "ingredients_without_ciqual_codes" : [], "ingredients_without_ciqual_codes_n" : 0, - "ingredients_without_ecobalyse_ids" : [], - "ingredients_without_ecobalyse_ids_n" : 0, + "ingredients_without_ecobalyse_ids" : [ + "en:green-lentils" + ], + "ingredients_without_ecobalyse_ids_n" : 1, "interface_version_created" : "import_csv_file - version 2019/09/17", "known_ingredients_n" : 5, "labels" : "Organic, EU Organic, FR-BIO-01, AB Agriculture Biologique, Agriculture France", diff --git a/tests/unit/expected_test_results/ingredients/es-procedente-e-agricultura-biologica.json b/tests/unit/expected_test_results/ingredients/es-procedente-e-agricultura-biologica.json index 6995763784727..ab38394057a07 100644 --- a/tests/unit/expected_test_results/ingredients/es-procedente-e-agricultura-biologica.json +++ b/tests/unit/expected_test_results/ingredients/es-procedente-e-agricultura-biologica.json @@ -2,7 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "19023", - "ecobalyse_code" : "milk", + "ecobalyse_code" : "milk-organic", "id" : "en:pasteurised-whole-cow-s-milk", "is_in_taxonomy" : 1, "labels" : "en:organic", diff --git a/tests/unit/expected_test_results/ingredients/fi-organic-label-part-of-ingredient.json b/tests/unit/expected_test_results/ingredients/fi-organic-label-part-of-ingredient.json index e210f57785792..1a95480a35633 100644 --- a/tests/unit/expected_test_results/ingredients/fi-organic-label-part-of-ingredient.json +++ b/tests/unit/expected_test_results/ingredients/fi-organic-label-part-of-ingredient.json @@ -14,7 +14,7 @@ }, { "ciqual_proxy_food_code" : "19051", - "ecobalyse_code" : "milk", + "ecobalyse_code" : "milk-organic", "id" : "en:milk", "is_in_taxonomy" : 1, "labels" : "en:organic", diff --git a/tests/unit/expected_test_results/ingredients/fi-origins.json b/tests/unit/expected_test_results/ingredients/fi-origins.json index eda4565d74e88..a364d88f2f624 100644 --- a/tests/unit/expected_test_results/ingredients/fi-origins.json +++ b/tests/unit/expected_test_results/ingredients/fi-origins.json @@ -40,7 +40,6 @@ }, { "ciqual_proxy_food_code" : "13034", - "ecobalyse_code" : "orange-non-eu", "id" : "en:orange", "is_in_taxonomy" : 1, "labels" : "en:organic", @@ -130,9 +129,10 @@ "ingredients_without_ecobalyse_ids" : [ "en:blackcurrant", "en:cocoa", - "en:cocoa-butter" + "en:cocoa-butter", + "en:orange" ], - "ingredients_without_ecobalyse_ids_n" : 3, + "ingredients_without_ecobalyse_ids_n" : 4, "known_ingredients_n" : 10, "lc" : "fi", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fr-origins-labels.json b/tests/unit/expected_test_results/ingredients/fr-origins-labels.json index 2f5697cfaef6e..f98319fb73b4e 100644 --- a/tests/unit/expected_test_results/ingredients/fr-origins-labels.json +++ b/tests/unit/expected_test_results/ingredients/fr-origins-labels.json @@ -52,7 +52,6 @@ }, { "ciqual_proxy_food_code" : "13034", - "ecobalyse_code" : "orange-non-eu", "id" : "en:orange", "is_in_taxonomy" : 1, "labels" : "en:organic", @@ -65,7 +64,7 @@ }, { "ciqual_proxy_food_code" : "13009", - "ecobalyse_code" : "lemon-eu", + "ecobalyse_code" : "lemon-organic", "id" : "en:lemon", "is_in_taxonomy" : 1, "labels" : "en:organic", @@ -102,7 +101,7 @@ }, { "ciqual_food_code" : "13008", - "ecobalyse_code" : "cherry-tr", + "ecobalyse_code" : "cherry-organic", "id" : "en:cherry", "is_in_taxonomy" : 1, "labels" : "en:organic", @@ -180,9 +179,10 @@ "en:blackcurrant", "en:cocoa", "en:cocoa-butter", - "en:grapefruit" + "en:grapefruit", + "en:orange" ], - "ingredients_without_ecobalyse_ids_n" : 4, + "ingredients_without_ecobalyse_ids_n" : 5, "known_ingredients_n" : 14, "lc" : "fr", "nutriments" : { diff --git a/tests/unit/expected_test_results/ingredients/fr-percents-origins.json b/tests/unit/expected_test_results/ingredients/fr-percents-origins.json index f07488c6a59ac..50a542f50d7d9 100644 --- a/tests/unit/expected_test_results/ingredients/fr-percents-origins.json +++ b/tests/unit/expected_test_results/ingredients/fr-percents-origins.json @@ -2,7 +2,7 @@ "ingredients" : [ { "ciqual_food_code" : "2074", - "ecobalyse_code" : "apple-fr", + "ecobalyse_code" : "apple-organic", "id" : "en:apple-juice", "is_in_taxonomy" : 1, "labels" : "en:organic", diff --git a/tests/unit/expected_test_results/ingredients/fr-specific-ingredients.json b/tests/unit/expected_test_results/ingredients/fr-specific-ingredients.json index 67536dab7947a..bedb0e26529dc 100644 --- a/tests/unit/expected_test_results/ingredients/fr-specific-ingredients.json +++ b/tests/unit/expected_test_results/ingredients/fr-specific-ingredients.json @@ -2,7 +2,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "31016", - "ecobalyse_code" : "sugar", + "ecobalyse_code" : "sugar-beet-organic", "id" : "en:cane-sugar", "is_in_taxonomy" : 1, "labels" : "en:organic", @@ -15,7 +15,7 @@ }, { "ciqual_food_code" : "13000", - "ecobalyse_code" : "apricot-eu", + "ecobalyse_code" : "apricot-organic", "id" : "en:apricot", "is_in_taxonomy" : 1, "labels" : "en:organic", diff --git a/tests/unit/expected_test_results/ingredients/fr-starred-label.json b/tests/unit/expected_test_results/ingredients/fr-starred-label.json index 881af2eee4274..82444424302ea 100644 --- a/tests/unit/expected_test_results/ingredients/fr-starred-label.json +++ b/tests/unit/expected_test_results/ingredients/fr-starred-label.json @@ -16,7 +16,7 @@ }, { "ciqual_proxy_food_code" : "31016", - "ecobalyse_code" : "sugar", + "ecobalyse_code" : "sugar-beet-organic", "id" : "en:cane-sugar", "is_in_taxonomy" : 1, "labels" : "en:fair-trade, en:organic", diff --git a/tests/unit/expected_test_results/recipes/fr-margherita-pizzas.fr-margherita-pizza-1.json b/tests/unit/expected_test_results/recipes/fr-margherita-pizzas.fr-margherita-pizza-1.json index 9befd174885bc..2beb4c8e3f03a 100644 --- a/tests/unit/expected_test_results/recipes/fr-margherita-pizzas.fr-margherita-pizza-1.json +++ b/tests/unit/expected_test_results/recipes/fr-margherita-pizzas.fr-margherita-pizza-1.json @@ -2,7 +2,7 @@ "ingredients" : [ { "ciqual_proxy_food_code" : "9410", - "ecobalyse_code" : "flour", + "ecobalyse_code" : "flour-organic", "id" : "en:wheat-flour", "is_in_taxonomy" : 1, "labels" : "en:organic", @@ -15,7 +15,7 @@ }, { "ciqual_food_code" : "20170", - "ecobalyse_code" : "tomato-heated-greenhouse-eu", + "ecobalyse_code" : "tomato-organic", "id" : "en:tomato-puree", "is_in_taxonomy" : 1, "labels" : "en:organic", @@ -41,7 +41,6 @@ }, { "ciqual_food_code" : "19590", - "ecobalyse_code" : "mozzarella", "id" : "en:mozzarella", "is_in_taxonomy" : 1, "labels" : "en:organic", @@ -56,7 +55,7 @@ }, { "ciqual_food_code" : "17440", - "ecobalyse_code" : "sunflower-oil", + "ecobalyse_code" : "sunflower-oil-organic", "from_palm_oil" : "no", "id" : "en:sunflower-oil", "is_in_taxonomy" : 1, @@ -203,11 +202,12 @@ "ingredients_without_ciqual_codes_n" : 2, "ingredients_without_ecobalyse_ids" : [ "en:herb", + "en:mozzarella", "en:salt", "en:spice", "en:yeast" ], - "ingredients_without_ecobalyse_ids_n" : 4, + "ingredients_without_ecobalyse_ids_n" : 5, "known_ingredients_n" : 22, "lc" : "fr", "misc_tags" : [ From 150348f4e1f4c6dd02afb69dbc35c857cc9b9e2a Mon Sep 17 00:00:00 2001 From: Open Food Facts Bot Date: Fri, 25 Oct 2024 12:31:12 +0000 Subject: [PATCH 09/18] chore: Linting changes --- lib/ProductOpener/Ingredients.pm | 72 +++++++++++++++++--------------- taxonomies/countries.txt | 56 ++++++++++++------------- 2 files changed, 66 insertions(+), 62 deletions(-) diff --git a/lib/ProductOpener/Ingredients.pm b/lib/ProductOpener/Ingredients.pm index 0e5ddc62d7f4a..06bae5298f8e3 100644 --- a/lib/ProductOpener/Ingredients.pm +++ b/lib/ProductOpener/Ingredients.pm @@ -3374,40 +3374,44 @@ sub get_missing_ecobalyse_ids ($ingredients_ref) { # If the ingredient is organic, the 'ecobalyse_labels_en_organic:en' id is used if ($ingredient_ref->{labels} =~ /\ben:organic\b/) { - # Retrieve the correct ecobalyse code - my $ecobalyse_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_labels_en_organic:en"); - if (defined $ecobalyse_code) { - $ingredient_ref->{ecobalyse_code} = $ecobalyse_code; - } - else { - my $ecobalyse_proxy_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_proxy:en"); - if (defined $ecobalyse_proxy_code) { - $ingredient_ref->{ecobalyse_proxy_code} = $ecobalyse_proxy_code; - } - else { - # Add to the list of ingredients without ecobalyse code - push(@ingredients_without_ecobalyse_ids, $ingredient_ref->{id}); - } - } - - } else { - - # Retrieve the correct ecobalyse code if the ingredient is not organic - my $ecobalyse_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse:en"); - if (defined $ecobalyse_code) { - $ingredient_ref->{ecobalyse_code} = $ecobalyse_code; - } - else { - my $ecobalyse_proxy_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_proxy:en"); - if (defined $ecobalyse_proxy_code) { - $ingredient_ref->{ecobalyse_proxy_code} = $ecobalyse_proxy_code; - } - else { - # Add to the list of ingredients without ecobalyse code - push(@ingredients_without_ecobalyse_ids, $ingredient_ref->{id}); - } - } - + # Retrieve the correct ecobalyse code + my $ecobalyse_code + = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_labels_en_organic:en"); + if (defined $ecobalyse_code) { + $ingredient_ref->{ecobalyse_code} = $ecobalyse_code; + } + else { + my $ecobalyse_proxy_code + = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_proxy:en"); + if (defined $ecobalyse_proxy_code) { + $ingredient_ref->{ecobalyse_proxy_code} = $ecobalyse_proxy_code; + } + else { + # Add to the list of ingredients without ecobalyse code + push(@ingredients_without_ecobalyse_ids, $ingredient_ref->{id}); + } + } + + } + else { + + # Retrieve the correct ecobalyse code if the ingredient is not organic + my $ecobalyse_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse:en"); + if (defined $ecobalyse_code) { + $ingredient_ref->{ecobalyse_code} = $ecobalyse_code; + } + else { + my $ecobalyse_proxy_code + = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_proxy:en"); + if (defined $ecobalyse_proxy_code) { + $ingredient_ref->{ecobalyse_proxy_code} = $ecobalyse_proxy_code; + } + else { + # Add to the list of ingredients without ecobalyse code + push(@ingredients_without_ecobalyse_ids, $ingredient_ref->{id}); + } + } + } #ecobalyse:en diff --git a/taxonomies/countries.txt b/taxonomies/countries.txt index e878a88e5427b..5e84552cc10d7 100644 --- a/taxonomies/countries.txt +++ b/taxonomies/countries.txt @@ -3127,6 +3127,7 @@ diq: Awıstırya dsb: Awstriska dv: އޮސްޓްރިއާ dz: ཨས་ཊི་ཡ +ecobalyse_is_part_of_eu: yes ee: Austria el: Αυστρία en-ca:Austria @@ -3332,7 +3333,6 @@ country_code_3:en: AUT language_codes:en: de osm_relation:en: 16239 wikidata:en: Q40 -ecobalyse_is_part_of_eu: yes en: Azerbaijan, Republic of Azerbaijan, AZ, AZE ab: Азербаиџьан @@ -4436,6 +4436,7 @@ diq: Belçıka dsb: Belgiska dv: ބެލްޖިއަމް dz: བེལ་ཇིཡམ +ecobalyse_is_part_of_eu: yes ee: Belgium el: Βέλγιο eml: Bélgi @@ -4635,7 +4636,6 @@ country_code_3:en: BEL language_codes:en: nl,fr,de osm_relation:en: 52411 wikidata:en: Q31 -ecobalyse_is_part_of_eu: yes en: Belize, BZ, BLZ ace: Belize @@ -6819,6 +6819,7 @@ de-ch:Bulgarien diq: Bulğarıstan, Bulgarıstan dsb: Bulgarska dv: ބަލްގޭރިއާ +ecobalyse_is_part_of_eu: yes ee: Bulgaria el: Βουλγαρία, BUL, Boύλγαροι eml: Bulgarî, Bulgaria @@ -7024,7 +7025,6 @@ country_code_3:en: BGR language_codes:en: bg osm_relation:en: 186382 wikidata:en: Q219 -ecobalyse_is_part_of_eu: yes en: Burkina Faso, BF, BFA ace: Burkina Faso @@ -10253,6 +10253,7 @@ de: Kroatien diq: Xırvatıstan dsb: Chorwatska dv: ކުރޮއޭޝިއާ +ecobalyse_is_part_of_eu: yes ee: Croatia el: Κροατία en-ca:Croatia @@ -10436,7 +10437,6 @@ country_code_3:en: HRV language_codes:en: hr osm_relation:en: 214885 wikidata:en: Q224 -ecobalyse_is_part_of_eu: yes en: Cuba, Republic of Cuba, CU, CUB ace: Kuba @@ -10783,6 +10783,7 @@ da: Cypern de: Republik Zypern, Südzypern, Kıbrıs Cumhuriyeti, Kypriakí Dimokratía, Zypern diq: Qıbrıs dsb: Cypern +ecobalyse_is_part_of_eu: yes ee: Cyprus el: Κύπρος, Κυπριακή Δημοκρατία en-ca:Cyprus @@ -10957,7 +10958,6 @@ country_code_2:en: CY country_code_3:en: CYP language_codes:en: el,tr osm_relation:en: 307787 -ecobalyse_is_part_of_eu: yes en: Czech Republic, Czechia, CZ, CZE ab: Чехиа @@ -11007,6 +11007,7 @@ diq: Çekıstan dsb: Česka dv: ޗެކް ޖުމްހޫރިއްޔާ dz: ཅེཀ་རི་པབ་ལིཀ་ +ecobalyse_is_part_of_eu: yes ee: Czech Republic el: Τσεχία en-ca:Czech Republic @@ -11197,7 +11198,6 @@ country_code_2:en: CZ country_code_3:en: CZE language_codes:en: cs osm_relation:en: 51684 -ecobalyse_is_part_of_eu: yes en: Côte d'Ivoire, Ivory Coast, Republic of Côte d'Ivoire, CI, CIV ace: Panté Gadéng @@ -11627,6 +11627,7 @@ diq: Danimarka dsb: Dańska dv: ޑެންމާކު dz: ཌེན་མཱཀ་ +ecobalyse_is_part_of_eu: yes ee: Denmark el: Δανία en-ca:Denmark @@ -11832,7 +11833,6 @@ zu: IDenimaki country_code_2:en: DK country_code_3:en: DNK language_codes:en: da -ecobalyse_is_part_of_eu: yes en: Djibouti, Republic of Djibouti, DJ, DJI ace: Djibouti @@ -13514,6 +13514,7 @@ de: Estland, Republik Estland diq: Estonya dsb: Estniska dz: ཨིསི་ཊོ་ནི་ཡ། +ecobalyse_is_part_of_eu: yes ee: Estonia el: Εσθονία eml: Estògna @@ -13707,7 +13708,6 @@ zu: I-Estoniya country_code_2:en: EE country_code_3:en: EST language_codes:en: et -ecobalyse_is_part_of_eu: yes en: Ethiopia, ET, ETH ace: Ethiopia @@ -14773,6 +14773,7 @@ diq: Finlanda dsb: Finska dv: ފިންލޭންޑު dz: ཕིན་ལེནཌ་ +ecobalyse_is_part_of_eu: yes ee: Finland el: Φινλανδία en-ca:Finland @@ -14977,7 +14978,6 @@ zu: IFinlandi country_code_2:en: FI country_code_3:en: FIN language_codes:en: fi,sv -ecobalyse_is_part_of_eu: yes en: France, The Hexagon, French Republic, FR, FRA ace: Peurancih @@ -15033,6 +15033,7 @@ diq: Fransa dsb: Francojska dv: ފަރަންސޭސިވިލާތް dz: ཕརཱནསི་ +ecobalyse_is_part_of_eu: yes ee: France el: Γαλλία eml: Franza @@ -15247,7 +15248,6 @@ zu: IFulansi country_code_2:en: FR country_code_3:en: FRA language_codes:en: fr -ecobalyse_is_part_of_eu: yes en: French Guiana, GF, GUF ace: Guyana Peurancih @@ -16259,6 +16259,7 @@ diq: Almanya dsb: Nimska dv: ޖަރުމަނުވިލާތް dz: ཇཱར་མ་ནི་ +ecobalyse_is_part_of_eu: yes ee: Germany el: Γερμανία, Ομοσπονδιακή Δημοκρατία της Γερμανίας eml: Germâgna @@ -16478,7 +16479,6 @@ zu: IJalimani country_code_2:en: DE country_code_3:en: DEU language_codes:en: de -ecobalyse_is_part_of_eu: yes en: Ghana, Republic of Ghana, GH, GHA ace: Ghana @@ -16883,6 +16883,7 @@ diq: Yunanıstan dsb: Grichiska dv: ޔޫނާން dz: གིརིསི་ +ecobalyse_is_part_of_eu: yes ee: Greece el: Ελλάδα, Ελλάς, Ελληνική Δημοκρατία, Ἑλλάς en-ca:Greece @@ -17080,7 +17081,6 @@ zu: IGreki country_code_2:en: GR country_code_3:en: GRC language_codes:en: el -ecobalyse_is_part_of_eu: yes en: Greenland, Greenland (country), GL, GRL af: Groenland @@ -19138,6 +19138,7 @@ de-ch:Ungarn diq: Macarıstan dsb: Hungorska dv: ހަންގޭރީ +ecobalyse_is_part_of_eu: yes ee: Hungary el: Ουγγαρία eml: Ungherî @@ -19338,7 +19339,6 @@ zh-yue:匈牙利 country_code_2:en: HU country_code_3:en: HUN language_codes:en: hu -ecobalyse_is_part_of_eu: yes en: Iceland, Republic of Iceland, IS, ISL ace: Islandia @@ -20968,6 +20968,7 @@ diq: İtalya dsb: Italska dv: އިޓަލީވިލާތް dz: ཨྀཊ་ལི་ +ecobalyse_is_part_of_eu: yes ee: Italy el: Ιταλία eml: Itâglia @@ -21182,7 +21183,6 @@ zu: ITaliya country_code_2:en: IT country_code_3:en: ITA language_codes:en: it -ecobalyse_is_part_of_eu: yes en: Jamaica, JA, Commonwealth of Jamaica, Jamdung, JM, JAM ace: Jamaika @@ -23235,6 +23235,7 @@ diq: Letonya dsb: Letiska dv: ލެޓުވިއާ dz: ལེཊི་བི་ཡ། +ecobalyse_is_part_of_eu: yes ee: Latvia el: Λεττονία en-ca:Latvia @@ -23416,7 +23417,6 @@ zu: ILatviya country_code_2:en: LV country_code_3:en: LVA language_codes:en: lv -ecobalyse_is_part_of_eu: yes en: Lebanon, Lebanese Republic, LB, LBN ace: Lebanon @@ -24479,6 +24479,7 @@ diq: Litwanya dsb: Litawska dv: ލިތުއޭނިއާ dz: ལི་ཐུ་ནི་ཡ། +ecobalyse_is_part_of_eu: yes ee: Lithuania el: Λιθουανία eml: Lituàgna @@ -24682,7 +24683,6 @@ zu: ILithuwaniya country_code_2:en: LT country_code_3:en: LTU language_codes:en: lt -ecobalyse_is_part_of_eu: yes en: Luxembourg, Luxemburg, Grand Duchy of Luxembourg, LU, LU, LUX ace: Luksèmburg, Luxemburg @@ -24729,6 +24729,7 @@ de: Luxemburg de-ch:Luxemburg diq: Luksemburg dsb: Luxemburgska +ecobalyse_is_part_of_eu: yes ee: Luxembourg el: Λουξεμβούργο eml: Lussembûrgh, Lussembûrg, Lusembûrgh @@ -24926,7 +24927,6 @@ zh-yue:盧森堡 country_code_2:en: LU country_code_3:en: LUX language_codes:en: fr,de,lb,en -ecobalyse_is_part_of_eu: yes en: Macau, Macao, Macau Special Administrative Region, Macau Special Administrative Region of the People's Republic of China, Aomen, MO, MAC ace: Makèë @@ -26065,6 +26065,7 @@ de-ch:Malta diq: Malta dsb: Malta dv: މޯލްޓާ +ecobalyse_is_part_of_eu: yes ee: Malta el: Μάλτα eml: Malta @@ -26245,7 +26246,6 @@ zu: IMalta country_code_2:en: MT country_code_3:en: MLT language_codes:en: en,mt -ecobalyse_is_part_of_eu: yes en: Marshall Islands, Republic of the Marshall Islands, Aolepān Aorōkin M̧ajeļ, MH, MHL ace: Pulo-pulo Marshall @@ -29481,6 +29481,7 @@ diq: Hollanda dsb: Nižozemska dv: ނެދަލޭންޑު dz: ནེ་དར་ལེནཌསི་ +ecobalyse_is_part_of_eu: yes ee: Netherlands el: Ολλανδία, Κάτω Χώρες en-ca:Netherlands @@ -29684,7 +29685,6 @@ zu: Netherlands country_code_2:en: NL country_code_3:en: NLD language_codes:en: nl -ecobalyse_is_part_of_eu: yes en: New Caledonia, NC, NCL ace: Kaledonia Barô @@ -33264,6 +33264,7 @@ de-ch:Polen diq: Polonya dsb: Pólska dv: ޕޮލެންޑު +ecobalyse_is_part_of_eu: yes ee: Poland el: Πολωνία eml: Pulógna @@ -33478,7 +33479,6 @@ zu: IPolandi country_code_2:en: PL country_code_3:en: POL language_codes:en: pl -ecobalyse_is_part_of_eu: yes en: Portugal, Portuguese Republic, PT, PT, PRT ace: Portugéh @@ -33530,6 +33530,7 @@ diq: Portekiz dsb: Portugalska dv: ޕޯޗުގަލް dz: པོར་ཅུ་གལ་ +ecobalyse_is_part_of_eu: yes ee: Portugal el: Πορτογαλία en-ca:Portugal @@ -33732,7 +33733,6 @@ zu: IPhothugali country_code_2:en: PT country_code_3:en: PRT language_codes:en: pt -ecobalyse_is_part_of_eu: yes en: Puerto Rico, Commonwealth of Puerto Rico, PR, PRI af: Puerto Rico @@ -34297,6 +34297,7 @@ de-ch:Irland diq: İrlanda dsb: Irska dv: އަޔަލޭންޑުގެ ޖުމްހޫރިއްޔާ +ecobalyse_is_part_of_eu: yes ee: Ireland el: Δημοκρατία της Ιρλανδίας, Έιρε, Ιρλανδική Δημοκρατία en-ca:Republic of Ireland @@ -34481,7 +34482,6 @@ zu: I-Ayilendi, Celts, I-Ayilandi country_code_2:en: IE country_code_3:en: IRL language_codes:en: en,ga -ecobalyse_is_part_of_eu: yes en: Republic of the Congo, Congo-Brazzaville, CG, COG, Congo Republic af: Republiek van die Kongo @@ -34773,6 +34773,7 @@ de-formal:Rumänien diq: Romanya dsb: Rumuńska dv: ރުމޭނިއާ +ecobalyse_is_part_of_eu: yes ee: Romania el: Ρουμανία eml: Rumanî @@ -34958,7 +34959,6 @@ zh-yue:羅馬尼亞 country_code_2:en: RO country_code_3:en: ROU language_codes:en: ro -ecobalyse_is_part_of_eu: yes en: Russia, Russian Federation, Russian federation, Rossiyskaya Federatsiya, Россия, Rossijskaja Federatsija, Российская Федерация, 🇷🇺, RU, RUS ab: Урыстәыла @@ -38291,6 +38291,7 @@ de: Slowakei diq: Slowakya dsb: Słowakska dv: ސުލޮވާކިއާ +ecobalyse_is_part_of_eu: yes ee: Slovakia el: Σλοβακία eo: Slovakio, Slovaka respubliko @@ -38469,7 +38470,6 @@ zu: ISlovaki country_code_2:en: SK country_code_3:en: SVK language_codes:en: sk -ecobalyse_is_part_of_eu: yes en: Slovenia, Republic of Slovenia, Slovenija, Republika Slovenija, SI, SVN ace: Slovenia @@ -38516,6 +38516,7 @@ de-ch:Slowenien diq: Slowenya dsb: Słowjeńska dv: ސުލޮވީނިއާ +ecobalyse_is_part_of_eu: yes ee: Slovenia el: Σλοβενία en-ca:Slovenia @@ -38695,7 +38696,6 @@ zh-yue:斯洛文尼亞 country_code_2:en: SI country_code_3:en: SVN language_codes:en: sl -ecobalyse_is_part_of_eu: yes en: Solomon Islands, SB, SLB ace: Pulo-pulo Solomon @@ -39992,6 +39992,7 @@ diq: İspanya dsb: Špańska dv: އިސްޕެއިން dz: སིཔཱེན་ +ecobalyse_is_part_of_eu: yes ee: Spain el: Ισπανία eml: Spaggna @@ -40203,7 +40204,6 @@ zu: ISpeyini country_code_2:en: ES country_code_3:en: ESP language_codes:en: es,ca,eu,gl -ecobalyse_is_part_of_eu: yes en: Sri Lanka, Democratic Socialist Republic of Sri Lanka, LK, LKA ace: Srilanka @@ -41129,6 +41129,7 @@ diq: İswec dsb: Šwedska dv: ސުވިޑަން dz: སུའི་ཌན་ +ecobalyse_is_part_of_eu: yes ee: Sweden el: Σουηδία en-ca:Sweden @@ -41332,7 +41333,6 @@ zu: ISwidi country_code_2:en: SE country_code_3:en: SWE language_codes:en: sv -ecobalyse_is_part_of_eu: yes en: Switzerland, Swiss Confederation, CH, CH, CHE ace: Swiss @@ -44938,6 +44938,7 @@ diq: Britanyaya Gırde, Britanya Gırd, Britanya, İngıltere, Britanya Gırdı, dsb: Wjelika Britaniska dv: ޔުނައިޓެޑް ކިންގްޑަމް dz: ཡུ་ནའི་ཊེཊ་ཀིང་ཌམ +ecobalyse_is_part_of_eu: yes ee: United Kingdom el: Ηνωμένο Βασίλειο eml: Régn Unî @@ -45140,7 +45141,6 @@ country_code_2:en: UK country_code_3:en: GBR language_codes:en: en,cy,ga,gd official_country_code_2:en: GB -ecobalyse_is_part_of_eu: yes en: United States Minor Outlying Islands, UM, UMI af: Klein afgeleë eilande van die Verenigde State van Amerika From f1803f665ae9879207eadcae6362818a933493d7 Mon Sep 17 00:00:00 2001 From: Martin Ces Date: Tue, 29 Oct 2024 14:58:57 +0100 Subject: [PATCH 10/18] taxonomy: changing the function assign_property_to_ingredient --- lib/ProductOpener/Ingredients.pm | 45 +++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/lib/ProductOpener/Ingredients.pm b/lib/ProductOpener/Ingredients.pm index 0e5ddc62d7f4a..bce84e84486be 100644 --- a/lib/ProductOpener/Ingredients.pm +++ b/lib/ProductOpener/Ingredients.pm @@ -3368,46 +3368,61 @@ sub get_missing_ecobalyse_ids ($ingredients_ref) { delete $ingredient_ref->{ecobalyse_code}; delete $ingredient_ref->{ecobalyse_proxy_code}; - # Getting properties from product - #my $product_origin = has_specific_ingredient_property() + # We are now looking for the appropriate ecobalyse id : + # ecobalyse_origins_france_label_organic (if the product comes from france, and is organic) + # ecobalyse_origins_european-union_label_organic (if the product comes from europe, and is organic) + # ecobalyse_label_organic (if the product is organic) + # ecobalyse_origins_france (if the product comes from france) + # ecobalyse_origins_european-uinion (if the product comes from the Europe region) + # ecobalyse (else) - # If the ingredient is organic, the 'ecobalyse_labels_en_organic:en' id is used + + # If the ingredient is organic... if ($ingredient_ref->{labels} =~ /\ben:organic\b/) { - # Retrieve the correct ecobalyse code + # ...we retrieve the organic ecobalyse code my $ecobalyse_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_labels_en_organic:en"); if (defined $ecobalyse_code) { $ingredient_ref->{ecobalyse_code} = $ecobalyse_code; } else { - my $ecobalyse_proxy_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_proxy:en"); - if (defined $ecobalyse_proxy_code) { - $ingredient_ref->{ecobalyse_proxy_code} = $ecobalyse_proxy_code; - } - else { - # Add to the list of ingredients without ecobalyse code - push(@ingredients_without_ecobalyse_ids, $ingredient_ref->{id}); + # Else, we retrieve the default ecobalyse code + my $ecobalyse_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse:en"); + if (defined $ecobalyse_code) { + $ingredient_ref->{ecobalyse_code} = $ecobalyse_code; } - } + else { + # Else, we retrieve the proxy ecobalyse code + my $ecobalyse_proxy_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_proxy:en"); + if (defined $ecobalyse_proxy_code) { + $ingredient_ref->{ecobalyse_proxy_code} = $ecobalyse_proxy_code; + } + else { + # Else, we add the ingredient to the list of ingredients without ecobalyse code + push(@ingredients_without_ecobalyse_ids, $ingredient_ref->{id}); + } + } + } + #If the ingredient is not organic... } else { - # Retrieve the correct ecobalyse code if the ingredient is not organic + # ...we retrieve the default ecobalyse code my $ecobalyse_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse:en"); if (defined $ecobalyse_code) { $ingredient_ref->{ecobalyse_code} = $ecobalyse_code; } else { + # Else, we retrieve the proxy ecobalyse code my $ecobalyse_proxy_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_proxy:en"); if (defined $ecobalyse_proxy_code) { $ingredient_ref->{ecobalyse_proxy_code} = $ecobalyse_proxy_code; } else { - # Add to the list of ingredients without ecobalyse code + # Else, we add the ingredient to the list of ingredients without ecobalyse code push(@ingredients_without_ecobalyse_ids, $ingredient_ref->{id}); } } - } #ecobalyse:en From 43448e061d196fa27ead852c29891e3eca12de3d Mon Sep 17 00:00:00 2001 From: Martin Ces Date: Tue, 29 Oct 2024 15:02:42 +0100 Subject: [PATCH 11/18] taxonomy: changing the function assign_property_to_ingredient --- lib/ProductOpener/Ingredients.pm | 72 +++++++++++++++----------------- 1 file changed, 34 insertions(+), 38 deletions(-) diff --git a/lib/ProductOpener/Ingredients.pm b/lib/ProductOpener/Ingredients.pm index ad258230600a7..8fb50debf06c2 100644 --- a/lib/ProductOpener/Ingredients.pm +++ b/lib/ProductOpener/Ingredients.pm @@ -3380,44 +3380,40 @@ sub get_missing_ecobalyse_ids ($ingredients_ref) { # If the ingredient is organic... if ($ingredient_ref->{labels} =~ /\ben:organic\b/) { - # Retrieve the correct ecobalyse code - my $ecobalyse_code - = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_labels_en_organic:en"); - if (defined $ecobalyse_code) { - $ingredient_ref->{ecobalyse_code} = $ecobalyse_code; - } - else { - my $ecobalyse_proxy_code - = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_proxy:en"); - if (defined $ecobalyse_proxy_code) { - $ingredient_ref->{ecobalyse_proxy_code} = $ecobalyse_proxy_code; - } - else { - # Add to the list of ingredients without ecobalyse code - push(@ingredients_without_ecobalyse_ids, $ingredient_ref->{id}); - } - } - - } - else { - - # Retrieve the correct ecobalyse code if the ingredient is not organic - my $ecobalyse_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse:en"); - if (defined $ecobalyse_code) { - $ingredient_ref->{ecobalyse_code} = $ecobalyse_code; - } - else { - my $ecobalyse_proxy_code - = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_proxy:en"); - if (defined $ecobalyse_proxy_code) { - $ingredient_ref->{ecobalyse_proxy_code} = $ecobalyse_proxy_code; - } - else { - # Add to the list of ingredients without ecobalyse code - push(@ingredients_without_ecobalyse_ids, $ingredient_ref->{id}); - } - } - + # Retrieve the correct ecobalyse code + my $ecobalyse_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_labels_en_organic:en"); + if (defined $ecobalyse_code) { + $ingredient_ref->{ecobalyse_code} = $ecobalyse_code; + } + else { + my $ecobalyse_proxy_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_proxy:en"); + if (defined $ecobalyse_proxy_code) { + $ingredient_ref->{ecobalyse_proxy_code} = $ecobalyse_proxy_code; + } + else { + # Add to the list of ingredients without ecobalyse code + push(@ingredients_without_ecobalyse_ids, $ingredient_ref->{id}); + } + } + + } else { + + # Retrieve the correct ecobalyse code if the ingredient is not organic + my $ecobalyse_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse:en"); + if (defined $ecobalyse_code) { + $ingredient_ref->{ecobalyse_code} = $ecobalyse_code; + } + else { + my $ecobalyse_proxy_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_proxy:en"); + if (defined $ecobalyse_proxy_code) { + $ingredient_ref->{ecobalyse_proxy_code} = $ecobalyse_proxy_code; + } + else { + # Add to the list of ingredients without ecobalyse code + push(@ingredients_without_ecobalyse_ids, $ingredient_ref->{id}); + } + } + } #ecobalyse:en From 2206feabe812abba591d4545b3384be3dbf4f190 Mon Sep 17 00:00:00 2001 From: Martin Ces Date: Wed, 30 Oct 2024 16:50:25 +0100 Subject: [PATCH 12/18] taxonomy; new version of the get_missing_ecobalyse_ids function --- lib/ProductOpener/Ingredients.pm | 57 ++++++++++++++------------------ 1 file changed, 24 insertions(+), 33 deletions(-) diff --git a/lib/ProductOpener/Ingredients.pm b/lib/ProductOpener/Ingredients.pm index 8fb50debf06c2..e01f91b4ed673 100644 --- a/lib/ProductOpener/Ingredients.pm +++ b/lib/ProductOpener/Ingredients.pm @@ -3376,44 +3376,35 @@ sub get_missing_ecobalyse_ids ($ingredients_ref) { # ecobalyse_origins_european-uinion (if the product comes from the Europe region) # ecobalyse (else) - + # List of suffixes + my @suffixes = (); # If the ingredient is organic... - if ($ingredient_ref->{labels} =~ /\ben:organic\b/) { + if ($ingredient_ref->{labels} =~ /\ben:organic\b/) { + push @suffixes, "_labels_organic"; + } + push @suffixes, ''; + push @suffixes, '_proxy'; - # Retrieve the correct ecobalyse code - my $ecobalyse_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_labels_en_organic:en"); - if (defined $ecobalyse_code) { - $ingredient_ref->{ecobalyse_code} = $ecobalyse_code; - } - else { - my $ecobalyse_proxy_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_proxy:en"); - if (defined $ecobalyse_proxy_code) { - $ingredient_ref->{ecobalyse_proxy_code} = $ecobalyse_proxy_code; - } - else { - # Add to the list of ingredients without ecobalyse code - push(@ingredients_without_ecobalyse_ids, $ingredient_ref->{id}); - } - } + # Loop through each suffix and proxy combination to retrieve ecobalyse code + foreach my $suffix (@suffixes) { + # Construct the property name using the proxy and suffix + my $property_name = "ecobalyse" . $suffix . ":en"; - } else { + # Attempt to retrieve the ecobalyse code for the current property name + my $ecobalyse_code = get_inherited_property("ingredients", $ingredient_ref->{id}, $property_name); - # Retrieve the correct ecobalyse code if the ingredient is not organic - my $ecobalyse_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse:en"); - if (defined $ecobalyse_code) { - $ingredient_ref->{ecobalyse_code} = $ecobalyse_code; + if (defined $ecobalyse_code) { + # Assign the ecobalyse code if found + $ingredient_ref->{ecobalyse_code} = $ecobalyse_code; + last; } - else { - my $ecobalyse_proxy_code = get_inherited_property("ingredients", $ingredient_ref->{id}, "ecobalyse_proxy:en"); - if (defined $ecobalyse_proxy_code) { - $ingredient_ref->{ecobalyse_proxy_code} = $ecobalyse_proxy_code; - } - else { - # Add to the list of ingredients without ecobalyse code - push(@ingredients_without_ecobalyse_ids, $ingredient_ref->{id}); - } - } - + # Exit the loop if a valid ecobalyse code was found + last if defined $ingredient_ref->{ecobalyse_code}; + } + + # If no ecobalyse code was found, add ingredient ID to list of missing codes + if (!defined $ingredient_ref->{ecobalyse_code}) { + push(@ingredients_without_ecobalyse_ids, $ingredient_ref->{id}); } #ecobalyse:en From 7034337d96f521fba8e5c90be4ea41a0278a2b6c Mon Sep 17 00:00:00 2001 From: Martin Ces Date: Thu, 31 Oct 2024 15:10:29 +0100 Subject: [PATCH 13/18] taxonomy: adressing bugsin Ingredients.pm --- lib/ProductOpener/Ingredients.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/ProductOpener/Ingredients.pm b/lib/ProductOpener/Ingredients.pm index e01f91b4ed673..a03ba330b7b08 100644 --- a/lib/ProductOpener/Ingredients.pm +++ b/lib/ProductOpener/Ingredients.pm @@ -3369,12 +3369,12 @@ sub get_missing_ecobalyse_ids ($ingredients_ref) { delete $ingredient_ref->{ecobalyse_proxy_code}; # We are now looking for the appropriate ecobalyse id : - # ecobalyse_origins_france_label_organic (if the product comes from france, and is organic) - # ecobalyse_origins_european-union_label_organic (if the product comes from europe, and is organic) - # ecobalyse_label_organic (if the product is organic) - # ecobalyse_origins_france (if the product comes from france) - # ecobalyse_origins_european-uinion (if the product comes from the Europe region) - # ecobalyse (else) + # ecobalyse_origins_france_label_organic (if the product comes from france, and is organic) + # ecobalyse_origins_european-union_label_organic (if the product comes from europe, and is organic) + # ecobalyse_label_organic (if the product is organic) + # ecobalyse_origins_france (if the product comes from france) + # ecobalyse_origins_european-union (if the product comes from the Europe region) + # ecobalyse (else) # List of suffixes my @suffixes = (); From 96b0cfdfc8a50a2c76bd68c8bec66311e7c4e5df Mon Sep 17 00:00:00 2001 From: Martin Ces Date: Mon, 4 Nov 2024 13:22:25 +0100 Subject: [PATCH 14/18] tackling (again) Perl errors --- lib/ProductOpener/Ingredients.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ProductOpener/Ingredients.pm b/lib/ProductOpener/Ingredients.pm index a03ba330b7b08..6b60e1230f6a1 100644 --- a/lib/ProductOpener/Ingredients.pm +++ b/lib/ProductOpener/Ingredients.pm @@ -3369,7 +3369,7 @@ sub get_missing_ecobalyse_ids ($ingredients_ref) { delete $ingredient_ref->{ecobalyse_proxy_code}; # We are now looking for the appropriate ecobalyse id : - # ecobalyse_origins_france_label_organic (if the product comes from france, and is organic) + # ecobalyse_origins_france_label_organic (if the product comes from france, and is organic) # ecobalyse_origins_european-union_label_organic (if the product comes from europe, and is organic) # ecobalyse_label_organic (if the product is organic) # ecobalyse_origins_france (if the product comes from france) From 995ade17cfd8fe43796a10266b0cbb4386450e79 Mon Sep 17 00:00:00 2001 From: Martin Ces Date: Mon, 4 Nov 2024 13:40:30 +0100 Subject: [PATCH 15/18] tackling (again) Perl errors --- lib/ProductOpener/Ingredients.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ProductOpener/Ingredients.pm b/lib/ProductOpener/Ingredients.pm index 6b60e1230f6a1..1f47a93c6e6f6 100644 --- a/lib/ProductOpener/Ingredients.pm +++ b/lib/ProductOpener/Ingredients.pm @@ -3373,7 +3373,7 @@ sub get_missing_ecobalyse_ids ($ingredients_ref) { # ecobalyse_origins_european-union_label_organic (if the product comes from europe, and is organic) # ecobalyse_label_organic (if the product is organic) # ecobalyse_origins_france (if the product comes from france) - # ecobalyse_origins_european-union (if the product comes from the Europe region) + # ecobalyse_origins_european-union (if the product comes from the Europe region) # ecobalyse (else) # List of suffixes From 0828916104bf8e91ed50b4ca188e81aebf3a5de5 Mon Sep 17 00:00:00 2001 From: Martin Ces Date: Mon, 4 Nov 2024 13:50:06 +0100 Subject: [PATCH 16/18] tackling (again) Perl errors --- lib/ProductOpener/Ingredients.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ProductOpener/Ingredients.pm b/lib/ProductOpener/Ingredients.pm index 1f47a93c6e6f6..8cb6adf7e4106 100644 --- a/lib/ProductOpener/Ingredients.pm +++ b/lib/ProductOpener/Ingredients.pm @@ -3370,11 +3370,11 @@ sub get_missing_ecobalyse_ids ($ingredients_ref) { # We are now looking for the appropriate ecobalyse id : # ecobalyse_origins_france_label_organic (if the product comes from france, and is organic) - # ecobalyse_origins_european-union_label_organic (if the product comes from europe, and is organic) - # ecobalyse_label_organic (if the product is organic) - # ecobalyse_origins_france (if the product comes from france) + # ecobalyse_origins_european-union_label_organic (if the product comes from europe, and is organic) + # ecobalyse_label_organic (if the product is organic) + # ecobalyse_origins_france (if the product comes from france) # ecobalyse_origins_european-union (if the product comes from the Europe region) - # ecobalyse (else) + # ecobalyse (else) # List of suffixes my @suffixes = (); From 5e5a8e276e34a914a4dc055fedc90ccc12c1afd9 Mon Sep 17 00:00:00 2001 From: Open Food Facts Bot Date: Mon, 4 Nov 2024 13:41:38 +0000 Subject: [PATCH 17/18] chore: Linting changes --- lib/ProductOpener/Ingredients.pm | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/ProductOpener/Ingredients.pm b/lib/ProductOpener/Ingredients.pm index 8cb6adf7e4106..c1dca02927d75 100644 --- a/lib/ProductOpener/Ingredients.pm +++ b/lib/ProductOpener/Ingredients.pm @@ -3379,32 +3379,32 @@ sub get_missing_ecobalyse_ids ($ingredients_ref) { # List of suffixes my @suffixes = (); # If the ingredient is organic... - if ($ingredient_ref->{labels} =~ /\ben:organic\b/) { - push @suffixes, "_labels_organic"; + if ($ingredient_ref->{labels} =~ /\ben:organic\b/) { + push @suffixes, "_labels_organic"; } push @suffixes, ''; push @suffixes, '_proxy'; # Loop through each suffix and proxy combination to retrieve ecobalyse code foreach my $suffix (@suffixes) { - # Construct the property name using the proxy and suffix - my $property_name = "ecobalyse" . $suffix . ":en"; + # Construct the property name using the proxy and suffix + my $property_name = "ecobalyse" . $suffix . ":en"; - # Attempt to retrieve the ecobalyse code for the current property name - my $ecobalyse_code = get_inherited_property("ingredients", $ingredient_ref->{id}, $property_name); + # Attempt to retrieve the ecobalyse code for the current property name + my $ecobalyse_code = get_inherited_property("ingredients", $ingredient_ref->{id}, $property_name); - if (defined $ecobalyse_code) { - # Assign the ecobalyse code if found - $ingredient_ref->{ecobalyse_code} = $ecobalyse_code; - last; - } - # Exit the loop if a valid ecobalyse code was found - last if defined $ingredient_ref->{ecobalyse_code}; + if (defined $ecobalyse_code) { + # Assign the ecobalyse code if found + $ingredient_ref->{ecobalyse_code} = $ecobalyse_code; + last; + } + # Exit the loop if a valid ecobalyse code was found + last if defined $ingredient_ref->{ecobalyse_code}; } # If no ecobalyse code was found, add ingredient ID to list of missing codes if (!defined $ingredient_ref->{ecobalyse_code}) { - push(@ingredients_without_ecobalyse_ids, $ingredient_ref->{id}); + push(@ingredients_without_ecobalyse_ids, $ingredient_ref->{id}); } #ecobalyse:en From 1b69d543af708a5160ec38d468a6d6c98035c326 Mon Sep 17 00:00:00 2001 From: Martin Ces Date: Tue, 12 Nov 2024 17:00:34 +0100 Subject: [PATCH 18/18] Correcting tests/unit for ecobalyse --- .../unit/expected_test_results/attributes/fr-palm-oil-free.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/expected_test_results/attributes/fr-palm-oil-free.json b/tests/unit/expected_test_results/attributes/fr-palm-oil-free.json index 0d247227a10b0..90449531c37af 100644 --- a/tests/unit/expected_test_results/attributes/fr-palm-oil-free.json +++ b/tests/unit/expected_test_results/attributes/fr-palm-oil-free.json @@ -630,7 +630,7 @@ }, { "ciqual_proxy_food_code" : "9410", - "ecobalyse_proxy_code" : "flour", + "ecobalyse_code" : "flour", "id" : "en:flour", "is_in_taxonomy" : 1, "percent_estimate" : 18.75,