schemaorg / suggestions-questions-brainstorming

Suggestions, questions, and brainstorming
19 stars 15 forks source link

Create a new Food type (help further with foodWarning and recipeIngredient) #200

Open thadguidry opened 9 years ago

thadguidry commented 9 years ago

@nicolastorzec @ekgs1 @danbri @chaals Currently our "Food" is just text now and sits under here:

  1. http://schema.org/foodWarning
  2. http://schema.org/ingredients

This issue tracks discussion for the need for a new Food type.

foodWarning and recipeIngredient could then have some expected values of:

  1. Product (for food recalls) - ex. http://www.fda.gov/Safety/Recalls/
  2. Food - a new type (allergy for Nuts),
  3. Ingredient - ex. https://www.gov.uk/food-labelling-and-packaging/food-and-drink-warnings
  4. Text
nicolastorzec commented 9 years ago

Food items should have a basic set of attributes: e.g. name(s), type, nutrition facts, allergy/warning information, origin, etc.

It should be possible to associate food to recipes, which make them some kind of ingredients.

Prepared food should also be somewhat related to products since they have a manufacturer, license information, recall information, etc.

Schema.org has a NutitionInformation class that we could extend by looking at information available from databases such USDA's NDB or Open Food Fact.

Examples: http://ndb.nal.usda.gov/ndb/foods/show/2171?fgcd=&manu=&lfacet=&format=&count=&max=35&offset=&sort=&qlookup=Apple

ekgs1 commented 9 years ago

EU 1169 should also be looked at for requirements on food labeling (warnings, allergens, nutrition, storage and usage, servings per package, etc). My organization (GS1) has done considerable work in this area.

(--edit: URL added by @danbri)

danbri commented 9 years ago

I've labeled this under Extension Tracking to help coordinate conversations.

Several relevant things should be connected here:

danbri commented 9 years ago

Recipe-related issues (to bear in mind if we touch Food, although they seem fairly separate so far):

danbri commented 9 years ago

Regarding food allergies, see also http://thenextweb.com/mobile/2015/07/29/emoji-for-food-allergies-may-come-to-your-phone-soon/ in the Unicode world - a proposal for icon / emoji representation of common allergies. http://www.unicode.org/L2/L2015/15197r-emoji-food-allergens.pdf /cc @ekgs1

The link with food packaging legislation is worth some thought.

twamarc commented 9 years ago

stepping back, I think we need a small vocab for food. Something between food/diet (from Health perspective) and food/recipe/product (from product/offer perspective).

We need to coordinate here. Any suggestion?

danbri commented 9 years ago

Also proposed in schemaorg/schemaorg#726

danbri commented 9 years ago

I've just marked schemaorg/schemaorg#607 closed as a duplicate of this discussion, however there are a number of comments in that thread that shouldn't be lost, so please take a look.

danbri commented 9 years ago

See also http://www.opentravel.org/Specifications/SchemaIndex.aspx?FolderName=2015A -> http://www.opentravel.org/2015A/OTA_SimpleTypes.xsd for MealType, used in Airlines. Potentially useful on Reservation too.

http://www.vktravels.us/airlinesMealCodes.php has per-airline extensions.

@vholland notes that some of these codes aren't really diets (e.g. baby meal)

bbdg commented 8 years ago

If a site goes to all the trouble to define a host of properties for a food, I'd imagine they would not want to repeat that information for each recipe, label, product, reservation, etc, on the site. Is the idea, then, that a site would define a food in one place and reference that food via id/url in the rest of the site? Or would the markup be such that every label, say, that has walnuts has to separately mark up that it is problematic for those with nut allergies. The latter approach makes it harder, I would think, to deduce the properties of foods from an aggregate of pages.

DDeering commented 8 years ago

Hi, I'd like to see if we could revisit this conversation regarding schema.org extensions for the Recipe and Restaurant types. Issues schemaorg/schemaorg#607 and #726 (both now closed) also touched on some good ideas. Especially in regards to the Restaurant schema type, I feel that perhaps what is currently lacking is a means where each item in a menu can be fully marked up with structured data, and likewise each ingredient in a recipe (food or drink item, quantity/servings, price, ingredients, options, nutrition, allergens, in-season/out-of-season, and so on).

Aaranged commented 8 years ago

+1 to the suggestion from @DDeering. Regarding menus specifically, I've seen more than one question from a webmaster who wanted to mark up individual menu items using schema.org (and I think that's certainly good additional data for search engines and other data consumers) yet none of the solutions I've seen discussed - all hacks - are satisfactory.

vholland commented 8 years ago

For now, could a site use OfferCatalog? I would like to see a subtype for restaurant menus, but that would require some work.

Aaranged commented 8 years ago

@vholland Yes, that's just the solution I proposed to the last webmaster that inquired, and was able to produce some validating code for same - a bit clunky, but works well enough as an interim solution.

DDeering commented 8 years ago

