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

Properties related to non-food products should not be returned for food products (and vice-versa) #128

Open
CharlesNepote opened this issue Jan 31, 2023 · 7 comments
Labels
✨ enhancement New feature or request 🎯 P0

Comments

@CharlesNepote
Copy link
Member

There are now more than 75 properties created by users (2023-01).

Some of them are dedicated to food products.

Some of them could be used for many, or even nearly any, kind of products:

Some of them could be used for different kind of products including food:

And some of them are clearly not relevant for food products and even sometimes exclusively dedicated to some categories:

These properties are visible at three places:

I think that deploying Folksonomy Engine to sister sites (see #62) will quickly lead to anarchy if we don't address this topic.

@CharlesNepote
Copy link
Member Author

CharlesNepote commented Feb 28, 2023

Solution 1

The first solution is to use prefixes to identify which things the property applies to. There are no changes in the API. When suggesting properties, the UI can filter the relevant ones.

Case 1: the property is dedicated to food products. Eg. packaging:nutriscore:multiple.

  • Entered in Open Food Facts: food:packaging:nutriscore:multiple
  • Stored in Folksonomy Engine DB: food:packaging:nutriscore:multiple
  • The property is not suggested for other kind of products, in Open Beauty Facts or Open Products Facts, because there is the food prefix.

Case 2: the property is dedicated to general products and beauty products, but not food products. Eg. flammable.

  • Either:
    • Two properties are created Open Products Facts or Open Beauty Facts as general:flammable and beauty:flammable.
    • One flammable property is created but there is no way to filter it for food products (except hard-coding it in the UI)

PROs:

  • no coding required in the backend

CONs:

  • for the user creating a new property, it can be difficult to know if he/she has to add a prefix or not
  • the case where a property is suited for two product's types but not all, is not managed

Solution 2

Create another DB which lists all properties and their targeted products.

property food beauty general
packaging:nutriscore:multiple true
flammable true true
conservation:temperature true true true

PROs:

  • short property names
  • can evolve by the time

CONs:

  • we need to either change Folksonomy Engine backend, either create another one
  • needs either another DB with its own interfaces, either multiple API call

Solution 3

Create a taxonomy for the properties. A taxonomy allows complex cases. Eg.:

<food_properties
en:packaging:nutriscore:multiple
fr:emballage:nutriscore:multiple
en:description:There are more than one Nutri-Score displayed on the packaging. The values should be the letters separated by commas.
en:example:a,b
xx:regexp_control:[a-e],[a-e](,[a-e])*

<beauty_properties
<general_properties
en:flammable

PROs:

  • allows much more usages: descriptions, translation, etc.
  • manage the case where a category can fit to some products' types but not all

CONs:

  • It's harder to specify properties usages: it is necessary to add it to the taxonomy.
  • New properties, before entering the taxonomy, will be displayed by default for every products' types (food, beauty, etc.) (we could create an entry automatically based on the website where the new property has been entered)
  • We have to modify the UI code to filter properties based on the taxonomy.

@benbenben2
Copy link
Contributor

Do you think that we could have option to add a column in the database for the sources (Open Food Facts, Open Beauty Facts, etc.)?

Like this, flammable entered in both Open Food Facts and Open Beauty Facts would lead to 2 rows in the database.

Then, we could either look at flammable for Open Food Facts or for Open Beauty Facts or for both.

@alexgarel
Copy link
Member

I like the idea of @benbenben2 because it does not require more work. It just separates usages. Until a property is added to a product type, it won't be suggested.

And API call can decide to filter or not on database type.

@CharlesNepote
Copy link
Member Author

CharlesNepote commented Apr 25, 2023

@benbenben2 @alexgarel yes this solution is quite simple, it's a bit like solution 1, but with an extra field.

it does not require more work

It does:

  • agree with the value: off, obf, opf?
  • create the field
  • manage it in API calls
  • populate it (I guess we could default to "OFF" as there are very few products related to OBF, OPF, etc.)
  • modify the front-end
  • manage the documentation of the properties: in this solution two properties with the same name could have a slightly different meanings, and the properties documentation won't make the difference. This is the most difficult part IMHO.

Solution 1 seems more simpler: we only need to modify the front-end (+ perhaps move few wiki pages). But it has the drawback to use long names, which can be different in the database and in the front-end...

@benbenben2
Copy link
Contributor

Maybe I do not get the point of the folksonomy engine.
Isn't it a tool literally for everyone?
If we impose rules and conventions based on a documentation, isn't it a risk to make it not for everyone?

@alexgarel
Copy link
Member

@benbenben2 this is the way openStreetMaps works !

(as we democratize Folksonomy Engine, we may also add some widgets for common properties)

@CharlesNepote
Copy link
Member Author

@benbenben2 like in OpenStreetMap project, everyone can create his/her own properties, but the properties are much efficient if they are also used by other people. Documenting the properties is not mandatory, but the undocumented properties get less chance to be reused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request 🎯 P0
Projects
Status: No status
Development

No branches or pull requests

3 participants