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
GNU Affero General Public License v3.0
611 stars 358 forks source link

SS-1: GlobalChem OpenFoodFacts Connection #6814

Open Sulstice opened 2 years ago

Sulstice commented 2 years ago

Epic: GlobalChem OpenFoodFacts Connector.

Description

Hi, I maintain chemical lists of compounds relevant to diverse communities, https://github.com/Sulstice/global-chem,

I want to form a connection between common ingredients found in food and relate it to a credible source. OpenFoodFacts seem's like a good start. Do you think it would be worthwhile for our software to connect if we can write the SMILES as well for the food.

Acceptance criteria

I will build the adapter on my end but would need validation from some of the maintainers of this organization.

What would a demo look like

I will provide a feature demonstration in my codebase

Tasks

alexgarel commented 2 years ago

Hi @Sulstice thanks for the issue. I think it really belongs to https://github.com/openfoodfacts/openfoodfacts-server as this is the main repository (this repository is only the python SDK). (cc @teolemon @stephanegigandet)

I'm not sure I understand it all about your proposal (sorry), but as it seems about connecting data and helping scientist, it's sound like a good idea :grinning:.

We have an ingredient taxonomy, where we can put properties that connects to other database (for example wikidata). You could complete it with the corresponding molecule name / or formula or id on your side. If you want, the other way around, you could also connect your database to our site we also have urls for ingredients like : https://world.openfoodfacts.org/ingredient/salt - but it may be wise to keep the connection on both side.

About taxonomies see : https://wiki.openfoodfacts.org/Global_taxonomies (and this presentation

Sulstice commented 2 years ago

@alexgarel @teolemon @stephanegigandet

Wow. I have just realized what you have done. This is amazing and exactly what I was looking for. I can work with what you have given me:

Here's what I was thinking:


        smiles = {
            'siedesalz': '[Na+].[Cl-]',
            'black salt': '[Na+].[Cl-].[Na+].[O-]S([O-])(=O)=O.OS(=O)(=O)[O-].[O-]S(=O)(=O)[O-].[Fe+3]',
            'finegrained salt': '[Na+].[Cl-]',
            'himalayan salt': '[Na+].[Cl-].[K+].[Fe+3]',
            'iodised salt': '[Na+].[Cl-].[I-]',
            'kosher salt': '[Na+].[Cl-]',
            'pink salt': '[Na+].[Cl-].[K+].[Fe+3]',
            'potassium salt': '[K+].[Cl-].[I-]',
            'refined salt': '[Na+].[Cl-].[O-][Si](=O)[O-].[O-][Si](=O)[O-].[Al+3].C(=O)([O-])[O-].[Mg+2]',
            'sea salt': '[Na+].[K+].[Mg+2].[Ca+2].[Cl-]',
            'smoked salt': '[a].[Na+].[K+].[Mg+2].[Ca+2].[Cl-]',
            'sodium iodide': '[Na+].[I-]',
            'unrefined salt': '[Na+].[K+].[Mg+2].[Ca+2].[Cl-].[Zn+2].[Cu+].[Fe+3].[P]',
            'rock salt': '[Na+].[Cl-]',
        }

How does this list look to you guys?

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 90 days with no activity.

alexgarel commented 1 year ago

@Sulstice sorry for letting it stale…

Just a comment on your proposal: your id should be prefixed by the language (eg "en:black salt") because not all ids are in english in the taxonomy (some ingredients might only be used in non english speaking countries).

teolemon commented 1 year ago

@Sulstice note that we're linking all ingredients to Wikidata, which in turn is linked to all kinds of DBs including SMILES related ones

Sulstice commented 1 year ago

@alexgarel Huh, I didn't even account for that. I think I can do that programmatically, where the user can add their own prefix based on the english, maybe translating it too.

That's interesting, I am also recently connecting into wikidata as well so there's going to be a way for all of us to connect.

github-actions[bot] commented 6 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