RDFa ( RDF in Attributes ) is a W3C recommendation that allows the embedding of RDF statements in HTML, XHTML, and a number of XML dialects. Together with microformats and microdata, it is one of the most common ways to add value to (X) HTML pages with computer-readable additional information. RDFa is one of the technologies of the Semantic Web.

  • 6.1 microformats
  • 6.2 Micro Data


RDFa as a module of XHTML

Back in 2004, Mark Birbeck presented in its publication XHTML and RDF a concept that forms the basis for RDFa. (The designation RDFa but not yet emerged in this document. ) In 2007 found these ideas in the W3C draft XHTML RDFa Module input.

RDFa 1.0

In October 2008, RDFa 1.0 was the official W3C Recommendation. From its genesis out it relied heavily on the proven extension mechanisms of the XML world, in particular XML namespaces. This had the consequence that RDFa 1.0 work only in XHTML and was not combined with classic HTML.

RDFa 1.1 and RDFa Lite

The current version, RDFa 1.1 was collected in June 2012 in the rank of a W3C Recommendation. The main difference with RDFa 1.0 is the absence of XML-specific peculiarities. RDFa can now equally in XML dialects (such as nuclear and SVG) as well as in HTML, especially HTML 5 can be used. Simultaneously with RDFa RDFa 1.1 Lite was born. RDFa Lite is not a separate variant, but a subset of RDFa, which considerably reduces the complexity, especially for beginners.


From the perspective of RDF RDFa is a record of several ways RDF. In contrast to pure RDF notations such as RDF / XML or Turtle RDFa embeds the RDF expressions in an existing document markup language (like HTML). Communication must not be double- maintained and kept up to date. The written information for people on a web page may be complemented by RDFa so that computer programs (eg search engines) capture their semantic meaning.

From the perspective of HTML RDFa is another way to structure the content of a website and to make it understandable for machines alongside microformats and microdata. RDFa can be based on a large amount of proven standard vocabularies fall back ( FOAF, SKOS, Dublin Core, SIOC, schema.org ), but also allows the definition of new terms.

To achieve this, RDFa adds to the so-called host languages ​​in the simplest case the following attributes ( RDFa Lite Subset ):

  • Vocab: specifies a default namespace, so the used vocabulary, fixed ( replacement for the XML namespace mechanism)
  • Prefix: sets if required more additional namespaces and their prefixes fixed (replacement for the XML namespace mechanism)
  • Resource: can denote the subject or object of the RDF statement
  • Property: determines the predicate of the statement
  • Typeof: determines the type of the subject

With the attributes listed above can be modeled almost all RDF expressions. In addition, the full RDFa 1.1 specification knows the following attributes for advanced applications:

  • About: is needed in individual cases rather than resource defining the subject
  • Content: specifies a content, which may be different from the readable content in the host language (eg formatted time information held by five clock )
  • Datatype: is a unique data type for a value to
  • InList: RDF generated list items
  • Rel: determines the predicate
  • Rev: determines the predicate ( if the subject is in the order of the object)

Finally, the following two HTML attributes of RDFa processors are evaluated according to fixed rules and are part of the generated RDF statements:

  • Src: source of an image file is in RDFa to the object
  • Href: link to another web address, in RDFa to the object


The following example uses the created by major search engines operators of schema.org vocabulary and simplified RDFa Lite syntax:


Buy the       vacuum cleaner XF704 < / span >       now in special offer!          Specifying vocab = " http://schema.org/ " determined in line 1 that all RDF identifiers are http://schema.org/ in the following tree in the namespace to find. The attribute typeof = " Product" right behind it indicates that is spoken in the following on a subject of type product and that relate any other information on it. In line 3 is specified with property = "name" that is now following product name. property = "image" reveals in line 5, that it is in the subsequent image file to the product picture.

The example can be extended:


Buy the       vacuum cleaner XF704 < / span >       now in special offer!            

      ( Product picture: Photo       " Cleanliness < / span > " by       John Doe       released for further use       without limitation < / span >    In line 7, a new namespace, a new vocabulary is included. Also still in line 7 indicates resource = " acmeXF704.jpg " that the further information refer to the image acmeXF704.jpg. property = " dc: title " property = "dc: creator " and property = " dc: rights " in lines 9-11 eventually provide more information about the title, author and rights of use of this image with the terms of the Dublin Core vocabulary.

Dissemination and practical applications

According WebDataCommons.org use 13% of all HTML pages some form of structured distinction. Of these, 49.3 % microformats, 14.4% and 36.3 % Microdata RDFa.

Important examples of the practical application are:

  • Schema.org is a joint initiative by search engines ( Google, Yahoo!, Bing, Yandex ) to provide a basic vocabulary for semantic enrichment of web pages. Since November 11, 2011 officially supports schema.org also RDFa.
  • Google supports RDFa in its rich snippets.
  • Facebook Open Graph Protocol when used RDFa.
  • Drupal is a content management system ( CMS), which has RDFa permanently installed since version 7.
  • WordPress is also a CMS, RDFa support via plugins.


  • Librdfa - RDFa library in C
  • Redland RDF libraries - set of RDF tools capable of reading and RDFa sources
  • RDFa Play - online tool for visualizing the data structure of the RDFa codes
  • Ruby RDF Distiller - tool to extract the RDF triples (among others) from RDFa in the Ruby programming language
  • Python RDFa 1.1 Distiller and Parser - Tool for extracting RDF triples from RDFa in the Python programming language



Microformats do without new attributes and use only the familiar HTML attributes class, rel and rev. Thus there are no problems in the integration of microformats even with HTML editors that check for the validity of the code based on a certain HTML version.

Various microformats are each limited to a single topic: There are special microformats recipes for resumes, social networking and so on. This simplifies the application, provided that it is exactly about these issues. Extensions are not possible at any time, but must be approved by the community. A combination of the data within the meaning of Linked Data is not possible with microformats.


Microdata was developed together with HTML 5 The specification is very similar to RDFa. The actual differences in the data model, which is based on the two specifications. RDFa is created with the express purpose of implementing the existing RDF concept in (X ) HTML. Accordingly, the mapping between RDF and RDFa works well. Microdata arose with other requirements. The exchange with RDF sources not working clearly in each constellation.