hproduct
<entry-title>hProduct</entry-title> This document represents a draft microformat specification. Although drafts are somewhat mature in the development process, the stability of this document cannot be guaranteed, and implementers should be prepared to keep abreast of future developments and changes. Watch this wiki page, or follow discussions on the #microformats IRC channel to stay up-to-date.
hProduct is a microformat suitable for publishing and embedding product data. hProduct is one of several open microformats standards suitable for embedding in HTML, XHTML, Atom, RSS, and arbitrary XML.
hProduct Microformat Draft Specification
- Editors/Authors
(alphabetical)
- Paul Lee, Google Product Search
- Jay Myers, Best Buy, Co., Inc.
- Contributors
(alphabetical)
- Craig Cook, Focal Curve
- Aaron Gustafson, Easy! Designs
Microformats copyright and patents statements apply.
Status
Draft, version 0.1.
Introduction
The web is a thriving consumer marketplace with a plethora of manufacturers and vendors scattered across the globe. Sifting through massive amounts of unstructured product data is a difficult task for both browsers and machines alike. The hProduct microformat gives structure to this metadata by providing constructs to identify universal product attributes, plus a mechanism to accomodate the wide variation in product attributes.
The hProduct microformat can assist consumers, manufacturers and retailers in a number of ways. If a browser or application understands that a specific web page contains the hProduct microformat, it can inform and help facilitate the best product choice by the consumer to fulfill their needs. An adpoted, open standard will ensure the correct product data is published between manufacturers and retailers, to the benefit of the consumer. Bringing order and structure to product data makes it easy for people and organizations to list the products and services they offer, and easy for web services to consume that product data for analysis and syndication.
Semantic XHTML Design Principles
XHTML is built on XML, and thus XHTML-based formats can be used not only for convenient display presentation, but also for general-purpose data exchange. In many ways, XHTML-based formats exemplify the best of both HTML and XML worlds. However, when building XHTML-based formats, it helps to have a guiding set of principles.
- Reuse the schema (names, objects, properties, values, types, hierarchies, constraints) as much as possible from pre-existing, established, well-supported standards by reference. Avoid restating constraints expressed in the source standard. Informative mentions are ok.
- For types with multiple components, use nested elements with class names equivalent to the names of the components.
- Plural components are made singular, and thus multiple nested elements are used to represent multiple text values that are comma-delimited.
- Use the most accurately precise semantic XHTML building block for each object etc.
- Otherwise use a generic structural element (e.g.
<span>
or<div>
), or the appropriate contextual element (e.g. an<li>
inside a<ul>
or<ol>
). - Use class names based on names from the original schema, unless the semantic XHTML building block precisely represents that part of the original schema. If names in the source schema are case-insensitive, then use an all lowercase equivalent. Components names implicit in prose (rather than explicit in the defined schema) should also use lowercase equivalents for ease of use. Spaces in component names become dash '-' characters.
- Finally, if the format of the data according to the original schema is too long and/or not human-friendly, use
<abbr>
instead of a generic structural element, and place the literal data into the 'title' attribute (where abbr expansions go), and the more brief and human-readable equivalent into the element itself. Further informative explanation of this use of<abbr>
: Human vs. ISO8601 dates problem solved
Inspiration and Acknowledgment
Many thanks go out to the contributors who laid the foundation for the current hProduct draft spec.
Scope
Giving details about a particular product is sometimes very complex as parameters are different for books and CDs than they are for iPods or cars. It should be very easy to mark up an item using hProduct and the syntax should be simple yet flexible enough for more advanced applications.
Out of Scope
This microformat does not intend to replicate any of the content proposed within hListing and would defer all money/transactional matters to that microformat. This microformat also does not attempt to specify a product ontology, or category-specific attributes; instead, it aims to create a framework to allow for flexible expression of both.
Format
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
In General
The hProduct format is based on a set of fields common to numerous ecommerce sites and formats in use today on the web.
Schema
The hProduct schema consists of the following (see existing class names for reference):
- hproduct
- availability. optional. text. can be further refined by type (instore, online, preorder, backorder, specialorder).
- brand. optional. text. can also use hCard for manufacturer.
- buy. optional. text. purchase messaging and/or rel="purchase" indicating target url for purchasing item.
- category. optional. text. can also use rel-tag. re-used from hCard.
- condition. optional. text. examples: 'new', 'used', 'refurbished'.
- description. optional. text. can also include valid HTML markup. re-used from hReview.
- model. optional. text.
- n. required. text. product name or title. re-used from [[hcard|hCard].
- photo. optional. image element or link. re-used from [[hcard|hCard].
- price. optional. floating point number. can be further refined by type (msrp, regular, sale, clearance), can use currency format.
- quantity. optional. integer.
- shipping. optional. text. shipping messaging.
- url. optional. href. can contain rel-tag rel='product'. re-used from [[hcard|hCard].
- version. optional. text. re-used from hReview.
- identifier. optional.
- type. required. - examples:
- mpn
- upc
- isbn
- issn
- ean
- jan
- sn
- vin
- sku
- value. required. - label may be implied
- type. required. - examples:
- p-v. optional. property-value pair.
- property. required - examples:
- accessory for
- artist
- author
- color
- compatible with
- quantity in lot
- rating - can be further denoted into rating types (product || merchant || mpaa || esrb || others)
- released - hcalendar event for date of release
- size
- value. required. - label may be implied
- property. required - examples:
Field details
Class names category
, n
, photo
, url
are reused from hCard. version
and description
are reused from hReview.
The fields of the hProduct schema represent the following:
hproduct::
Root class nameavailability::
the class name availability is used to determine availability of product. MUST be singular.brand::
the class name brand is used identify brand of the product. SHOULD use hCard for manufacturer name. MUST be singular.buy::
the class name buy contains messaging on how to buy product and/or relevant URLs to facilitate purchase. MAY be plural.category::
the class name category identifies product category. MAY use rel-tag microformat. MAY be plural to represent multiple categories.condition::
the class name condition identifies the product condition. MAY include text like "new", "used", "refurbished".MUST be singular.model::
the class name model identifies the manufacturer model name/ number associated with the item. MUST be singular.n::
product text name. MUST be singular.photo::
the class name photo MAY be applied to an <img> or <a> element. MAY be plural.price::
the class name price is used to identify a floating point number. MAY be refined by type, including msrp, regular, sale, or clearance. MAY use currency format. MAY be plural.quantity::
the class name quantity quantifies the number of available units of a product. MUST be singular.shipping::
the class name shipping MAY define the method, timeframe, and cost associated with shipping the product. MUST be singular.url::
the class name url SHOULD refer to the web page associated with product details. MAY use rel-tag, rel='product'. MUST be singular.version::
the class name version SHOULD indicate the version of the hProduct format used for the item. by omitting this field, the publisher is stating that implementations MAY interpret the hProduct according to any version of the hProduct specification. MUST be singular.identifier::
the identifier structure is used to describe product identifiers like UPC or SKU, and is designed to accommodate new or as-yet-unidentified identifiers. SHOULD be singular.type::
the class name type identifies the identifier type.value::
label MAY be implied
p-v::
the class p-v is the mechanism used to accomodate the wide variation in product attributes. MAY be plural.property::
the class name property is used to identify unique product attributes used in class p-v.value::
label MAY be implied.
Additional Details
Internationalization: Though there are many English-language tokens, they are only used as invisible class-names; user-visible listing information can be completely localized. Note that (X)HTML LANG attribute rules still apply as usual, for multilingual aggregators of hProduct.
XMDP Profile
- hproduct-profile (@TODO)
Notes
This section is informative.
- ...
Examples in Production
- Description of BestBuy.com implementation
- ... (@TODO)
Copyright
- JayMyers: I release all of my contributions to the public domain.
Public Domain Contribution Requirement. Since the author(s) released this work into the public domain, in order to maintain this work's public domain status, all contributors to this page agree to release their contributions to this page to the public domain as well. Contributors may indicate their agreement by adding the public domain release template to their user page per the Voluntary Public Domain Declarations instructions. Unreleased contributions may be reverted/removed.
Patents
This specification is subject to a royalty free patent policy, e.g. per the W3C Patent Policy, and IETF RFC3667 & RFC3668.