Changes

Jump to navigation Jump to search
3,529 bytes removed ,  14:14, 23 February 2023
no edit summary
Line 2: Line 2:  
'''Open Food Facts''' uses multiple '''taxonomies''' for its inner workings. These taxonomies run from simple word lists with their translations, to complex hierarchies with relations between entries and attributes. The taxonomies are used to analyse and structure the information found on products.
 
'''Open Food Facts''' uses multiple '''taxonomies''' for its inner workings. These taxonomies run from simple word lists with their translations, to complex hierarchies with relations between entries and attributes. The taxonomies are used to analyse and structure the information found on products.
   −
This page gives an overview of the taxonomies and some guiding principles that are valid for all taxonomies.
+
The [[Languages taxonomy]] for instance lists the most important languages in the world, translated into these languages. The [[Ingredients taxonomy]] lists all the ingredients that OFF has discovered on food products.
   −
== Overview ==
+
This page gives an overview of the taxonomies and some guiding principles that are valid for all taxonomies. For each specific taxonomy there is a specific wikipage.
The list of taxonomies in use is:
  −
* ''Additives classes taxonomy''
  −
* ''Brands taxonomy'' for the producers of products and their corresponding brands. This taxonomy is not in use and still under construction (5-oct-2022);
  −
* ''Categories taxonomy'' used to put similar products together, so that they can be compared, averages calculated and analysed as a group. For instance an orange juice of a specific brand can be compared to all orange juices;
  −
* ''Countries taxonomy'' has a list of all countries, regions, areas, etc. in the world;
  −
* ''Ingredients taxonomy'' for ingredients found on product ingredients lists. Some specific ingredients have been put into separate taxonomies, as these need special handling due to legal requirements:
  −
** ''Additives taxonomy''
  −
** ''Allergens taxonomy''
  −
** ''Amino acids taxonomy''
  −
** ''[[Ingredients processing taxonomy]]''
  −
** ''Minerals taxonomy''
  −
** ''Nucleotides taxonomy''
  −
** ''Other nutritional substances taxonomy''
  −
** ''Vitamins taxonomy''
  −
* ''[[Labels taxonomy]]'' for every logo and claim by producer about product quality, supply chain, sourcing, diets, etc.;
  −
* ''[[Languages taxonomy]]'' with a list of world languages in multiple languages;
  −
* ''NOVA groups taxonomy''
  −
* ''Packaging/recycling taxonomies'' have been spread out over several specific taxonomies:
  −
** ''Materials taxonomy'' with a list of all possible materials that can be used;
  −
** ''Shapes taxonomy'' which describe all the packaging parts the packaging can consist of;
  −
** ''Recycling taxonomy'' with all ways packaging can be recycled;
  −
* ''States taxonomy'' which describe how complete the data of a product on OFF is;
      
== Presentations ==
 
== Presentations ==
Line 81: Line 59:     
== Implementation ==
 
== Implementation ==
Each taxonomy is implemented as simple text file.
+
Each taxonomy is implemented as simple text file. See [[Taxonomy implementation]]
   −
=== Formatting ===
+
== Maintenance ==
An example taxonomy file is presented below to illustrate the formatting.
+
Anyone can contribute to the maintenance of these taxonomies. You might want to add a translation, add synonyms, new entries or parents. Have a look at [[Taxonomy Maintenance]].
<pre>
  −
# stopwords
  −
stopwords:en: some,stopwords
  −
stopwords:fr: word,that,are,removed,when,matching
     −
