Improving Data: Food

Posted on 02/10/2012 by

1


The Data Team have been cooking up a set of data over the past few weeks (they asked me to say that :)) all about food, which is now available. They’re working on a dataset reflecting the world of recipes from the ingredients and tools needed through to cooking techniques. This will allow people who need recipes for their websites or mobile apps to quickly get up to speed.

Food’s data are sourced from the BBC and Foodista, and the resources available in the set currently include:

  • recipes
  • foods and ingredients (i.e. an ingredient is a quantity, unit of measure, food and preparation: 500 g of carrots, julienned)
  • tools used/required for preparing a recipe
  • cooking techniques.

We point to the original source (via foaf:isPrimaryTopicOf) so, for each recipe, food, tool, technique, etc. people can see where the data comes from and go to the source if they want to.

As the dataset is updated, the Data Team will broaden the sources of food data, and increase the data quality for those passionate about food. They’ll be adding resources and improving the links between them to include things like: chefs, diets, seasonality information, and more.

Food aims to answer questions such as:

  • I fancy cooking something with “X”, but I don’t like “Y” what shall I cook?
  • I am pregnant and vegan, what should I prepare for dinner?

Ambitiously, it could also provide data to be used to aid the invention of new recipes based on the co-occurrence of ingredients.

Let’s take an example query to illustrate this (the query can be found here):

Crab Recipes

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX recipe: <http://linkedrecipes.org/schema/>

SELECT ?label ?recipe WHERE {
 <http://data.kasabi.com/dataset/food/foods/crab> recipe:ingredient_of ?recipe .
 ?recipe a recipe:Recipe .
 ?recipe rdfs:label ?label .

There are other sample queries, and if you subscribe to the dataset, you can run them within Kasabi to explore the results you can expect with your API calls. These queries can also be turned into stored procedure APIs, which let you call these results as requests. You can read more about Stored Procedures here.

Food primarily uses the Linked Recipes vocabulary, and you can see all the vocabularies and classes used on the schema page. If you’d like to get stuck in further, the Developer Documentation gives some other ideas for usage and describes how the data is modelled, and there is a getting started guide for working with Kasabi.

Because this dataset will be continuously updated, the Data Team would like hear from you—whether you have suggestions (tell us what’s missing), or if you have ideas for good sources of food data. Email me or leave a comment below, and I’ll make sure the Data Team gets your feedback!

Happy cooking.

Posted in: Datasets