Hi @Jofre Espigule-Pons! This is such a cool post, well done!
The way that I would probably approach calculating calories per item for most foods is by using an EntityInstance
of the food and using the property "AbsoluteTotalCaloriesContent". Sometimes this can give you Missing
since we don't always have every pairing hooked up of quantity and nutrition that is out there. "Items" is usually a good bet, and using "Grams" is even better if you can figure out the mass of any ingredient used. Many baking recipes will include it in the ingredient text like "1 cup (120g) flour", or you can use "AbsoluteMass" to find it like this:
EntityInstance[Entity[
"Food", {EntityProperty["Food", "FoodType"] -> ContainsExactly[{
Entity["FoodType", "Flour"]}],
EntityProperty["Food", "AddedFoodTypes"] -> ContainsExactly[{}]}],
Quantity[1, "Cups"]]["AbsoluteMass"]
Because of the way Food works, you will usually be getting an average for entities when using the type of EntityProperty["Food", ...] -> ...
constructs like above. This can lead to some inconsistencies, since various properties are generated from more or less complete sets of data. Properties that only rely on item mass will use every item mass data point, whereas properties that rely on both item mass and calories will only use data points that have both an item mass and a calorie value, so you will often be getting a value averaged from a smaller set of data points.
Below I have an example of how I would go about deconstructing these averaged values a bit, which may show you why you are getting things somewhat inconsistently or different from how you would expect.
Let me know if you have more questions or you think of anything thing else you'd like me to show you. I think you are using Food data extremely well and I'm sure I could learn some best practices from you :-)