recipe-brainstorming: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
m (Added concern about multi-step methods and split ingredient lists)
Line 287: Line 287:
* '''License''': optional. [[rel-license]].
* '''License''': optional. [[rel-license]].


=== Issues ===
=== Discussion ===
{{OpenIssue}} <code>entry-title</code> and <code>entry-summary</code> are not always semantically right and may not be good class names.
* <code>entry-title</code> and <code>entry-summary</code> are not always semantically right and may not be good class names.
* <code>title</code> and <code>summary</code> already used for a different purpose (in [[hCard]] and [[hCalendar]]/[[hReview]]/[[hListing]]). [[accepted-limitations-of-microformats#Microformat_Namespacing_Issue More | Read more]].
** <code>title</code> and <code>summary</code> already used for a different purpose (in [[hCard]] and [[hCalendar]]/[[hReview]]/[[hListing]]). [[accepted-limitations-of-microformats#Microformat_Namespacing_Issue More | Read more]].
* <code>recipe-title</code> and <code>recipe-summary</code> suggested.
** <code>recipe-title</code> and <code>recipe-summary</code> suggested.
* The 'photo' property should be usable for elements containing the element <code><img></code>.
** This format reuses the 'photo' property of [[hCard]] so we can't change the way it is parsed in the recipe format without also changing the way it is pased in hCard ([[hcard#Human_vs._Machine_readable|Human_vs._Machine_readable]]). This is an hCard problem and should not be discussed here.


== See Also ==
== See Also ==

Revision as of 20:25, 24 June 2008

Recipe Brainstorming

Towards a Recipe microformat. Please read the process before editing this page.

Format-In-Progress

This format-in-progress follows the restarting of Recipe development by Frances Berriman on 25th September 2007. Note that this Format-In-Progress section is intended to be edited to reflect the discussion that occurs on the microformats-new list, rather than being a free-form playground for schema.

Editors
Ben Ward (Yahoo!, Inc.)
Frances Berriman (BBC)

Introduction

Recipe is based on examples and fields in existing formats.

The recipe microformat is designed for the mark-up of instructions for creating meals, drinks or food-based items.

Root Class Name

To be decided. Likely ‘hrecipe’.

Property List

Recipe properties, with sub-properties listed in parentheses, like (this), plurality indicated by square brackets, like this[]. Note that the draft property names may change, but their function should remain.

Optional and required for each field is explicitly stated at this stage. Fields without have not been determined.

  • Title - Required.
  • Summary – A short introduction, accompanying statement about the recipe. Optional.
  • Author - An hCard for the author of the recipe. Optional.
  • Date Published - Optional
  • Photo[] - Accompanying image. Optional.
  • Ingredient[] (Quantity [Optional], Name [Required], ‘Optionality’ [Optional], Preparation Notes [Optional]) - 1 or more required.
  • Method - The block of text containing the method of the recipe. Required.

Ingredient > ‘Optionality’. States that an ingredient is optional to the recipe. Its absence should imply that the ingredient is required.

Suggested fields for inclusion

  • License - using rel-licence attribution
  • Tags - using rel-tag.
  • Method > Steps or Method-Step[] as a child of Method. Imply ordered steps from an HTML list or explicitly mark-up ordered steps respectively.
  • Yield – Quantity produced by this recipe
  • Calories – per serving. May be part of the [measure] microformat in future.

Known Issues

  • Mark-up of quantity would be enhanced by use of a [measure] microformat. However, such a format does not yet exist outside of brainstorming. It must be decided whether quantity is useful/parsable _enough_ without explicit mark-up of values and units.

RecipeML-based Brainstorm

Excerpted from Conor Bandon's Blog entry and derived from The RecipeML Spec:

  • Recipe_Title
  • Summary Description (one liner)
  • Measurement System (U.S., Imperial etc)
  • Ingredients (each one a separate "item" rather than block text with count/amount/range/unit broken out too)
    • Some (e.g. meats, vegetables) could optionally be marked up with (elements of) the proposed species microformat. Andy Mabbett 06:41, 16 Nov 2006 (PST)
    • Ingredient importance (e.g. Main, Required, Optional) should be listed as an attribute of each entry. α
    • Units need separate microformat: see measure
    • Ingredient Preparation: such as diced, chopped, sliced, grated, minced, etc. Steve Lewis 18:55, 11 Feb 2007 (PST)
  • Preparation Time (overall time)
  • Yield Quantity and Unit (4 pancakes or 5 servings)
  • Background Information - Optional section to encapsulate information that is useful but not necessarily required for a successful recipe. α
    • Author (Person) (hcard?)
    • Submitter (Person) (hcard?)
    • Source (Book Title etc)
    • Date (Of Creation or Publication)
    • Rights (Copyright or other)
    • Meal Category (Starter, entree, dessert )
    • Cuisine Category (Italian etc)
  • Instructions (text, but can contain:)
    • Steps (optional)
      • Should be an ordered list Andy Mabbett 14:46, 16 Nov 2006 (PST)
      • Another vote for an ordered list, perhaps in the XOXO format. α
      • Many recipes associate ingredients with specific steps of a multi-step method; if methods are broken out into steps, then the format should support this association whether the complete ingredient list is up front or the ingredient list is itself broken out per step. Ben Curtis
  • Photo (optional) Cameron Perry
    • Could be one per dish, or one for each (or for some of the) step(s). Andy Mabbett

Additional Suggestions

  • Steps - As cited above but to include estimated time per step. Include the type of step (prep, preheat, cook, bake, mix, saute, etc) as well as the ingredients involved. This would be very useful when trying to time a meal so all the food appears together.
    • I think this is being to specific. Are there any real world examples where this would be useful? --Yde 08:41, 30 May 2008 (PDT)
  • Difficulty/Notes - Perhaps incorporation of hReview to describe difficulty (using rating) and general comments (review), as an optional field. Frances Berriman
  • Suitability (e.g. vegetarian, vegan, wheat-free, etc.). Possibly rel-tag. Andy Mabbett 14:57, 16 Nov 2006 (PST)
  • Ingredient Grouping - In baking you need to differentiate wet from dry ingredients. See also an example recipe from extratasty.com for useful grouping in cocktail mixing. Steve Lewis 19:10, 11 Feb 2007
    • Maybe this ingredient grouping can be used to express some alternative ingredients, like "mayonnaise or cream cheese". Estêvão Samuel Procópio 15:33, 16 Dez 2007 (PDT)
    • This could be solved by using a xoxo list and ignoring list items that don't include a class="name". Example:

<ul class="ingredients"> <li>Booze <ul> <li>1 part <span class="name">Rum</span></li> </ul> </li> <li>Mixer <li>1 part <span class="name">Cola</span></li> <li>1 part <span class="name">Lime juice</span></li> </li> </ul> --Yde 13:09, 18 Apr 2008 (PDT)

    • We can't have a dependency on XOXO or any list mark-up for ingredients. That's too restrictive on publishing patterns, preventing patterns like:

<p class="method">Take <span class="ingredient"><span class="quantity">a handful</span> of spinach</span> and fry it</p>

--BenWard 13:20, 18 Apr 2008 (PDT)

You're right. I think grouping would introduce too many new elements (class="group", class="group-title") considering how relatively uncommon this is. --Yde 13:51, 23 Apr 2008 (PDT)

  • Number of dishes or similary - often it's mentioned how many dishes (or breads in baking, etc) the ingredients are for. WilleRaab 16:57, 20 Jul 2007 (PDT)
  • Suitable for occations - what occations are the dish suitable for? WilleRaab 16:57, 20 Jul 2007 (PDT)
  • Category - many sites categorize their recipes. WilleRaab 16:57, 20 Jul 2007 (PDT)
    • Tags could be used for both suitability and category.

Note: Comments added "WilleRaab 16:57, 20 Jul 2007 (PDT)" are added after looking at http://tasteline.com, example: here.

  • Under what terms is the recipe licensed? Microformat: rel="license". Often a page is in the creative commons but the page author has taken some text from a copyrighted page and in theory re-published the work in violation to the terms of use, adding a rel="license" to each recipe on the page? Lee Jordan 20:55, 04 Feb 2008 (GMT)

Proposed Ingredient List Optimisation

TobyInk 03:42, 23 Mar 2008 (PDT):

If class="ingredients" (note: plural) is found on an element, class="ingredient" (note: singular) is automatically implied on all its children.

<ul class="ingredients">
<li><span class="quantity">3</span> <span class="name">eggs</span></li>
<li><span class="quantity">6 oz</span> <span class="name">self-raising flour</span></li>
<li><span class="quantity">6 oz</span> <span class="name">caster sugar</span></li>
<li><span class="quantity">6 oz</span> <span class="name">butter</span></li>
<li><span class="quantity">1 tsp</span> <span class="name">vanilla essence</span></li>
</ul>

is a shorthand for:

<ul class="ingredients">
<li class="ingredient"><span class="quantity">3</span> <span class="name">eggs</span></li>
<li class="ingredient"><span class="quantity">6 oz</span> <span class="name">self-raising flour</span></li>
<li class="ingredient"><span class="quantity">6 oz</span> <span class="name">caster sugar</span></li>
<li class="ingredient"><span class="quantity">6 oz</span> <span class="name">butter</span></li>
<li class="ingredient"><span class="quantity">1 tsp</span> <span class="name">vanilla essence</span></li>
</ul>

I agree. This would save a lot of space, especially combined with the proposed hmeasur minimisation technique. --Yde 12:57, 18 Apr 2008 (PDT)

Proposed Ingredient Name/Quantity Optimisation

TobyInk 03:42, 23 Mar 2008 (PDT):

This idea's a bit more "out there" and probably needs a bit more work.

<li class="ingredient">3  eggs</li>

(note the double-space between '3' and 'eggs') is treated as a shorthand for:

<li class="ingredient"><span class="quantity">3</span> <span class="name">eggs</span></li>

This is similar to N-optimisation in hCard, but uses a double space instead of a single space because the components (quantity, name) may themselves each contain spaces. With both of these optimisations in place, the sponge cake ingredient list can be written as concisely as:

<ul class="ingredients">
<li>3  eggs</li>
<li>6 oz  self-raising flour</li>
<li>6 oz  caster sugar</li>
<li>6 oz  butter</li>
<li>1 tsp  vanilla essence</li>
</ul>

Which (apart from the double spaces) is pretty close to how many people publish ingredients lists already. (Certainly close to how I do!)

Alternative Proposed Ingredient Name/Quantity Optimisation

TobyInk 02:02, 24 Mar 2008 (PDT): Perhaps a better solution than the double spacing...

As above, but:

<ul class="ingredients">
<li><var>3</var> eggs</li>
<li><var>6 oz</var> self-raising flour</li>
<li><var>6 oz</var> caster sugar</li>
<li><var>6 oz</var> butter</li>
<li><var>1 tsp</var> vanilla essence</li>
</ul>

Or is this stretching the meaning of <var> too much?

Proposed Ingredient Name Optimisation

--Yde 02:12, 23 Apr 2008 (PDT):

If no class="quantity" or class="name" is found, the content of the ingredient element is treated as the name of the ingredient.

<li class="ingredient">salt</li>

is a shorthand for:

<li class="ingredient"><span class="name">salt</span></li>

Maybe we should even allow markup like

<li class="ingredient"><span class="quantity">1 tbsp</span>salt</li>

which would be parsed as

  • ingredient
    • quantity: 1 tbsp
    • name: salt

NOTE: To avoid confusion, I used the class name "name" although I think it should be changed to "item".

Cookcamp brainstorming

At CookCamp in February 2007, Tantek moderated a fairly free form discussion of how to publish/share recipes. Here is a photo of the whiteboard:

422072573_9956d93f61.jpg

To Do: OCR this and enter rough notes here...


Issues

Please do feel to add your comments below. If this section grows too large, please create a seperate recipe-issues section. Thanks!

Scope

  • Is this intended for only food recipes, or also recipes for, say, glue, paint, dyes and other chemicals? Andy Mabbett 14:53, 16 Nov 2006 (PST)
    • +1 Wondered the same. I'd like to see this extended as a general recipe for anything that can be created in a defined way/order, rather than just edible food.Frances Berriman
    • Agreed. This format could apply to a set of methods and materials, including cooking, science experiments, craft making, building, etc. - essentially any how-to or tutorial. Cameron Perry
    • However, now I view my addition of 'calories per serving' as suspect, ;) though I guess it could still apply, since it's just a unit of energy. John LeMasney
      • Recipe for Nitroglycerine (not recommended by Weight Watchers) ? Andy Mabbett 10:43, 1 Feb 2007 (PST)
    • The scope is determined by the recipe-examples research that is done, other musings are purely theoretical and thus discouraged. So far this means recipes means only food recipes. In addition, "recipe" in common vernacular applies primarily to food. Other uses are certainly outside the common 80/20 (note that 80/20 does note mean there are no non-food cases, merely that they are outside the 80). If you want to pursue other types of recipes, e.g. "chemical-recipes" - start that as a separate research effort per the process. Tantek 07:39, 15 Mar 2007 (PDT)
      • Work is continuing on the recipe format now with the scope limited to food-based items only. Phae 08:44, 3 Oct 2007 (PDT)
  • Is it possible to have special structure for the details of the operations in the cooking. For Eg. I invite you to have a look at the following Page [1]. Should it be possible to have special markup for the operations? Or is that going too far? Maybe we could keep this open ended so that it could be included when sites would actually be interested in including the same... Anyway the article makes for some interesting reading though it is from 1985 ;-) SudarshanP 06:46, 26 Jun 2007 (PDT)
    • I think this could be considered out of scope. It's the sort of thing that would be detailed in the descriptive narrative, but I'm not sure there's evidence from the examples that this type of behaviour is common enough to warrant specific properties to hold it. Phae 08:44, 3 Oct 2007 (PDT)

Measure

open issue!

  • Quantities play a key part in recipes, so do we feel the recipe format will rely on quantities so heavily that the measure microformat needs to be completed first, or do we feel it can exist without it and use of measure can be optional in the first version? Phae 08:44, 3 Oct 2007 (PDT)
    • The former. Andy Mabbett 13:10, 4 Feb 2008 (PST)
    • The use of a measure microformat should be optional. Otherwise it will prevent people from using less specific measurements like "a handful" or "a bottle" or just "some". Yde 08:59, 30 May 2008 (PDT)
  • The abbr design pattern should be used to mark up measures, such as lbs and kg, measures are also not restricted to ingredients as they describe temperature too, as such should the sup element be used in the presentation of the degree symbol, within the abbr? See BBC weather example Lee Jordan 20:00, 4 Feb 2008 (GMT)
  • Conversion is tricky and is important, you've found a great recipe but it's measured in "cups". temperature is usually handled well by recipe authors, unless "gas mark" is used. The lang attribute (optional) could be used to denote the intentional language convention of the markup, to aid parsers "convert on the fly"? Is there currently a sematic way of marking up content as being metric or imperial? (complications come in mixed measure conventions in the same text section, so lang= on the abbr rather than the ul would help). A browser could then know the text was originally written in metric and convert to imperial if the user agent was en-GB, or a DOM script equally could aid conversion from cups to oz based on that? As an Englishman reading American text I find it hard to know what a "cup" is and then there are the Europeans to consider. Lang attributes might not be useful as for example en-US and en-GB measure distance in miles for example, rel="us-volume" (cups), rel="gb-volume" (tablespoons)? Lee Jordan 20:15, 4 Feb 2008 (GMT)
  • Should the hmeasure class be applied to all ingredient list items (i.e. <li class="hmeasure">) or just the ingredients list itself (i.e. <ul class="hmeasure">)? All ingredients are related to measurement (a value, a unit and an item) so it might as well be defined once or am I missing something? --Yde 12:37, 18 Apr 2008 (PDT)
  • On the measure site it says: The names "value" and "type" are taken from hCard; "item" is used from hReview. For the same reasons, should we change quantity to value + unit and name to item or does this brake compatability with some recipe format? --Yde 13:25, 18 Apr 2008 (PDT)

Single foodstuffs

If "method" is made optional, this could be used for marking up individual foodstuffs in prose. for example, "I like to eat cheese for supper." would become:

I like to eat <span class="hRecipe"><span class="ingredient">cheese</span></span> for supper.

or simply (if the proposed "sub-microformat-pattern" is adopted):

I like to eat <span class="hRecipe-ingredient">cheese</span> for supper.
Andy Mabbett 08:16, 5 Jan 2008 (PST)

But that's not really a recipe, is it? And what would the purpose of knowing that cheese is an ingredient be? --Yde 12:46, 18 Apr 2008 (PDT)

Menus

With the addition of a "price" field, and perhaps one or two others, and again making "method" optional, this microformat can also be used for menus. See menu examples.

Andy Mabbett 02:39, 19 Feb 2008 (PST)

I would consider this out of scope (which is to produce an as-simple-as-possible microformat "for the mark-up of instructions for creating meals, drinks or food-based items" - introduction) --Yde 13:39, 23 Apr 2008 (PDT)

Schema proposal

Based on the brainstorm and the discussions on the mailing list ([2], [3])

Class names author and published are taken from hAtom, photo used from hCard and item from measure.

  • Title: entry-title. required. text.
  • Summary: entry-summary. optional. text.
  • Author: author. optional. hcard.
  • Date published: published. optional. datetime-design-pattern.
  • Photo(s): photo. optional. img or url.
  • Ingredient(s): ingredient. 1 or more required.
    • Quantity: quantity. optional. text, optionally measure.
    • Item: item. required. text.
    • Note: note. optional. text.
    • Optionality: optional. optional. text. Its absence should imply that the ingredient is required.
  • Method: method. required. text.
  • Yield: yield. optional. text.
  • Preparation time: preparation-time. optional. datetime-design-pattern.
  • Tags: optional. rel-tag.
  • License: optional. rel-license.

Discussion

  • entry-title and entry-summary are not always semantically right and may not be good class names.
  • The 'photo' property should be usable for elements containing the element <img>.
    • This format reuses the 'photo' property of hCard so we can't change the way it is parsed in the recipe format without also changing the way it is pased in hCard (Human_vs._Machine_readable). This is an hCard problem and should not be discussed here.

See Also