XHTML+RDFa

XHTML+RDFa (Extensible Hypertext Markup Language + Resource Description Framework in attributes) is an extended version of the XHTML markup language for supporting RDF through a collection of attributes and processing rules in the form of well-formed XML documents. XHTML+RDFa is one of the techniques used to develop Semantic Web content by embedding rich semantic markup. Version 1.1 of the language is a superset of XHTML 1.1, integrating the attributes according to RDFa Core 1.1. In other words, it is an RDFa support through XHTML Modularization.

RDFa in XHTML version 1.0 became a World Wide Web Consortium (W3C) Recommendation on 14 October 2008.

The current recommendation is RDFa+XHTML version 1.1, which became a W3C Recommendation on 7 June 2012 and was updated with a ”Second Edition” on 22 August 2013 and a ”Third Edition” on 17 March 2015.

Version 1.1 is based on XHTML™ 1.1 - Module-based XHTML - Second Edition. Version 1.0 was based on the first edition.

Overview
Conventional Web documents contain large amounts of structured data that can be rendered in web browsers. This approach works fine for publishing purposes, however, a large amount of data stored in Web documents cannot be processed this way. XHTML+RDFa can provide machine-readable metadata within the markup code which makes additional user functionalities available. Most important of all, actions can be performed automatically that enables up-to-date publishing, structured search and sharing. RDFa can serve as a bridge between the "human and data webs". The potential in web documents enriched with RDFa is increasing since major search engines begin to process them while indexing. Yahoo indexes RDFa and microformats since 2008 and Google since 2009. The RDFa attribute specifications make it possible to describe structured data in any markup language. The RDFa markup in XHTML+RDFa reuses the markup code, thus eliminating the need for unnecessary duplications. XHTML+RDFa is not widely distributed yet, probably due to the lack of support in authoring tools and content management systems. However, there is good tendency. Drupal 7, for example, supports RDFa. Since the “a” in RDFa stands for attributes, it is straightforward to use CSS selectors to style the code.

Document Type Definition
The combination of XHTML 1.1 and RDFa modules is claimed to be an example markup language. The Document Type Definition (DTD) is published at the W3C website.

According to the document type declaration, the identifiers of an XHTML+RDFa document should look like the following:

An example XHTML+RDFa document:

Authoring
The RDFa metadata is embedded as an XHTML attribute of the document element, generally the XHTML tag. The annotation syntax provided by RDFa can be used to express RDF statements in XHTML documents.

Validation
XHTML+RDFa documents can be validated individually online at the W3C Markup Validation Service or together with CSS and RSS at W3C Unicorn. The validity of XHTML+RDFa documents can be indicated by the XHTML+RDFa conformance icons of W3C.

Examples
XHTML syntax, additional namespaces and semantic markup.