If you don't already know what Google Rich Snippets or schema.org are, this post is probably not for you.
Google Rich Snippets are not deprecated! The schema.org FAQ states, "If you have already done markup and it is already being used by Google, Microsoft, or Yahoo!, the markup format will continue to be supported. Changing to the new markup format could be helpful over time because you will be switching to a standard that is accepted across all three companies, but you don't have to do it."
This guide is for people who want to do it anyway.
Disclaimer: despite my working for Google, this guide has no official status. It represents nothing beyond my own personal interpretation, based on my experience writing about microdata and Google Rich Snippets in my free HTML5 book which you should totally pay money for because this is the way I want the world to work.
Some notes:
Table of Contents
§
http://
is now http://
. Some properties have new names.
Old itemprop | New itemprop |
---|---|
street-address | streetAddress |
locality | addressLocality |
region | addressRegion |
postal-code | postalCode |
country-name | addressCountry |
§
http://
is now http://
. There are no changes to property names or semantics.
Several properties in the old data-vocabulary.org
schema were of type http://
. In the schema.org
vocabulary, many of these now use a location
property of type Place. The new Place schema contains a geo
property of type GeoCoordinates.
§
http://
is now http://
. The new schema has a number of more specific types like Corporation
, NGO
, and SportsTeam
. Use the most specific type that is appropriate.
Some properties have new names or are expressed in different ways.
Old itemprop | New itemprop |
---|---|
tel | telephone |
geo | moved to |
§
http://
is now http://
. Some properties have new names or are expressed in different ways.
Old itemprop | New itemprop |
---|---|
nickname | obsolete |
photo | image |
title | jobTitle |
role | obsolete |
friend , contact , acquaintance | obsolete, use knows , follows , or colleagues |
In addition, the affiliation
used to be a plain text property. It now takes an Organization. (See also: Organization changes)
§
http://
is now http://
. The new schema has a number of more specific types like BusinessEvent
, SocialEvent
, or Festival
. Use the most specific type that is appropriate.
Some properties have new names or are expressed in different ways.
Old itemprop | New itemprop |
---|---|
summary | name |
photo | image |
eventType | obsolete, use a specific event type if available |
geo | moved to location property |
In addition, the location
property used to be plain text or an Organization or an Address; now it must be either a Place or a PostalAddress. (See also: Address changes)
§
http://
is now http://
. Some properties have new names or are expressed in different ways.
Old itemprop | New itemprop |
---|---|
category | obsolete |
review | reviews (type Review) |
offerdetails | offers (type Offer) |
identifier | productID |
The brand
property used to be plain text, but it now takes an Organization.
§
http://
is now http://
. Some properties have new names or are expressed in different ways.
Old itemprop | New itemprop |
---|---|
itemreviewed | itemReviewed (type Thing) |
rating | reviewRating |
reviewer | author (type Person or Organization) |
dtreviewed | datePublished |
description | reviewBody |
§
http://
is now http://
. Some properties have new names or are expressed in different ways.
Old itemprop | New itemprop |
---|---|
currency | priceCurrency |
condition | itemCondition (type OfferItemCondition) |
offerURL | url |
identifier | moved to productID property of itemOffered |
The availability
property used to be an enumerated attribute, but it now takes an ItemAvailability.
§
On February 25, 1993, Marc Andreessen wrote:
I'd like to propose a new, optional HTML tag:
IMG
Required argument is
SRC="url"
.This names a bitmap or pixmap file for the browser to attempt to pull over the network and interpret as an image, to be embedded in the text at the point of the tag's occurrence.
An example is:
<IMG SRC="file://foobar.com/foo/bar/blargh.xbm">
(There is no closing tag; this is just a standalone tag.)
This tag can be embedded in an anchor like anything else; when that happens, it becomes an icon that's sensitive to activation just like a regular text anchor.
Browsers should be afforded flexibility as to which image formats they support. Xbm and Xpm are good ones to support, for example. If a browser cannot interpret a given format, it can do whatever it wants instead (X Mosaic will pop up a default bitmap as a placeholder).
This is required functionality for X Mosaic; we have this working, and we'll at least be using it internally. I'm certainly open to suggestions as to how this should be handled within HTML; if you have a better idea than what I'm presenting now, please let me know. I know this is hazy wrt image format, but I don't see an alternative than to just say ``let the browser do what it can'' and wait for the perfect solution to come along (MIME, someday, maybe).
Xbm and Xpm were popular graphics formats on Unix systems.
“Mosaic” was one of the earliest web browsers. ("X Mosaic" was the version that ran on Unix systems.) When he wrote this message in early 1993, Marc Andreessen had not yet founded the company that made him famous, Mosaic Communications Corporation, nor had he started work on that company's flagship product, “Mosaic Netscape.” (You may know them better by their later names, "Netscape Corporation" and “Netscape Navigator.”)
“MIME, someday, maybe” is a reference to content negotiation, a feature of HTTP where a client (like a web browser) tells the server (like a web server) what types of resources it supports (like image/jpeg
) so the server can return something in the client's preferred format. The Original HTTP as defined in 1991 (the only version that was implemented in February 1993) did not have a way for clients to tell servers what kind of images they supported, thus the design dilemma that Marc faced.
A few hours later, Tony Johnson replied:
I have something very similar in Midas 2.0 (in use here at SLAC, and due for public release any week now), except that all the names are different, and it has an extra argument
NAME="name"
. It has almost exactly the same functionality as your proposedIMG
tag. e.g.
<ICON name="NoEntry" href="http://note/foo/bar/NoEntry.xbm">
The idea of the name parameter was to allow the browser to have a set of "built in" images. If the name matches a "built in" image it would use that instead of having to go out and fetch the image. The name could also act as a hint for "line mode" browsers as to what kind of a symbol to put in place of the image.
I don't much care about the parameter or tag names, but it would be sensible if we used the same things. I don't much care for abbreviations, ie why not
IMAGE=
andSOURCE=
. I somewhat preferICON
since it imlies that theIMAGE
should be smallish, but maybeICON
is an overloaded word?
Midas was another early web browser, a contemporary of X Mosaic. It was cross-platform; it ran on both Unix and VMS. “SLAC” refers to the Stanford Linear Accelerator Center (now the SLAC National Accelerator Laboratory). SLAC hosted the first web server in the United States (in fact the first web server outside Europe). When Tony wrote this message, SLAC was an old-timer on the WWW, having hosted five pages on their web server for a whopping 441 days.
Tony continued:
While we are on the subject of new tags, I have another, somewhat similar tag, which I would like to support in Midas 2.0. In principle it is:
<INCLUDE HREF="...">
The intention here would be that the second document is to be included into the first document at the place where the tag occured. In principle the referenced document could be anything, but the main purpose was to allow images (in this case arbitrary sized) to be embedded into documents. Again the intention would be that when HTTP2 comes along the format of the included document would be up for separate negotiation.
“HTTP2” is a reference to Basic HTTP as defined in 1992. At this point in early 1993, it was still largely unimplemented. The draft known as “HTTP2” evolved and was eventually standardized as “HTTP 1.0” (albeit not for another three years). HTTP 1.0 did include request headers for content negotiation, a.k.a. “MIME, someday, maybe.”
Tony continued:
An alternative I was considering was:
<A HREF="..." INCLUDE>See photo</A>
I don't much like adding more functionality to the
<A>
tag, but the idea here is to maintain compatibility with browsers that can not honour theINCLUDE
parameter. The intention is that browsers which do understandINCLUDE
, replace the anchor text (in this case "See photo") with the included document (picture), while older or dumber browsers ignore theINCLUDE
tag completely.
This proposal was never implemented, although the idea of text-if-an-image-is-missing is an important accessibility technique which was missing from Marc’s initial <IMG>
proposal. Many years later, this feature was bolted on as the <img alt>
attribute, which Netscape promptly broke by erroneously treating it as a tooltip.
A few hours after that, Tim Berners-Lee responded:
I had imagined that figues would be reprented as
<a name=fig1 href="fghjkdfghj" REL="EMBED, PRESENT">Figure </a>
where the relation ship values mean
EMBED Embed this here when presenting it PRESENT Present this whenever the source document is presentedNote that you can have various combinations of these, and if the browser doesn't support either one, it doesn't break.
[I] see that using this as a method for selectable icons means nesting anchors. Hmmm. But I hadn't wanted a special tag.
This proposal was never implemented, but the rel
attribute is still around.
It would be nice if there was a way to specify the content type, e.g.
<IMG HREF="http://nsa.gov/pub/sounds/gorby.au" CONTENT-TYPE=audio/basic>
But I am completely willing to live with the requirement that I specify the content type by file extension.
This proposal was never implemented, but Netscape did later add arbitrary embedding of media objects with the <embed>
element.
While images are at the top of my list of desired medium types in a WWW browser, I don't think we should add idiosyncratic hooks for media one at a time. Whatever happened to the enthusiasm for using the MIME typing mechanism?
This isn't a substitute for the upcoming use of MIME as a standard document mechanism; this provides a necessary and simple implementation of functionality that's needed independently from MIME.
Let's temporarily forget about MIME, if it clouds the issue. My objection was to the discussion of "how are we going to support embedded images" rather than "how are we going to support embedded objections in various media".
Otherwise, next week someone is going to suggest 'lets put in a new tag
<AUD SRC="file://foobar.com/foo/bar/blargh.snd">
' for audio.There shouldn't be much cost in going with something that generalizes.
With the benefit of hindsight, it appears that Jay’s concerns were well-founded. It took a little more than a week, but HTML5 did finally add new <video>
and <audio>
elements.
Responding to Jay’s original message, Dave Raggett said:
True indeed! I want to consider a whole range of possible image/line art types, along with the possibility of format negotiation. Tim's note on supporting clickable areas within images is also important.
Later in 1993, Dave Raggett proposed HTML+ as an evolution of the HTML standard. The proposal was never implemented, and it was superceded by HTML 2.0. HTML 2.0 was a “retro-spec,” which means it formalized features already in common use. “This specification brings together, clarifies, and formalizes a set of features that roughly corresponds to the capabilities of HTML in common use prior to June 1994.”
Dave later wrote HTML 3.0, based on his earlier HTML+ draft. HTML 3.0 was also never implemented (outside of the W3C’s own reference implementation, Arena), and it was superceded by HTML 3.2. HTML 3.2 was also a “retro-spec” — “HTML 3.2 adds widely deployed features such as tables, applets and text flow around images, while providing full backwards compatibility with the existing standard HTML 2.0.”
Dave later co-authored HTML 4.0 and developed HTML Tidy, and went on to help with XHTML, XForms, MathML, and other modern W3C specifications.
Getting back to 1993, Marc replied to Dave:
Actually, maybe we should think about a general-purpose procedural graphics language within which we can embed arbitrary hyperlinks attached to icons, images, or text, or anything. Has anyone else seen Intermedia's capabilities wrt this?
Intermedia was a hypertext project from Brown University. It was developed from 1985 to 1991 and ran on A/UX, a Unix-like operating system for early Macintosh computers.
The idea of a “general-purpose procedural graphics language” did eventually catch on. Modern browsers support both SVG (declarative markup with embedded scripting) and <canvas>
(procedural direct-mode graphics API), although the latter started as a proprietary extension before being “retro-specced” by the WHATWG.
Other systems to look at which have this (fairly valuable) notion are Andrew and Slate. Andrew is built with _insets_, each of which has some interesting type, such as text, bitmap, drawing, animation, message, spreadsheet, etc. The notion of arbitrary recursive embedding is present, so that an inset of any kind can be embedded in any other kind which supports embedding. For example, an inset can be embedded at any point in the text of the text widget, or in any rectangular area in the drawing widget, or in any cell of the spreadsheet.
“Andrew” is a reference to the Andrew User Interface System (although at that time it was simply known as the Andrew Project).
Meanwhile, Thomas Fine had a different idea:
Here's my opinion. The best way to do images in WWW is by using MIME. I'm sure postscript is already a supported subtype in MIME, and it deals very nicely with mixing text and graphics.
But it isn't clickable, you say? Yes your right. I suspect there is already an answer to this in display postscript. Even if there isn't the addition to standard postscript is trivial. Define an anchor command which specifies the URL and uses the current path as a closed region for the button. Since postscript deals so well with paths, this makes arbitrary button shapes trivial.
Display Postscript was an on-screen rendering technology co-developed by Adobe and NeXT.
This proposal was never implemented, but the idea that the best way to fix HTML is to replace it with something else altogether still pops up from time to time.
Tim Berners-Lee, March 2, 1993:
HTTP2 allows a document to contain any type which the user has said he can handle, not just registered MIME types. So one can experiment. Yes I think there is a case for postscript with hypertext. I don't know whether display postcript has enough. I know Adobe are trying to establish their own postscript-based "PDF" which will have links, and be readable by their proprietory brand of viewers.
I thought that a generic overlaying language for anchors (Hytime based?) would allow the hypertext and the graphics/video standards to evolve separately, which would help both.
Let the
IMG
tag beINCLUDE
and let it refer to an arbitrary document type. OrEMBED
ifINCLUDE
sounds like a cpp include which people will expect to provide SGML source code to be parsed inline -- not what was intended.
HyTime was an early, SGML-based hypertext document system. It loomed large in many early discussions of HTML, and later XML.
Tim’s proposal for an <INCLUDE>
tag was never implemented, although you can see echoes of it in <object>
, <embed>
, and the <iframe>
element.
Finally, on March 12, 1993, Marc Andreessen revisited the thread:
Back to the inlined image thread again -- I'm getting close to releasing Mosaic v0.10, which will support inlined GIF and XBM images/bitmaps, as mentioned previously. ...
We're not prepared to support
INCLUDE
/EMBED
at this point. ... So we're probably going to go with<IMG SRC="url">
(notICON
, since not all inlined images can be meaningfully called icons). For the time being, inlined images won't be explicitly content-type'd; down the road, we plan to support that (along with the general adaptation of MIME). Actually, the image reading routines we're currently using figure out the image format on the fly, so the filename extension won't even be significant.
I don’t really know why I wrote this. It wasn’t what I set out to write. That happens. But I am extraordinarily fascinated with all aspects of this almost-17-year-old conversation. Consider:
But none of this answers the original question: why do we have an <img>
element? Why not an <icon>
element? Or an <include>
element? Why not a hyperlink with an include
attribute, or some combination of rel
values? Why an <img>
element? Quite simply, because Marc Andreessen shipped one, and shipping code wins.
That’s not to say that all shipping code wins; after all, Andrew and Intermedia and HyTime shipped code too. Code is necessary but not sufficient for success. And I certainly don’t mean to say that shipping code before a standard will produce the best solution. Marc’s <img>
element didn’t mandate a common graphics format; it didn’t define how text flowed around it; it didn’t support text alternatives or fallback content for older browsers. And 16, almost 17 years later, we’re still struggling with content sniffing, and it’s still a source of crazy security vulnerabilities. And you can trace that all the way back, 17 years, through the Great Browser Wars, all the way back to February 25, 1993, when Marc Andreessen offhandedly remarked, “MIME, someday, maybe,” and then shipped his code anyway.
The ones that win are the ones that ship.
§
This is the house
This is the house
The house of confusion
That Jeffrey built.
These are the tags
That live in the house
The house of confusion
That Jeffrey built.
These are the slashes
That we all ignore
That end the tags
That live in the house
The house of confusion
That Jeffrey built.
This is the namespace
That doesn't do squat
When we parse the slashes
That end the tags
That live in the house
That Jeffrey built.
This is the header
That nobody sees
’Cause they see the namespace
That doesn't do squat
When we parse the slashes
That end the tags
That live in the house
That Jeffrey built.
This is the spec
That nobody uses
’Cause we use the header
That nobody sees
’Cause they see the namespace
That doesn't do squat
When we parse the slashes
That end the tags
That live in the house
That Jeffrey built.
Say goodbye to the spec
That no longer exists
And stick with the header
That nobody sees
And drop the namespace
That doesn't do squat
And skip the slashes
That end the tags
That live in the house
That live in the house
The house of confusion
That Jeffrey built.
§
Time to resurface a few good comments I made at Tim's place last year:
> if an electronic-trading system receives an XML message for a transaction valued at €2,000,000, and there's a problem with a missing end tag, you do not want the system guessing what the message meant
You [Tim] have used this example, or variations of it, since 1997. I think I can finally express why it irritates me so much: you are conflating "non-draconian error handling" with "non-deterministic error handling". It is true that there are some non-draconian formats which do not define an error handling mechanism, and it is true that this leads to non-interoperable implementations, but it is not true that non-draconian error handling implies "the system has to guess." It is possible to specify a deterministic algorithm for graceful (non-draconian) error handling; this is one of the primary things WHATWG is attempting to do for HTML 5.
If any format (including an as-yet-unspecified format named "XML 2.0") allows the creation of a document that two clients can parse into incompatible representations, and both clients have an equal footing for claiming that their way is correct, then that format has a serious bug. Draconian error handling is one way to solve such a bug, but it is not the only way, and for 10 years you've been using an overly simplistic example that misleadingly claims otherwise.
And, in the same thread but on a different note:
I would posit that, for the vast majority of feed producers, feedvalidator.org *is* RSS (and Atom). People only read the relevant specs when they want to argue that the validator has a false positive (which has happened, and results in a new test) or a false negative (which has also happened, and also results in a new test). Around the time that RFC 4287 was published, Sam rearranged the tests by spec section. This is why specs matter. The validator service lets morons be efficient morons, and the tests behind it let the assholes be efficient assholes. More on this in a minute.
> A simpler specification would require a smaller and finite amount of test cases.
The only thing with a "finite amount of test cases" is a dead fish wrapped in yesterday's newspaper.
On October 2, 2002, the service that is now hosted at feedvalidator.org came bundled with 262 tests. Today it has 1707. That ain't all Atom. To a large extent, the increase in tests parallels an increase in understanding of feed formats and feed delivery mechanisms. The world understands more about feeds in 2007 than it did in 2002, and much of that knowledge is embodied in the validator service.
If a group of people want to define an XML-ish format with robust, deterministic error handling, then they will charge ahead and do so. Some in that group will charge ahead to write tests and a validator, which (one would hope) will be available when the spec finally ships. And then they will spend the next 5-10 years refining the validator, and its tests, based on the world's collective understanding. It will take this long to refine the tests into something bordering on comprehensive *regardless of how simple the spec is* in the first place.
In short, you're asking the wrong question: "How can we reduce the number of tests that would we need to ship with the spec in order to feel like we had complete coverage?" That's a pernicious form of premature optimization. The tests you will actually need (and, hopefully, will actually *have*, 5 years from now) bears no relationship to the tests you can dream up now. True "simplicity" emerges over time, as the world's understanding grows and the format proves that it won't drown you in "gotchas" and unexpected interactions. XML is over 10 years old now. How many XML parsers still don't support RFC 3023? How many do support it if you only count the parts where XML is served as "application/xml"?
I was *really proud* of those 262 validator tests in 2002. But if you'd forked the validator on October 3rd, 2002, and never synced it, you'd have something less than worthless today. Did the tests rot? No; the world just got smarter.
On a somewhat related note, I've cobbled together a firehose which tracks comments (like these) that I make on other selected sites. Many thanks to Sam for teaching me about Venus filters, which make it all possible. If you've been thinking "Gee, I just can't get enough of that Pilgrim guy, I wish there were a way that I could stalk him without being overly creepy about it," then this firehose is for you.
#skydiving #rss #thinkofthechildren #shibboleth #opensource #scalability
§
Even the experts can't get it right 100% of the time.
screenshot taken at 10:29 PM on March 8, 2008.
For the record, my site is valid HTML 5, except the parts that aren't. My therapist says I shouldn't rely so much on external validation.
§