I am trying to determine how to mark up a Recipe
in Schema.org where the recipe has multiple sub-recipes.
For example: A Victoria Sponge might have:
Set #1: Ingredients, preparation steps, and prep/cook times for the Sponge
Set #2: Ingredients, preparation steps, and prep times for the Filling
Set #3: Ingredients, preparation steps, and prep times for the Icing/Topping
I have seen recipe examples where all the ingredients are together in a list and the instructions/steps then attempt to determine which is use at which point, but this is not really satisfactory.
Obvious approaches are: separate recipe components, or perhaps an "array" of ingredients and steps. And, I can see it ought to be possible using a HowTo
structure of steps of sub-recipes, but cannot see how.
I'd really like to see an example that has actually been tried. I am using JSON-LD, but anything that demonstrates a principle would be much appreciated!
If you need to group the ingredients per "sub-recipe", you have to provide multiple
Recipe
items, because therecipeIngredient
property is only defined for theRecipe
type.I don’t know if such a model was intended, but it seems to be possible with the specified expected values. It works if you think that a
Recipe
instruction step can be aRecipe
itself.JSON-LD example
Example explanation
The main
Recipe
has three instruction steps.ListItem
is used to give each step aposition
(so that theItemList
is ordered).The first and the last steps are
HowToStep
items. AHowToStep
is a list that can takeHowToDirection
andHowToTip
items as list entries.The second step is a
HowToSection
item.HowToSection
is a "sub-grouping of steps". Its definition gives this example, which seems to fit your case:Now, instead of representing this
HowToSection
’ssteps
again as a list ofHowToStep
items, the sub-recipe is given asRecipe
item. This is possible becausesteps
hasCreativeWork
as expected value, of whichRecipe
is a sub-type.(Note that Google’s SDTT doesn’t recognize the
HowTo
types yet. They were introduced with the current Schema.org version 3.3, which was released last month.)