openfoodfacts / openfoodfacts-server

Open Food Facts database, API server and web interface - đŸȘ🩋 Perl, CSS and JS coders welcome 😊 For helping in Python, see Robotoff or taxonomy-editor
http://openfoodfacts.github.io/openfoodfacts-server/
GNU Affero General Public License v3.0
657 stars 384 forks source link

SS-1: A way to connect our ingredient chemical composition database to your Open Food Facts Server #8642

Open Sulstice opened 1 year ago

Sulstice commented 1 year ago

Problem

Hi, we started recording chemical compositons to food and colour additive lists used in food in our open source chemical knowledge graph.

We recorded chemical lists of a Mango:

https://github.com/Global-Chem/global-chem/blob/development/global_chem/global_chem/food/fruits/mango/constituents_of_mango.py

Salt:

https://github.com/Global-Chem/global-chem/blob/development/global_chem/global_chem/food/salt/salt.py

And Federal Food and Drug Administration Colour Lists:

https://github.com/Global-Chem/global-chem/blob/development/global_chem/global_chem/food/color_additives/fda_list_one.py

Proposed solution

We are hoping to connect our API's somehow if people are interested in learning the chemical composition of different foods and their 1-D molecular representation.

Number of products impacted

Could be a lot if everyone can query ingredients based on the chemical composition.

Time per product

A linkage between us could take about a week of development with testing.

alexgarel commented 1 year ago

Hi @Sulstice

Of course this is of interest to us, because it can help people with rare disease.

Do you propose it as a contribution ?

Nickspizza001 commented 1 year ago

Hello @alexgarel I am Damilola from GlobalChem. That's great to hear! GlobalChem would like to contribute to OpenFoodFacts, What is any possible way to link both our data together?

alexgarel commented 1 year ago

Hi @Nickspizza001 (sorry for late reply, summer is a bit full of work !).

I don't know what @stephanegigandet, @aleene, @moon-rabbitOFF or @teolemon think, but a first way could be to add to link ingredients / additives / etc. to the id in your database in the taxonomies (see https://wiki.openfoodfacts.org/Global_taxonomies)

Also I'm not sure about the license of your database. Is MPL 2.0 the license for the data ?

Sulstice commented 1 year ago

Hi @alexgarel,

No worries, I totally get it. We can move slow, I care more that we do it correctly.

Yeah so here's an output of our knowledge graph which puts it nicely how it's organized:


               ┌tainted_sexual_enhancements
                  │       ┌exsens_products
             ┌sex─├exsens─└lube
             │    └contraceptives─oral_contraceptives
             │          ┌pihkal
             │          ├schedule_five
             │          ├schedule_three
             ├narcotics─├schedule_four
             │          ├schedule_two
             │          └schedule_one
             ├animals─snakes─drugs_from_snake_venom
             ├interstellar_space─asteroid_ryugu
             │              ┌amino_acids
             │              ├vitamins
             ├miscellaneous─├open_smiles
             │              └regex_patterns
             │                       ┌allergen_inactive_ingredients
             ├formulation─excipients─├monoclonal_antibodies
             │                       └biopharmaceutics_class_three─cimetidine_and_acyclovir
             ├warfare─organophosphorous_nerve_agents
             │                            ┌privileged_kinase_inhibitors
             │                            ├common_r_group_replacements
             ├proteins─kinases─┌scaffolds─├privileged_scaffolds
             │                 │          └iupac_blue_book
             │                 └braf─braf_inhibitors
             │            ┌alternative_jet_fuels
             ├environment─├emerging_perfluoroalkyls
             │            └chemicals_from_biomass
             │          ┌clay─montmorillonite_adsorption
             ├materials─└polymers─common_monomer_repeating_units
             │     ┌salt
             │     │             ┌mango_flavonoids
             │     │             ├mango_phytocompounds
             │     │             ├mango_fatty_acids
             │     ├fruits─mango─├mango_vitamins
             │     │             ├mango_phenolic_acids
             │     │             └mango_amino_acids
             ├food─│                ┌fda_list_one
             │     │                ├fda_list_three
             │     │                ├fda_list_two
             │     └color_additives─├fda_list_seven
             │                      ├fda_list_six
             │                      ├fda_list_four
             │                      └fda_list_five
             ├education─cengage─organic_and_inorganic_bronsted_acids