@vholland I also think it's a viable option but perhaps not the cleanest one. As Aaranged mentioned, it does get a bit clunky. I've used OfferCatalog and marked up each menu item as a Product but it still lacks the ability to mark up ingredients, nutrition, allergens and so on, at least in a simple way. So I imagine that a few new properties would need to be added. And since that's the case, I propose that we go ahead and create a good, complete solution instead of something that, as Aaron said, works as an interim solution.

Considering that there's about 15 million restaurants in the world that could benefit from these extensions, I think there's tremendous value in doing this and I'd be happy to help.

vholland commented 8 years ago

@DDeering agreed. The next best step would be outlining the use cases and any types or properties which would make modeling restaurant menus easier.

DDeering commented 8 years ago

@vholland Sounds good. I'll try to come up with a few ideas myself very soon.

Aaranged commented 8 years ago

In case anyone encounters this thread who is looking for an example of the OfferCatalog approach to menu markup, here's a post a menu marked up in microdata (that passes Google SDTT validation): https://plus.google.com/+DavidKutcher/posts/3xUA25sKPva

monecchi commented 8 years ago

Any progress regarding this issue so far?

I'm not sure if this is out of topic, but Facebook's Open Graph restaurant.menu, restaurant.menu_section, restaurant.menu_item and restaurant.restaurant objects seem to be a very good reference for a structured schema.org solution.

Here's how Facebook describe those objects and how they're structured: https://developers.facebook.com/docs/reference/opengraph. Not sure though if those are deprecated or not, but I've implemented them on a WordPress site which uses a custom food post type just for playing around.

After I got it implemented, I got the results bellow, and this is more or less what I'd expect a schema.org structured restaurant menu to be like. Facebook's Open Graph indeed give us a brief example of how a simple but deep relationship between those restaurant objects can be approached. Those open graph meta tags go along with some common ones such as og:type, og:title, og:description, og:url, og:image etc., enhancing the restaurant.menu objects.

Short to the point, these are the meta tags output I got for my site:

On a Restaurant Menu main page

<meta property="og:type"  content="restaurant.menu" /> 

<meta property="restaurant:restaurant"   content="My Restaurant name (Branch)" />

<!-- The Restaurant Menu Sections - these act like menu categories -->
<meta property="restaurant:section"   content="Breakfast" />
<meta property="restaurant:section"   content="Lunch" />
<meta property="restaurant:section"   content="Dinner" />
<meta property="restaurant:section"   content="Pizzas" />

<!-- The Restaurant location & contact info details -->
<meta property="restaurant:contact_info:street_address"   content="1601 Willow Rd." /> 
<meta property="restaurant:contact_info:locality"   content="Menlo Park" /> 
<meta property="restaurant:contact_info:region"   content="California" /> 
<meta property="restaurant:contact_info:postal_code"   content="94025" /> 
<meta property="restaurant:contact_info:country_name"   content="United States" /> 
<meta property="restaurant:contact_info:email"   content="brian&#064;example.com" /> 
<meta property="restaurant:contact_info:phone_number"   content="212-555-1234" /> 
<meta property="restaurant:contact_info:website"   content="http://www.facebook.com" /> 
<meta property="place:location:latitude"   content="37.484828" /> 
<meta property="place:location:longitude"   content="-122.148283" />

On a Restaurant Menu section (category) page

<meta property="og:type"   content="restaurant.menu_section" />

<!-- The Restaurant Menu Section  -->
<meta property="restaurant:menu"   content="Dinner Menu" />

<!-- The Restaurant Menu Items related to this section (category)  -->
<meta property="restaurant:item"   content="Fresh Fish Salad" />
<meta property="restaurant:item"   content="Lasagna" />
<meta property="restaurant:item"   content="Honey Mustard Chicken Crunch" />
<meta property="restaurant:item"   content="Chicken Noodle Soup" />

On a Restaurant Menu single food item page

<!-- The Restaurant Menu Section a menu item belongs to  -->
<meta property="restaurant:section"   content="Pizzas" />

<!-- The Restaurant Menu Item details & variations  -->
<meta property="restaurant:variation:name"   content="Small, 4 slices" />
<meta property="restaurant:variation:price:currency"   content="USD"/>
<meta property="restaurant:variation:price:amount"   content="12.90" />

<meta property="restaurant:variation:name" content="Big, 6 Slices" />
<meta property="restaurant:variation:price:currency" content="USD"/>
<meta property="restaurant:variation:price:amount" content="22.90" />

<meta property="restaurant:variation:name" content="Giga, 10 Slices" />
<meta property="restaurant:variation:price:currency" content="USD"/>
<meta property="restaurant:variation:price:amount" content="35.90" />
danbri commented 4 years ago

I think we'll come back to this theme for sure, but per recent tidy-up I'm tagging it for a move to the suggestions-questions-brainstorming repo.

jaygray0919 commented 4 years ago

Yea, this is a can-of-worms

RichardWallis commented 4 years ago

See issue #7 for the context of the move from the main Schema.org issue tracker to this repository.