Skip to content

Conversation

@MatthiasWiesmann
Copy link
Contributor

@MatthiasWiesmann MatthiasWiesmann commented Dec 30, 2025

@alex-jansen alex-jansen merged commit ebe73db into main Dec 30, 2025
2 checks passed
@MatthiasWiesmann MatthiasWiesmann deleted the b_4666_allow_diet branch December 30, 2025 15:20
@fthobe
Copy link
Contributor

fthobe commented Dec 30, 2025

Could you add samples?

@alex-jansen
Copy link
Contributor

Before I create a PR with an example, does the snippet below give a good idea of the intention? (the key here is the use of the sameAs property to link to one or more web pages with an official definition of the specific named diet (the description property under Diet is optional and I just added it for illustration)

{
  "@context": "https://schema.org",
  "@type": "Recipe",
  "name": "Avocado panzanella",
  "image": "https://wwww.examplemenus.com/avopan.jpg",
  "description": "A simple recipe for a quick and easy meal with avocado.",
  "suitableForDiet": [
    {
      "@type": "Diet",
      "name": "Vegan",
      "description": "A plant-based eating pattern that excludes all foods derived from animals",
      "sameAs": [
        "https://www.nhs.uk/live-well/eat-well/how-to-eat-a-balanced-diet/the-vegan-diet/",
        "https://en.wikipedia.org/wiki/Veganism",
        "https://snomed.info/sct/24930006"
      ],
      "code": {
        "@type": "MedicalCode",
        "codeValue": "24930006",
        "codingSystem": "SNOMED-CT"
      }
    },
    {
      "@type": "Diet",
      "name": "Mediterranean",
      "description": "Diet based on the traditional eating habits of people in countries bordering the Mediterranean Sea.",
      "sameAs": "https://en.wikipedia.org/wiki/Mediterranean_diet"
    }
  ]
}

As far as I understand there is no "official" dictionary (for example, maintained by a government or health organization) with Diet codes that can be referenced. The best I found is some diets that are specified as medical (SNOMED) codes . I illustrated that as well above for Vegan diet to show how official codes for diets can be added if available. One additional thing we can do here is allow DefinedTerm as value for the code property to reference other authoritative well-defined and non-medical external enumerations of Diets, but only if these are available.

@TechHappyNZ and @fthobe based on #3176

@fthobe
Copy link
Contributor

fthobe commented Jan 2, 2026

Here's what I'd do:

  • there are some diet types defined in gs1, I'd actually provide content parity with them as it seems extremely low hanging fruit, it might one day be handy for recipies and also food / grocery shopping applications, gs1 made the template, I would only migrate the missing ones over into the current diet set (which seems to derive from there anyway)

  • everything else be left to custom implementation citing external standards like you suggested

The reasoning behind that:

  • all gs1 labels are commercially established for any boxed food, why not keep them as most of them are already in the enum and only few are missing and they do seem to cover the majority of lifestyle diet related searches (low carb, keto, low fat,...)
  • i understand what Matthias pointed out (schema.org is not a nutrition content platform), so for all non gs1 purposes i think what you suggested is brilliant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants