From 304e90cc4d40a390cc0f6cdd3efd057184162d94 Mon Sep 17 00:00:00 2001 From: Pierre Slamich Date: Sat, 21 May 2022 16:07:41 +0200 Subject: [PATCH 1/9] fix: add more linked panels for attributes --- lib/ProductOpener/Attributes.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/ProductOpener/Attributes.pm b/lib/ProductOpener/Attributes.pm index d0c71e86d6f0c..0dee670b21c52 100644 --- a/lib/ProductOpener/Attributes.pm +++ b/lib/ProductOpener/Attributes.pm @@ -302,6 +302,7 @@ sub initialize_attribute($$) { my $allergen = $1; $allergen =~ s/_/-/g; $attribute_ref->{icon_url} = "$static_subdomain/images/attributes/no-$allergen.svg"; + #$attribute_ref->{panel_id} = "$allergen"; } elsif ($attribute_id =~ /^(low)_(salt|sugars|fat|saturated_fat)$/) { my $nid = $2; @@ -313,13 +314,14 @@ sub initialize_attribute($$) { $analysis_tag =~ s/_/-/g; $attribute_ref->{icon_url} = "$static_subdomain/images/attributes/$analysis_tag.svg"; $attribute_ref->{panel_id} = "ingredients_analysis_en-" . $analysis_tag; + # does not seem to be working } elsif ($attribute_id =~ /^(labels)_(.*)$/) { my $tagtype = $1; my $tag = $2; $tag =~ s/_/-/g; - - $attribute_ref->{icon_url} = "$static_subdomain/images/attributes/${tag}.svg"; + $attribute_ref->{icon_url} = "$static_subdomain/images/attributes/${tag}.svg"; + $attribute_ref->{panel_id} = "${tag}"; } # Initialize name and setting name if a language is requested @@ -348,6 +350,8 @@ sub initialize_attribute($$) { my $name = display_taxonomy_tag($target_lc, "ingredients_analysis", "en:$analysis_tag"); $attribute_ref->{name} = $name; $attribute_ref->{setting_name} = $name; + $attribute_ref->{panel_id} = "ingredients_analysis_en-" . $analysis_tag; + } From 95a2af943efd779dba9e0daf1f106ba727726d6c Mon Sep 17 00:00:00 2001 From: Pierre Slamich Date: Fri, 17 Mar 2023 15:03:03 +0100 Subject: [PATCH 2/9] Update Attributes.pm --- lib/ProductOpener/Attributes.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ProductOpener/Attributes.pm b/lib/ProductOpener/Attributes.pm index bfa6a01fabea5..15b142d78ba78 100644 --- a/lib/ProductOpener/Attributes.pm +++ b/lib/ProductOpener/Attributes.pm @@ -289,7 +289,8 @@ sub initialize_attribute ($attribute_id, $target_lc) { my $allergen = $1; $allergen =~ s/_/-/g; $attribute_ref->{icon_url} = "$static_subdomain/images/attributes/no-$allergen.svg"; - #$attribute_ref->{panel_id} = "$allergen"; + # There is currently no knowledge panel related to allergens + # $attribute_ref->{panel_id} = "$allergen"; } elsif ($attribute_id =~ /^(low)_(salt|sugars|fat|saturated_fat)$/) { my $nid = $2; From e5f04cd34647a10c641149d72a259b20ca1524c0 Mon Sep 17 00:00:00 2001 From: Pierre Slamich Date: Mon, 20 Mar 2023 15:34:30 +0100 Subject: [PATCH 3/9] Update lib/ProductOpener/Attributes.pm Co-authored-by: Alex Garel --- lib/ProductOpener/Attributes.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ProductOpener/Attributes.pm b/lib/ProductOpener/Attributes.pm index 15b142d78ba78..fc29294e0ffec 100644 --- a/lib/ProductOpener/Attributes.pm +++ b/lib/ProductOpener/Attributes.pm @@ -340,7 +340,7 @@ sub initialize_attribute ($attribute_id, $target_lc) { my $name = display_taxonomy_tag($target_lc, "ingredients_analysis", "en:$analysis_tag"); $attribute_ref->{name} = $name; $attribute_ref->{setting_name} = $name; - $attribute_ref->{panel_id} = "ingredients_analysis_en-" . $analysis_tag; + $attribute_ref->{panel_id} = "ingredients_analysis_en:" . $analysis_tag; } # Nutrient levels From 6efaf77ee1c7643452738b352be15c30179ac934 Mon Sep 17 00:00:00 2001 From: Pierre Slamich Date: Tue, 23 May 2023 11:58:54 +0200 Subject: [PATCH 4/9] Update lib/ProductOpener/Attributes.pm Co-authored-by: Alex Garel --- lib/ProductOpener/Attributes.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/ProductOpener/Attributes.pm b/lib/ProductOpener/Attributes.pm index fc29294e0ffec..a6085c6104953 100644 --- a/lib/ProductOpener/Attributes.pm +++ b/lib/ProductOpener/Attributes.pm @@ -301,8 +301,7 @@ sub initialize_attribute ($attribute_id, $target_lc) { my $analysis_tag = $attribute_id; $analysis_tag =~ s/_/-/g; $attribute_ref->{icon_url} = "$static_subdomain/images/attributes/$analysis_tag.svg"; - $attribute_ref->{panel_id} = "ingredients_analysis_en-" . $analysis_tag; - # does not seem to be working + $attribute_ref->{panel_id} = "ingredients_analysis_en:" . $analysis_tag; } elsif ($attribute_id =~ /^(labels)_(.*)$/) { my $tagtype = $1; From fbd9371a80e67afd566fcb751e0dc2ef5a534e47 Mon Sep 17 00:00:00 2001 From: Pierre Slamich Date: Tue, 23 May 2023 22:13:12 +0200 Subject: [PATCH 5/9] Update lib/ProductOpener/Attributes.pm --- lib/ProductOpener/Attributes.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ProductOpener/Attributes.pm b/lib/ProductOpener/Attributes.pm index a6085c6104953..d04a8f9cb2bc5 100644 --- a/lib/ProductOpener/Attributes.pm +++ b/lib/ProductOpener/Attributes.pm @@ -308,7 +308,8 @@ sub initialize_attribute ($attribute_id, $target_lc) { my $tag = $2; $tag =~ s/_/-/g; $attribute_ref->{icon_url} = "$static_subdomain/images/attributes/${tag}.svg"; - $attribute_ref->{panel_id} = "${tag}"; + # Will be relevant when we have panels for all labels + # $attribute_ref->{panel_id} = "${tag}"; } # Initialize name and setting name if a language is requested From fe221f191b28e8d3a5d50305fc21e0fe4233111a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Gigandet?= Date: Fri, 26 May 2023 15:15:33 +0200 Subject: [PATCH 6/9] link to ingredients / ingredients_analysis panels for unknown allergens / ingredients analysis --- lib/ProductOpener/Attributes.pm | 33 +++++++++++++++++++++++++-------- tests/unit/attributes.t | 22 ++++++++++++++++++++-- 2 files changed, 45 insertions(+), 10 deletions(-) diff --git a/lib/ProductOpener/Attributes.pm b/lib/ProductOpener/Attributes.pm index d04a8f9cb2bc5..3ce6b5512f8a2 100644 --- a/lib/ProductOpener/Attributes.pm +++ b/lib/ProductOpener/Attributes.pm @@ -289,8 +289,6 @@ sub initialize_attribute ($attribute_id, $target_lc) { my $allergen = $1; $allergen =~ s/_/-/g; $attribute_ref->{icon_url} = "$static_subdomain/images/attributes/no-$allergen.svg"; - # There is currently no knowledge panel related to allergens - # $attribute_ref->{panel_id} = "$allergen"; } elsif ($attribute_id =~ /^(low)_(salt|sugars|fat|saturated_fat)$/) { my $nid = $2; @@ -301,15 +299,13 @@ sub initialize_attribute ($attribute_id, $target_lc) { my $analysis_tag = $attribute_id; $analysis_tag =~ s/_/-/g; $attribute_ref->{icon_url} = "$static_subdomain/images/attributes/$analysis_tag.svg"; - $attribute_ref->{panel_id} = "ingredients_analysis_en:" . $analysis_tag; } elsif ($attribute_id =~ /^(labels)_(.*)$/) { my $tagtype = $1; my $tag = $2; $tag =~ s/_/-/g; + $attribute_ref->{icon_url} = "$static_subdomain/images/attributes/${tag}.svg"; - # Will be relevant when we have panels for all labels - # $attribute_ref->{panel_id} = "${tag}"; } # Initialize name and setting name if a language is requested @@ -340,7 +336,7 @@ sub initialize_attribute ($attribute_id, $target_lc) { my $name = display_taxonomy_tag($target_lc, "ingredients_analysis", "en:$analysis_tag"); $attribute_ref->{name} = $name; $attribute_ref->{setting_name} = $name; - $attribute_ref->{panel_id} = "ingredients_analysis_en:" . $analysis_tag; + } # Nutrient levels @@ -1320,6 +1316,17 @@ sub compute_attribute_allergen ($product_ref, $target_lc, $attribute_id) { display_taxonomy_tag($target_lc, "allergens", $allergen_id) ); $attribute_ref->{icon_url} = "$static_subdomain/images/attributes/$allergen-content-unknown.svg"; + + if (not($product_ref->{ingredients_n})) { + # If we don't have ingredients, + # link to the ingredients panel that will have an action to add ingredients + $attribute_ref->{panel_id} = "ingredients"; + } + else { + # If we have ingredients, then we have too many ingredients that we did not recognize, + # link to the ingredients analysis details + $attribute_ref->{panel_id} = "ingredients_analysis_details"; + } } elsif ($attribute_ref->{match} == 100) { $attribute_ref->{title} = sprintf( @@ -1467,8 +1474,18 @@ sub compute_attribute_ingredients_analysis ($product_ref, $target_lc, $analysis) # the ingredients_analysis taxonomy contains en:palm-oil and not en:contains-palm-oil $analysis_tag =~ s/contains-(.*)$/$1/; - # Link to the corresponding knowledge panel (the panel id depends on the value of the property) - $attribute_ref->{panel_id} = "ingredients_analysis_en:" . $analysis_tag; + # Link to the corresponding knowledge panel + if (($status eq "unknown") and not($product_ref->{ingredients_n})) { + # If the status is unknown, and we don't have ingredients, + # link to the ingredients panel that will have an action to add ingredients + # Note that the status may be known (e.g. from labels like "Palm oil free") + # even if we don't have ingredients + $attribute_ref->{panel_id} = "ingredients"; + } + else { + # Otherwise we link to the panel specific to the ingredients analysis property + $attribute_ref->{panel_id} = "ingredients_analysis_en:" . $analysis_tag; + } if ($target_lc ne "data") { $attribute_ref->{title} = display_taxonomy_tag($target_lc, "ingredients_analysis", "en:$analysis_tag"); diff --git a/tests/unit/attributes.t b/tests/unit/attributes.t index 2dbc72628b313..5f9c5b84cb68a 100755 --- a/tests/unit/attributes.t +++ b/tests/unit/attributes.t @@ -151,9 +151,27 @@ my @tests = ( ingredients_text => "Cow milk, salt, microbial culture, garlic flavouring, guar gum, sugar, high fructose corn syrup", } - ] + ], - # + # Ingredients analysis and allergens when we don't have ingredients, or ingredients are not recognized + [ + 'en-no-ingredients', + { + lc => "en", + categories => "Cheeses", + categories_tags => ["en:cheeses"], + } + ], + [ + 'en-unknown-ingredients', + { + lc => "en", + categories => "Cheeses", + categories_tags => ["en:cheeses"], + ingredients_text => + "some ingredient that we do not recognize", + } + ], ); foreach my $test_ref (@tests) { From d502821d131fc842aa82a104216748302c601b66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Gigandet?= Date: Fri, 26 May 2023 15:36:34 +0200 Subject: [PATCH 7/9] update tests --- ...ted-attribute-groups-knowledge-panels.json | 20 ++++++++++++++++--- .../en-ecoscore-score-at-20-threshold.json | 20 ++++++++++++++++--- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-updated-attribute-groups-knowledge-panels.json b/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-updated-attribute-groups-knowledge-panels.json index 0a9da8c17d518..29670dd396177 100644 --- a/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-updated-attribute-groups-knowledge-panels.json +++ b/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-updated-attribute-groups-knowledge-panels.json @@ -65,6 +65,7 @@ "icon_url" : "http://static.openfoodfacts.localhost/images/attributes/gluten-content-unknown.svg", "id" : "allergens_no_gluten", "name" : "Gluten", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Presence unknown: Gluten" }, @@ -74,6 +75,7 @@ "icon_url" : "http://static.openfoodfacts.localhost/images/attributes/milk-content-unknown.svg", "id" : "allergens_no_milk", "name" : "Milk", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Presence unknown: Milk" }, @@ -83,6 +85,7 @@ "icon_url" : "http://static.openfoodfacts.localhost/images/attributes/eggs-content-unknown.svg", "id" : "allergens_no_eggs", "name" : "Eggs", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Presence unknown: Eggs" }, @@ -92,6 +95,7 @@ "icon_url" : "http://static.openfoodfacts.localhost/images/attributes/nuts-content-unknown.svg", "id" : "allergens_no_nuts", "name" : "Nuts", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Presence unknown: Nuts" }, @@ -101,6 +105,7 @@ "icon_url" : "http://static.openfoodfacts.localhost/images/attributes/peanuts-content-unknown.svg", "id" : "allergens_no_peanuts", "name" : "Peanuts", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Presence unknown: Peanuts" }, @@ -110,6 +115,7 @@ "icon_url" : "http://static.openfoodfacts.localhost/images/attributes/sesame-seeds-content-unknown.svg", "id" : "allergens_no_sesame_seeds", "name" : "Sesame seeds", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Presence unknown: Sesame seeds" }, @@ -119,6 +125,7 @@ "icon_url" : "http://static.openfoodfacts.localhost/images/attributes/soybeans-content-unknown.svg", "id" : "allergens_no_soybeans", "name" : "Soybeans", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Presence unknown: Soybeans" }, @@ -128,6 +135,7 @@ "icon_url" : "http://static.openfoodfacts.localhost/images/attributes/celery-content-unknown.svg", "id" : "allergens_no_celery", "name" : "Celery", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Presence unknown: Celery" }, @@ -137,6 +145,7 @@ "icon_url" : "http://static.openfoodfacts.localhost/images/attributes/mustard-content-unknown.svg", "id" : "allergens_no_mustard", "name" : "Mustard", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Presence unknown: Mustard" }, @@ -146,6 +155,7 @@ "icon_url" : "http://static.openfoodfacts.localhost/images/attributes/lupin-content-unknown.svg", "id" : "allergens_no_lupin", "name" : "Lupin", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Presence unknown: Lupin" }, @@ -155,6 +165,7 @@ "icon_url" : "http://static.openfoodfacts.localhost/images/attributes/fish-content-unknown.svg", "id" : "allergens_no_fish", "name" : "Fish", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Presence unknown: Fish" }, @@ -164,6 +175,7 @@ "icon_url" : "http://static.openfoodfacts.localhost/images/attributes/crustaceans-content-unknown.svg", "id" : "allergens_no_crustaceans", "name" : "Crustaceans", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Presence unknown: Crustaceans" }, @@ -173,6 +185,7 @@ "icon_url" : "http://static.openfoodfacts.localhost/images/attributes/molluscs-content-unknown.svg", "id" : "allergens_no_molluscs", "name" : "Molluscs", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Presence unknown: Molluscs" }, @@ -182,6 +195,7 @@ "icon_url" : "http://static.openfoodfacts.localhost/images/attributes/sulphur-dioxide-and-sulphites-content-unknown.svg", "id" : "allergens_no_sulphur_dioxide_and_sulphites", "name" : "Sulphur dioxide and sulphites", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Presence unknown: Sulphur dioxide and sulphites" } @@ -197,7 +211,7 @@ "icon_url" : "http://static.openfoodfacts.localhost/images/attributes/vegan-status-unknown.svg", "id" : "vegan", "name" : "Vegan", - "panel_id" : "ingredients_analysis_en:vegan-status-unknown", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Vegan status unknown" }, @@ -206,7 +220,7 @@ "icon_url" : "http://static.openfoodfacts.localhost/images/attributes/vegetarian-status-unknown.svg", "id" : "vegetarian", "name" : "Vegetarian", - "panel_id" : "ingredients_analysis_en:vegetarian-status-unknown", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Vegetarian status unknown" }, @@ -215,7 +229,7 @@ "icon_url" : "http://static.openfoodfacts.localhost/images/attributes/palm-oil-content-unknown.svg", "id" : "palm_oil_free", "name" : "Palm oil free", - "panel_id" : "ingredients_analysis_en:palm-oil-content-unknown", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Palm oil content unknown" } diff --git a/tests/unit/expected_test_results/attributes/en-ecoscore-score-at-20-threshold.json b/tests/unit/expected_test_results/attributes/en-ecoscore-score-at-20-threshold.json index d9d1ef1c1d173..8cd7a84fc7826 100644 --- a/tests/unit/expected_test_results/attributes/en-ecoscore-score-at-20-threshold.json +++ b/tests/unit/expected_test_results/attributes/en-ecoscore-score-at-20-threshold.json @@ -71,6 +71,7 @@ "icon_url" : "https://server_domain/images/attributes/gluten-content-unknown.svg", "id" : "allergens_no_gluten", "name" : "Gluten", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Presence unknown: Gluten" }, @@ -80,6 +81,7 @@ "icon_url" : "https://server_domain/images/attributes/milk-content-unknown.svg", "id" : "allergens_no_milk", "name" : "Milk", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Presence unknown: Milk" }, @@ -89,6 +91,7 @@ "icon_url" : "https://server_domain/images/attributes/eggs-content-unknown.svg", "id" : "allergens_no_eggs", "name" : "Eggs", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Presence unknown: Eggs" }, @@ -98,6 +101,7 @@ "icon_url" : "https://server_domain/images/attributes/nuts-content-unknown.svg", "id" : "allergens_no_nuts", "name" : "Nuts", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Presence unknown: Nuts" }, @@ -107,6 +111,7 @@ "icon_url" : "https://server_domain/images/attributes/peanuts-content-unknown.svg", "id" : "allergens_no_peanuts", "name" : "Peanuts", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Presence unknown: Peanuts" }, @@ -116,6 +121,7 @@ "icon_url" : "https://server_domain/images/attributes/sesame-seeds-content-unknown.svg", "id" : "allergens_no_sesame_seeds", "name" : "Sesame seeds", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Presence unknown: Sesame seeds" }, @@ -125,6 +131,7 @@ "icon_url" : "https://server_domain/images/attributes/soybeans-content-unknown.svg", "id" : "allergens_no_soybeans", "name" : "Soybeans", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Presence unknown: Soybeans" }, @@ -134,6 +141,7 @@ "icon_url" : "https://server_domain/images/attributes/celery-content-unknown.svg", "id" : "allergens_no_celery", "name" : "Celery", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Presence unknown: Celery" }, @@ -143,6 +151,7 @@ "icon_url" : "https://server_domain/images/attributes/mustard-content-unknown.svg", "id" : "allergens_no_mustard", "name" : "Mustard", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Presence unknown: Mustard" }, @@ -152,6 +161,7 @@ "icon_url" : "https://server_domain/images/attributes/lupin-content-unknown.svg", "id" : "allergens_no_lupin", "name" : "Lupin", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Presence unknown: Lupin" }, @@ -161,6 +171,7 @@ "icon_url" : "https://server_domain/images/attributes/fish-content-unknown.svg", "id" : "allergens_no_fish", "name" : "Fish", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Presence unknown: Fish" }, @@ -170,6 +181,7 @@ "icon_url" : "https://server_domain/images/attributes/crustaceans-content-unknown.svg", "id" : "allergens_no_crustaceans", "name" : "Crustaceans", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Presence unknown: Crustaceans" }, @@ -179,6 +191,7 @@ "icon_url" : "https://server_domain/images/attributes/molluscs-content-unknown.svg", "id" : "allergens_no_molluscs", "name" : "Molluscs", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Presence unknown: Molluscs" }, @@ -188,6 +201,7 @@ "icon_url" : "https://server_domain/images/attributes/sulphur-dioxide-and-sulphites-content-unknown.svg", "id" : "allergens_no_sulphur_dioxide_and_sulphites", "name" : "Sulphur dioxide and sulphites", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Presence unknown: Sulphur dioxide and sulphites" } @@ -203,7 +217,7 @@ "icon_url" : "https://server_domain/images/attributes/vegan-status-unknown.svg", "id" : "vegan", "name" : "Vegan", - "panel_id" : "ingredients_analysis_en:vegan-status-unknown", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Vegan status unknown" }, @@ -212,7 +226,7 @@ "icon_url" : "https://server_domain/images/attributes/vegetarian-status-unknown.svg", "id" : "vegetarian", "name" : "Vegetarian", - "panel_id" : "ingredients_analysis_en:vegetarian-status-unknown", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Vegetarian status unknown" }, @@ -221,7 +235,7 @@ "icon_url" : "https://server_domain/images/attributes/palm-oil-content-unknown.svg", "id" : "palm_oil_free", "name" : "Palm oil free", - "panel_id" : "ingredients_analysis_en:palm-oil-content-unknown", + "panel_id" : "ingredients", "status" : "unknown", "title" : "Palm oil content unknown" } From ef48fac9e95c89ecddbd6484197d21813d0056ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Gigandet?= Date: Fri, 26 May 2023 15:36:51 +0200 Subject: [PATCH 8/9] lint --- tests/unit/attributes.t | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/unit/attributes.t b/tests/unit/attributes.t index 5f9c5b84cb68a..f81ec38e07e8f 100755 --- a/tests/unit/attributes.t +++ b/tests/unit/attributes.t @@ -168,10 +168,9 @@ my @tests = ( lc => "en", categories => "Cheeses", categories_tags => ["en:cheeses"], - ingredients_text => - "some ingredient that we do not recognize", + ingredients_text => "some ingredient that we do not recognize", } - ], + ], ); foreach my $test_ref (@tests) { From 079f6e7cd183aa1d4e207ac9924a1ea2f66b191e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Gigandet?= Date: Fri, 26 May 2023 15:37:02 +0200 Subject: [PATCH 9/9] lint --- .../attributes/en-no-ingredients.json | 849 ++++++++++++++++ .../attributes/en-unknown-ingredients.json | 918 ++++++++++++++++++ 2 files changed, 1767 insertions(+) create mode 100644 tests/unit/expected_test_results/attributes/en-no-ingredients.json create mode 100644 tests/unit/expected_test_results/attributes/en-unknown-ingredients.json diff --git a/tests/unit/expected_test_results/attributes/en-no-ingredients.json b/tests/unit/expected_test_results/attributes/en-no-ingredients.json new file mode 100644 index 0000000000000..27216b02150aa --- /dev/null +++ b/tests/unit/expected_test_results/attributes/en-no-ingredients.json @@ -0,0 +1,849 @@ +{ + "allergens" : "", + "allergens_from_ingredients" : "", + "allergens_from_user" : "(en) ", + "allergens_hierarchy" : [], + "allergens_tags" : [], + "attribute_groups_en" : [ + { + "attributes" : [ + { + "description" : "", + "description_short" : "Missing data to compute the Nutri-Score", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/nutriscore-unknown.svg", + "id" : "nutriscore", + "match" : 0, + "name" : "Nutri-Score", + "panel_id" : "nutriscore", + "status" : "unknown", + "title" : "Nutri-Score unknown" + }, + { + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/nutrient-level-salt-unknown.svg", + "id" : "low_salt", + "missing" : "Missing nutrition facts", + "name" : "Salt", + "status" : "unknown", + "title" : "Salt in unknown quantity" + }, + { + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/nutrient-level-fat-unknown.svg", + "id" : "low_fat", + "missing" : "Missing nutrition facts", + "name" : "Fat", + "status" : "unknown", + "title" : "Fat in unknown quantity" + }, + { + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/nutrient-level-sugars-unknown.svg", + "id" : "low_sugars", + "missing" : "Missing nutrition facts", + "name" : "Sugars", + "status" : "unknown", + "title" : "Sugars in unknown quantity" + }, + { + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/nutrient-level-saturated-fat-unknown.svg", + "id" : "low_saturated_fat", + "missing" : "Missing nutrition facts", + "name" : "Saturated fat", + "status" : "unknown", + "title" : "Saturated fat in unknown quantity" + } + ], + "id" : "nutritional_quality", + "name" : "Nutritional quality" + }, + { + "attributes" : [ + { + "debug" : "missing ingredients list", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/gluten-content-unknown.svg", + "id" : "allergens_no_gluten", + "name" : "Gluten", + "panel_id" : "ingredients", + "status" : "unknown", + "title" : "Presence unknown: Gluten" + }, + { + "debug" : "missing ingredients list", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/milk-content-unknown.svg", + "id" : "allergens_no_milk", + "name" : "Milk", + "panel_id" : "ingredients", + "status" : "unknown", + "title" : "Presence unknown: Milk" + }, + { + "debug" : "missing ingredients list", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/eggs-content-unknown.svg", + "id" : "allergens_no_eggs", + "name" : "Eggs", + "panel_id" : "ingredients", + "status" : "unknown", + "title" : "Presence unknown: Eggs" + }, + { + "debug" : "missing ingredients list", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/nuts-content-unknown.svg", + "id" : "allergens_no_nuts", + "name" : "Nuts", + "panel_id" : "ingredients", + "status" : "unknown", + "title" : "Presence unknown: Nuts" + }, + { + "debug" : "missing ingredients list", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/peanuts-content-unknown.svg", + "id" : "allergens_no_peanuts", + "name" : "Peanuts", + "panel_id" : "ingredients", + "status" : "unknown", + "title" : "Presence unknown: Peanuts" + }, + { + "debug" : "missing ingredients list", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/sesame-seeds-content-unknown.svg", + "id" : "allergens_no_sesame_seeds", + "name" : "Sesame seeds", + "panel_id" : "ingredients", + "status" : "unknown", + "title" : "Presence unknown: Sesame seeds" + }, + { + "debug" : "missing ingredients list", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/soybeans-content-unknown.svg", + "id" : "allergens_no_soybeans", + "name" : "Soybeans", + "panel_id" : "ingredients", + "status" : "unknown", + "title" : "Presence unknown: Soybeans" + }, + { + "debug" : "missing ingredients list", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/celery-content-unknown.svg", + "id" : "allergens_no_celery", + "name" : "Celery", + "panel_id" : "ingredients", + "status" : "unknown", + "title" : "Presence unknown: Celery" + }, + { + "debug" : "missing ingredients list", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/mustard-content-unknown.svg", + "id" : "allergens_no_mustard", + "name" : "Mustard", + "panel_id" : "ingredients", + "status" : "unknown", + "title" : "Presence unknown: Mustard" + }, + { + "debug" : "missing ingredients list", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/lupin-content-unknown.svg", + "id" : "allergens_no_lupin", + "name" : "Lupin", + "panel_id" : "ingredients", + "status" : "unknown", + "title" : "Presence unknown: Lupin" + }, + { + "debug" : "missing ingredients list", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/fish-content-unknown.svg", + "id" : "allergens_no_fish", + "name" : "Fish", + "panel_id" : "ingredients", + "status" : "unknown", + "title" : "Presence unknown: Fish" + }, + { + "debug" : "missing ingredients list", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/crustaceans-content-unknown.svg", + "id" : "allergens_no_crustaceans", + "name" : "Crustaceans", + "panel_id" : "ingredients", + "status" : "unknown", + "title" : "Presence unknown: Crustaceans" + }, + { + "debug" : "missing ingredients list", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/molluscs-content-unknown.svg", + "id" : "allergens_no_molluscs", + "name" : "Molluscs", + "panel_id" : "ingredients", + "status" : "unknown", + "title" : "Presence unknown: Molluscs" + }, + { + "debug" : "missing ingredients list", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/sulphur-dioxide-and-sulphites-content-unknown.svg", + "id" : "allergens_no_sulphur_dioxide_and_sulphites", + "name" : "Sulphur dioxide and sulphites", + "panel_id" : "ingredients", + "status" : "unknown", + "title" : "Presence unknown: Sulphur dioxide and sulphites" + } + ], + "id" : "allergens", + "name" : "Allergens", + "warning" : "There is always a possibility that data about allergens may be missing, incomplete, incorrect or that the product's composition has changed. If you are allergic, always check the information on the actual product packaging." + }, + { + "attributes" : [ + { + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/vegan-status-unknown.svg", + "id" : "vegan", + "name" : "Vegan", + "panel_id" : "ingredients", + "status" : "unknown", + "title" : "Vegan status unknown" + }, + { + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/vegetarian-status-unknown.svg", + "id" : "vegetarian", + "name" : "Vegetarian", + "panel_id" : "ingredients", + "status" : "unknown", + "title" : "Vegetarian status unknown" + }, + { + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/palm-oil-content-unknown.svg", + "id" : "palm_oil_free", + "name" : "Palm oil free", + "panel_id" : "ingredients", + "status" : "unknown", + "title" : "Palm oil content unknown" + } + ], + "id" : "ingredients_analysis", + "name" : "Ingredients" + }, + { + "attributes" : [ + { + "description" : "", + "description_short" : "Food processing level unknown", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/nova-group-unknown.svg", + "id" : "nova", + "match" : 0, + "name" : "NOVA group", + "panel_id" : "nova", + "status" : "unknown", + "title" : "NOVA not computed" + }, + { + "description" : "", + "description_short" : "", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/additives-unknown.svg", + "id" : "additives", + "match" : 0, + "missing" : "Missing ingredients list", + "name" : "Additives", + "panel_id" : "additives", + "status" : "unknown", + "title" : "Additives not computed" + } + ], + "id" : "processing", + "name" : "Food processing" + }, + { + "attributes" : [ + { + "description" : "", + "description_short" : "High environmental impact", + "grade" : "d", + "icon_url" : "https://server_domain/images/attributes/ecoscore-d.svg", + "id" : "ecoscore", + "match" : 35, + "name" : "Eco-Score", + "panel_id" : "ecoscore", + "status" : "known", + "title" : "Eco-Score D" + }, + { + "description" : "", + "description_short" : "Currently only for products with chicken or eggs", + "grade" : "e", + "icon_url" : "https://server_domain/images/attributes/forest-footprint-not-computed.svg", + "id" : "forest_footprint", + "match" : 0, + "name" : "Forest footprint", + "status" : "known", + "title" : "Forest footprint not computed" + } + ], + "id" : "environment", + "name" : "Environment" + }, + { + "attributes" : [ + { + "description" : "Organic farming aims to protect the environment and to conserve biodiversity by prohibiting or limiting the use of synthetic fertilizers, pesticides and food additives.", + "description_short" : "Organic products promote ecological sustainability and biodiversity.", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/organic-unknown.svg", + "id" : "labels_organic", + "name" : "Organic farming", + "status" : "unknown", + "title" : "Missing information: organic product?" + }, + { + "description" : "When you buy fair trade products, producers in developing countries are paid an higher and fairer price, which helps them improve and sustain higher social and often environmental standards.", + "description_short" : "Fair trade products help producers in developing countries.", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/fair-trade-unknown.svg", + "id" : "labels_fair_trade", + "name" : "Fair trade", + "status" : "unknown", + "title" : "Missing information: fair trade product?" + } + ], + "id" : "labels", + "name" : "Labels" + } + ], + "categories" : "Cheeses", + "categories_properties" : { + "agribalyse_proxy_food_code:en" : "12001", + "ciqual_food_code:en" : "12999" + }, + "categories_properties_tags" : [ + "all-products", + "categories-known", + "agribalyse-food-code-unknown", + "agribalyse-proxy-food-code-12001", + "agribalyse-proxy-food-code-known", + "ciqual-food-code-12999", + "ciqual-food-code-known", + "agribalyse-known", + "agribalyse-12001" + ], + "categories_tags" : [ + "en:cheeses" + ], + "data_quality_bugs_tags" : [ + "en:main-language-missing", + "en:code-missing", + "en:created-missing" + ], + "data_quality_errors_tags" : [], + "data_quality_info_tags" : [ + "en:no-packaging-data", + "en:ecoscore-extended-data-not-computed", + "en:food-groups-1-known", + "en:food-groups-2-known", + "en:food-groups-3-unknown" + ], + "data_quality_tags" : [ + "en:main-language-missing", + "en:code-missing", + "en:created-missing", + "en:no-packaging-data", + "en:ecoscore-extended-data-not-computed", + "en:food-groups-1-known", + "en:food-groups-2-known", + "en:food-groups-3-unknown", + "en:ecoscore-origins-of-ingredients-origins-are-100-percent-unknown", + "en:ecoscore-packaging-packaging-data-missing", + "en:ecoscore-production-system-no-label", + "en:ecoscore-threatened-species-ingredients-missing" + ], + "data_quality_warnings_tags" : [ + "en:ecoscore-origins-of-ingredients-origins-are-100-percent-unknown", + "en:ecoscore-packaging-packaging-data-missing", + "en:ecoscore-production-system-no-label", + "en:ecoscore-threatened-species-ingredients-missing" + ], + "ecoscore_data" : { + "adjustments" : { + "origins_of_ingredients" : { + "aggregated_origins" : [ + { + "origin" : "en:unknown", + "percent" : 100 + } + ], + "epi_score" : 0, + "epi_value" : -5, + "origins_from_origins_field" : [ + "en:unknown" + ], + "transportation_scores" : { + "ad" : 0, + "al" : 0, + "at" : 0, + "ax" : 0, + "ba" : 0, + "be" : 0, + "bg" : 0, + "ch" : 0, + "cy" : 0, + "cz" : 0, + "de" : 0, + "dk" : 0, + "dz" : 0, + "ee" : 0, + "eg" : 0, + "es" : 0, + "fi" : 0, + "fo" : 0, + "fr" : 0, + "gg" : 0, + "gi" : 0, + "gr" : 0, + "hr" : 0, + "hu" : 0, + "ie" : 0, + "il" : 0, + "im" : 0, + "is" : 0, + "it" : 0, + "je" : 0, + "lb" : 0, + "li" : 0, + "lt" : 0, + "lu" : 0, + "lv" : 0, + "ly" : 0, + "ma" : 0, + "mc" : 0, + "md" : 0, + "me" : 0, + "mk" : 0, + "mt" : 0, + "nl" : 0, + "no" : 0, + "pl" : 0, + "ps" : 0, + "pt" : 0, + "ro" : 0, + "rs" : 0, + "se" : 0, + "si" : 0, + "sj" : 0, + "sk" : 0, + "sm" : 0, + "sy" : 0, + "tn" : 0, + "tr" : 0, + "ua" : 0, + "uk" : 0, + "us" : 0, + "va" : 0, + "world" : 0, + "xk" : 0 + }, + "transportation_values" : { + "ad" : 0, + "al" : 0, + "at" : 0, + "ax" : 0, + "ba" : 0, + "be" : 0, + "bg" : 0, + "ch" : 0, + "cy" : 0, + "cz" : 0, + "de" : 0, + "dk" : 0, + "dz" : 0, + "ee" : 0, + "eg" : 0, + "es" : 0, + "fi" : 0, + "fo" : 0, + "fr" : 0, + "gg" : 0, + "gi" : 0, + "gr" : 0, + "hr" : 0, + "hu" : 0, + "ie" : 0, + "il" : 0, + "im" : 0, + "is" : 0, + "it" : 0, + "je" : 0, + "lb" : 0, + "li" : 0, + "lt" : 0, + "lu" : 0, + "lv" : 0, + "ly" : 0, + "ma" : 0, + "mc" : 0, + "md" : 0, + "me" : 0, + "mk" : 0, + "mt" : 0, + "nl" : 0, + "no" : 0, + "pl" : 0, + "ps" : 0, + "pt" : 0, + "ro" : 0, + "rs" : 0, + "se" : 0, + "si" : 0, + "sj" : 0, + "sk" : 0, + "sm" : 0, + "sy" : 0, + "tn" : 0, + "tr" : 0, + "ua" : 0, + "uk" : 0, + "us" : 0, + "va" : 0, + "world" : 0, + "xk" : 0 + }, + "values" : { + "ad" : -5, + "al" : -5, + "at" : -5, + "ax" : -5, + "ba" : -5, + "be" : -5, + "bg" : -5, + "ch" : -5, + "cy" : -5, + "cz" : -5, + "de" : -5, + "dk" : -5, + "dz" : -5, + "ee" : -5, + "eg" : -5, + "es" : -5, + "fi" : -5, + "fo" : -5, + "fr" : -5, + "gg" : -5, + "gi" : -5, + "gr" : -5, + "hr" : -5, + "hu" : -5, + "ie" : -5, + "il" : -5, + "im" : -5, + "is" : -5, + "it" : -5, + "je" : -5, + "lb" : -5, + "li" : -5, + "lt" : -5, + "lu" : -5, + "lv" : -5, + "ly" : -5, + "ma" : -5, + "mc" : -5, + "md" : -5, + "me" : -5, + "mk" : -5, + "mt" : -5, + "nl" : -5, + "no" : -5, + "pl" : -5, + "ps" : -5, + "pt" : -5, + "ro" : -5, + "rs" : -5, + "se" : -5, + "si" : -5, + "sj" : -5, + "sk" : -5, + "sm" : -5, + "sy" : -5, + "tn" : -5, + "tr" : -5, + "ua" : -5, + "uk" : -5, + "us" : -5, + "va" : -5, + "world" : -5, + "xk" : -5 + }, + "warning" : "origins_are_100_percent_unknown" + }, + "packaging" : { + "non_recyclable_and_non_biodegradable_materials" : 1, + "value" : -15, + "warning" : "packaging_data_missing" + }, + "production_system" : { + "labels" : [], + "value" : 0, + "warning" : "no_label" + }, + "threatened_species" : { + "warning" : "ingredients_missing" + } + }, + "agribalyse" : { + "agribalyse_proxy_food_code" : "12001", + "co2_agriculture" : 4.456254, + "co2_consumption" : 0.0066875618, + "co2_distribution" : 0.03557378, + "co2_packaging" : 0.26266115, + "co2_processing" : 0.26259642, + "co2_total" : 5.2352765418, + "co2_transportation" : 0.21150363, + "code" : "12001", + "dqr" : "1.81", + "ef_agriculture" : 0.41824056, + "ef_consumption" : 0.0024548656, + "ef_distribution" : 0.0089382699, + "ef_packaging" : 0.021679542, + "ef_processing" : 0.027537041, + "ef_total" : 0.4954066285, + "ef_transportation" : 0.01655635, + "is_beverage" : 0, + "name_en" : "Camembert cheese, from cow's milk", + "name_fr" : "Camembert, sans précision", + "score" : 54, + "version" : "3.1" + }, + "grade" : "d", + "grades" : { + "ad" : "d", + "al" : "d", + "at" : "d", + "ax" : "d", + "ba" : "d", + "be" : "d", + "bg" : "d", + "ch" : "d", + "cy" : "d", + "cz" : "d", + "de" : "d", + "dk" : "d", + "dz" : "d", + "ee" : "d", + "eg" : "d", + "es" : "d", + "fi" : "d", + "fo" : "d", + "fr" : "d", + "gg" : "d", + "gi" : "d", + "gr" : "d", + "hr" : "d", + "hu" : "d", + "ie" : "d", + "il" : "d", + "im" : "d", + "is" : "d", + "it" : "d", + "je" : "d", + "lb" : "d", + "li" : "d", + "lt" : "d", + "lu" : "d", + "lv" : "d", + "ly" : "d", + "ma" : "d", + "mc" : "d", + "md" : "d", + "me" : "d", + "mk" : "d", + "mt" : "d", + "nl" : "d", + "no" : "d", + "pl" : "d", + "ps" : "d", + "pt" : "d", + "ro" : "d", + "rs" : "d", + "se" : "d", + "si" : "d", + "sj" : "d", + "sk" : "d", + "sm" : "d", + "sy" : "d", + "tn" : "d", + "tr" : "d", + "ua" : "d", + "uk" : "d", + "us" : "d", + "va" : "d", + "world" : "d", + "xk" : "d" + }, + "missing" : { + "ingredients" : 1, + "labels" : 1, + "origins" : 1, + "packagings" : 1 + }, + "missing_data_warning" : 1, + "missing_key_data" : 1, + "score" : 34, + "scores" : { + "ad" : 34, + "al" : 34, + "at" : 34, + "ax" : 34, + "ba" : 34, + "be" : 34, + "bg" : 34, + "ch" : 34, + "cy" : 34, + "cz" : 34, + "de" : 34, + "dk" : 34, + "dz" : 34, + "ee" : 34, + "eg" : 34, + "es" : 34, + "fi" : 34, + "fo" : 34, + "fr" : 34, + "gg" : 34, + "gi" : 34, + "gr" : 34, + "hr" : 34, + "hu" : 34, + "ie" : 34, + "il" : 34, + "im" : 34, + "is" : 34, + "it" : 34, + "je" : 34, + "lb" : 34, + "li" : 34, + "lt" : 34, + "lu" : 34, + "lv" : 34, + "ly" : 34, + "ma" : 34, + "mc" : 34, + "md" : 34, + "me" : 34, + "mk" : 34, + "mt" : 34, + "nl" : 34, + "no" : 34, + "pl" : 34, + "ps" : 34, + "pt" : 34, + "ro" : 34, + "rs" : 34, + "se" : 34, + "si" : 34, + "sj" : 34, + "sk" : 34, + "sm" : 34, + "sy" : 34, + "tn" : 34, + "tr" : 34, + "ua" : 34, + "uk" : 34, + "us" : 34, + "va" : 34, + "world" : 34, + "xk" : 34 + }, + "status" : "known" + }, + "ecoscore_grade" : "d", + "ecoscore_score" : 34, + "ecoscore_tags" : [ + "d" + ], + "food_groups" : "en:cheese", + "food_groups_tags" : [ + "en:milk-and-dairy-products", + "en:cheese" + ], + "languages" : {}, + "languages_codes" : {}, + "languages_hierarchy" : [], + "languages_tags" : [ + "en:0" + ], + "lc" : "en", + "misc_tags" : [ + "en:nutriscore-not-computed", + "en:nutrition-not-enough-data-to-compute-nutrition-score", + "en:nutriscore-missing-nutrition-data", + "en:nutriscore-missing-nutrition-data-energy", + "en:nutriscore-missing-nutrition-data-fat", + "en:nutriscore-missing-nutrition-data-saturated-fat", + "en:nutriscore-missing-nutrition-data-sugars", + "en:nutriscore-missing-nutrition-data-sodium", + "en:nutriscore-missing-nutrition-data-proteins", + "en:nutrition-no-fiber", + "en:packagings-number-of-components-0", + "en:packagings-not-complete", + "en:packagings-empty", + "en:ecoscore-extended-data-not-computed", + "en:ecoscore-missing-data-warning", + "en:ecoscore-missing-data-labels", + "en:ecoscore-missing-data-origins", + "en:ecoscore-missing-data-packagings", + "en:ecoscore-missing-data-no-packagings", + "en:ecoscore-computed", + "en:ecoscore-changed", + "en:ecoscore-grade-changed" + ], + "nova_group_debug" : "no nova group when the product does not have ingredients", + "nova_group_error" : "missing_ingredients", + "nova_groups_tags" : [ + "unknown" + ], + "nutrient_levels" : {}, + "nutrient_levels_tags" : [], + "nutriments" : {}, + "nutrition_data_per" : "100g", + "nutrition_data_prepared_per" : "100g", + "nutrition_grades_tags" : [ + "unknown" + ], + "nutrition_score_beverage" : 0, + "nutrition_score_debug" : "missing energy - missing fat - missing saturated-fat - missing sugars - missing sodium - missing proteins", + "nutrition_score_warning_no_fiber" : 1, + "packaging_materials_tags" : [], + "packaging_recycling_tags" : [], + "packaging_shapes_tags" : [], + "packagings" : [], + "pnns_groups_1" : "Milk and dairy products", + "pnns_groups_1_tags" : [ + "milk-and-dairy-products", + "known" + ], + "pnns_groups_2" : "Cheese", + "pnns_groups_2_tags" : [ + "cheese", + "known" + ], + "traces" : "", + "traces_from_ingredients" : "", + "traces_from_user" : "(en) ", + "traces_hierarchy" : [], + "traces_tags" : [], + "unknown_nutrients_tags" : [] +} diff --git a/tests/unit/expected_test_results/attributes/en-unknown-ingredients.json b/tests/unit/expected_test_results/attributes/en-unknown-ingredients.json new file mode 100644 index 0000000000000..1a1d6e516bbe5 --- /dev/null +++ b/tests/unit/expected_test_results/attributes/en-unknown-ingredients.json @@ -0,0 +1,918 @@ +{ + "additives_n" : 0, + "additives_old_n" : 0, + "additives_old_tags" : [], + "additives_original_tags" : [], + "additives_tags" : [], + "allergens" : "", + "allergens_from_ingredients" : "", + "allergens_from_user" : "(en) ", + "allergens_hierarchy" : [], + "allergens_tags" : [], + "amino_acids_tags" : [], + "attribute_groups_en" : [ + { + "attributes" : [ + { + "description" : "", + "description_short" : "Missing data to compute the Nutri-Score", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/nutriscore-unknown.svg", + "id" : "nutriscore", + "match" : 0, + "name" : "Nutri-Score", + "panel_id" : "nutriscore", + "status" : "unknown", + "title" : "Nutri-Score unknown" + }, + { + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/nutrient-level-salt-unknown.svg", + "id" : "low_salt", + "missing" : "Missing nutrition facts", + "name" : "Salt", + "status" : "unknown", + "title" : "Salt in unknown quantity" + }, + { + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/nutrient-level-fat-unknown.svg", + "id" : "low_fat", + "missing" : "Missing nutrition facts", + "name" : "Fat", + "status" : "unknown", + "title" : "Fat in unknown quantity" + }, + { + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/nutrient-level-sugars-unknown.svg", + "id" : "low_sugars", + "missing" : "Missing nutrition facts", + "name" : "Sugars", + "status" : "unknown", + "title" : "Sugars in unknown quantity" + }, + { + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/nutrient-level-saturated-fat-unknown.svg", + "id" : "low_saturated_fat", + "missing" : "Missing nutrition facts", + "name" : "Saturated fat", + "status" : "unknown", + "title" : "Saturated fat in unknown quantity" + } + ], + "id" : "nutritional_quality", + "name" : "Nutritional quality" + }, + { + "attributes" : [ + { + "debug" : "too many unknown ingredients: 1 ingredients (1 unknown)", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/gluten-content-unknown.svg", + "id" : "allergens_no_gluten", + "name" : "Gluten", + "panel_id" : "ingredients_analysis_details", + "status" : "unknown", + "title" : "Presence unknown: Gluten" + }, + { + "debug" : "too many unknown ingredients: 1 ingredients (1 unknown)", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/milk-content-unknown.svg", + "id" : "allergens_no_milk", + "name" : "Milk", + "panel_id" : "ingredients_analysis_details", + "status" : "unknown", + "title" : "Presence unknown: Milk" + }, + { + "debug" : "too many unknown ingredients: 1 ingredients (1 unknown)", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/eggs-content-unknown.svg", + "id" : "allergens_no_eggs", + "name" : "Eggs", + "panel_id" : "ingredients_analysis_details", + "status" : "unknown", + "title" : "Presence unknown: Eggs" + }, + { + "debug" : "too many unknown ingredients: 1 ingredients (1 unknown)", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/nuts-content-unknown.svg", + "id" : "allergens_no_nuts", + "name" : "Nuts", + "panel_id" : "ingredients_analysis_details", + "status" : "unknown", + "title" : "Presence unknown: Nuts" + }, + { + "debug" : "too many unknown ingredients: 1 ingredients (1 unknown)", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/peanuts-content-unknown.svg", + "id" : "allergens_no_peanuts", + "name" : "Peanuts", + "panel_id" : "ingredients_analysis_details", + "status" : "unknown", + "title" : "Presence unknown: Peanuts" + }, + { + "debug" : "too many unknown ingredients: 1 ingredients (1 unknown)", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/sesame-seeds-content-unknown.svg", + "id" : "allergens_no_sesame_seeds", + "name" : "Sesame seeds", + "panel_id" : "ingredients_analysis_details", + "status" : "unknown", + "title" : "Presence unknown: Sesame seeds" + }, + { + "debug" : "too many unknown ingredients: 1 ingredients (1 unknown)", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/soybeans-content-unknown.svg", + "id" : "allergens_no_soybeans", + "name" : "Soybeans", + "panel_id" : "ingredients_analysis_details", + "status" : "unknown", + "title" : "Presence unknown: Soybeans" + }, + { + "debug" : "too many unknown ingredients: 1 ingredients (1 unknown)", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/celery-content-unknown.svg", + "id" : "allergens_no_celery", + "name" : "Celery", + "panel_id" : "ingredients_analysis_details", + "status" : "unknown", + "title" : "Presence unknown: Celery" + }, + { + "debug" : "too many unknown ingredients: 1 ingredients (1 unknown)", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/mustard-content-unknown.svg", + "id" : "allergens_no_mustard", + "name" : "Mustard", + "panel_id" : "ingredients_analysis_details", + "status" : "unknown", + "title" : "Presence unknown: Mustard" + }, + { + "debug" : "too many unknown ingredients: 1 ingredients (1 unknown)", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/lupin-content-unknown.svg", + "id" : "allergens_no_lupin", + "name" : "Lupin", + "panel_id" : "ingredients_analysis_details", + "status" : "unknown", + "title" : "Presence unknown: Lupin" + }, + { + "debug" : "too many unknown ingredients: 1 ingredients (1 unknown)", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/fish-content-unknown.svg", + "id" : "allergens_no_fish", + "name" : "Fish", + "panel_id" : "ingredients_analysis_details", + "status" : "unknown", + "title" : "Presence unknown: Fish" + }, + { + "debug" : "too many unknown ingredients: 1 ingredients (1 unknown)", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/crustaceans-content-unknown.svg", + "id" : "allergens_no_crustaceans", + "name" : "Crustaceans", + "panel_id" : "ingredients_analysis_details", + "status" : "unknown", + "title" : "Presence unknown: Crustaceans" + }, + { + "debug" : "too many unknown ingredients: 1 ingredients (1 unknown)", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/molluscs-content-unknown.svg", + "id" : "allergens_no_molluscs", + "name" : "Molluscs", + "panel_id" : "ingredients_analysis_details", + "status" : "unknown", + "title" : "Presence unknown: Molluscs" + }, + { + "debug" : "too many unknown ingredients: 1 ingredients (1 unknown)", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/sulphur-dioxide-and-sulphites-content-unknown.svg", + "id" : "allergens_no_sulphur_dioxide_and_sulphites", + "name" : "Sulphur dioxide and sulphites", + "panel_id" : "ingredients_analysis_details", + "status" : "unknown", + "title" : "Presence unknown: Sulphur dioxide and sulphites" + } + ], + "id" : "allergens", + "name" : "Allergens", + "warning" : "There is always a possibility that data about allergens may be missing, incomplete, incorrect or that the product's composition has changed. If you are allergic, always check the information on the actual product packaging." + }, + { + "attributes" : [ + { + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/vegan-status-unknown.svg", + "id" : "vegan", + "name" : "Vegan", + "panel_id" : "ingredients_analysis_en:vegan-status-unknown", + "status" : "unknown", + "title" : "Vegan status unknown" + }, + { + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/vegetarian-status-unknown.svg", + "id" : "vegetarian", + "name" : "Vegetarian", + "panel_id" : "ingredients_analysis_en:vegetarian-status-unknown", + "status" : "unknown", + "title" : "Vegetarian status unknown" + }, + { + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/palm-oil-content-unknown.svg", + "id" : "palm_oil_free", + "name" : "Palm oil free", + "panel_id" : "ingredients_analysis_en:palm-oil-content-unknown", + "status" : "unknown", + "title" : "Palm oil content unknown" + } + ], + "id" : "ingredients_analysis", + "name" : "Ingredients" + }, + { + "attributes" : [ + { + "description" : "", + "description_short" : "Food processing level unknown", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/nova-group-unknown.svg", + "id" : "nova", + "match" : 0, + "name" : "NOVA group", + "panel_id" : "nova", + "status" : "unknown", + "title" : "NOVA not computed" + }, + { + "grade" : "a", + "icon_url" : "https://server_domain/images/attributes/0-additives.svg", + "id" : "additives", + "match" : 100, + "name" : "Additives", + "panel_id" : "additives", + "status" : "known", + "title" : "Without additives" + } + ], + "id" : "processing", + "name" : "Food processing" + }, + { + "attributes" : [ + { + "description" : "", + "description_short" : "High environmental impact", + "grade" : "d", + "icon_url" : "https://server_domain/images/attributes/ecoscore-d.svg", + "id" : "ecoscore", + "match" : 35, + "name" : "Eco-Score", + "panel_id" : "ecoscore", + "status" : "known", + "title" : "Eco-Score D" + }, + { + "description" : "", + "description_short" : "Currently only for products with chicken or eggs", + "grade" : "e", + "icon_url" : "https://server_domain/images/attributes/forest-footprint-not-computed.svg", + "id" : "forest_footprint", + "match" : 0, + "name" : "Forest footprint", + "status" : "known", + "title" : "Forest footprint not computed" + } + ], + "id" : "environment", + "name" : "Environment" + }, + { + "attributes" : [ + { + "description" : "Organic farming aims to protect the environment and to conserve biodiversity by prohibiting or limiting the use of synthetic fertilizers, pesticides and food additives.", + "description_short" : "Organic products promote ecological sustainability and biodiversity.", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/organic-unknown.svg", + "id" : "labels_organic", + "name" : "Organic farming", + "status" : "unknown", + "title" : "Missing information: organic product?" + }, + { + "description" : "When you buy fair trade products, producers in developing countries are paid an higher and fairer price, which helps them improve and sustain higher social and often environmental standards.", + "description_short" : "Fair trade products help producers in developing countries.", + "grade" : "unknown", + "icon_url" : "https://server_domain/images/attributes/fair-trade-unknown.svg", + "id" : "labels_fair_trade", + "name" : "Fair trade", + "status" : "unknown", + "title" : "Missing information: fair trade product?" + } + ], + "id" : "labels", + "name" : "Labels" + } + ], + "categories" : "Cheeses", + "categories_properties" : { + "agribalyse_proxy_food_code:en" : "12001", + "ciqual_food_code:en" : "12999" + }, + "categories_properties_tags" : [ + "all-products", + "categories-known", + "agribalyse-food-code-unknown", + "agribalyse-proxy-food-code-12001", + "agribalyse-proxy-food-code-known", + "ciqual-food-code-12999", + "ciqual-food-code-known", + "agribalyse-known", + "agribalyse-12001" + ], + "categories_tags" : [ + "en:cheeses" + ], + "data_quality_bugs_tags" : [ + "en:main-language-missing", + "en:code-missing", + "en:created-missing" + ], + "data_quality_errors_tags" : [], + "data_quality_info_tags" : [ + "en:no-packaging-data", + "en:ingredients-percent-analysis-ok", + "en:all-but-one-ingredient-with-specified-percent", + "en:ecoscore-extended-data-not-computed", + "en:food-groups-1-known", + "en:food-groups-2-known", + "en:food-groups-3-unknown" + ], + "data_quality_tags" : [ + "en:main-language-missing", + "en:code-missing", + "en:created-missing", + "en:no-packaging-data", + "en:ingredients-percent-analysis-ok", + "en:all-but-one-ingredient-with-specified-percent", + "en:ecoscore-extended-data-not-computed", + "en:food-groups-1-known", + "en:food-groups-2-known", + "en:food-groups-3-unknown", + "en:ingredients-unknown-score-above-0", + "en:ingredients-100-percent-unknown", + "en:ecoscore-origins-of-ingredients-origins-are-100-percent-unknown", + "en:ecoscore-packaging-packaging-data-missing", + "en:ecoscore-production-system-no-label" + ], + "data_quality_warnings_tags" : [ + "en:ingredients-unknown-score-above-0", + "en:ingredients-100-percent-unknown", + "en:ecoscore-origins-of-ingredients-origins-are-100-percent-unknown", + "en:ecoscore-packaging-packaging-data-missing", + "en:ecoscore-production-system-no-label" + ], + "ecoscore_data" : { + "adjustments" : { + "origins_of_ingredients" : { + "aggregated_origins" : [ + { + "origin" : "en:unknown", + "percent" : 100 + } + ], + "epi_score" : 0, + "epi_value" : -5, + "origins_from_origins_field" : [ + "en:unknown" + ], + "transportation_scores" : { + "ad" : 0, + "al" : 0, + "at" : 0, + "ax" : 0, + "ba" : 0, + "be" : 0, + "bg" : 0, + "ch" : 0, + "cy" : 0, + "cz" : 0, + "de" : 0, + "dk" : 0, + "dz" : 0, + "ee" : 0, + "eg" : 0, + "es" : 0, + "fi" : 0, + "fo" : 0, + "fr" : 0, + "gg" : 0, + "gi" : 0, + "gr" : 0, + "hr" : 0, + "hu" : 0, + "ie" : 0, + "il" : 0, + "im" : 0, + "is" : 0, + "it" : 0, + "je" : 0, + "lb" : 0, + "li" : 0, + "lt" : 0, + "lu" : 0, + "lv" : 0, + "ly" : 0, + "ma" : 0, + "mc" : 0, + "md" : 0, + "me" : 0, + "mk" : 0, + "mt" : 0, + "nl" : 0, + "no" : 0, + "pl" : 0, + "ps" : 0, + "pt" : 0, + "ro" : 0, + "rs" : 0, + "se" : 0, + "si" : 0, + "sj" : 0, + "sk" : 0, + "sm" : 0, + "sy" : 0, + "tn" : 0, + "tr" : 0, + "ua" : 0, + "uk" : 0, + "us" : 0, + "va" : 0, + "world" : 0, + "xk" : 0 + }, + "transportation_values" : { + "ad" : 0, + "al" : 0, + "at" : 0, + "ax" : 0, + "ba" : 0, + "be" : 0, + "bg" : 0, + "ch" : 0, + "cy" : 0, + "cz" : 0, + "de" : 0, + "dk" : 0, + "dz" : 0, + "ee" : 0, + "eg" : 0, + "es" : 0, + "fi" : 0, + "fo" : 0, + "fr" : 0, + "gg" : 0, + "gi" : 0, + "gr" : 0, + "hr" : 0, + "hu" : 0, + "ie" : 0, + "il" : 0, + "im" : 0, + "is" : 0, + "it" : 0, + "je" : 0, + "lb" : 0, + "li" : 0, + "lt" : 0, + "lu" : 0, + "lv" : 0, + "ly" : 0, + "ma" : 0, + "mc" : 0, + "md" : 0, + "me" : 0, + "mk" : 0, + "mt" : 0, + "nl" : 0, + "no" : 0, + "pl" : 0, + "ps" : 0, + "pt" : 0, + "ro" : 0, + "rs" : 0, + "se" : 0, + "si" : 0, + "sj" : 0, + "sk" : 0, + "sm" : 0, + "sy" : 0, + "tn" : 0, + "tr" : 0, + "ua" : 0, + "uk" : 0, + "us" : 0, + "va" : 0, + "world" : 0, + "xk" : 0 + }, + "values" : { + "ad" : -5, + "al" : -5, + "at" : -5, + "ax" : -5, + "ba" : -5, + "be" : -5, + "bg" : -5, + "ch" : -5, + "cy" : -5, + "cz" : -5, + "de" : -5, + "dk" : -5, + "dz" : -5, + "ee" : -5, + "eg" : -5, + "es" : -5, + "fi" : -5, + "fo" : -5, + "fr" : -5, + "gg" : -5, + "gi" : -5, + "gr" : -5, + "hr" : -5, + "hu" : -5, + "ie" : -5, + "il" : -5, + "im" : -5, + "is" : -5, + "it" : -5, + "je" : -5, + "lb" : -5, + "li" : -5, + "lt" : -5, + "lu" : -5, + "lv" : -5, + "ly" : -5, + "ma" : -5, + "mc" : -5, + "md" : -5, + "me" : -5, + "mk" : -5, + "mt" : -5, + "nl" : -5, + "no" : -5, + "pl" : -5, + "ps" : -5, + "pt" : -5, + "ro" : -5, + "rs" : -5, + "se" : -5, + "si" : -5, + "sj" : -5, + "sk" : -5, + "sm" : -5, + "sy" : -5, + "tn" : -5, + "tr" : -5, + "ua" : -5, + "uk" : -5, + "us" : -5, + "va" : -5, + "world" : -5, + "xk" : -5 + }, + "warning" : "origins_are_100_percent_unknown" + }, + "packaging" : { + "non_recyclable_and_non_biodegradable_materials" : 1, + "value" : -15, + "warning" : "packaging_data_missing" + }, + "production_system" : { + "labels" : [], + "value" : 0, + "warning" : "no_label" + }, + "threatened_species" : {} + }, + "agribalyse" : { + "agribalyse_proxy_food_code" : "12001", + "co2_agriculture" : 4.456254, + "co2_consumption" : 0.0066875618, + "co2_distribution" : 0.03557378, + "co2_packaging" : 0.26266115, + "co2_processing" : 0.26259642, + "co2_total" : 5.2352765418, + "co2_transportation" : 0.21150363, + "code" : "12001", + "dqr" : "1.81", + "ef_agriculture" : 0.41824056, + "ef_consumption" : 0.0024548656, + "ef_distribution" : 0.0089382699, + "ef_packaging" : 0.021679542, + "ef_processing" : 0.027537041, + "ef_total" : 0.4954066285, + "ef_transportation" : 0.01655635, + "is_beverage" : 0, + "name_en" : "Camembert cheese, from cow's milk", + "name_fr" : "Camembert, sans précision", + "score" : 54, + "version" : "3.1" + }, + "grade" : "d", + "grades" : { + "ad" : "d", + "al" : "d", + "at" : "d", + "ax" : "d", + "ba" : "d", + "be" : "d", + "bg" : "d", + "ch" : "d", + "cy" : "d", + "cz" : "d", + "de" : "d", + "dk" : "d", + "dz" : "d", + "ee" : "d", + "eg" : "d", + "es" : "d", + "fi" : "d", + "fo" : "d", + "fr" : "d", + "gg" : "d", + "gi" : "d", + "gr" : "d", + "hr" : "d", + "hu" : "d", + "ie" : "d", + "il" : "d", + "im" : "d", + "is" : "d", + "it" : "d", + "je" : "d", + "lb" : "d", + "li" : "d", + "lt" : "d", + "lu" : "d", + "lv" : "d", + "ly" : "d", + "ma" : "d", + "mc" : "d", + "md" : "d", + "me" : "d", + "mk" : "d", + "mt" : "d", + "nl" : "d", + "no" : "d", + "pl" : "d", + "ps" : "d", + "pt" : "d", + "ro" : "d", + "rs" : "d", + "se" : "d", + "si" : "d", + "sj" : "d", + "sk" : "d", + "sm" : "d", + "sy" : "d", + "tn" : "d", + "tr" : "d", + "ua" : "d", + "uk" : "d", + "us" : "d", + "va" : "d", + "world" : "d", + "xk" : "d" + }, + "missing" : { + "labels" : 1, + "origins" : 1, + "packagings" : 1 + }, + "missing_data_warning" : 1, + "missing_key_data" : 1, + "score" : 34, + "scores" : { + "ad" : 34, + "al" : 34, + "at" : 34, + "ax" : 34, + "ba" : 34, + "be" : 34, + "bg" : 34, + "ch" : 34, + "cy" : 34, + "cz" : 34, + "de" : 34, + "dk" : 34, + "dz" : 34, + "ee" : 34, + "eg" : 34, + "es" : 34, + "fi" : 34, + "fo" : 34, + "fr" : 34, + "gg" : 34, + "gi" : 34, + "gr" : 34, + "hr" : 34, + "hu" : 34, + "ie" : 34, + "il" : 34, + "im" : 34, + "is" : 34, + "it" : 34, + "je" : 34, + "lb" : 34, + "li" : 34, + "lt" : 34, + "lu" : 34, + "lv" : 34, + "ly" : 34, + "ma" : 34, + "mc" : 34, + "md" : 34, + "me" : 34, + "mk" : 34, + "mt" : 34, + "nl" : 34, + "no" : 34, + "pl" : 34, + "ps" : 34, + "pt" : 34, + "ro" : 34, + "rs" : 34, + "se" : 34, + "si" : 34, + "sj" : 34, + "sk" : 34, + "sm" : 34, + "sy" : 34, + "tn" : 34, + "tr" : 34, + "ua" : 34, + "uk" : 34, + "us" : 34, + "va" : 34, + "world" : 34, + "xk" : 34 + }, + "status" : "known" + }, + "ecoscore_grade" : "d", + "ecoscore_score" : 34, + "ecoscore_tags" : [ + "d" + ], + "food_groups" : "en:cheese", + "food_groups_tags" : [ + "en:milk-and-dairy-products", + "en:cheese" + ], + "ingredients" : [ + { + "id" : "en:some-ingredient-that-we-do-not-recognize", + "percent_estimate" : 100, + "percent_max" : 100, + "percent_min" : 100, + "text" : "some ingredient that we do not recognize" + } + ], + "ingredients_analysis" : { + "en:palm-oil-content-unknown" : [ + "en:some-ingredient-that-we-do-not-recognize" + ], + "en:vegan-status-unknown" : [ + "en:some-ingredient-that-we-do-not-recognize" + ], + "en:vegetarian-status-unknown" : [ + "en:some-ingredient-that-we-do-not-recognize" + ] + }, + "ingredients_analysis_tags" : [ + "en:palm-oil-content-unknown", + "en:vegan-status-unknown", + "en:vegetarian-status-unknown" + ], + "ingredients_from_or_that_may_be_from_palm_oil_n" : 0, + "ingredients_from_palm_oil_n" : 0, + "ingredients_from_palm_oil_tags" : [], + "ingredients_hierarchy" : [ + "en:some-ingredient-that-we-do-not-recognize" + ], + "ingredients_n" : 1, + "ingredients_n_tags" : [ + "1", + "1-10" + ], + "ingredients_original_tags" : [ + "en:some-ingredient-that-we-do-not-recognize" + ], + "ingredients_percent_analysis" : 1, + "ingredients_tags" : [ + "en:some-ingredient-that-we-do-not-recognize" + ], + "ingredients_text" : "some ingredient that we do not recognize", + "ingredients_that_may_be_from_palm_oil_n" : 0, + "ingredients_that_may_be_from_palm_oil_tags" : [], + "ingredients_with_specified_percent_n" : 0, + "ingredients_with_specified_percent_sum" : 0, + "ingredients_with_unspecified_percent_n" : 1, + "ingredients_with_unspecified_percent_sum" : 100, + "ingredients_without_ciqual_codes" : [ + "en:some-ingredient-that-we-do-not-recognize" + ], + "ingredients_without_ciqual_codes_n" : 1, + "known_ingredients_n" : 0, + "languages" : {}, + "languages_codes" : {}, + "languages_hierarchy" : [], + "languages_tags" : [ + "en:0" + ], + "lc" : "en", + "minerals_tags" : [], + "misc_tags" : [ + "en:nutriscore-not-computed", + "en:nutrition-not-enough-data-to-compute-nutrition-score", + "en:nutriscore-missing-nutrition-data", + "en:nutriscore-missing-nutrition-data-energy", + "en:nutriscore-missing-nutrition-data-fat", + "en:nutriscore-missing-nutrition-data-saturated-fat", + "en:nutriscore-missing-nutrition-data-sugars", + "en:nutriscore-missing-nutrition-data-sodium", + "en:nutriscore-missing-nutrition-data-proteins", + "en:nutrition-no-fiber", + "en:packagings-number-of-components-0", + "en:packagings-not-complete", + "en:packagings-empty", + "en:ecoscore-extended-data-not-computed", + "en:ecoscore-missing-data-warning", + "en:ecoscore-missing-data-labels", + "en:ecoscore-missing-data-origins", + "en:ecoscore-missing-data-packagings", + "en:ecoscore-missing-data-no-packagings", + "en:ecoscore-computed", + "en:ecoscore-changed", + "en:ecoscore-grade-changed" + ], + "nova_group_debug" : "no nova group if too many ingredients are unknown: 1 out of 1", + "nova_group_error" : "too_many_unknown_ingredients", + "nova_groups_tags" : [ + "unknown" + ], + "nucleotides_tags" : [], + "nutrient_levels" : {}, + "nutrient_levels_tags" : [], + "nutriments" : { + "fruits-vegetables-nuts-estimate-from-ingredients_100g" : 0, + "fruits-vegetables-nuts-estimate-from-ingredients_serving" : 0 + }, + "nutrition_data_per" : "100g", + "nutrition_data_prepared_per" : "100g", + "nutrition_grades_tags" : [ + "unknown" + ], + "nutrition_score_beverage" : 0, + "nutrition_score_debug" : "missing energy - missing fat - missing saturated-fat - missing sugars - missing sodium - missing proteins", + "nutrition_score_warning_no_fiber" : 1, + "other_nutritional_substances_tags" : [], + "packaging_materials_tags" : [], + "packaging_recycling_tags" : [], + "packaging_shapes_tags" : [], + "packagings" : [], + "pnns_groups_1" : "Milk and dairy products", + "pnns_groups_1_tags" : [ + "milk-and-dairy-products", + "known" + ], + "pnns_groups_2" : "Cheese", + "pnns_groups_2_tags" : [ + "cheese", + "known" + ], + "traces" : "", + "traces_from_ingredients" : "", + "traces_from_user" : "(en) ", + "traces_hierarchy" : [], + "traces_tags" : [], + "unknown_ingredients_n" : 1, + "unknown_nutrients_tags" : [], + "vitamins_tags" : [] +}