W3C

RDFa Lite 1.1

W3C Working Draft 08 December 2011

This version:
http://www.w3.org/TR/2011/WD-rdfa-lite-20111208/
Latest published version:
http://www.w3.org/TR/rdfa-lite/
Latest editor's draft:
http://www.w3.org/2010/02/rdfa/sources/rdfa-lite/
Editor:
Manu Sporny, Digital Bazaar, Inc.

Abstract

RDFa Lite is a small subset of RDFa consisting of a few attributes that may be applied to most simple to moderate structured data markup tasks. While it is not a complete solution for advanced markup tasks, it does provide a good entry point for beginners.

Status of This Document

This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.

This document was published by the W3C RDF Web Applications Working Group as a First Public Working Draft. The purpose of this document is to provide an easy 15 minute introduction to RDFa that will resonate with most Web developers. This document is not intended to be a complete specification of RDFa 1.1. The complete specification of RDFa can be found in RDFa Core or one of the host languages for RDFa: XHTML+RDFa, SVG+RDFa, or HTML+RDFa. This document is intended to become a W3C Recommendation. If you wish to make comments regarding this document, please send them to public-rdfa-wg@w3.org (subscribe, archives). All feedback is welcome.

Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.

Table of Contents

1. Introduction

The RDFa syntax [RDFA-CORE] is often criticized as having too much functionality, leaving first-time authors confused about the more advanced features. This lighter version of RDFa helps authors easily jump into the structured data world. The goal was to create a very minimal subset that will work for 80% of the folks out there doing simple data markup.

2. The Attributes

RDFa Lite consists of five simple attributes; vocab, typeof, property, about, and prefix. RDFa 1.1 Lite is completely upwards compatible with the full set of RDFa 1.1 attributes. This means that if an author finds that RDFa Lite isn't powerful enough, transitioning to the full version of RDFa is just a matter of adding the more powerful RDFa attributes into the existing RDFa Lite markup.

2.1 vocab, typeof and property

RDFa, like Microformats and Microdata, allow us to talk about things on the Web. Typically when we talk about a thing, we use a particular vocabulary to talk about it. So, if you wanted to talk about People, the vocabulary that you would use would specify terms like name and telephone number. When we want to mark up things on the Web, we need to do something very similar, which is specify which vocabulary that we are going to be using. Here is a simple example that specifies a vocabulary that we intend to use to markup things in the paragraph:

<p vocab="http://schema.org/">
   My name is Manu Sporny and you can give me a ring via 1-800-555-0199.
</p>

As you will note above, we have specified that we're going to be using the vocabulary that can be found at http://schema.org/. This is a vocabulary that has been released by major search engine companies to talk about common things on the Web that Search Engines care about – things like People, Places, Reviews, Recipes, and Events. Once we have specified the vocabulary, we need to specify the type of the thing that we're talking about. In this particular case we are talking about a Person, which can be marked up like so:

<p vocab="http://schema.org/" typeof="Person">
   My name is Manu Sporny and you can give me a ring via 1-800-555-0199.
</p>

Now all we need to do is specify which properties of that person we want to point out to the search engine. In the following example, we mark up the person's name and phone number:

<p vocab="http://schema.org/" typeof="Person">
   My name is
   <span property="name">Manu Sporny</span>
   and you can give me a ring via
   <span property="telephone">1-800-555-0199</span>.
</p>

Now, when somebody types in “phone number for Manu Sporny” into a search engine, the search engine can more reliably answer the question directly, or point the person searching to a more relevant Web page.

2.2 about

If you want Web authors to be able to talk about the things on your page, you can identify the thing using a hash and a name. For example:

<p vocab="http://schema.org/" about="#manu" typeof="Person">
   My name is
   <span property="name">Manu Sporny</span>
   and you can give me a ring via
   <span property="telephone">1-800-555-0199</span>.
   <img property="image" src="http://manu.sporny.org/images/manu.png" />
</p>

