Microdata (HTML)
HTML |
---|
Comparisons |
Microdata is a WHATWG HTML specification used to nest metadata within existing content on web pages.[1] Search engines, web crawlers, and browsers can extract and process Microdata from a web page and use it to provide a richer browsing experience for users. Search engines benefit greatly from direct access to this structured data because it allows them to understand the information on web pages and provide more relevant results to users.[2][3] Microdata uses a supporting vocabulary to describe an item and name-value pairs to assign values to its properties.[4] Microdata is an attempt to provide a simpler way of annotating HTML elements with machine-readable tags than the similar approaches of using RDFa and microformats.
In 2013, because the W3C HTML Working Group failed to find someone to serve as an editor for the Microdata HTML specification, its development was terminated with a 'Note'.[5][6] However, since that time, two new editors were selected, and five newer versions of the working draft have been published,[7][8][9][10] the most recent being Working Draft 26 April 2018.[10]
Vocabularies
Microdata vocabularies do not provide the semantics, or meaning of an Item.[11] Web developers can design a custom vocabulary or use vocabularies available on the web. A collection of commonly used markup vocabularies are provided by Schema.org schemas which include: Person, "Place", Event, Organization, Product, Review, Review-aggregate, Breadcrumb, Offer, Offer-aggregate. The website schema.org was established by search engine operators like Google, Microsoft, Yahoo!, and Yandex, which use microdata markup to improve search results.[12]:85
For some purposes, an ad-hoc vocabulary is adequate. For others, a vocabulary will need to be designed. Where possible, authors are encouraged to re-use existing vocabularies, as this makes content re-use easier.[1]
Localization
In some cases, search engines covering specific regions may provide locally-specific extensions of microdata. For example, Yandex, a major search engine in Russia, supports microformats such as hCard (company contact information), hRecipe (food recipe), hReview (market reviews) and hProduct (product data) and provides its own format for definition of the terms and encyclopedic articles. This extension was made in order to solve transliteration problems between the Cyrillic and Latin alphabets. After the implementation of additional parameters from Schema's vocabulary,[13] indexation of information in Russian-language web-pages became more successful.
Global attributes
itemscope
– Creates the Item and indicates that descendants of this element contain information about it.[1]itemtype
– A valid URL of a vocabulary that describes the item and its properties' context.itemid
– Indicates a unique identifier of the item.itemprop
– Indicates that its containing tag holds the value of the specified item property. The property's name and value context are described by the item's vocabulary. Properties values usually consist of string values, but can also use URLs using thea
element and itshref
attribute, theimg
element and itssrc
attribute, or other elements that link to or embed external resources.[1]itemref
– Properties that are not descendants of the element with theitemscope
attribute can be associated with the item using this attribute. Provides a list of element IDs (notitemid
s) with additional properties elsewhere in the document.[1]datetime
– Indicates date or duration as specified by ISO 8601 standard.
Example
The following HTML5 markup may be found on a typical “About” page containing information about a person:
<section> Hello, my name is John Doe, I am a graduate research assistant at the University of Dreams. My friends call me Johnny. You can visit my homepage at <a href="http://www.example.com/~JohnnyD">www.example.com/~JohnnyD</a>. I live at 1234 Peach Drive, Warner Robins, Georgia.</section>
Here is the same markup with added Schema.org[14][15][16] Microdata:
<section itemscope itemtype="http://schema.org/Person"> Hello, my name is <span itemprop="name">John Doe</span>, I am a <span itemprop="jobTitle">graduate research assistant</span> at the <span itemprop="affiliation">University of Dreams</span>. My friends call me <span itemprop="additionalName">Johnny</span>. You can visit my homepage at <a href="http://www.example.com/~JohnnyD" itemprop="url">www.example.com/~JohnnyD</a>. <section itemprop="address" itemscope itemtype="http://schema.org/PostalAddress"> I live at <span itemprop="streetAddress">1234 Peach Drive</span>, <span itemprop="addressLocality">Warner Robins</span>, <span itemprop="addressRegion">Georgia</span>. </section> </section>
As the above example shows, Microdata items can be nested. In this case, an item of type http://schema.org/PostalAddress is nested inside an item of type http://schema.org/Person.
The following text shows how Google parses the Microdata from the above example code. Developers can test pages containing Microdata using Google's Rich Snippet Testing Tool.[17]
Item Type: http://schema.org/Person name = John Doe jobTitle = graduate research assistant affiliation = University of Dreams additionalName = Johnny url = http://www.example.com/~JohnnyD[yes|permanent dead link|dead link}}] address = Item(1) Item 1 Type: http://schema.org/PostalAddress streetAddress = 1234 Peach Drive addressLocality = Warner Robins addressRegion = Georgia
The same machine-readable terms can be used not only in HTML Microdata, but also in other annotations such as RDFa or JSON-LD in the markup, or in an external RDF file in a serialization such as RDF/XML, Notation3, or Turtle.
Support
- Servers: Google can[18] use microdata in its result pages.[17] It was the preferred snippet format for the Google+ social network.[19]
- Browsers: (As of July 2021), no major browser supports the Microdata DOM API.[20] Opera supported it from 11.60 (released in 2011), but since removed its implementation.[21] Firefox removed it in version 49.[22]
See also
- Semantic web
- Microformat
- RDFa Lite
- JSON-LD
- Semantic HTML
- Semantic social network
References
- ↑ 1.0 1.1 1.2 1.3 1.4 "Microdata — HTML Draft Standard". Whatwg.org. http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html.
- ↑ "MicroData - The Future of Search Engine Relevance and Optimization (SEO)". Lyquix.com. http://www.lyquix.com/blog-and-news/microdata-the-future-of-search-engine-relevance-and-search-engine-optimization-seo.
- ↑ Schema.org http://schema.org/
- ↑ ""Distributed," "Extensibility," And Other Fancy Words". Diveintohtml5.info. http://diveintohtml5.info/extensibility.html.
- ↑ Cotton, Paul (2 Oct 2013). "WG Decision to publish HTML Microdata as a WG Note". public-html-admin@w3.org (Mailing list). Retrieved 2016-06-30.
- ↑ "HTML Microdata". W3.org. 23 June 2014. http://www.w3.org/TR/microdata/.
- ↑ "HTML Microdata W3C First Public Working Draft 04 May 2017". https://www.w3.org/TR/2017/WD-microdata-20170504/.
- ↑ "HTML Microdata W3C Working Draft 26 June 2017". https://www.w3.org/TR/2017/WD-microdata-20170626/.
- ↑ "HTML Microdata W3C Working Draft 09 October 2017". 9 October 2017. https://www.w3.org/TR/2017/WD-microdata-20171009/.
- ↑ 10.0 10.1 "HTML Microdata W3C Working Draft 10 October 2017". 10 October 2017. https://www.w3.org/TR/2017/WD-microdata-20171010/.
- ↑ "HTML Standard". https://html.spec.whatwg.org/multipage/microdata.html.
- ↑ MacDonald, Matthew (2014). HTML5: The missing manual (2nd ed.). O'Reilly and Associates. ISBN 978-1-4493-6326-0.
- ↑ "Semantic markup deployment in Russia". Academia.edu. https://www.academia.edu/6732371.
- ↑ "Documentation". Schema.org. http://schema.org/docs/documents.html.
- ↑ "Type Hierarchy". Schema.org. http://schema.org/docs/full.html.
- ↑ "Schema.org Turtle RDFS Schema". http://schema.rdfs.org/all.ttl.
- ↑ 17.0 17.1 "Rich snippets (microdata, microformats, RDFa)". Google Inc.. 2016-05-17. https://developers.google.com/structured-data/testing.
- ↑ "Rich Snippet display clarification". 2016-06-22. https://www.google.com/support/webmasters/bin/answer.py?answer=99170.
- ↑ Google Webmasters Channel (2011-12-06). Types of Rich Snippets (Video). Archived from the original on 2021-12-15. Retrieved 2016-06-30.
- ↑ "Microdata DOM API - Web APIs | MDN" (in en-US). https://developer.mozilla.org/en-US/docs/Web/API/Microdata_DOM_API.
- ↑ Opera Software Documentation Team (2011-12-06). "Opera 11.60 for Windows changelog". Opera.com. http://www.opera.com/docs/changelogs/windows/1160/.
- ↑ "909633 - Remove HTML Microdata API" (in en). https://bugzilla.mozilla.org/show_bug.cgi?id=909633.
External links
- Microdata — HTML Draft Standard, WHATWG, https://html.spec.whatwg.org/multipage/microdata.html
- W3C HTML Microdata Working Group Note, W3C, https://www.w3.org/TR/microdata/
- Almaer, Dion (2009-05-11), Hixie discusses the addition of HTML5 "microdata", Ajaxian, http://ajaxian.com/archives/hixie-discusses-the-addition-of-html5-microdata
- HTML5 Microdata Specs, Data-Vocabulary.org, http://www.data-vocabulary.org
Original source: https://en.wikipedia.org/wiki/Microdata (HTML).
Read more |