Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: opposite categories #10392

Merged
merged 25 commits into from
Jul 5, 2024
Merged

chore: opposite categories #10392

merged 25 commits into from
Jul 5, 2024

Conversation

aleene
Copy link
Contributor

@aleene aleene commented Jun 5, 2024

What

Adding opposite characteristics to categories, as discussed in the data quality meeting. Based on the list on https://wiki.openfoodfacts.org/Data_quality_missions.

Some on the list are not included as these are better designated by the characteristic exclusive (can not be combined with another category)..

@aleene aleene self-assigned this Jun 5, 2024
@aleene aleene marked this pull request as draft June 5, 2024 07:19
@github-actions github-actions bot added 🧬 Taxonomies https://wiki.openfoodfacts.org/Global_taxonomies categories labels Jun 5, 2024
@CharlesNepote
Copy link
Member

Great!

To go further, could you explain deeper the "exclusive" characteristic? What I understand is that an "exclusive" category means that the product can't have another category than itself and its parents.
Eg. Plant-based foods and beverages > Plant-based foods | Condiments > Spices > Peppers > White Peppers

But could you also provide an example of a category that is NOT exclusive?

Regarding to the list here, could you make two lists: one containing the opposites and one containing the exclusives?

@aleene aleene changed the title chore:opposite categories chore: opposite categories Jun 5, 2024
@aleene
Copy link
Contributor Author

aleene commented Jun 5, 2024

We could add tests:

  • the opposite category name should exist as a category in order to prevent spelling errors
  • the opposite category should also have an opposite category that refers back

@aleene
Copy link
Contributor Author

aleene commented Jun 5, 2024

The final categories (leaves/end points) should be exclusive. A product can not belong to multiple leaves, for instance a meat can not be a fish nor a black pepper. A leaf category can have multiple parents, for instance skimmed milk can belong to pasteurised milks and homogenised milks.
Opposite products define the relation between leaves based on some characteristic, i.e. pasteurised milks versus unpasteurised milks. Opposite products are a special case of exclusivity and have only one common direct parent
Opposite products are also a special case of Set-related leaves. Set leaves do not have just two possible values, but more, for instance: skimmed, semi-skimmed, whole milks; or short, medium or long grain rice.

@github-actions github-actions bot added the 💥 Merge Conflicts 💥 Merge Conflicts label Jun 17, 2024
@aleene aleene marked this pull request as ready for review June 20, 2024 07:11
@aleene aleene requested a review from a team as a code owner June 20, 2024 07:11
Copy link

sonarcloud bot commented Jun 20, 2024

@teolemon teolemon added the 🧽 Data quality https://wiki.openfoodfacts.org/Quality label Jun 20, 2024
@github-actions github-actions bot removed the 💥 Merge Conflicts 💥 Merge Conflicts label Jun 20, 2024
@@ -1141,6 +1164,7 @@ hr:Pića i pripravci za piće
it:Bevande e preparati per bevande
nl:Dranken en drankbereidingen
description:en:This mixes ready to drink beverages and not-ready to drink beverages
opposite:en: en:meals
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The opposite of "Beverages" would be "Food" I think, not "meals". Of course that would mean putting most parent categories under "Food"

Copy link
Contributor

@stephanegigandet stephanegigandet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a comment for beverages vs meals. Otherwise it looks good to me. I think we could try it, and add some data quality warnings based on it, to see what product it flags, and then we could adjust.

@stephanegigandet stephanegigandet merged commit e6aeddc into main Jul 5, 2024
12 checks passed
@stephanegigandet stephanegigandet deleted the aleene-opposites branch July 5, 2024 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
categories 🧽 Data quality https://wiki.openfoodfacts.org/Quality 🧬 Taxonomies https://wiki.openfoodfacts.org/Global_taxonomies 🧪 tests
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants