Skip to content

add recipe shape#65

Open
tgra wants to merge 3 commits into
mainfrom
tgra/add-recipe-shape
Open

add recipe shape#65
tgra wants to merge 3 commits into
mainfrom
tgra/add-recipe-shape

Conversation

@tgra
Copy link
Copy Markdown
Member

@tgra tgra commented May 8, 2026

Type of Change

* [x] New domain file
* [ ] Update existing domain file
* [ ] Documentation only

If updating:

* [ ] New shape
* [ ] Additional constraints (non-breaking)
* [ ] New version of existing shape

Domain

Domain file: recipe.ttl
Purpose of domain: describe a recipe, with ref to [schema.org/Recipe](https://schema.org/Recipe)
Intended use cases: recipe collection app - umai by https://noeldemartin.com/ uses https://schema.org/Recipe

Shape Details

Shape name(s): RecipeShape, HowToStepShape, NutritionInformationShape

Target class / node: https://schema.org/Recipe


## Shape Change

  • [ x] New shape
  • New version of existing shape
  • Non-breaking constraint addition
  • Documentation update

Description:

---

## Immutability Confirmation

  • Existing constraints were not modified
  • Previously valid data remains valid
  • If behaviour changed, a new shape/version was introduced

---

## Examples

### Valid example

```turtle

@prefix schema: <https://schema.org/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<#recipe>
    a schema:Recipe ;
    schema:name "Best ever macaroni cheese recipe" ;
    schema:description "Creamy baked macaroni cheese with cheddar, parmesan, mustard, and a crunchy baguette topping." ;
    schema:image <https://images.immediate.co.uk/production/volatile/sites/30/2024/09/Best-ever-macaroni-cheese-19c8add.jpg?resize=700,636> ;
    schema:url <https://www.bbcgoodfood.com/recipes/best-ever-macaroni-cheese-recipe> ;
    schema:sameAs <https://www.bbcgoodfood.com/recipes/best-ever-macaroni-cheese-recipe> ;
    schema:author <https://www.bbcgoodfood.com/> ;
    schema:datePublished "2024-09-01"^^xsd:date ;

    schema:prepTime "PT10M" ;
    schema:cookTime "PT40M" ;
    schema:totalTime "PT50M" ;

    schema:recipeYield "4 servings" ;
    schema:recipeCategory "Main course" ;
    schema:recipeCuisine "British" ;
    schema:keywords "macaroni cheese, pasta bake, comfort food, vegetarian" ;
    schema:cookingMethod "Baking" ;
    schema:suitableForDiet <https://schema.org/VegetarianDiet> ;

    schema:recipeIngredient
        "500ml whole milk",
        "350g spiral pasta",
        "250g mature cheddar cheese, grated",
        "50g baguette, cut into chunks",
        "50g parmesan cheese, grated",
        "3 tbsp plain flour",
        "2 tbsp butter plus 1 tbsp melted butter",
        "1 tsp English mustard powder",
        "1 garlic clove, finely chopped" ;

    schema:recipeInstructions
        <#step1>,
        <#step2>,
        <#step3>,
        <#step4>,
        <#step5>,
        <#step6>,
        <#step7> ;

    schema:tool
        "Saucepan",
        "Baking dish",
        "Whisk",
        "Oven" ;

    schema:supply
        "Baking paper",
        "Wooden spoon" ;

    schema:nutrition <#nutrition> .

<#step1>
    a schema:HowToStep ;
    schema:position 1 ;
    schema:name "Prepare topping" ;
    schema:text "Heat the oven to 200C/180C fan/gas 6. Bake buttered baguette chunks until crisp." .

<#step2>
    a schema:HowToStep ;
    schema:position 2 ;
    schema:name "Cook pasta" ;
    schema:text "Boil the pasta for slightly less time than package instructions, then drain." .

<#step3>
    a schema:HowToStep ;
    schema:position 3 ;
    schema:name "Start sauce" ;
    schema:text "Melt butter, then cook garlic and mustard powder before stirring in flour." .

<#step4>
    a schema:HowToStep ;
    schema:position 4 ;
    schema:name "Add milk" ;
    schema:text "Gradually whisk in milk until the sauce is smooth." .

<#step5>
    a schema:HowToStep ;
    schema:position 5 ;
    schema:name "Add cheese" ;
    schema:text "Simmer until thickened, then stir in cheddar and half the parmesan." .

<#step6>
    a schema:HowToStep ;
    schema:position 6 ;
    schema:name "Assemble dish" ;
    schema:text "Mix pasta into sauce and transfer to an ovenproof baking dish." .

<#step7>
    a schema:HowToStep ;
    schema:position 7 ;
    schema:name "Bake" ;
    schema:text "Top with baguette chunks and parmesan, then bake until golden and crisp." .

<#nutrition>
    a schema:NutritionInformation ;
    schema:calories "720 calories" ;
    schema:fatContent "34 g" ;
    schema:proteinContent "32 g" ;
    schema:carbohydrateContent "68 g" ;
    schema:fiberContent "4 g" ;
    schema:sugarContent "8 g" ;
    schema:sodiumContent "780 mg" .

Invalid example


Compatibility

* [ ] Fully backwards compatible
* [ ] May cause new validation failures
* [ ] Breaking change

Explanation if needed.


Validation

* [ ] SHACL validation run
* [ ] Example data tested

Tools used:


Reviewer Checklist

* [ ] Immutability respected
* [ ] Targeting is correct
* [ ] Constraints justified
* [ ] Examples match expected behaviour

@tgra tgra requested review from jeswr and langsamu May 8, 2026 08:47
@jg10-mastodon-social
Copy link
Copy Markdown

In case it's useful, here's a previous attempt to describe how Umai uses recipe data. NoelDeMartin/umai#22

There were unresolved questions about how to use shape trees to express cross-resource and multi-shape relationships, but I understand that's out of scope here anyway.

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.

2 participants