# synonyms that are not field values but that are contained in field values
+
== Overview ==
synonyms:en: global, international
+
The list of taxonomies in use is (these are the files in the [https://github.com/openfoodfacts/openfoodfacts-server/tree/main/taxonomies taxonomies folder] on Github:
 
+
* ''Additives classes taxonomy''
en: value, a synonym value, another synonym value
+
* ''Brands taxonomy'' for the producers of products and their corresponding brands. This taxonomy is not in use and still under construction (5-oct-2022);
fr: valeur, une valeur synonyme, une autre valeur synonyme
+
* ''Categories taxonomy'' used to put similar products together, so that they can be compared, averages calculated and analysed as a group. For instance an orange juice of a specific brand can be compared to all orange juices;
 
+
* ''Countries taxonomy'' has a list of all countries, regions, areas, etc. in the world;
<en: value
+
* ''Ingredients taxonomy'' for ingredients found on product ingredients lists. Some specific ingredients have been put into separate taxonomies, as these need special handling due to legal requirements:
en: a child value, a synonym for a child value
+
** ''Additives taxonomy''
fr: une valeur enfant, un synonyme d'une valeur enfant
+
** ''Allergens taxonomy''
 
+
** ''Amino acids taxonomy''
<en: value
+
** ''[[Ingredients processing taxonomy]]''
en: another child value
+
** ''Minerals taxonomy''
 
+
** ''Nucleotides taxonomy''
<en: a child value
+
** ''Other nutritional substances taxonomy''
<en: another child value
+
** ''Vitamins taxonomy''
en: a grand-child value
+
* ''[[Labels taxonomy]]'' for every logo and claim by producer about product quality, supply chain, sourcing, diets, etc.;
 
+
* ''[[Languages taxonomy]]'' with a list of world languages in multiple languages;
# properties
+
* ''NOVA groups taxonomy''
en: value
+
* ''Packaging/recycling taxonomies'' have been spread out over several specific taxonomies:
fr: valeur
+
** ''Materials taxonomy'' with a list of all possible materials that can be used;
description:en: a property of value
+
** ''Shapes taxonomy'' which describe all the packaging parts the packaging can consist of;
description:fr: french version of the property
+
** ''Recycling taxonomy'' with all ways packaging can be recycled;
country_code:en: a property that is the same for all languages -> use English suffix en:
+
* ''States taxonomy'' which describe how complete the data of a product on OFF is;
wikidata:en:Q89
  −
 
  −
</pre>
  −
 
  −
==== Languages ====
  −
Each language has a 2-letter prefix. e.g. "en" for English and "fr" for French.
  −
 
  −
A value can be defined in another language (which becomes the canonical language), e.g. <code>fr:soupes-a-l-oignon</code> could be the canonical value for "Onion Soups" if we don't have an English translation yet.
  −
 
  −
New values (e.g. categories that do not exist yet) should have an English canonical value.
  −
 
  −
When a field value needs to be translated to a target language, if the translation does not exist yet, English is shown (or the canonical language if the English translation does not exist either).
      
== Ideas ==
 
== Ideas ==
 
+
If you have any ideas for taxonomies, contact us on Slack and describe a proposal on this wiki.
 
=== Draft Taxonomies ===
 
=== Draft Taxonomies ===
 
There are some ideas of creating other taxonomies:
 
There are some ideas of creating other taxonomies:
Line 135: Line 97:  
* [[Global IGP taxonomy]]
 
* [[Global IGP taxonomy]]
 
* [[Global EC marks taxonomy]]
 
* [[Global EC marks taxonomy]]
 +
* [[Diets taxonomy]]
   −
TBD: the following texts will be updated and/or placed in separate pages. @aleene 5-10-2022
+
== Access ==
 
+
The taxonomies can be viewed on Github, via the products on the website and with an API. This is detailed on a separate page:
 
+
[[Taxonomy access]].
==== Singular or plural? ====
  −
Generally, we use the plural for categories but some of them are in singular. We don't put the plural form when it has a different meaning. For example Beef and Beefs. We are talking of the meat and not the animal, so there is no "s". But "Rillettes" in french (and others languages) doesn't have a singular form.
  −
 
  −
Sometimes plural or singular depends on the language. The situation for dutch is described in [[Dutch translation issues]].
  −
 
  −
If the category is in plural form, the translations should be in the plural form.
  −
 
  −
<pre>
  −
@stephane new proposal (not yet adopted, to be discussed)
  −
In the categories taxonomy, always use the plural (en:beers, fr:bières).
  −
Then add the singular (especially if it's not a simple rule like removing the final s) in a property:
  −
singular:en:beer
  −
singular:fr:bière
  −
For the ingredients taxonomy, do the reverse:
  −
always use the singular for the main entry, and then add the plural:
  −
en:tomato
  −
plural:en:tomatoes
  −
</pre>
  −
 
  −
== Getting taxonomies files ==
  −
 
  −
=== Finding new opportunities for taxonomization ===
  −
* A good trick to find candidates for taxonomization is
  −
  * https://world.openfoodfacts.org/categories?filter=-
  −
  * https://world.openfoodfacts.org/labels?filter=-
  −
  * https://world.openfoodfacts.org/origins?filter=-
  −
  * https://world.openfoodfacts.org/ingredients?filter=-
  −
* Everything in italics is up for grabs
  −
 
  −
=== Taxonomies in JSON format ===
  −
Every taxonomy is also available as a json on OpenFoodFacts. Use
  −
* <code><nowiki>https://static.openfoodfacts.org/data/taxonomies/</nowiki><taxonomy name>.json</code>
  −
* or <code><nowiki>https://static.openfoodfacts.org/data/taxonomies/</nowiki><taxonomy name>.full.json</code> to get additional properties
  −
 
  −
Example for categories:
  −
* https://static.openfoodfacts.org/data/taxonomies/categories.json
  −
* https://static.openfoodfacts.org/data/taxonomies/categories-full.json
  −
 
  −
=== Taxonomy API ===
  −
We have a basic taxonomy API to get information about a taxonomy.
  −
 
  −
Eg. to get information about ''en:carrots'' entry in ''categories'' taxonomy:
  −
 
  −
https://world.openfoodfacts.org/api/v2/taxonomy?tagtype=categories&tags=en:carrots
  −
 
  −
you can add ''lc'' (language code) parameter to ask for more than one language. ''cc'' is used for country code.
  −
 
  −
Eg. to add french information on previous request:
  −
 
  −
[https://world.openfoodfacts.org/api/v2/taxonomy?tagtype=categories&tags=en:carrots&lc=en%2Cfr&cc=fr https://world.openfoodfacts.org/api/v2/taxonomy?tagtype=categories&tags=en:carrots&lc=en,fr&cc=fr]
  −
 
  −
== Building and deploying taxonomies ==
  −
 
  −
Changes to taxonomies on GitHub are not deployed instantly, the need to be built, deployed, and products need to be re-processed with the new taxonomy.
  −
 
  −
* [[How to build and deploy taxonomies]]
  −
 
  −
== More info ==
  −
For detailed information specific for the ingredients taxonomy see [[Project:Ingredients ontology|Ingredients Ontology]].
   
[[Category:Taxonomies]]
 
[[Category:Taxonomies]]

Navigation menu