global_chem──│     ┌transdermal_and_dermal_delivery─surfactants
             ├skin─└sunscreen
             │                  ┌bidendate_phosphine_ligands─nickel_ligands
             ├organic_synthesis─├solvents─common_organic_solvents
             │                  └protecting_groups─amino_acid_protecting_groups
             │                                               ┌medical_gases
             │                                               ├anaesthetics
             │                                               ├cysticidal_medicines
             │                                               ├access_group_antibiotics
             │                                               ├antidotes
             │                                               ├watch_group_antibiotics
             │                                               ├reserve_group_antibiotics
             │                                               ├anticonvulsants
             │                    ┌world_health_organization─├opioid_analgesics
             │                    │                          ├anaphylaxis_medicines
             │                    │                          ├antifilarials
             │                    │                          ├preoperative_medicines
             │                    │                          ├intestinal_anthelminthics
             │                    │                          ├palliative_care
             │                    │                          ├non_steroidal_anti_inflammatory_medicines
             │                    │                          └antischistosomals_medicines
             │                    │             ┌hydrocarbons
             │                    │             ├proteins_glycoproteins_enzymes
             │                    │             ├nitrogenous_compounds
             ├medicinal_chemistry─│             ├alcohols
             │                    │             ├sugars
             │                    │             ├esters_and_lactones
             │                    │             ├pigments
             │                    │             ├acids
             │                    ├cannabinoids─├flavanoidglycosides
             │                    │             ├fatty_acids
             │                    │             ├constituents_of_cannabis_sativa
             │                    │             ├terpenes
             │                    │             ├steroids
             │                    │             ├ketones
             │                    │             ├aldehydes
             │                    │             ├non_cannabinoids_phenols
             │                    │             └phytocannabinoids
             │                    │         ┌electrophilic_warheads_for_kinases
             │                    ├warheads─└common_warheads_covalent_inhibitors
             │                    │      ┌iupac_blue_book_rings
             │                    ├rings─├rings_in_drugs
             │                    │      └phase_2_hetereocyclic_rings
             │                    └chinese─how_to_live_longer
             └peptides─lanthipeptides

nodes can be fetched by their literal name. For example.


from global_chem import GlobalChem
gc = GlobalChem()

gc.build_global_chem_network()
smiles = gc.get_node('mango')

Yes it is MPL 2.0 for the data. It's also got a U.S. copyright for the dictionary given to my personal name.

alexgarel commented 1 year ago

@Nickspizza001 and @Sulstice it might be a good idea to join the #taxonomies chan on our slack

aleene commented 1 year ago

Do you support links to wikidata? Links to OFF have been added to Wikidata. For me it seems a bit to much if we add other links. I rather keep things centralised on wikidata.

raphael0202 commented 1 year ago

Hello! Another approach is to link your database against Wikidata, and when we're working on project that involves using your database, we can very easily link our taxonomy against your database through Wikidata.

Sulstice commented 1 year ago

https://www.wikidata.org/wiki/Wikidata:Dataset_Imports/Chemical_Composition_of_a_Mango

How is this?

github-actions[bot] commented 10 months ago

This issue has been open 90 days with no activity. Can you give it a little love by linking it to a parent issue, adding relevant labels and projets, creating a mockup if applicable, adding code pointers from https://github.com/openfoodfacts/openfoodfacts-server/blob/main/.github/labeler.yml, giving it a priority, editing the original issue to have a more comprehensive description
 Thank you very much for your contribution to 🍊 Open Food Facts