Improved schema.org JSON structure for grouping instructions, ingredients, tools #1874
seyfeb
started this conversation in
Ideas and discussions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was doing some thinking on how the schema.org standard's structure could be used to allow users to give the recipes more structure. Related issues are
Instructions
For the instructions we could use
HowToSection
elements to allow structuring the recipe into multiple parts andHowToDirection
elements for the single steps.The sections can have their own title, description, photos and videos attached that are a general representation of the section and a list of instructions.
The instructions can come with their own photos and videos, illustrating the individual step, a list of ingredients and tools required for the step, the time required for this step which can be shown as a timer (e.g. "Cook for 20min.").
UI
This would allow for different UI ideas to be implemented:
schema.org properties
The schema.org properties I have in mind are listed below
HowToSection
name
orheadlines
: The title of the section. I'd prefername
abstract
,text
, ordescription
: For summarizing the content or some introductory words to the section.description
should be the most fittingassociatedMedia
(MediaObject): Could be used for images, videos, recipe ingredients, ...position
: Indicates the position in the list of sections and instructionsimage
: If one wants to show one or multiple general images for the sectionthumbnail
/thumbnailUrl
: Thumnails of the imagesHowToDirection
position
: Indicates the position in the list of sections and instructionsname
orheadline
: Actually, I don't think this is necessarily required. One could use Markdown in the text, but I expect that most of the time you wouldn't add another title to a single instructionsupply
: Ingredients for the instruction. However, I'm not sure how things like baking sheets, etc. would be handled. There is also thematerial
property, which can be of type Product.tool
: Tools required in this stepimage
: Image(s) of the stepthumbnail
/thumbnailUrl
: Thumnails of the imagestimeRequired
ortotalTime
: Timer for a step. (There is alsoprepTime
andperformTime
, but I think one timer should be enough for a single step. tbd. I'd vote fortotalTime
.)text
: The instructions, Markdown supportedThe advantage of using
HowToDirection
over using HowToStep is, that the former hassupply
andtool
properties which can be used for defining required ingredients and, well, tools.Example JSON
In the example below I show a non-complete (in the sense that you should not try to cook it) recipe for a lasagna as an example for the ideas above. I left out the dates, nutrition, etc. which are not important for the ideas here, but should obviously still be supported. Regarding the timers: If those where moved to the actual step where time is consumed, the main
cookTime
property could be the sum of all cook times for information purpose only and would not need to have countdown timer functionality anymore.I used the
supply
property for listing ingredients, as proposed here schemaorg/schemaorg#882.Short version of JSON
Full JSON
tl;dr;
HowToSection
s in our JSON would allow ingredient groupingHowToDirection
for instruction steps would allow individually definingtools
,ingredients
,images
, andtimers
with the instruction textDo you spot any issues or have an opinion on this? :)
Beta Was this translation helpful? Give feedback.
All reactions