Function Repository Resource:

WineFoodPairing

Source Notebook

Get the foods that pair well with select wines

Contributed by: Gay Wilson

ResourceFunction["WineFoodPairing"][]

gives a list of wines available in the dataset.

ResourceFunction["WineFoodPairing"][entity]

gives the food pairings for the specified wine entity.

ResourceFunction["WineFoodPairing"][wine]

gives the food pairings for the specified wine text string.

ResourceFunction["WineFoodPairing"][wine,format]

gives the food pairings for the wine text string in the specified format.

Details

WineFoodPairing[] returns the full list of 32 wines in the dataset.
The variable entity should be a wine entity from the Wolfram Knowledgebase.
The variable wine should be a text string of a wine variety. The variable wine is case-insensitive and diacritic-insensitive ("Rosé" or "rose").
WineFoodPairing["Entities"] returns the full dataset of wine-food pairings as implicit entities.
WineFoodPairing["Names"] displays the full dataset in text format.
WineFoodPairing[wine, "Entities"] returns the food pairings for the specified wine as implicit entities.
WineFoodPairing[wine, "Names"] returns the food pairings for the specified wine in text format.

Examples

Basic Examples (2) 

Get a list of the wines available in the dataset:

In[1]:=
ResourceFunction["WineFoodPairing"][]
Out[1]=

Get the food pairings for a single wine. Click the + sign in each box to open and view the food entity:

In[2]:=
ResourceFunction["WineFoodPairing"][
Entity["Food", {EntityProperty["Food", "FoodTypeGroup"] -> Entity[
    "FoodTypeGroup", "Wines"], EntityProperty["Food", "AddedFoodTypes"] -> ContainsExactly[{}], EntityProperty["Food", "Variety"] -> Entity[
    "FoodVariety", "Chardonnay"]}]]
Out[2]=
In[3]:=
ResourceFunction["WineFoodPairing"]["cabernet sauvignon"]
Out[3]=

Retrieve the full dataset of wine-food pairings as implicit entities. Click the truncated lists, such as {…3}, to view the food entities in that list:

In[4]:=
ResourceFunction["WineFoodPairing"]["Entities"]
Out[4]=

Scope (1) 

Display the full dataset in text form:

In[5]:=
ResourceFunction["WineFoodPairing"]["Names"]
Out[5]=

Options (1) 

Retrieve the food pairings for a single wine as entities (the default) or text string names:

In[6]:=
ResourceFunction["WineFoodPairing"]["cabernet sauvignon", "Entities"]
Out[6]=
In[7]:=
ResourceFunction["WineFoodPairing"]["cabernet sauvignon", "Names"]
Out[7]=

Possible Issues (1) 

For an unknown wine, a Missing result is given:

In[8]:=
ResourceFunction["WineFoodPairing"]["Beaujolais"]
Out[8]=

Neat Examples (1) 

If a specific wine is not available in the dataset, use an LLM to find a similar one:

In[9]:=
ResourceFunction["WineFoodPairing"][
 LLMFunction[
   "Choose one of these wines that best matches ``. Respond only with the wine and nothing else.
Choices:
" <> StringRiffle[ResourceFunction["WineFoodPairing"][], "\n"]][
  "Beaujolais"]]
Out[9]=

Requirements

Wolfram Language 13.0 (December 2021) or above

Version History

  • 1.0.0 – 04 December 2024

Source Metadata

Related Resources

License Information