Visualice la nutrición en términos de valores diarios recomendados
Wolfram Knowledgebase no sólo incluye propiedades detalladas e información nutricional para más de 37.000 "Food" y 1000 "FoodType" entidades, sino también datos de los valores diarios recomendados para 175 nutrientes. Juntos, estos conjuntos de datos extensivos permiten explorar computacionalmente el contenido nutricional de virtualmente cualquier comida, luego de forma intuitiva visualizarlos usando un simple gráfico.

EntityValue["Nutrient", "EntityCount"]

Recupere una lista de valores diarios recomendados de nutrientes con base en una dieta de 2000 calorías diarias.

allDailyValues =
Append[DeleteMissing[
EntityValue["Nutrient", "DailyValue", "EntityAssociation"]],
Entity["Nutrient", "Energy"] ->
Quantity[2000, ("LargeCalories")/("Days")]]*Quantity[1, "Days"]

Mapee las propiedades de alimentos con los nutrientes.

propertyNutrientRules = {EntityProperty["Food",
"AbsoluteSodiumContent"] -> Entity["Nutrient", "Sodium"],
EntityProperty["Food", "AbsoluteTotalCarbohydratesContent"] ->
Entity["Nutrient", "TotalCarbohydrates"],
EntityProperty["Food", "AbsoluteTotalFatContent"] ->
Entity["Nutrient", "TotalFat"],
EntityProperty["Food", "AbsoluteTotalFiberContent"] ->
Entity["Nutrient", "DietaryFiber"],
EntityProperty["Food", "AbsoluteIronContent"] ->
Entity["Nutrient", "Iron"],
EntityProperty["Food", "AbsoluteTotalCaloriesContent"] ->
Entity["Nutrient", "Energy"]};
Codifique un desayuno típico usando EntityGroup y EntityInstance.

breakfast = EntityGroup[{
EntityInstance[Entity[
"Food", {
EntityProperty["Food", "CookingMethod"] -> Entity[
"CookingMethod", "HardBoiled"],
EntityProperty["Food", "FoodType"] -> ContainsExactly[{
Entity["FoodType", "Egg"]}],
EntityProperty[
"Food", "AddedFoodTypes"] -> ContainsExactly[{}]}],
Quantity[2, "Servings"]],
EntityInstance[Entity[
"Food", {EntityProperty["Food", "FoodType"] -> ContainsExactly[{
Entity["FoodType", "Bacon"]}],
EntityProperty[
"Food", "AddedFoodTypes"] -> ContainsExactly[{}]}],
Quantity[3, "Slices"]],
EntityInstance[Entity[
"Food", {EntityProperty["Food", "FoodType"] -> ContainsExactly[{
Entity["FoodType", "HashBrown"]}],
EntityProperty[
"Food", "AddedFoodTypes"] -> ContainsExactly[{}]}],
Quantity[1, "Servings"]],
EntityInstance[Entity[
"Food", {EntityProperty["Food", "FoodType"] -> ContainsExactly[{
Entity["FoodType", "OrangeJuice"]}],
EntityProperty[
"Food", "AddedFoodTypes"] -> ContainsExactly[{}]}],
Quantity[2, "Servings"]]
}];
Construya un "gráfico tipo brújula" mostrando hexágonos radialmente anidados indicando 50%, 100% (marcados en verde), y 150% de los valores diarios recomendados para seis nutrientes principales.

compassPlot[breakfast]

Especifique el almuerzo y la cena además del desayuno.

lunch = EntityGroup[{
EntityInstance[Entity[
"Food", {EntityProperty["Food", "FoodType"] -> ContainsExactly[{
Entity["FoodType", "PeanutButter"]}],
EntityProperty[
"Food", "AddedFoodTypes"] -> ContainsExactly[{}]}],
Quantity[2, "Tablespoons"]],
EntityInstance[Entity[
"Food", {EntityProperty["Food", "FoodType"] -> ContainsExactly[{
Entity["FoodType", "Bread"]}],
EntityProperty[
"Food", "AddedFoodTypes"] -> ContainsExactly[{}]}],
Quantity[2, "Slices"]],
EntityInstance[Entity[
"Food", {EntityProperty["Food", "FoodType"] -> ContainsExactly[{
Entity["FoodType", "Jelly"]}],
EntityProperty[
"Food", "AddedFoodTypes"] -> ContainsExactly[{}]}],
Quantity[1, "Servings"]]
}];

dinner = EntityGroup[{
EntityInstance[Entity[
"Food", {EntityProperty["Food", "FoodType"] -> ContainsExactly[{
Entity["FoodType", "Spaghetti"]}],
EntityProperty[
"Food", "AddedFoodTypes"] -> ContainsExactly[{}]}],
Quantity[1, "Servings"]],
EntityInstance[Entity[
"Food", {EntityProperty["Food", "FoodType"] -> ContainsExactly[{
Entity["FoodType", "Meatball"]}],
EntityProperty[
"Food", "AddedFoodTypes"] -> ContainsExactly[{}]}],
Quantity[3, "Items"]],
EntityInstance[Entity[
"Food", {
EntityProperty["Food", "BrandName"] -> Entity[
"FoodBrandName", "Bertolli"],
EntityProperty["Food", "FoodType"] -> ContainsExactly[{
Entity["FoodType", "Sauce"]}],
EntityProperty[
"Food", "AddedFoodTypes"] -> ContainsExactly[{}]}],
Quantity[1.5, "Servings"]],
EntityInstance[Entity[
"Food", {
EntityProperty["Food", "Flavor"] -> Entity[
"FoodFlavor", "Cola"],
EntityProperty["Food", "FoodType"] -> ContainsExactly[{
Entity["FoodType", "CarbonatedBeverage"]}],
EntityProperty[
"Food", "AddedFoodTypes"] -> ContainsExactly[{}]}],
Quantity[1, "USSodaCanVolumes"]]
}];
Visualice la cobertura nutricional en incrementos después de cada comida.
