Food | Documentation | Ontology |
FoodOn | Documentation | Ontology |
Ingredient | Documentation | Ontology |
The functionality of the WhatToMake system can be demonstrated through the four competency questions that were devised in order to develop the ontology. Each question aims to target a specific functionality of the WhatToMake ontology, as explained below. Some questions include sample SPARQL queries, which can be run most easily by entering the queries into the public FoodKG SPARQL endpoint at https://inciteprojects.idea.rpi.edu/foodkg/#query or by loading the ontology into Protege. If you choose to use Protege., load the http://purl.org/heals/ingredient ontology by URL into Protege and execute the queries in the SPARQL Query tab. Note that the food and foodon ontology components are imported as a part of the ingredient ontology.
NOTE: The syntax of the SPARQL queries below assumes direct entry into the public FoodKG SPARQL endpoint, not Protege.
1) "What recipes contain beef?"
This question targets the ontology's ability to query the system for recipes that contain a single
incredient, beef. An example SPARQL query for this question is shown below.
PREFIX food: <http://purl.org/heals/food/>
PREFIX ingredient: <http://purl.org/heals/ingredient/>
SELECT DISTINCT ?recipe
WHERE {
?recipe food:hasIngredient ingredient:Beef .
}
2) "What recipes contain beef, carrots, and potatoes?"
This question is similar to the first, but allows for a user to specify multiple ingredients at a time. An
example SPARQL query for this question is shown below.
PREFIX food: <http://purl.org/heals/food/>
PREFIX ingredient: <http://purl.org/heals/ingredient/>
SELECT DISTINCT ?recipe
WHERE {
?recipe food:hasIngredient ingredient:Beef .
?recipe food:hasIngredient ingredient:Carrot .
?recipe food:hasIngredient ingredient:Potato .
}
3) "What recipes contain bananas that do not contain walnuts?"
This question allows a user to specify which ingredients the would like to include while also specifying
those to exclude. This kind of question is especially relevant in cases of allergies, intolerances, and
dislikes. An example SPARQL query for this question is shown below.
PREFIX food: <http://purl.org/heals/food/>
PREFIX ingredient: <http://purl.org/heals/ingredient/>
SELECT DISTINCT ?recipe
WHERE {
?recipe food:hasIngredient ingredient:Banana .
FILTER NOT EXISTS {
?recipe food:hasIngredient ingredient:Walnut .
}
}
4) "What recipes that have chicken are low in sugar?"
This question addresses the use case of accomodating nutritional-based recommendations. This kind of
question would be ideal for a diabetic user who must reduct their sugar intake. Currently, the ontology
encodes nutritional information related to sugar by using glycemic index values. An example SPARQL query
for this question is shown below.
PREFIX food: <http://purl.org/heals/food/>
PREFIX ingredient: <http://purl.org/heals/ingredient/>
SELECT DISTINCT ?recipe
WHERE {
?recipe food:hasIngredient ingredient:Chicken .
FILTER NOT EXISTS{
?recipe food:hasIngredient ?ingredient .
?ingredient food:hasGlycemicIndex ?GI .
FILTER (?GI >= 50)}
}
In order to run the above queries, we recommend one of the following options: