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

Missing nutrients (e.g. Polyols) #862

Open
monsieurtanuki opened this issue Jan 3, 2024 · 8 comments
Open

Missing nutrients (e.g. Polyols) #862

monsieurtanuki opened this issue Jan 3, 2024 · 8 comments

Comments

@monsieurtanuki
Copy link
Contributor

Description

cf. @CharlesNepote's openfoodfacts/smooth-app#4943
There are some nutrients in Food.pm and https://world.openfoodfacts.org/cgi/nutrients.pl?lc=fr&cc=fr that we don't deal with in off-dart: they are not in off-dart's Nutrient enum.

Expected behavior

We should be able to deal with all nutrients, at least most of them.

@monsieurtanuki monsieurtanuki self-assigned this Jan 3, 2024
@monsieurtanuki
Copy link
Contributor Author

@CharlesNepote There are 47 "nutrients" found in Food.pm that are currently not in off-dart.
For each nutrient, we need to attach a Unit (KCAL, KJ, G, MILLI_G, MICRO_G, MILLI_L, L, PERCENT).
Would you list the important nutrients you would like to see added, each with their unit?

  1. alpha-linolenic-acid
  2. arachidic-acid
  3. arachidonic-acid
  4. behenic-acid
  5. beta-carotene
  6. bicarbonate
  7. carbon-footprint
  8. carbon-footprint-from-meat-or-fish
  9. casein
  10. cerotic-acid
  11. chlorophyl
  12. cocoa
  13. collagen-meat-protein-ratio
  14. dihomo-gamma-linolenic-acid
  15. elaidic-acid
  16. energy-from-fat
  17. folates
  18. fructose
  19. fruits-vegetables-nuts
  20. fruits-vegetables-nuts-dried
  21. fruits-vegetables-nuts-estimate
  22. gamma-linolenic-acid
  23. glucose
  24. glycemic-index
  25. gondoic-acid
  26. insoluble-fiber
  27. lactose
  28. lignoceric-acid
  29. maltodextrins
  30. maltose
  31. mead-acid
  32. melissic-acid
  33. montanic-acid
  34. nervonic-acid
  35. nucleotides
  36. nutrition-score-fr
  37. nutrition-score-uk
  38. omega-9-fat
  39. ph
  40. polyols
  41. serum-proteins
  42. silica
  43. soluble-fiber
  44. starch
  45. sucrose
  46. taurine
  47. water-hardness

@CharlesNepote
Copy link
Member

@monsieurtanuki, I have investigated a little bit and, yes, all your questions' answers are in the Perl code: https://github.com/openfoodfacts/openfoodfacts-server/blob/7d295d10fcc8939cccfd093810cb0edb8a3c9449/lib/ProductOpener/Food.pm#L400

We should ask ourselves if these data shouldn't be provided as data, and not as Perl code, to let any kind of apps reuse it more easily -- a YAML file as it allows comments? Should I open a bug @stephanegigandet ?

@monsieurtanuki
Copy link
Contributor Author

@CharlesNepote Developers can already get a JSON version of it with https://world.openfoodfacts.org/cgi/nutrients.pl?lc=fr&cc=fr, easy to reuse, therefore I think we're already almost good here.
Except that the unit is missing: that would be helpful for instance to know that vitamin b12 is rather given in µg. Where does the default unit come from?

@monsieurtanuki monsieurtanuki removed their assignment Jan 11, 2024
@stephanegigandet
Copy link
Contributor

@monsieurtanuki @CharlesNepote all the nutrients and their default unit are in the nutrients taxonomy: https://github.com/openfoodfacts/openfoodfacts-server/blob/main/taxonomies/nutrients.txt

I can add the units to the output of https://world.openfoodfacts.org/cgi/nutrients.pl?lc=fr&cc=fr

@monsieurtanuki
Copy link
Contributor Author

I can add the units to the output of https://world.openfoodfacts.org/cgi/nutrients.pl?lc=fr&cc=fr

@stephanegigandet That would be nice, that's typically the unit:en: µg info that we need in the current issue.

@CharlesNepote
Copy link
Member

@monsieurtanuki
Copy link
Contributor Author

Thank you @CharlesNepote @stephanegigandet!
That means we can now add the unit into our OrderedNutrient object.

For the record, some stats about the lc=fr&cc=fr unit repartition:

  • g: 65
  • mg: 26
  • µg: 11
  • kj: 3
  • kcal: 1
  • % vol: 2 ("acidity", "alcohol") - same as % or needs to be added?
  • %: 5
  • mmol/l: 1 ("water-hardness") - needs to be added
  • empty unit: 4 (e.g for "nutriscore")

@monsieurtanuki
Copy link
Contributor Author

To be checked, added or edited in off-dart (data from lc=fr&cc=fr):

  • unit: 'kj'
    • energy-kj
    • energy-from-fat
    • energy
  • unit: 'kcal'
    • energy-kcal
  • unit: 'g'
    • fat
    • saturated-fat
    • butyric-acid
    • caproic-acid
    • caprylic-acid
    • capric-acid
    • lauric-acid
    • myristic-acid
    • palmitic-acid
    • stearic-acid
    • arachidic-acid
    • behenic-acid
    • lignoceric-acid
    • cerotic-acid
    • montanic-acid
    • melissic-acid
    • unsaturated-fat
    • monounsaturated-fat
    • polyunsaturated-fat
    • alpha-linolenic-acid
    • eicosapentaenoic-acid
    • docosahexaenoic-acid
    • linoleic-acid
    • arachidonic-acid
    • gamma-linolenic-acid
    • dihomo-gamma-linolenic-acid
    • oleic-acid
    • elaidic-acid
    • gondoic-acid
    • mead-acid
    • erucic-acid
    • nervonic-acid
    • trans-fat
    • sugars
    • added-sugars
    • sucrose
    • glucose
    • fructose
    • lactose
    • maltose
    • maltodextrins
    • starch
    • polyols
    • erythritol
    • carbohydrates
    • fiber
    • soluble-fiber
    • insoluble-fiber
    • proteins
    • casein
    • serum-proteins
    • nucleotides
    • salt
    • added-salt
    • sodium
    • beta-carotene
    • taurine
    • chlorophyl
    • carbon-footprint
    • carbon-footprint-from-meat-or-fish
    • choline
    • phylloquinone
    • beta-glucan
    • inositol
    • carnitine
    • inositol
    • carnitine
  • unit: 'mg'
    • omega-9-fat
    • omega-3-fat
    • omega-6-fat
    • cholesterol
    • vitamin-e
    • vitamin-c
    • vitamin-b1
    • vitamin-b2
    • vitamin-pp
    • vitamin-b6
    • pantothenic-acid
    • silica
    • bicarbonate
    • potassium
    • chloride
    • calcium
    • phosphorus
    • iron
    • magnesium
    • zinc
    • copper
    • manganese
    • fluoride
    • caffeine
    • sulphate
    • nitrate
  • unit: 'µg'
    • vitamin-a
    • vitamin-d
    • vitamin-k
    • vitamin-b9
    • folates
    • vitamin-b12
    • biotin
    • selenium
    • chromium
    • molybdenum
    • iodine
  • unit: '% vol'
    • alcohol
    • acidity
  • unit: '%'
    • fruits-vegetables-nuts
    • fruits-vegetables-nuts-dried
    • fruits-vegetables-nuts-estimate
    • collagen-meat-protein-ratio
    • cocoa
  • unit: 'mmol/l'
    • water-hardness
  • unit: ''
    • ph
    • nutrition-score-fr
    • nutrition-score-uk
    • glycemic-index

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants