Data fields: Difference between revisions
(Initial version) |
(More on serving size) |
||
Line 12: | Line 12: | ||
==== Serving size ==== | ==== Serving size ==== | ||
Serving size has specific goal: to let Open Food Facts app make a proportional calculation of each nutrient per serving size. If a candy's weight is 5 g, it can be chosen as the serving size: if these candies has 66 g of sugar per 100 g, it has about 3 g per candy. | Serving size has a specific goal: to let Open Food Facts app make a proportional calculation of each nutrient per serving size. If a candy's weight is 5 g, it can be chosen as the serving size: if these candies has 66 g of sugar per 100 g, it has about 3 g per candy. [https://github.com/openfoodfacts/openfoodfacts-server/blob/f25308b7d47255be83210f699f897cba87c9517f/lib/ProductOpener/Food.pm#L3835 Allowed units] are: <code>kg, g, mg, µg, oz, l, dl, cl, ml, fl.oz, fl oz, г, мг, кг, л, дл, кл, мл, 毫克, 公斤, 毫公升, 吨</code>. | ||
<code>grammes</code>, <code>liter</code>, etc., are NOT recognized. | |||
Decimals can be written with a comma (<code>,</code>) or a point (<code>.</code>). | |||
Good: | Good: | ||
* 60 g | * <code>60 g</code> (preferred, for readability reasons) | ||
* 30g | * <code>30g</code> | ||
* <code>35G</code> | |||
* <code>90 ml</code> | |||
* <code>1L</code> | |||
Possible (while not recommanded): | |||
* <code>cookie 25g</code> | |||
* <code>One Slice (50g)</code> | |||
* <code>97 g (0.5 cup)</code> | |||
Bad: | Bad: | ||
* 30 gr | * <code>30 gr</code> => <code>gr</code> is not a correct unit | ||
* 9 candies and 2 biscuits | * <code>9 candies and 2 biscuits</code> => it's not possible to calculate a ratio because we don't know the weight of this portion | ||
* 30 | * <code>30</code> => there is no unit |
Revision as of 11:25, 13 March 2020
Data fields
A "data field" is a structured information that has at least a specific usage. For example, the "product name" field allows us to easily recognize the main name printed on the packaging.
Open Food Facts manages different kinds of data fields:
- fields that can be completed by users, such as the name of the product, the brand, etc.
- fields that are always computed by machines such as the name of the contributor or the date of the contribution
- fields that are sometimes computed based on other fields, such as the Nutri-Score, the Nova score, etc.
Fields completed by users
[to be competed]
Serving size
Serving size has a specific goal: to let Open Food Facts app make a proportional calculation of each nutrient per serving size. If a candy's weight is 5 g, it can be chosen as the serving size: if these candies has 66 g of sugar per 100 g, it has about 3 g per candy. Allowed units are: kg, g, mg, µg, oz, l, dl, cl, ml, fl.oz, fl oz, г, мг, кг, л, дл, кл, мл, 毫克, 公斤, 毫公升, 吨
.
grammes
, liter
, etc., are NOT recognized.
Decimals can be written with a comma (,
) or a point (.
).
Good:
60 g
(preferred, for readability reasons)30g
35G
90 ml
1L
Possible (while not recommanded):
cookie 25g
One Slice (50g)
97 g (0.5 cup)
Bad:
30 gr
=>gr
is not a correct unit9 candies and 2 biscuits
=> it's not possible to calculate a ratio because we don't know the weight of this portion30
=> there is no unit