FoodOntology / joint-food-ontology-wg

This is a repository for documents and issues related to the development of interoperable food related ontologies.
22 stars 3 forks source link

How do we handle ingredients? #22

Open JessSing opened 3 years ago

JessSing commented 3 years ago

I'm reusing the apple pie example on the website here, but there are four aspects to ingredients:

  1. Containment claims: Apple Pie contains Apple, Flour, etc...
  2. Process: Mix a certain amount of some ingredients (Apple, Flour, ...) in a sequence and perform operations on them.
  3. Planning Requirement: Apple Pie needs a total of 3lbs of Apple and 1lb of Flour (It's a big pie).
  4. Nutrition: An Apple Pie is a good source of Apples which are a good source of Fiber, about 300 calories per slice.

The two main aspects that I'm most concerned about are numbers 1 and 3. Containment can be seen as either a claim or a measurement. For #3, we need to be able to communicate that there is a need to attain certain amounts of ingredients in order to make the recipe.

2 and 4 are useful for allergies, but 1 and 3 are needed right now and I don't have a good solution at the moment. Schema.org allows us to make claims but it doesn't give us the room to specify ingredients semantically and GS1 has a percentage based approach based on a string gs1:ingredient name (https://www.gs1.org/voc/ingredient).

Also, 1 and 4 may not match since some ingredients are created chemically like caramelan and caramelin. So is there a FoodOn doc to resolve 1 and 3? I just really need to say that Apples are used in creating apple pies.

ddooley commented 3 years ago

Hi, For some reason I didn't catch the creation of this issue weeks ago - sorry about that. I can chip in on the FoodOn front. Your questions raise for me the ontology requirement for relations attached to "apple pie" as:

While acknowledging that there are many past attempts / systems for describing recipes, FoodOn still wants a solution that works within the OBOFoundry framework of relations and entities - so we can directly benefit from RO relations, CHEBI chemicals, cutlery terms (coming soon in ENVO), NCBITaxon organisms, UO units, and of course FoodOn ingredients - a solution that tightly integrates all the biomedical and agricultural data being curated now with OBOFoundry ontologies.

Re. product: FoodOn is evolving towards two branches: single ingredient foods (which can still have elaborate preparation) under "food product by organism", and multi-component food products.

Regarding recipes, a few notes:

I will provide examples on FoodOn website of annotating a food product with nutrient measures according to OBOFoundry design principles, once the CDNO import project is complete.

Hope that helps?

oldskeptic commented 3 years ago

I just read the Recipe Model ticket and something between hasIngredient and "quantitative ingredient list" is promising to record "has 10g of peanuts as an ingredient".

It occurs to me that a lot of documentation is essentially being held within tickets. At some point, we should really start a proper document to record all of this.

FrancescoVit commented 3 years ago

I just read the Recipe Model ticket and something between hasIngredient and "quantitative ingredient list" is promising to record "has 10g of peanuts as an ingredient".

Could it be conceptually similar to "John's mass is 70kg" example in the OBI data model? (see http://obi-ontology.org/docs/data-intro/). We would be using the rightmost part of the schema.

Something like: "Apple pie" has quality (or has ingredient or has part) "peanuts (as ingredient)" [instance of peanuts?]

"10" [instance] specifies values of "peanuts (as ingredient)" [instance]

"10" [instance] has measurement unit label "grams"

(as you can see, I am still a bit uncomfortable with writing more complec axioms...)

ddooley commented 3 years ago

Of course we want something simple, but with comfort of knowing that it can be unambiguously and semantically broken down into more complex, granular semantics if desired. I turn to COB, the new joint OBOFoundry ontology, which has simple has characteristic and has quantity relations . Past OBI/IAO methods for describing measurements were a bit complicated, and confusingly overlap in axioms right now in OBI (I'm helping to sort that out). Also right now work is being done to simplify both UO unit ontology (and synchronize with OM ontology of units and measures), see https://github.com/OBOFoundry/COB/issues/35.

For now, at instance data level, lets display instances of classes in <> brackets, and use the following instances in our example:

<apple pie>                             // FoodOn
<peanut (whole, dried)>        // FoodOn
<mass>                                    // PATO
<sampling time>                     // An EFO term at moment

Then:

<apple pie> 'has ingredient' <peanut (whole, dried)>
<peanut (whole, dried)> 'has characteristic' <mass>
<mass> 'has quantity' "10.0"^^uo:gram

Slight catch is that the 'has quantity' references user defined units; An upcoming version of UO looks like it will support this and likely fully compatible with a major international unit standard syntax. Also, possibly we keep unit in a separate data property.

To say all this instance data was observed at a particular time: [edit: I changed semantic of how to attach sampling time. Issue is one could make this more complex - saying that a sampling time is about a sample which is part of some food.]

<sampling time> 'is about' <apple pie> 
<sampling time> 'has quantity' 1997-07-16T19:20+01:00^^xsd:datetime

Further history about old ways of doing this: In OBOFoundry/IAO thinking any measurement is a piece of information ABOUT some material entity, or about a quality/characteristic of an entity. The first notion was that a measurement is a datum - and usually if scalar has a value and a unit, or sometimes just a string representation (if it hasn't been parsed yet). This works out ok insofar as a mass measurement datum can be in grams or ounces, and have different numbers, and it cleanly separates them data structure wise. But then people added the abstraction of a "value specification" about a datum, which itself is about something. The value specification holds the actual measurement detail parts; this allows multiple value specifications, say in fahrenheit and celsius, for a temperature measurement datum.

ddooley commented 3 years ago

To your point about documentation, as soon as we agree on these little models / nanopublications, I will document on the FoodOn site.

oldskeptic commented 3 years ago

This is a quick follow up to the last call; there are many existing vocabularies / ontologies that define the thing being measured and/or define the measurement itself. What I'd like to understand is how those two things are linked in FoodOn since the combination of these two things is a pattern that repeats in several different use cases.

Using @ddooley 's peanut example:

<apple pie> 'has ingredient' <peanut (whole, dried)>
<peanut (whole, dried)> 'has characteristic' <mass>
<mass> 'has quantity' "10.0"^^uo:gram

implies that all apple pies have peanuts and that all peanuts weight 10 grams. In a context this may be true, but the context of Jessica's question is how does I record that this apple pie has quantity 10 grams of peanuts whereas this other apple pie has quantity 5 grams of peanuts?

Is this what foodon has in mind?

<apple pie> 'has ingredient' <peanutingredient0001>
<peanutingredient0001> 'has ingredient' <peanut (whole, dried)>
<peanutingredient0001> 'has mass' "10.0"^^uo:gram
ddooley commented 3 years ago

Just heading out, so briefly I said "lets display instances of classes in <> brackets" ... so it was an instance of apple pie that had peanuts as an ingredient, and that instance was 10 g. So no implication that any other apple pie has peanuts in it. Whether that instance of an apple pie was following a recipe that had peanuts in it is another question - for the recipes thread!

oldskeptic commented 3 years ago

Referencing schema.org ticket in this area: schemaorg/schemaorg#882