Dataset Foodista
Published 7th March 2011
Updated 2nd March 2012
Resources 88717

Foodista is a community edited recipe wiki, published under a Creative Common Attribution license. The wiki contains information on foods, tools, techniques, and recipes. This data has been made machine-readable and used to populate this dataset.

Explore the dataset
Default APIs

SPARQL Endpoint

Use the SPARQL 1.1 query language to perform structured queries against a dataset. Useful for performing precise queries against a dataset whose structure you understand.

Sample queries

This query looks up the identifier (URI) of an ingredient in the Foodista dataset. The names of the foods are associated with the RDF Schema label property. Simply alter the value of the property to look-up a different food name. Names will need to be exactly matched. For fuzzier lookups, use the search API.

Query: 
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX f: <http://linkedrecipes.org/schema/> SELECT ?uri WHERE { ?uri a f:Food; rdfs:label "Grated Carrot". }
Login to test this query using our experimental API explorer Permalink to this sample query

This is a basic query that allows a list of recipes to be extracted from the dataset. The query will return at most ten results. Add an OFFSET clause to page into the dataset. Additional recipe properties can be added to filter the list.

Query: 
PREFIX dct: <http://purl.org/dc/terms/> PREFIX f: <http://linkedrecipes.org/schema/> SELECT ?uri ?title WHERE { ?uri a f:Recipe; dct:title ?title. } LIMIT 10
Login to test this query using our experimental API explorer Permalink to this sample query

This query illustrates how to find recipes that use specific ingredients. The ingredient property relates recipes to their ingredients. This query references the ingredients (in this case Carrots and Cashews) by their unique identifiers, however labels could be used instead.

The query will return the identifier, title and recipe homepage on the Foodista site for each matched recipe. This could be used to build links to Foodista to allow a user to read the recipe in detail.

Query: 
PREFIX dct: <http://purl.org/dc/terms/> PREFIX f: <http://linkedrecipes.org/schema/> PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?uri ?title ?recipePage WHERE { ?uri a f:Recipe; dct:title ?title; foaf:isPrimaryTopicOf ?recipePage; f:ingredient <http://data.kasabi.com/dataset/foodista/food/4CXZ7VHS>; f:ingredient <http://data.kasabi.com/dataset/foodista/food/CX8CMQHZ>. } LIMIT 10
Login to test this query using our experimental API explorer Permalink to this sample query

This query finds the URIs and labels of all of the foods used as ingredients.

Rather than query for all things of a particular type it queries instead for all things that are used as an ingredient in a recipe.

 

Query: 
PREFIX f: <http://linkedrecipes.org/schema/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT DISTINCT ?ingredient ?label WHERE { ?recipe a f:Recipe; f:ingredient ?ingredient; OPTIONAL { ?ingredient rdfs:label ?label } }
Login to test this query using our experimental API explorer Permalink to this sample query
Query: 
SELECT ?tool { ?tool a <http://linkedrecipes.org/schema/Tool> }
Login to test this query using our experimental API explorer Permalink to this sample query

This query returns what are the most used techniques or preparation methods (according to the Foodista community).

If you want to learn how to cook, it's better you know this stuff!

Query: 
PREFIX lr: <http://linkedrecipes.org/schema/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX dct: <http://purl.org/dc/terms/> SELECT ?method (COUNT(?method) AS ?count) ?label ?description { ?recipe lr:uses ?method . ?method a lr:PreparationMethod . ?method rdfs:label ?label . ?method dct:description ?description . } GROUP BY ?method ?label ?description ORDER BY DESC(?count) LIMIT 20
Login to test this query using our experimental API explorer Permalink to this sample query

Stuff you could get away with it.

Query: 
PREFIX lr: <http://linkedrecipes.org/schema/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX dct: <http://purl.org/dc/terms/> SELECT ?method (COUNT(?method) AS ?count) ?label ?description { ?recipe lr:uses ?method . ?method a lr:PreparationMethod . ?method rdfs:label ?label . ?method dct:description ?description . } GROUP BY ?method ?label ?description ORDER BY ASC(?count) LIMIT 20
Login to test this query using our experimental API explorer Permalink to this sample query
Query: 
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?ingredient { ?i a <http://linkedrecipes.org/schema/Food> . ?i rdfs:label ?ingredient . }
Login to test this query using our experimental API explorer Permalink to this sample query
Query: 
PREFIX lr: <http://linkedrecipes.org/schema/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX dct: <http://purl.org/dc/terms/> SELECT ?ingredient (COUNT(?ingredient) AS ?count) ?label ?description { ?recipe a lr:Recipe . ?recipe lr:ingredient ?ingredient . ?ingredient a lr:Food . ?ingredient rdfs:label ?label . ?ingredient dct:description ?description . } GROUP BY ?ingredient ?label ?description ORDER BY DESC(?count) LIMIT 20
Login to test this query using our experimental API explorer Permalink to this sample query
Query: 
PREFIX lr: <http://linkedrecipes.org/schema/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX dct: <http://purl.org/dc/terms/> SELECT ?ingredient (COUNT(?ingredient) AS ?count) ?label ?description { ?recipe a lr:Recipe . ?recipe lr:ingredient ?ingredient . ?ingredient a lr:Food . ?ingredient rdfs:label ?label . ?ingredient dct:description ?description . } GROUP BY ?ingredient ?label ?description ORDER BY ASC(?count) LIMIT 20
Login to test this query using our experimental API explorer Permalink to this sample query
Create a sample query

Search API

Perform a free-text search against the text fields indexed in a dataset. Useful when you want to quickly query a dataset but don't know, or need to know its structure. There is also a solr search endpoint allowing more complex queries.

Lookup API

Retrieve a description of a single resource. Useful for fetching the key properties and relationships of a single entity.

Reconciliation API

Useful for resolving names, labels or codes against a dataset in Kasabi to find links to more data. This API is compatible with the Google Refine tool.

How to Attribute This Dataset

Kasabi provides a quick and easy way to attribute a dataset from any webpage. We think attribution is an important community norm.

To directly embed an attribution message in a webpage, add a script tag that invokes our Attribution API as follows

<script
     type="text/javascript"
     src="http://api.kasabi.com/dataset/foodista/attribution">
</script>

If you need more flexible options, then read the Attribution API documentation

External Sources

The following external sources were used in creating or compiling this dataset
  • http://foodista.com
Contributed APIs

Bind a SPARQL 1.1 query to a parameterised URL to create a simple way to request results of a query. Custom formats can be added by applying XSLT stylesheets. Useful for creating custom APIs against datasets.

View configuration, subscription and access details

This stored procedure will pull a list of recipes where the supplied tag is defined.

Example: http://api.kasabi.com/dataset/foodista/apis/3x6?apikey=[your_key_here]&tag=diabetic - will return a list of recipes with the the tag 'diabetic'.

View configuration, subscription and access details

This stored procedure retrieves recipes containing supplied ingredient.

Example Usage:

http://api.kasabi.com/dataset/foodista/apis/7eq?apikey=<your_api_key>&ingredient=Onion&output=json

This would return recipe title, description, recipe webpage link and picture. Currently the ingredient name is case sensitive.

View configuration, subscription and access details

Shape a completely custom RESTful API against a dataset. Allows users to create completely custom APIs that are tailored for their own uses. Offers a standard XML and JSON output.

View configuration, subscription and access details

Bind a SPARQL 1.1 query to a parameterised URL to create a simple way to request results of a query. Custom formats can be added by applying XSLT stylesheets. Useful for creating custom APIs against datasets.

View configuration, subscription and access details