Changes

Jump to navigation Jump to search
3,820 bytes added ,  14:09, 12 August 2018
Line 1: Line 1:  
== Introduction ==
 
== Introduction ==
== Why? ==
+
== Why? ==  
 
Why do we need an ingredients ontology? The ontology describes how ingredients are derived from each other and how ingredients can be combined into new ingredients. An ontology might be useful to:
 
Why do we need an ingredients ontology? The ontology describes how ingredients are derived from each other and how ingredients can be combined into new ingredients. An ontology might be useful to:
 
* '''Normalise ingredients''' - Producers take a lot of freedom in describing the ingredients they use. An ontology helps to standardise the ingredients.
 
* '''Normalise ingredients''' - Producers take a lot of freedom in describing the ingredients they use. An ontology helps to standardise the ingredients.
Line 67: Line 67:  
=== Explanation ===
 
=== Explanation ===
 
* The <nowiki>#</nowiki>  describes a comment line and can be used to add a definition of the ingredient. In this case the definition is taken from wikipedia.
 
* The <nowiki>#</nowiki>  describes a comment line and can be used to add a definition of the ingredient. In this case the definition is taken from wikipedia.
* The ''<en:butter'' line describes the parent ingredient of this ingredient. The parent ingredient forms the basis of the current ingredient. This line is optional.
+
* The ''<en:butter'' line describes the parent ingredient of this ingredient. The parent ingredient forms the basis of the current ingredient. This line is optional. It implies that any properties of the parent are also valid for the child, unless a property has been redefined.
 
* The ''en:clarified butter'' line is the main name of the ingredient. Any synonyms appear after the main name, separated by comma's. The prefix ''en:'' defines the language of the main ingredient.  
 
* The ''en:clarified butter'' line is the main name of the ingredient. Any synonyms appear after the main name, separated by comma's. The prefix ''en:'' defines the language of the main ingredient.  
 
* The next lines provide translations of the main ingredient in other languages. One language per line. Each line starts with a language prefix. Thus ''de:'' means german.
 
* The next lines provide translations of the main ingredient in other languages. One language per line. Each line starts with a language prefix. Thus ''de:'' means german.
 +
 
== Categories Taxonomy==
 
== Categories Taxonomy==
 
OFF maintains a categories taxonomy to categorise products. This categories taxonomy is related to the ingredient ontology, but subtly different.
 
OFF maintains a categories taxonomy to categorise products. This categories taxonomy is related to the ingredient ontology, but subtly different.
Line 77: Line 78:     
For example the product [https://world.openfoodfacts.org/product/20139315/beurre-gastronomique-doux-milbona Beurre Gastronomique Doux] of the brand ''Milbona'' with barcode ''20139315'' has one ingredient: [https://world.openfoodfacts.org/ingredient/pasteurized-butter Beurre pasteurisé] and belongs to the [https://world.openfoodfacts.org/category/sweet-cream-butters Sweet cream butters] category.
 
For example the product [https://world.openfoodfacts.org/product/20139315/beurre-gastronomique-doux-milbona Beurre Gastronomique Doux] of the brand ''Milbona'' with barcode ''20139315'' has one ingredient: [https://world.openfoodfacts.org/ingredient/pasteurized-butter Beurre pasteurisé] and belongs to the [https://world.openfoodfacts.org/category/sweet-cream-butters Sweet cream butters] category.
 +
 +
== Maintenance ==
 +
This section described how the taxonomy file should be maintained, i.e. adding ingredients, editing ingredients, etc.
 +
 +
=== Automatic add ===
 +
Describes how automatically new ingredients can be added from the ingredients available in the OFF-database. @stephane
 +
 +
=== Add single ingredient ===
 +
An ingredient is a node in the taxonomy file, which describes a single ingredient as is found in an ingredient list.
 +
 +
==== Add ingredient name ====
 +
You can add an ingredient anywhere in the file at first. Keep a blank line between the previous and next ingredient. Add the ingredient in the format: <nowiki>LANGUAGE_CODE:MAIN_INGREDIENT_NAME, SYNONYM, SYNONYM</nowiki>.
 +
 +
Thus start by defining the ingredient name you want to add. If there are multiple ingredients names possible, decide which ingredient name will be the MAIN_INGREDIENT_NAME. The other names can be added as SYNONYM. Each ingredient name is separated by comma's.
 +
 +
Determine the language code to be used. Find your language in this [https://www.loc.gov/standards/iso639-2/php/code_list.php lang list] and add the corresponding ISO 639-1 code as LANGUAGE_CODE to your MAIN_INGREDIENT_NAME, separated by a colon (:).
 +
 +
==== Add translations ====
 +
You can add translations for an ingredient. Each translation should appear on a new line.
 +
 +
* Wikipedia translations
 +
If the ingredient exists as article in Wikipedia, you can add the translations supplied by Wikipedia. You can use the language codes used by Wikipedia (as seen in the article url). You should use the title of the articles, as this corresponds the wikipedia link and might include some disambiguation.
 +
 +
Warning: you can not add the three (or more) letter codes used by Wikipedia. OFF does not support those. However you might add them as comment lines, so we have hem for the future.
 +
 +
* Other translations
 +
It is possible to add other languages through an online dictionary. [https://www.linguee.com/ Linguee] might help you here if you speak multiple languages. But preferable this should be checked by native speakers.
 +
 +
* Untranslatable ingredients
 +
Sometimes an item can not be translated, as it just does not exist. If possible we could add a description instead.
 +
 +
==== Sort translations ====
 +
The translations should be sorted in alphabetical order of the language code.
 +
 +
An exception is the first line, that is the default language, which is used, when no translation is present.
 +
 +
==== Add corresponding wikipedia entry ====
 +
On a new line you can add the wikipedia article that corresponds the ingredient. The format to use for this line is:<br />
 +
<nowiki>Wikipedia:https://LANGUAGE_CODE.wikipedia.org/wiki/MAIN_INGREDIENT_NAME</nowiki><br />
 +
So be careful that your main ingredient name is indeed a wikipedia article. This does not always work out as such.
 +
 +
==== Add a parent ingredient ====
 +
It is possible to link ingredients based on related properties. If you can answer the question "The ingredient is a kind of other ingredient", then you can probably assign that ingredient as parent. First search if it exists already. If not then you should add the parent ingredient as well to the ontology. And add the parent ingredient in the format:
 +
<nowiki><LANGUAGE_CODE:PARENT_INGREDIENT_NAME</nowiki><br />
 +
 +
== Issues ==
 +
=== Language codes ===
 +
OFF seems to use the short ISO 639-1 [https://www.loc.gov/standards/iso639-2/php/code_list.php language codes]. The consequence is that not all languages that are found on Wikipedia can be implemented in OFF. For instance the language [https://fur.wikipedia.org/wiki/Lenghe_furlane Furlan], does not have a ISO 639-1 code, but does have a ISO 639-2 code (fur).
 +
 +
=== Disambiguation ===
 +
How should disambiguation be handled?
    
[[Category:Ingredients]]
 
[[Category:Ingredients]]
 
[[Category:Products]]
 
[[Category:Products]]
 
[[Category:Ontology]]
 
[[Category:Ontology]]
3,393

edits

Navigation menu