Swiss Food Knowledge Graph (SwissFKG)
- SwissFKG is a unified nutrition knowledge graph that consolidates Swiss recipes, ingredient-level data, allergen information, and dietary guidelines.
- It uses a Graph-RAG architecture combined with LLM-powered enrichment to enable context-aware dietary assessments and substitution suggestions.
- The system integrates Swiss-specific datasets such as the Swiss FCDB, national allergen regulations, and multilingual recipes to support personalized nutrition recommendations.
The Swiss Food Knowledge Graph (SwissFKG) is a food and nutrition knowledge graph centered on Switzerland that unifies Swiss recipes with ingredient-level nutrient profiles, ingredient substitutions, allergen information as defined by Swiss law, dietary restrictions, and Swiss Food Pyramid categories and national nutrition guidelines under one graph. It was introduced as, to the authors’ knowledge, the first resource to unite recipes, ingredients, and their substitutions with nutrient data, dietary restrictions, allergen information, and national nutrition guidelines in a Swiss context, with the stated goals of providing a centralized, structured repository for nutrition-related information, enabling context-aware personalized nutrition recommendation, and serving as a reliable knowledge base for AI systems and automatic dietary assessment pipelines (Rahman et al., 14 Jul 2025).
1. Historical and conceptual position
SwissFKG emerged in response to a problem that food knowledge-graph research had already identified at a broader level: food data are generated by nutrition tables, food compositional databases, recipes, menus, health data, IoT streams, and social media, yet these resources remain fragmented as information silos. In that literature, a knowledge graph is understood as a multi-relational graph of data in which nodes denote entities and edges denote typed relations, typically represented as RDF subject–predicate–object triples and governed by ontologies in OWL or RDFS (Min et al., 2021). SwissFKG adopts that general food-KG rationale but specializes it to the Swiss setting, where relevant nutrition information exists but is spread across many sources and no centralized repository had integrated all relevant nutrition-related aspects within a Swiss context (Rahman et al., 14 Jul 2025).
Its immediate motivation was methodological as much as infrastructural. The system was framed against three shortcomings of existing automatic dietary assessment and recommendation tools: fragmented Swiss data, over-reliance on visual cues, and lack of context and personalization. The paper specifically notes that image-based dietary assessment cannot observe internal composition of layered foods or ingredient substitutions in home cooking, and states that this can produce dangerous errors, including in insulin dosing for diabetics. It also emphasizes that many systems ignore allergies, intolerances, cultural food practices, religious or ethical dietary restrictions, and personal preferences, while off-the-shelf LLMs are trained on noisy web-scale data, can hallucinate or give unsafe advice, and rarely align to specific national guidelines or allergen regulations (Rahman et al., 14 Jul 2025).
Within the broader semantic-food landscape, SwissFKG occupies the niche of a nationally focused, integrative knowledge graph. Review work on food data in the Semantic Web describes this general class of system as a hub linking national food composition resources, recipes, ontologies such as FoodOn, clinical terminologies such as SNOMED CT, and specialized resources for chemicals, food–disease relations, and food–drug interactions (Sasanski et al., 31 Aug 2025). SwissFKG’s Swiss specificity lies in its use of Swiss Food Composition Database data, Swiss allergen regulation, Swiss Food Pyramid categories, multilingual recipe sources, and an explicit focus on Swiss cuisine, seasonal patterns, and nationally grounded recommendations (Rahman et al., 14 Jul 2025).
2. Graph model, ontology, and Swiss-specific schema
SwissFKG is implemented as a property/labelled graph; the paper does not describe it as RDF-based at the schema level, although its Graph-RAG layer stores graph content as triples of the form (subject, predicate, object) with properties on nodes and edges (Rahman et al., 14 Jul 2025). The core node types are Recipe, Instruction, Ingredient, CompositeSubstitute, DietRestriction, Season, Cuisine, Utensil, AllergenCategory, and SwissFoodPyramidCategory. Recipe nodes include properties such as id, name, description, macro-nutrient info, and keywords. Instruction nodes hold step-level text and links to ingredients used in that step. Ingredient covers ordinary ingredients, substitute ingredients, and ingredients used in composite substitutes, with properties including name, canonical form, nutrient values from Swiss FCDB or USDA, and GI where available. CompositeSubstitute represents multi-ingredient substitutes such as replacing cream with a mix of milk and starch (Rahman et al., 14 Jul 2025).
The relation vocabulary is correspondingly fine-grained. Recipe --CONTAINS--> Ingredient edges carry quantity, unit, and preparation notes. Instruction --USES--> Ingredient records ingredient usage at the step level, and Recipe --HAS--> Instruction links recipes to stepwise instructions. Dietary compliance is represented by Recipe/Ingredient --IS_SUITABLE_FOR--> DietRestriction. Swiss allergen law is captured with Ingredient --ALLERGEN_OF--> AllergenCategory, and Swiss Food Pyramid membership with Ingredient --CLASSIFIED_AS--> SwissFoodPyramidCategory. Substitution structure is modeled by Ingredient --SUBSTITUTED_BY--> Ingredient, Ingredient --HAS_COMPOSITE_SUBSTITUTE--> CompositeSubstitute, and CompositeSubstitute --COMPOSED_OF--> Ingredient, with ratios, quantities, and notes stored on the relevant edges (Rahman et al., 14 Jul 2025).
Swiss-specific modeling is explicit rather than incidental. Nutrient data are drawn from the Swiss FCDB; allergen groups come from Swiss OIDAl Annex 6; food groups come from the Swiss Food Pyramid; recipes were collected from Swiss culinary websites; and the multilingual setting is reflected in original recipe text in German, French, and Italian, translated to English but stored as multilingual content. Cuisine tagging includes “Swiss” alongside other cuisines, while seasonal suitability is modeled through four Season nodes: Spring, Summer, Autumn, and Winter (Rahman et al., 14 Jul 2025).
The graph statistics reported for the initial release quantify that schema at instance level:
| Component | Count |
|---|---|
| Nodes | 5,896 |
| Edges | 62,499 |
| Recipes | 1,000 |
| Ingredients | 2,548 |
| Instructions | 2,176 |
| Utensils | 91 |
| Cuisines | 21 |
| Allergen categories | 14 |
| Swiss Food Pyramid categories | 9 |
The node breakdown additionally reports DietRestriction: 19, CompositeSubstitute: 14, and Season: 4. The text elsewhere describes DietRestriction as “18 types based on WHO dietary restrictions infographic,” so the paper presents both an 18-type conceptual description and a 19-node graph count without reconciling them (Rahman et al., 14 Jul 2025). Among the 1,000 recipes, 893 contain ingredients that are allergens; 584 are vegetarian-friendly; 467 are gluten-free; more than 500 are suitable for religious restrictions; and more than 300 are low/free lactose. The most frequent ingredients are salt, pepper, olive oil, water, and sugar; the most frequent allergens are category 7 (milk/dairy), category 1 (gluten), and category 8 (nuts) (Rahman et al., 14 Jul 2025).
3. Data sources and the LLM-powered enrichment pipeline
SwissFKG was assembled from four main source families: Swiss recipes, nutrition databases, a substitution database, and guidelines and regulations. The recipe corpus comprises approximately 1,000 recipes crawled from “well-known Swiss culinary websites,” followed by manual cleaning to remove invalid ingredients, missing instructions, and duplicate recipes. Some recipes share a name but differ in content, and each such recipe receives a unique ID. Before graph loading, recipes were normalized into a custom JSON schema containing recipe-level macro-nutrition where available, ingredients, utensils, instructions, seasons, cuisines, keywords, and tags (Rahman et al., 14 Jul 2025).
The nutritional backbone combines the Swiss Food Composition Database, containing 1,146 food items commonly consumed in Switzerland, with USDA FoodData Central, containing more than 10,000 items used as fallback when no Swiss FCDB match exists. Glycemic index values were added from FoodStruct, which provides GI for 615 items. Ingredient substitutions were imported from FoodSubs, which offers substitution options for 3,177 unique ingredients. Regulatory and guideline data include Swiss allergen regulation under OIDAl Annex 6, the Swiss Food Pyramid, and the WHO dietary restrictions infographic used as the basis for dietary-restriction categories (Rahman et al., 14 Jul 2025).
Population and enrichment of the graph were performed with a semi-automated LLM pipeline using four open models under 70B parameters: Gemma3 (27B), Mistral Small 3.2 (24B), Phi-4 (14B), and Qwen3 (30B-A3B). All were served via Ollama with temperature , fixed seed, context tokens, top-p , top-k , thinking mode disabled for models that support it, Chain-of-Thought prompting in the system prompts, and JSON-constrained output formats with examples in the prompt. Approximately 10% of the data—100 recipes and 200 ingredients—were hand-annotated as ground truth for evaluation (Rahman et al., 14 Jul 2025).
The enrichment pipeline includes translation, ingredient text splitting, ingredient-to-nutrient alignment, dietary-restriction and allergen classification, Swiss Food Pyramid mapping, and substitution ingestion. For non-English recipe translation, evaluation used COMET (wmt22-comet-da). Gemma3 achieved the best overall results with COMET scores of 0.8061 for names, 0.8376 for instructions, and 0.8761 for ingredients, and was therefore chosen as the translation model. For ingredient text splitting and normalization, evaluated with Ratcliff–Metzener similarity, Gemma3 again performed best at 0.9578, ahead of Phi-4 at 0.9197, Qwen3 at 0.9178, and Mistral Small 3.2 at 0.8628 (Rahman et al., 14 Jul 2025).
Ingredient matching to Swiss FCDB, USDA, and FoodSubs entries was performed by direct string match where possible and otherwise by embeddings-based cosine similarity,
Among the tested embedding models, Mxbai Embed Large obtained the highest accuracy at 0.66, followed by All MiniLM 33M at 0.64 and Nomic Embed at 0.61. The authors note that All MiniLM often produced correct matches but low similarity scores below 0.5, implying a tight embedding space and difficulty in thresholding (Rahman et al., 14 Jul 2025).
Classification quality varied by task. For allergen mapping, Mistral Small 3.2 achieved the best score at 0.947; Gemma3 scored 0.923, Qwen3 0.912, and Phi-4 0.810. For Swiss Food Pyramid categories, Phi-4 performed best at , with Mistral at 0.795, Gemma3 at 0.78, and Qwen3 at 0.765. For dietary restrictions, Mistral Small 3.2 again led at , followed by Phi-4 at 0.803, Gemma3 at 0.794, and Qwen3 at 0.790. The most persistent error patterns occurred when no label should have been assigned, such as “icing sugar” being incorrectly marked as a gluten allergen, and in the “diabetic diet” label, which had 61–74% error and is explicitly described as the hardest dietary-restriction label because of the lack of standardized diabetic-diet rules and high context dependence in real-world guidelines (Rahman et al., 14 Jul 2025).
4. Graph-RAG, nutritional reasoning, and context-aware recommendation
SwissFKG is primarily a structured data layer; reasoning and recommendation are delegated to LLMs using Graph-RAG. Within the graph, nutrient values are linked to each ingredient from Swiss FCDB or USDA, GI values are included for many ingredients from FoodStruct, dietary restrictions are represented through Ingredient --IS_SUITABLE_FOR--> DR and Recipe --IS_SUITABLE_FOR--> DR, allergens are represented through Ingredient --ALLERGEN_OF--> AllergenCategory, Swiss Food Pyramid groupings through Ingredient --CLASSIFIED_AS--> [SFP](https://www.emergentmind.com/topics/sparse-functional-programming-sfp) Category, and substitutions through direct and composite substitution edges. This allows a Graph-RAG agent to filter recipes whose suitability edges match a user’s dietary restrictions, exclude recipes containing allergens that intersect a user profile, propose modifications via substitution edges, and reason about Swiss Food Pyramid alignment or diabetic needs via GI (Rahman et al., 14 Jul 2025).
The Graph-RAG pipeline is defined in four stages: knowledge representation, graph embeddings, query handling, and answer generation. Graph content is stored as triples such as (Recipe:ApplePie, CONTAINS, Ingredient:Apples), with node and edge properties preserved. Queries are embedded and matched against graph embeddings using cosine similarity with a cutoff of 0.5. The LLM extracts key concepts, keywords, and synonyms from the query, candidates are retrieved and re-ranked, and the top 10 relevant items are retained to fit the context window. Answer generation then uses the retrieved graph snippets, including triples and properties, as prompt context for natural-language synthesis (Rahman et al., 14 Jul 2025).
Evaluation used 50 curated questions derived from the graph and compared two LLMs—Gemma3 (27B) and Mistral Small 3.2 (24B)—with three embedding models. Final QA accuracy was defined as
so an answer was counted correct if the expected answer was contained within the generated answer. Gemma3 combined with All MiniLM 33M achieved 0.64 accuracy, with Nomic Embed 0.72, and with Mxbai Embed Large 0.80, the best overall result. Mistral Small 3.2 achieved 0.66 with All MiniLM 33M, 0.74 with Nomic Embed, and 0.76 with Mxbai Embed Large. The paper emphasizes that embedding choice had large impact: for Gemma3 the gap between best and worst embeddings was 16 percentage points, and for Mistral Small 3.2 it was 10 points. With All MiniLM 33M, no knowledge was retrieved for eight questions under Gemma3 and 13 under Mistral Small 3.2, highlighting retrieval failures (Rahman et al., 14 Jul 2025).
This Graph-RAG positioning places SwissFKG within a broader methodological line in food AI. Separate work had already formulated food recommendation as constrained KBQA over a large-scale food knowledge graph, integrating ingredient inclusion and exclusion, nutrient bounds, user preferences, and health guidelines into a unified constraint model (Chen et al., 2021). More recent KG-augmented LLM systems such as KERL retrieve subgraphs with SPARQL, serialize recipe-centered neighborhoods, and use LoRA-adapted LLMs for recommendation, recipe generation, and nutritional analysis (Mohbat et al., 20 May 2025). SwissFKG differs by centering a Swiss national corpus and a Swiss regulatory frame, but its Graph-RAG design is directly consonant with those architectures (Rahman et al., 14 Jul 2025).
5. Empirical profile, implementation status, and limitations
SwissFKG’s empirical profile is defined less by downstream recommendation accuracy than by the quality of its enrichment and retrieval pipeline. Translation scores around 0.80–0.88, ingredient text-splitting similarity near 0.96, allergen up to 0.947, dietary-restriction 0 up to 0.868, Swiss Food Pyramid mapping 1 up to 0.8, ingredient matching accuracy up to 0.66, and Graph-RAG QA accuracy up to 0.80 together establish the initial system as a workable but still partially noisy infrastructure rather than a finalized authoritative registry (Rahman et al., 14 Jul 2025).
The paper is explicit about its limitations. Only open-source, non-domain-specific LLMs up to approximately 30B were tested; domain-specific fine-tuning was not applied. Current metrics—COMET, character similarity, 2, cosine-based matching accuracy, and answer-inclusion accuracy—do not capture hallucination frequency, semantic drift, or long-term consistency of the graph schema. Evaluation coverage is limited to roughly 10% labeled ground truth. LLMs sometimes violate prompt instructions and make unjustified assumptions, and diabetic dietary-restriction mapping is singled out as particularly unreliable. Static dense embeddings with a fixed cosine threshold can fail outright in retrieval. The authors therefore call for human-in-the-loop validation, especially for low-confidence or novel mappings (Rahman et al., 14 Jul 2025).
Implementation details further delimit the current status. Experiments ran on an NVIDIA RTX A6000 GPU. LLMs and embedding models were served through Ollama 0.9.0. The paper deliberately treats the graph at a conceptual level and does not specify the underlying graph database or query language, nor does it provide an official GitHub or Zenodo release. It explicitly states that there is no statement in the paper that SwissFKG or its code is publicly available (Rahman et al., 14 Jul 2025).
These caveats matter because food-domain GraphRAG systems can appear more authoritative than their evidence warrants. Related work on visual analytics for food-science GraphRAG systems has shown that human verification remains necessary, that retrieval of irrelevant or conflicting graph data can still yield erroneous answers, and that experts can use such interfaces not only to verify LLM responses but also to identify inaccuracies within the underlying knowledge graph itself (Lee et al., 8 Jun 2026). SwissFKG’s own emphasis on expert oversight is consistent with that broader finding (Rahman et al., 14 Jul 2025).
6. Broader significance and likely development paths
SwissFKG’s main significance lies in how it bridges visual, contextual, nutritional, and regulatory dimensions of diet within one structured substrate. The paper frames it as going beyond recipe recommendations by offering ingredient-level information such as allergen and dietary-restriction information, substitutions, and guidance aligned with nutritional guidelines. This makes it relevant to automatic dietary assessment, personalized meal planning, support for diabetics and other patients, and public-health tools promoting adherence to national recommendations. It is also presented as a building block toward a future global Food Knowledge Graph (Rahman et al., 14 Jul 2025).
Its design also fits naturally within broader patterns in food knowledge engineering. Review literature recommends FoodOn as the semantic backbone for national food KGs, alignment to SNOMED CT and EuroFIR-compatible vocabularies for clinical and European interoperability, and linking of national nutrient databases, recipes, products, chemistry resources, and health interaction datasets into a coherent semantic ecosystem (Sasanski et al., 31 Aug 2025). SwissFKG’s current graph is not yet RDF-first, but its entity types, multilingual alignment needs, and Graph-RAG use already make those interoperability questions structurally central (Rahman et al., 14 Jul 2025).
Several plausible development paths are explicitly suggested by adjacent research rather than claimed as already implemented. Work on FKG.in shows how a national food KG can become application-agnostic infrastructure spanning recipes, ingredients, cooking characteristics, cuisines, mealtimes, nutrition, diet labels, allergen labels, and later links to agriculture, geography, and health (Gupta et al., 2024). The food-composition extension of FKG.in demonstrates an architecture in which a consolidated food composition table, a dietary measurement ontology, and LLM-based information resolution jointly compute recipe-level nutrient profiles and feed them back into the graph (Gupta et al., 2024). A traceability-oriented extension of FKG.in models food claims, their sources, contexts, and validating evidence as a claim layer over a national food KG (Gupta et al., 22 Aug 2025). None of these systems is SwissFKG, but together they indicate technically plausible directions for SwissFKG’s expansion.
The Swiss setting also offers concrete adjacent resources. FoodRepo, an open repository of barcoded food items mostly sold in Switzerland, reports more than 21,000 items on the Swiss market, with product IDs, barcodes, names, quantities, ingredients, nutrient values, timestamps, and image URLs, and is described as a solid starting point for large-scale studies in digital nutrition (Lazzari et al., 2018). SwissFKG does not claim to integrate FoodRepo, yet the availability of a large Swiss product repository suggests a direct route toward richer branded-product coverage, provided provenance and mapping quality are maintained. More generally, the literature on food knowledge graphs repeatedly identifies multimodal integration, data quality and completeness, interoperability, privacy, cultural specificity, and dynamic adaptation as the major challenges for the next generation of food KGs (Min et al., 2021).
Taken together, SwissFKG is best understood as an initial national food knowledge infrastructure: Swiss-specific in data sources and regulatory grounding, graph-centric in representation, LLM-assisted in enrichment, and Graph-RAG-oriented in downstream use. Its current contribution is the consolidation of recipes, substitutions, nutrient data, allergen categories, dietary restrictions, and national guidelines into one operational graph. Its long-term importance depends on the quality of curation, interoperability with broader semantic food resources, and the robustness of the verification mechanisms layered on top of it (Rahman et al., 14 Jul 2025).