microdata: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
(Undo revision 70305 by Btrem (talk), actually no, it was abandoned and dead for nearly 4 years, then briefly re-adopted in 2017 and once again abandoned subsequently in less than a year afterwards)
Tag: Undo
 
(7 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<entry-title>microdata</entry-title>
{{DISPLAYTITLE:microdata}}


<dfn style="font-style:italic;font-weight:bold">microdata</dfn> is an extension to [[HTML5]] that provides another way to embed [[microformats]] and [[poshformats]] vocabularies.
<dfn style="font-style:italic;font-weight:bold">microdata</dfn> is part of [[WHATWG]]'s [[HTML]] living specification that provides another way to embed [[microformats]] and [[poshformats]] vocabularies, and has been superseded by [[microformats2]].


Specification: http://www.w3.org/TR/microdata/
microdata was explicitly dropped by the W3C in 2013 (and therefore not part of W3C [[HTML5]]) due to a lack of interest by anyone to edit the spec and keep it up to date.[http://lists.w3.org/Archives/Public/public-html-admin/2013Oct/0018.html]. It was later briefly re-adopted by W3C in [https://www.w3.org/TR/2017/WD-microdata-20170504/ 2017], updated a few times as recently as [https://www.w3.org/TR/2018/WD-microdata-20180426/ 2018], and then re-abandoned again in less than a year.


== summary ==
== summary ==
microdata consists of a set of attribute extensions to [[HTML5]]:
microdata consists of a set of attribute extensions to [[HTML]]:


* <code>itemprop</code> attribute is a more specific version of <code>class</code>, for field names
* <code>itemprop</code> attribute is a more specific version of <code>class</code>, for field names
Line 17: Line 17:
For common semantics on the web (e.g. [[hcard|people+organizations]], [[hcalendar|events]], [[hreview|reviews]], [[hatom|syndicated content]]), [[microformats]] are still simpler and easier than [[microdata]], and are already well implemented across numerous tools and services.
For common semantics on the web (e.g. [[hcard|people+organizations]], [[hcalendar|events]], [[hreview|reviews]], [[hatom|syndicated content]]), [[microformats]] are still simpler and easier than [[microdata]], and are already well implemented across numerous tools and services.


For uncommon, rare, experimental, or one-off semantics, [[microdata]] offers a simpler and easier to understand solution than alternatives that use [[namespaces]] like XML/RDF/RDFa.  Developers should consider [[microdata]] as another way of expressing semantics that they may otherwise use [[poshformats]] for.
For uncommon, rare, experimental, or one-off semantics:
* [[microdata]] offers a simpler and easier to understand solution than alternatives that use [[namespaces]] like XML/RDF/RDFa.  Developers may consider [[microdata]] as another way of expressing semantics that they may otherwise use [[poshformats]] for.
* '''[[microformats2#VENDOR_EXTENSIONS|microformats2 offers extension methods]]''' for adding both vendor extensions (e.g. h-vnd-* p-vnd-* etc.) and experimental extensions (e.g. h-x-* p-x-* etc.) and as such should be considered for another simpler way of expressing extended, one-off, custom, or site-specific semantics.
Either way, such uncommon, rare, experimental, or one-off semantics in the wild should be documented so they may inform possible future microformats vocabularies.
 
 


== history ==
== history ==
microdata didn't happen overnight.  Much of the design and simplicity of microdata is based on years of work on microformats [[principles]] deliberately designed to help guide and create simpler, more usable and accessible solutions. It happened so quickly because Ian Hickson designed microdata based upon years of work by both the microformats community, and the concept of using reverse-domain-names as unique qualifiers (popularized perhaps by Java programming language naming conventions).
microdata didn't happen overnight.  Much of the design and simplicity of microdata is based on years of work on microformats [[principles]] deliberately designed to help guide and create simpler, more usable and accessible solutions. It happened so quickly because Ian Hickson designed microdata based upon years of work by both the microformats community, and the concept of using reverse-domain-names as unique qualifiers (popularized perhaps by Java programming language naming conventions).


== potential ==
most recently, lessons learned from the microdata parsing/data model were incorporated into [[microformats2]] which now serves as a functional replacement thanks to the [[microformats2-parsing]] specification.
I think there are some very clever ideas in general purpose microdata, it has a lot of potential, and despite being a bit more abstract than microformats, still much simpler/easier to explain to web designers/developers/programmers than any form of RDF.


General microdata may be the right solution to the general purpose data representation problem that microformats specifically chose not to work on.
== parsers and tools ==
[http://schema.rdfs.org/tools.html schema.rdfs.org has a list of tools].


- [[User:Tantek|Tantek]] 17:42, 22 August 2009 (UTC)
* Python: [https://github.com/edsu/rdflib-microdata rdflib-microdata]
* Ruby: [https://github.com/gkellogg/rdf-microdata RDF::Microdata]
* Ruby: [http://lawrencewoodman.github.com/mida/ Mida]
* PHP: [https://github.com/linclark/MicrodataPHP MicrodataPHP]
* JavaScript (jQuery): [https://gitorious.org/microdatajs/ MicrodataJS]
* Java: [https://any23.apache.org/ Any23]


== microdata vocabularies ==
== microdata vocabularies ==
Line 33: Line 43:


=== microdata vCard vocabulary ===
=== microdata vCard vocabulary ===
Formerly documented as a separate specification at <nowiki>http://dev.w3.org/html5/mdvcard/</nowiki>, the microdata vCard vocabulary is currently available as [http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#vcard part of WHATWG additions to HTML5].
Formerly documented as a separate specification at <nowiki>http://dev.w3.org/html5/mdvcard/</nowiki>, the microdata vCard vocabulary is currently available as [http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#vcard part of WHATWG additions to HTML].
 
* Recommendation: use [[hCard]] directly instead, taking into account:
** the [[hcard-faq|hCard FAQ]] and
** [[hcard-issues-resolved|resolved]]+[[hcard-issues-closed|closed issues]].  


hCard 1.0.1 (under development) is incorporating these errata.  
* Recommendation: use [[h-card]] directly instead.


Using hCard will produce Google Rich Snippets, as well as work with [[yahoo-search]], and [[Firefox]] [[Operator]] and other tools.
If you're specifically looking to produce Google Rich Snippets, use [[hCard]] in addition to [[h-card]].


Note:
Note:
Line 48: Line 54:


=== microdata vEvent vocabulary ===
=== microdata vEvent vocabulary ===
Formerly documented as a separate specification at <nowiki>http://dev.w3.org/html5/mdvevent/</nowiki>, the microdata vEvent vocabulary is currently available as [http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#vevent part of WHATWG additions to HTML5].
Formerly documented as a separate specification at <nowiki>http://dev.w3.org/html5/mdvevent/</nowiki>, the microdata vEvent vocabulary is currently available as [http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#vevent part of WHATWG additions to HTML].


* Recommendation: use [[hCalendar]] directly instead, taking into account:
* Recommendation: use [[h-event]] directly instead.
** the [[hcalendar-faq|hCalendar FAQ]] and
** [[hcalendar-issues-resolved|resolved]]+[[hcalendar-issues-closed|closed issues]].  


hCalendar 1.0.1 (under development) is incorporating these errata. 
If you're specifically looking to produce Google Rich Snippets, use [[hCalendar]] in addition to [[h-event]].
 
Using hCalendar will produce Google Rich Snippets, as well as work with [[yahoo-search]], and [[Firefox]] [[Operator]] and other tools.


Note:
Note:
Line 81: Line 83:
</head>
</head>
<body>
<body>
<section itemtype="http://microformats.org/profile/hcard" itemscope>
<section itemtype="http://microformats.org/profile/h-card" itemscope>
<h1 itemprop="fn">Corey Mwamba</h1>
<h1 itemprop="name">Corey Mwamba</h1>
<div itemprop="adr">
<p itemprop="street-address">56 Nowhere Road</p>
<p itemprop="street-address">56 Nowhere Road</p>
<p itemprop="locality">Nowhere</p>
<p itemprop="locality">Nowhere</p>
Line 94: Line 95:
</source>
</source>


And here's an simple hCalendar example:
And here's an simple [[h-event]] example:


<source lang="html4strict">
<source lang="html4strict">
Line 103: Line 104:
</head>
</head>
<body>
<body>
<div itemtype="http://microformats.org/profile/hcalendar" itemscope>
<div itemtype="http://microformats.org/profile/h-event" itemscope>
  <a itemprop="url" href="http://conferences.oreillynet.com/pub/w/40/program.html">
  <a itemprop="url" href="http://conferences.oreillynet.com/pub/w/40/program.html">
   http://conferences.oreillynet.com/pub/w/40/program.html
   http://conferences.oreillynet.com/pub/w/40/program.html
  </a>
  </a>
  <span itemprop="summary">Web 2.0 Conference</span>:  
  <span itemprop="summary">Web 2.0 Conference</span>:  
  <time itemprop="dtstart" datetime="2005-10-05">October 5</time>-
  <time itemprop="start" datetime="2005-10-05">October 5</time>-
  <time itemprop="dtend" datetime="2005-10-07">7</time>,
  <time itemprop="end" datetime="2005-10-07">7</time>,
  at the <span itemprop="location">Argent Hotel, San Francisco, CA</span>
  at the <span itemprop="location">Argent Hotel, San Francisco, CA</span>
</div>
</div>
Line 129: Line 130:
* [[principles]]
* [[principles]]
* [[XMDP]]
* [[XMDP]]
==Related Links==
[http://www.cellulite.co.uk/advice/spa-treatment/mesotherapy '''mesotherapy''']

Latest revision as of 21:44, 14 December 2020


microdata is part of WHATWG's HTML living specification that provides another way to embed microformats and poshformats vocabularies, and has been superseded by microformats2.

microdata was explicitly dropped by the W3C in 2013 (and therefore not part of W3C HTML5) due to a lack of interest by anyone to edit the spec and keep it up to date.[1]. It was later briefly re-adopted by W3C in 2017, updated a few times as recently as 2018, and then re-abandoned again in less than a year.

summary

microdata consists of a set of attribute extensions to HTML:

  • itemprop attribute is a more specific version of class, for field names
  • subject attribute allows semantically linking within the page. Conceptually similar to the include-pattern.
  • itemref attribute allows including properties elsewhere on the page that are not descendants of itemscope. Takes space-separated ids (for example itemref="address phone" would include the elements with id="address" and id="phone"). Conceptually similar to the include-pattern.
  • content attribute on the meta element can be used to include invisible data that is not part of the content. As current browsers move meta inside <head>, make sure to include via itemref. Conceptually similar to the 'value-title' feature of the value-class-pattern.
  • itemscope attribute identifies blocks to be marked as structured data. Conceptually similar to the mfo brainstorming.
  • itemtype attribute to specify the type for an item (for example: itemtype="http://microformats.org/profile/hcard")

For common semantics on the web (e.g. people+organizations, events, reviews, syndicated content), microformats are still simpler and easier than microdata, and are already well implemented across numerous tools and services.

For uncommon, rare, experimental, or one-off semantics:

  • microdata offers a simpler and easier to understand solution than alternatives that use namespaces like XML/RDF/RDFa. Developers may consider microdata as another way of expressing semantics that they may otherwise use poshformats for.
  • microformats2 offers extension methods for adding both vendor extensions (e.g. h-vnd-* p-vnd-* etc.) and experimental extensions (e.g. h-x-* p-x-* etc.) and as such should be considered for another simpler way of expressing extended, one-off, custom, or site-specific semantics.

Either way, such uncommon, rare, experimental, or one-off semantics in the wild should be documented so they may inform possible future microformats vocabularies.


history

microdata didn't happen overnight. Much of the design and simplicity of microdata is based on years of work on microformats principles deliberately designed to help guide and create simpler, more usable and accessible solutions. It happened so quickly because Ian Hickson designed microdata based upon years of work by both the microformats community, and the concept of using reverse-domain-names as unique qualifiers (popularized perhaps by Java programming language naming conventions).

most recently, lessons learned from the microdata parsing/data model were incorporated into microformats2 which now serves as a functional replacement thanks to the microformats2-parsing specification.

parsers and tools

schema.rdfs.org has a list of tools.

microdata vocabularies

Separate from the microdata specification, there are a number of microdata vocabularies, based on microformats and previous formats like vCard and iCalendar.

microdata vCard vocabulary

Formerly documented as a separate specification at http://dev.w3.org/html5/mdvcard/, the microdata vCard vocabulary is currently available as part of WHATWG additions to HTML.

  • Recommendation: use h-card directly instead.

If you're specifically looking to produce Google Rich Snippets, use hCard in addition to h-card.

Note:

  • Avoid the "microdata vCard vocabulary" as in many ways it is an out-of-date fork/snapshot of hCard, even though portions of it appear to based directly on the vCard RFC. as well.
  • Avoid Google’s Rich Snippets vocabularies (Person and Organization), which are also forks of hCard/vCard, and are only implemented by Google currently.

microdata vEvent vocabulary

Formerly documented as a separate specification at http://dev.w3.org/html5/mdvevent/, the microdata vEvent vocabulary is currently available as part of WHATWG additions to HTML.

  • Recommendation: use h-event directly instead.

If you're specifically looking to produce Google Rich Snippets, use hCalendar in addition to h-event.

Note:

  • Avoid the "microdata vEvent vocabulary" as in many ways it is an out-of-date fork/snapshot of hCalendar's vevent root class name and applicable properties, even though portions of it appear to based directly on the iCalendar RFC.
  • Avoid Google’s Rich Snippets vocabulary (Event), which is also a fork of hCalendar/iCalendar, and are only implemented by Google currently.

microdata Licensing Works vocabulary

Formerly documented as a separate specification at http://dev.w3.org/html5/mdwork/, the microdata Licensing Works vocabulary is currently available as part of WHATWG additions to HTML5.

The licensing microformat work provides a potential microformat alternative to the microdata Licensing Works vocabulary.

Please see: licensing-brainstorming and provide feedback.

microformats in microdata

For those that are ok with going with an HTML5 only solution, it may be interesting to consider and document a consistent way to use microformats and microformats vocabulary in microdata.

A possible simple implementation could look like this:

<!DOCTYPE html>
<html lang="en">
<head>
<title>Corey Mwamba</title>
</head>
<body>
<section itemtype="http://microformats.org/profile/h-card" itemscope>
<h1 itemprop="name">Corey Mwamba</h1>
<p itemprop="street-address">56 Nowhere Road</p>
<p itemprop="locality">Nowhere</p>
<p itemprop="postal-code">NO1 6QT</p>
</div>
<a href="http://www.coreymwamba.co.uk/" itemprop="url">My web site</a>
</section>
</body>
</html>

And here's an simple h-event example:

<!DOCTYPE html>
<html lang="en">
<head>
<title>Web 2.0 Conference</title>
</head>
<body>
<div itemtype="http://microformats.org/profile/h-event" itemscope>
 <a itemprop="url" href="http://conferences.oreillynet.com/pub/w/40/program.html">
  http://conferences.oreillynet.com/pub/w/40/program.html
 </a>
 <span itemprop="summary">Web 2.0 Conference</span>: 
 <time itemprop="start" datetime="2005-10-05">October 5</time>-
 <time itemprop="end" datetime="2005-10-07">7</time>,
 at the <span itemprop="location">Argent Hotel, San Francisco, CA</span>
</div>
</body>
</html>

The advantage is that no major re-wiring in thinking is required to adjust real-world usage - but would parsers be able to deal with the change? And in fact, would this require a recasting of microformats themselves? --Epicurious 19:16, 16 August 2010 (UTC)

alternatives

Since the introduction of XMDP, web authors have been able to define their specific uses of rel attribute values and class names.

(needs expansion with examples) ...

see also