Differences Between Microdata and RDFa
While there are many (technical, smaller) differences, there is a choice of those that I consider important (as a base, my answer is to webmasters ).
Specifications
Applicability
Microdata can only be used in (X) HTML5 (respectively HTML, as defined by WHATWG).
RDFa can be used in different host languages, that is, in several (X) versions of HTML and XML (thus also in SVG, MathML, Atom, etc.).
And new host languages โโcan be supported, since RDFa Core is an attribute specification for expressing structured data in any markup language. "
Using multiple dictionaries
In Microdata it is more difficult, and sometimes impossible, to use multiple dictionaries for the same content.
Thanks to the use of prefixes RDFa allows you to mix dictionaries.
Using Inverse Properties
Microdata does not provide a way to use inverse properties. This is necessary for dictionaries that do not define inverse properties (for example, they only define parent instead of parent and child ). The popular Schema.org is such a dictionary (with only a few older exceptions).
While W3C Note Microdata to RDF defines an experimental itemprop-reverse , this attribute is not part of W3Cs or WHATWGs Microdata.
RDFa supports the use of inverse properties (with the rev attribute).
Semantic Web
Using Microdata, you do not play a role in the semantic network (and AFDIK Microdata does not intend to), mainly because it is not defined as serializing RDF (although there are ways to extract RDF from Microdata ).
RDFa is a serialization of RDF , and RDF is the foundation of the W3Cs Semantic Web .
The specifications of RDFa Core and HTML + RDFa may be more complex than HTML Microdata , but this is not a fair comparison because they offer more features.
Like Microdata there will be RDFa Lite (which "works for most everyday needs"), and this specification, at least in my opinion, is less complicated than Microdata.
What to do?
If you want to support specific consumers (e.g. search engine and browser add-on), you should check their documentation for supported syntaxes.
If you want to learn only one syntax and not have specific consumers in mind, (attention, subjective opinion!) Come with RDFa. Why?
- RDFa has matured over the years and is a W3C Rec, while Microdata is a relatively new invention and not a standardized W3C.
- RDFa can be used in many languages, not just HTML5.
- RDFa allows mixed use of dictionaries for the same content, and it natively supports the use of inverse properties.
Can not decide? Use both options.
Please note that you can also use multiple syntaxes for the same content so that you can have Microdata and RDFa (and Microformats, JSON-LD and ...) for maximum compatibility.
Here is a simple Microdata snippet:
<p itemscope itemtype="http://schema.org/Person"> <span itemprop="name">John Doe</span> is his name. </p>
Has the same snippet using RDFa (Lite):
<p typeof="schema:Person"> <span property="schema:name">John Doe</span> is his name. </p>
And here both syntaxes are used together:
<p itemscope itemtype="http://schema.org/Person" typeof="schema:Person"> <span itemprop="name" property="schema:name">John Doe</span> is his name. </p>
But it is usually not required / recommended to go down this route.
unor Sep 17 '14 at 10:41 2014-09-17 10:41
source share