If we assume that the markup above can be found at http://example.org/people, then the identifier for the thing is the address, plus the value in the about attribute. Therefore, the identifier for the thing on the page would be: http://example.org/people#manu. This identifier is also useful if you want to talk about the thing on another Web page. By identifying all things on the Web using a unique Uniform Resource Locator (URL), we can start building a Web of things. Companies building software for the Web can use this Web of things to answer complex questions like: "What is Manu Sporny's phone number and what does he look like?".

The Working Group is considering replacing the @about attribute with @resource. The details of the proposal are outlined in the wiki. The Working Group needs feedback from Web authors and implementers in order to ensure that the decision reflects something that would be helpful to authors. The change would result in the example above being changed to the following:

<p vocab="http://schema.org/" resource="#manu" typeof="Person">
   My name is
   <span property="name">Manu Sporny</span>
   and you can give me a ring via
   <span property="telephone">1-800-555-0199</span>.
   <img property="image" src="http://manu.sporny.org/images/manu.png" />
</p>

2.3 prefix

In some cases, a vocabulary may not have all of the terms an author needs when describing their thing. The last feature in RDFa 1.1 Lite that some authors might need is the ability to specify more than one vocabulary. For example, if we are describing a Person and we need to specify that they have a favorite animal, we could do something like the following:

<p vocab="http://schema.org/" prefix="ov: http://open.vocab.org/terms/" about="#manu" typeof="Person">
   My name is
   <span property="name">Manu Sporny</span>
   and you can give me a ring via
   <span property="telephone">1-800-555-0199</span>.
   <img property="image" src="http://manu.sporny.org/images/manu.png" />
   My favorite animal is the <a property="ov:preferredAnimal">Liger</a>.
</p>

The example assigns a short-hand prefix to the Open Vocabulary (ov) and uses that prefix to specify the preferredAnimal vocabulary term. Since schema.org doesn't have a clear way of expressing a favorite animal, the author instead depends on this alternate vocabulary to get the job done.

RDFa 1.1 Lite also pre-defines a number of useful and popular prefixes, such as dc, foaf and schema. This ensures that even if authors forget to declare the popular prefixes, that their structured data will continue to work.

3. Conformance

As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.

The key words must, must not, required, should, should not, recommended, may, and optional in this specification are to be interpreted as described in [RFC2119].

3.1 Document Conformance

In order for a document to claim that it is a conforming HTML+RDFa Lite document, it must provide the facilities described as mandatory in this section. The document conformance criteria are listed below, of which only a subset are mandatory:

An example of a conforming RDFa Lite document:

<html lang="en">
  <head>
    <title>Example Document</title>
  </head>
  <body>
    <p>This website is <a href="http://example.org/">example.org</a>.</p>
  </body>
</html>

3.2 RDFa Processor Conformance

The RDFa Processor conformance criteria are listed below, all of which are mandatory:

3.3 User Agent Conformance

A User Agent is considered to be a type of RDFa Processor when the User Agent stores or processes RDFa attributes and their values. The reason there are separate RDFa Processor Conformance and a User Agent Conformance sections is because one can be a valid HTML5 RDFa Processor but not a valid HTML5 User Agent (for example, by only providing a very small subset of rendering functionality).

The User Agent conformance criteria are listed below, all of which are mandatory:

A. References

A.1 Normative references

[HTML-RDFA]
Sporny, Manu et. al. RDFa in HTML 2010. W3C. URL: http://www.w3.org/TR/rdfa-in-html/
[HTML5]
Ian Hickson; David Hyatt. HTML5. 25 May 2011. W3C Working Draft. (Work in progress.) URL: http://www.w3.org/TR/html5
[RFC2119]
S. Bradner. Key words for use in RFCs to Indicate Requirement Levels. March 1997. Internet RFC 2119. URL: http://www.ietf.org/rfc/rfc2119.txt

A.2 Informative references

[RDFA-CORE]
Shane McCarron; et al. RDFa Core 1.1: Syntax and processing rules for embedding RDF through attributes. 31 March 2011. W3C Working Draft. URL: http://www.w3.org/TR/2011/WD-rdfa-core-20110331