Content deleted Content added
Filling in 11 references using Reflinks |
m Sections were not appropriate in these examples, as sections require headings (h1-6) as per spec |
||
(89 intermediate revisions by 62 users not shown) | |||
Line 1:
{{short description|Specification for metadata in web pages}}
{{Other uses|Microdata (disambiguation)}}
{{HTML}}
'''Microdata''' is a [[WHATWG]] [[HTML]] specification used to nest [[metadata]] within existing content on web pages.<ref name="WHATWG"/> [[Search engines]], [[web crawlers]], and [[Web browser|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
== Vocabularies ==
Microdata vocabularies do not provide the [[semantics]], or meaning of an Item.<ref>{{Cite web | title = HTML Standard | url = https://html.spec.whatwg.org/multipage/microdata.html | website = Web Hypertext Application Technology Working Group | access-date = 30 December 2016}}</ref> 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''.
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.<ref name="WHATWG"/>
== 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.
▲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. Due to the implementation of additional marking parameters of Schema's vocabulary, <ref name="AcademicYan"/> the indexation of information in Russian-language web-pages became considerably more successful.
== Global attributes ==
* <code>itemscope</code> – Creates the Item and indicates that descendants of this [[HTML element|element]] contain information about it.<ref name="WHATWG"/>
* <code>itemtype</code> – A valid URL of a vocabulary that describes the item and its properties' context.
* <code>itemid</code> – Indicates a unique identifier of the item.
* <code>itemprop</code> – 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
* <code>itemref</code> – Properties that are not descendants of the element with the <code>itemscope</code> attribute can be associated with the item using this attribute. Provides a list of element
* <code>datetime</code> – 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:
<
<
the University of Dreams.
My friends call me Johnny.
You can visit my homepage at <a href="http://www.
I live at 1234 Peach Drive, Warner Robins, Georgia.</
</syntaxhighlight>
Here is the same markup with added [[Schema.org]]<ref>{{cite web|url=http://schema.org/docs/documents.html |title=Documentation |publisher=Schema.org |access-date
<
<
Hello, my name is
<span itemprop="name">John Doe</span>,
Line 44 ⟶ 46:
<span itemprop="additionalName">Johnny</span>.
You can visit my homepage at
<a href="http://www.
<
I live at
<span itemprop="streetAddress">1234 Peach Drive</span>,
<span itemprop="addressLocality">Warner Robins</span>,
<span itemprop="addressRegion">Georgia</span>.
</
</
</syntaxhighlight>
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''.<ref name="GoogleRS"/>
<div class="plainlinks">
Item
Type: http://schema.org/Person
Line 64 ⟶ 66:
affiliation = University of Dreams
additionalName = Johnny
url = <nowiki>http://www.
address = Item(1)
Item 1
Line 71 ⟶ 73:
addressLocality = Warner Robins
addressRegion = Georgia
</div>
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 [[Resource Description Framework|RDF]] file in a serialization such as [[RDF/XML]], [[Notation3]], or [[Turtle (syntax)|Turtle]].
== Support ==
* Servers: [[Google]] can<ref name=GoogleCan /> use microdata in its [[Search engine results page|result pages]].<ref name=GoogleRS /> It
* Browsers: {{As of|
== See also ==
* [[Semantic web]]
* [[Microformat]]
* [[RDFa Lite]]
* [[
* [[CP/LD|CP/LD (Content Profile/Linked Document)]]
* [[Semantic HTML]]
* [[Semantic social network]]
==
{{Reflist|30em|refs=
<ref name="WHATWG">{{cite web|url=http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html |title=Microdata — HTML Draft Standard |publisher=Whatwg.org |access-date
<ref name="AcademicYan">{{cite web|url=
<ref name="GoogleCan">{{cite web|url=
<ref name="GoogleRS">{{cite web|url=https://developers.google.com/structured-data/testing |title=Rich snippets (microdata, microformats, RDFa) |publisher=Google
<ref name="DIVE">{{cite web|url=http://diveintohtml5.info/extensibility.html |title=
== External links ==
* {{citation |url=https://html.spec.whatwg.org/multipage/microdata.html |title=Microdata — HTML Draft Standard |publisher=[[Web Hypertext Application Technology Working Group|WHATWG]]}}
* {{citation |url=
* {{citation |url=http://
* {{citation |url=http://www.data-vocabulary.org |title=HTML5 Microdata Specs |publisher=Data-Vocabulary.org}}
{{Semantic Web}}
[[Category:Semantic HTML]]
[[Category:Search engine optimization]]
|