Below you can find three sample queries evaluating the ability of FATO to address competency questions relevant to the domain. The dataset used to produce the presented outputs can be found here: Sample Data
Query 1: Select products that contain allergens but they do not follow the cleaning and segregation standards required.
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix fi: <http://www.w3id.org/FATO/instances/> prefix fato: <http://www.w3id.org/FATO/> prefix gcp: <https://ns.gs1.org/gpc/> prefix gs1: <https://gs1.org/voc/> select ?productL ?allergen ?sClean ?sSegr ?cStand where { ?product fato:hasDeclaration ?faManagement; rdfs:label ?productL.
?allID fato:hasType ?allergen.
?faManagement rdf:type fato:CleaningAndSegregation; fato:specifies ?allID; fato:cleaningTimeSufficient ?sClean; fato:sufficientSegregation ?sSegr; fato:cleaningStandardsAchieved ?cStand.
Filter (!(?sClean && ?sSegr && ?cStand)) } groupby ?productL ?allergen ?sClean ?sSegr ?cStand orderby ?productL |
Output:
productL | allergen | sClean | sSegr | cStand |
Egg-Free Mayo | soy | FALSE | TRUE | TRUE |
Egg-Free Pancakes | gluten | TRUE | TRUE | FALSE |
Fruit and Nut Bar | nuts | FALSE | TRUE | TRUE |
Hazelnut Spread | nuts | TRUE | FALSE | TRUE |
Lactose-Free Milk | dairy | TRUE | FALSE | TRUE |
Nut-Free Brownies | eggs | FALSE | TRUE | FALSE |
Oatmeal Cookies | dairy | TRUE | FALSE | TRUE |
Organic Hummus | sesame | TRUE | TRUE | FALSE |
Soy Milk | soy | TRUE | FALSE | TRUE |
Soy Sauce | gluten | TRUE | TRUE | FALSE |
Query 2: Find products that contain dairy allergens but they are labeled as dairy free
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix fato: <http://www.w3id.org/FATO/> prefix gcp: <https://ns.gs1.org/gpc/> prefix gs1: <https://gs1.org/voc/> prefix fi: <http://www.w3id.org/FATO/instances/> select distinct ?productL ?hasAllergen ?labelClaim where { ?product fato:includesClaim ?lclaim; fato:contains ?all; rdfs:label ?productL. ?lclaim rdfs:label ?labelClaim. ?all fato:hasType ?hasAllergen.
FILTER REGEX(STR(?hasAllergen), ".*dairy.*", "i") FILTER REGEX(STR(?labelClaim), ".*free.*dairy.*|.*dairy.*free.*", "i")
} orderby ?productL |
Output:
productL |
Gluten-Free Muffins |
Nut-Free Chocolate Bar |
Protein Shake |
Query 3: Fetch food allergen management information about products, including their ingredients and the corresponding allergens, label claims, consumer suitability and information on any food safety plans.
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix fi: <http://www.w3id.org/FATO/instances/> prefix fato: <http://www.w3id.org/FATO/> prefix gcp: <https://ns.gs1.org/gpc/> prefix gs1: <https://gs1.org/voc/> select distinct ?gpcL (CONCAT(?productL, " [", GROUP_CONCAT(DISTINCT CONCAT(?ingL, " (", ?allL, ")"); SEPARATOR=", "), "] (", GROUP_CONCAT(DISTINCT ?claimL; SEPARATOR=", "), ") suitable for ", GROUP_CONCAT(DISTINCT ?suitableFor; SEPARATOR=", ") ) AS ?productLabel) (GROUP_CONCAT(DISTINCT CONCAT(?plan, " : ", ?cpath, " => ", ?planDetails); SEPARATOR=", ") AS ?FoodSafety) where {
?foodSafety fato:isDocumentedFor ?product; fato:HACCPplan ?plan; fato:criticalControlPathway ?cpath; fato:labelDetails ?planDetails.
?product fato:belongsTo ?gpc; rdfs:label ?productL; fato:includesClaim ?claim; fato:hasDeclaration ?ingDeclaration; fato:isSuitableFor ?cgroup.
?cgroup rdfs:label ?suitableFor. ?ingDeclaration fato:concerns ?ingredient; fato:specifies ?allergen; .
?ingredient rdfs:label ?ingL. ?allergen fato:hasType ?allL.
?gpc rdfs:label ?gpcL. ?claim rdfs:label ?claimL. } groupby ?gpcL ?productL orderby ?gpcL |
Output:
gpcL | productLabel | FoodSafety |
Bakery | Egg-Free Cookies [Wheat Flour (gluten), Butter (dairy)] (contains dairy) suitable for Vegetarians, Egg Intolerant | Baking Line : Egg Contamination => regular cleaning |
Breakfast Foods | Egg-Free Pancakes [Wheat Flour (gluten)] (contains gluten) suitable for Vegetarians, Egg Intolerant | Mixing Station : Egg Contamination => regular cleaning |
Cheese Alternatives | Cashew Cheese [Cashews (nuts)] (contains nuts) suitable for Lactose Intolerant, Vegetarians | Processing Plant : Cross-contamination => dedicated equipment |
Cheese Alternatives | Vegan Cheese [Cashews (nuts)] (contains nuts) suitable for Vegans | Processing Plant : Cross-contamination => dedicated equipment |
Chocolate | Vegan Chocolate [Soy Lecithin (soy)] (free from dairy) suitable for Vegans, Lactose Intolerant | Processing Plant : Cross-contamination => regular cleaning |
Condiments | Egg-Free Mayo [Soy Protein (soy)] (free from eggs) suitable for Vegetarians, Egg Intolerant | Mixing Station : Allergen Contamination => strict ingredient control |
Dips | Organic Hummus [Tahini (sesame)] (contains sesame) suitable for Vegetarians | Mixing Station : Microbial Growth => temperature control |
Milk | Lactose-Free Milk [Lactose-Free Milk (dairy)] (free from lactose) suitable for Lactose Intolerant | Processing Plant : Bacterial Growth => temperature control |
Milk Alternatives | Soy Milk [Soybeans (soy)] (contains soy) suitable for Vegans | Processing Plant : Bacterial Growth => temperature control |
Milk Substitutes | Almond Milk [Almonds (nuts)] (free from dairy) suitable for Lactose Intolerant | Processing Plant : Bacterial Growth => temperature control to FDA standards |
Pasta | Egg-Free Pasta [Wheat Flour (gluten)] (contains gluten) suitable for Vegetarians, Egg Intolerant | Extrusion Line : Egg Contamination => regular cleaning |
Smoothies | Spinach Smoothie [Almond Milk (nuts)] (contains nuts) suitable for Vegetarians | Processing Plant : Cross-contamination => regular cleaning |
Snacks | Vegan Protein Bar [Almonds (nuts)] (contains nuts) suitable for Vegans | Processing Line : Cross-contamination => dedicated equipment |