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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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
HowToSectionelements to allow structuring the recipe into multiple parts andHowToDirectionelements 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
HowToSectionnameorheadlines: The title of the section. I'd prefernameabstract,text, ordescription: For summarizing the content or some introductory words to the section.descriptionshould 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 imagesHowToDirectionposition: Indicates the position in the list of sections and instructionsnameorheadline: 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 thematerialproperty, which can be of type Product.tool: Tools required in this stepimage: Image(s) of the stepthumbnail/thumbnailUrl: Thumnails of the imagestimeRequiredortotalTime: Timer for a step. (There is alsoprepTimeandperformTime, 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
HowToDirectionover using HowToStep is, that the former hassupplyandtoolproperties 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
cookTimeproperty 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
supplyproperty for listing ingredients, as proposed here schemaorg/schemaorg#882.Short version of JSON
Full JSON
tl;dr;
HowToSections in our JSON would allow ingredient groupingHowToDirectionfor instruction steps would allow individually definingtools,ingredients,images, andtimerswith the instruction textDo you spot any issues or have an opinion on this? :)
Beta Was this translation helpful? Give feedback.
All reactions