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.

Introduction

The RDFa syntax 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 markup for things like search engines.

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>

RDFa Processor Conformance

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

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:

The Attributes

RDFa Lite consists of six simple attributes; vocab, typeof, property, rel, about, and prefix. RDFa 1.1 Lite is completely upwards compatible with the full set of RDFa 1.1 attributes.

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-0155.
</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 manufacturers 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're talking about a Person.

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

rel

At times, two things on the Web may be related to one another in a specific way. For example, the current page may describe a thing that has a picture of it somewhere else on the Web.

 
<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-0155</span>.
   <img rel="image" src="http://manu.sporny.org/images/manu.png" />
</p>
        

The example above links the Person on the page to the image elsewhere on the Web using the “image” relationship. A search engine will now be able to divine that the Person on the page is depicted by the image that is linked to in the page.

about

If you want people to link to 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-0155</span>.
   <img rel="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.

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-0155</span>.
   <img rel="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.

One of the nice things about RDFa 1.1 (and RDFa 1.1 Lite) is that a number of useful and popular prefixes, such as dc, foaf and schema are pre-defined for all RDFa processors. This ensures that even if authors forget to declare the popular prefixes, that their structured data will continue to work.