<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="xmlspec.xsl"?>
<!DOCTYPE spec PUBLIC "-//W3C//DTD Specification V2.1//EN"
     "http://www.w3.org/XML/1998/06/xmlspec-v21.dtd" [
    <!ENTITY syntax.name "RDFa">
    <!ENTITY version "1.0">
    <!ENTITY XFormsNS "http://www.w3.org/2002/xforms">
    <!ENTITY prev-dd "27">
    <!ENTITY prev-mm "10">
    <!ENTITY prev-year "2005">
    <!ENTITY dd "05">
    <!ENTITY MM "April">
    <!ENTITY mm "04">
    <!ENTITY year "2007">
    <!ENTITY iso.doc.date "&year;&MMDD;">
    <!ENTITY MMDD "&mm;&dd;">
    <!ENTITY ne "≠">
    <!ENTITY ouml "ö">
    <!ENTITY times "×">
    <!ENTITY order "£">
    <!ENTITY le "≤">
    <!ENTITY cellback "#d0d9fa">
    <!ENTITY eacute "é">
    <!ENTITY copy "©">
    <!ENTITY sect "§">
]>
<!-- "http://www.w3.org/XML/1998/06/xmlspec-v21.dtd" -->
<spec w3c-doctype="base">
  <header>
    <title>&syntax.name; Syntax</title>
    <subtitle>A collection of attributes for layering RDF on XML languages</subtitle>
    <w3c-designation>Internal Working Draft</w3c-designation>
    <w3c-doctype>Editors' Draft</w3c-doctype>
        <!-- notice>Notice this!!</notice -->
        <publoc>
            $Id: Overview.xml,v 1.8 2007/04/06 16:36:34 adida Exp $
        </publoc>
        <prevlocs>
	  <loc href="http://www.w3.org/2001/sw/BestPractices/HTML/2005-rdfa-syntax">http://www.w3.org/2001/sw/BestPractices/HTML/2005-rdfa-syntax</loc>
        </prevlocs>
        <latestloc>
            <loc href="http://www.w3.org/2006/07/SWD/RDFa/syntax">http://www.w3.org/2006/07/SWD/RDFa/syntax</loc>
        </latestloc>
        <authlist>
            <author>
                <name>Mark Birbeck</name>
                <affiliation>x-port.net Ltd.</affiliation>
                <email href="mailto:Mark.Birbeck@x-port.net">Mark.Birbeck@x-port.net</email>
            </author>
            <author>
                <name>Steven Pemberton</name>
                <affiliation>CWI</affiliation>
            </author>
            <author>
                <name>Ben Adida</name>
                <affiliation>Creative Commons</affiliation>
                <email href="mailto:ben@adida.net">ben@adida.net</email>
            </author>
        </authlist>
        <abstract>
          <p>                
              Current web pages, written in HTML, contain significant
              inherent structured data. When publishers can express this
              data more completely, and when tools can read it, a new world
              of user functionality becomes available, letting users
              transfer structured data between applications and web sites.
              An event on a web page can be directly imported into a user's
              desktop calendar. A license on a document can be detected so
              that the user is informed of his rights automatically. A
              photo's creator, camera setting information, resolution, and
              topic can be published as easily as the original photo itself,
              enabling structured search and sharing.
          </p>
          <p>
              RDFa is a syntax for expressing this structured data in
              XHTML. The rendered, hypertext data of XHTML is reused
              by the RDFa markup, so that publishers don't repeat
              themselves. The underlying abstract representation is
              RDF, which lets publishers build their own vocabulary,
              extend others, and evolve their vocabulary with
              maximal interoperability over time. The expressed
              structure is closely tied to the data, so that
              rendered data can be copied and pasted along with its
              relevant structure.
          </p>

          <p>
            This document is a detailed syntax specification for RDFa. For a more gentle introduction, please consult the <a href="http://www.w3.org/2006/07/SWD/RDFa/primer">RDFa Primer</a>.
          </p>        </abstract>
        <status>

          <p> This is an internal draft produced by the Semantic Web
          Deployment Working Group <bibref ref="SWD-WG" />, in
          cooperation with the HTML Working Group
          <bibref ref="HTML-WG" />. Initial work on RDFa began with
          the Semantic Web Best Practices and Deployment Working Group
          <bibref ref="SWBPD-WG" />.
</p>
	  <p>
	  This document has <i>no official standing within the W3C</i>. It is also a work in progress, which means it may change at any time, without warning, and you shouldn't rely on anything in this document.
	  </p>
          <p>
            <emph>Last Modified: &year;-&mm;-&dd;</emph>
          </p>
        </status>
        <languages>
            <language>en</language>
        </languages>
        <revisiondesc>
            <p>
                <emph>Last Modified: $Id: Overview.xml,v 1.8 2007/04/06 16:36:34 adida Exp $</emph>
            </p>
        </revisiondesc>
    </header>
    <body>
      <div1>
	<head>Motivation</head>
	<p>
	  RDF/XML <a href="#RDF-SYNTAX">[RDF-SYNTAX]</a> provides
          sufficient flexibility to represent all of the abstract
          concepts in
          RDF <a href="#RDF-CONCEPTS">[RDF-CONCEPTS]</a>. However, it
          presents two challenges; first it is difficult or impossible
          to validate documents that contain RDF/XML using XML Schemas
          or DTD's, which makes it difficult to import RDF/XML into
          other markup languages. Whilst newer schema languages such
          as RELAX NG <a href="#RELAXNG">[RELAXNG]</a> do provide a
          way to validate documents that contain arbitrary RDF/XML, it
          will be a while before they gain wide support.
	</p>
	<p> Second, even if one could add RDF/XML directly into an XML
	  dialect like XHTML, there would be significant data
	  duplication between the rendered data and the RDF/XML
	  structured data. It would be far better to add RDF to a document
	  without repeating the document's existing data. For example,
	  an XHTML document that explicitly renders its author's name
	  "Mark Birbeck" should not need to repeat this name for RDF
	  expression of the same concept: the existing markup should
	  be augmentable to RDF with minimal data repetition.
	</p>
	
	<p>
	  Third, as users often want to transfer structured data from one application to another, sometimes to or from a non-web-based application, it is highly beneficial to express the web data's structure "in context." A user can then get contextual information about specific rendered data, for example by "right-clicking" on an item of interest.
  </p>
	<p> In the past, some attributes were 'hard-wired' directly
	  into the markup language to represent specific concepts.
	  For example, in XHTML 1.1 and HTML there is
	  a <att>cite</att> attribute. The attribute allows an author
	  to add information to a document to indicate the origin of a
	  quote. The following example comes from <bibref ref="HTML"
	  />, although it has been reformatted as XHTML
	  <bibref ref="XHTML" />:
	</p>
	<eg><![CDATA[
<blockquote cite="http://www.example.com/tolkien/twotowers.html">
    <p>They went in single file, running like hounds on a strong scent,
    and an eager light was in their eyes. Nearly due west the broad
    swath of the marching Orcs tramped its ugly slot; the sweet grass
    of Rohan had been bruised and blackened as they passed.</p>
</blockquote>
        ]]></eg>
	<p>
	  The problem here is that we have had to add a specific attribute to designate citation, and further, both the browser and some
	  metadata processor need to have knowledge of this attribute, and its position within the mark-up.
        </p>
	<p>
	    The
          motivation of RDFa is to devise a means by which documents
          can be augmented with metadata, using property values from
          the growing range of available taxonomies, reusing existing
          content from the host language. In RDFa, one way that the
          example given above could be marked-up is as follows:
        </p>

	<eg><![CDATA[
<blockquote>
    <link rel="dc:source" href="http://www.example.com/tolkien/twotowers.html" />
    <p>They went in single file, running like hounds on a strong scent,
    and an eager light was in their eyes. Nearly due west the broad
    swath of the marching Orcs tramped its ugly slot; the sweet grass
    of Rohan had been bruised and blackened as they passed.</p>
</blockquote>
        ]]></eg>

	<p>
	  Or, if the publisher wishes to give the user a clickable
	  link with the same embedded RDF:
	</p>

	<eg><![CDATA[
<blockquote about="#q1">
    taken from <a rel="dc:source"
		  href="http://www.example.com/tolkien/twotowers.html">
      Tolkien's Two Towers</a>.
    <p>They went in single file, running like hounds on a strong scent,
    and an eager light was in their eyes. Nearly due west the broad
    swath of the marching Orcs tramped its ugly slot; the sweet grass
    of Rohan had been bruised and blackened as they passed.</p>
</blockquote>
        ]]></eg>

	<p>
          We feel this proposal contributes to standardisation, and
          takes the pressure off language authors to anticipate all
          the structural requirements users of their language might
          have -- in this example we have used "source" from the
          Dublin Core <bibref ref="DC" /> list, rather than inventing
          our own citation attribute which would be unknown to other
          languages. For example, the source could still be determined
          if the same quote were marked-up in SVG:
        </p>
	<eg><![CDATA[
<svg:text>
    <link rel="dc:source" href="http://www.example.com/tolkien/twotowers.html" />
    They went in single file, running like hounds on a strong scent,
    and an eager light was in their eyes. Nearly due west the broad
    swath of the marching Orcs tramped its ugly slot; the sweet grass
    of Rohan had been bruised and blackened as they passed.
</svg:text>
        ]]></eg>
	<p>
          We feel these aspects of our proposal are crucial to the future of the Semantic Web, and the place of mark-up documents
          within it.
        </p>
	<p>
	  This proposal therefore outlines a new XML syntax for RDF that relies only on XML attributes, and so can be easily imported
          into other markup languages allowing them to carry arbitrary RDF.
	</p>
      </div1>
      <div1>
	<head>Terms and Abbrevations</head>
	<div2>
	  <head>Namespaces</head>
          <p>In the following examples, for brevity assume that the following namespace prefixes are defined:
            <table>
              <tbody>
                <tr>
                  <td>cc:</td>
                  <td>http://creativecommons.org/ns#</td>
                </tr>
                <tr>
                  <td>dc:</td>
                  <td>http://purl.org/dc/elements/1.1/</td>
                </tr>
                <tr>
                  <td>ex:</td>
                  <td>http://example.org/</td>
                </tr>
                <tr>
                  <td>foaf:</td>
                  <td>http://xmlns.com/foaf/0.1/</td>
                </tr>
                <tr>
                  <td>rdf:</td>
                  <td>http://www.w3.org/1999/02/22-rdf-syntax-ns#</td>
                </tr>
                <tr>
                  <td>rdfs:</td>
                  <td>http://www.w3.org/2000/01/rdf-schema#</td>
                </tr>
                <tr>
                  <td>svg:</td>
                  <td>http://www.w3.org/2000/svg</td>
                </tr>
                <tr>
                  <td>xh11:</td>
                  <td>http://www.w3.org/1999/xhtml</td>
                </tr>
                <tr>
                  <td>xsd:</td>
                  <td>http://www.w3.org/2001/XMLSchema#</td>
                </tr>
                <tr>
                  <td>biblio:</td>
                  <td>http://example.org/biblio/0.1</td>
                </tr>
                <tr>
                  <td>taxo:</td>
                  <td>http://purl.org/rss/1.0/modules/taxonomy/</td>
                </tr>
              </tbody>
            </table>
          </p>
        </div2>
            <div2>
                <head>RDF Terminology</head>
                <p>This document uses the following terminology defined in <bibref ref="RDF-CONCEPTS"/>:
                    <ulist>
                        <item>
                            <p>URI reference</p>
                        </item>
                        <item>
                            <p>literal</p>
                        </item>
                        <item>
                            <p>plain literal</p>
                        </item>
                        <item>
                            <p>typed literal</p>
                        </item>
                        <item>
                            <p>XML literal</p>
                        </item>
                        <item>
                            <p>XML value</p>
                        </item>
                        <item>
                            <p>node</p>
                        </item>
                        <item>
                            <p>blank node</p>
                        </item>
                        <item>
                            <p>triple</p>
                        </item>
                        <item>
                            <p>RDF graph</p>
                        </item>
                    </ulist>
                </p>
                <p>
                    We also add two further concepts, an [&syntax.name; element] and the [context statement] both of which are explained in the
                    processing section.
                </p>
                <p>
                    The aim of &syntax.name; is to allow [RDF graph]s to be carried in XML documents of any type. An [RDF graph] comprises
                    [node]s linked by relationships. The basic unit of a graph is a [triple], in which a
                    subject [node] is linked to an object [node] via a [predicate]. The subject [node] is always either an
                    [RDF URI reference] or a [blank node], the predicate is <emph>always</emph> an [RDF URI reference], and the
                    object of a statement can be an [RDF URI reference], a [literal], or a [blank node].</p>
                <p> In &syntax.name;, a subject [RDF URI reference] is
                    indicated using the attribute <att>about</att> and
                    predicates are represented using one of the
                    attributes
                    <att>property</att>, <att>rel</att>, or <att>rev</att>.  Objects which are [RDF URI reference]s
                    are represented using the attribute <att>href</att>, whilst objects that are [literal]s are represented either with the
                    attribute <att>content</att>, or the content of the element in question.
                </p>
                <div3>
                    <head>N-Triples</head>
                    <p>Most of the examples in this document are shown translated into N-Triples <bibref ref="N-TRIPLES"/> syntax, with a slight variation
                        in that QNames can be used to replace a URI reference. To tell them apart, the QName will have no angle brackets, e.g. the triple:</p>
                    <eg><![CDATA[
<http://internet-apps.blogspot.com/> dc:creator "Mark Birbeck" .
                    ]]></eg>
                    <p>
                        should be read as an abbreviation for the N-Triples syntax:
                    </p>
                    <eg><![CDATA[
<http://internet-apps.blogspot.com/>
  <http://purl.org/dc/elements/1.1/creator>
  "Mark Birbeck" .
                     ]]></eg>
                    <p>Datatypes can also be abbreviated, so the following:</p>
                    <eg><![CDATA[
<> dc:title
   "E = mc<sup>2</sup>: The Most Urgent Problem of Our Time"^^rdf:XMLLiteral .
                    ]]></eg>
                    <p>
                        should be read as an abbreviation for this N-Triples statement:
                    </p>
                    <eg><![CDATA[
<> <http://purl.org/dc/elements/1.1/creator>
   "E = mc<sup>2</sup>: The Most Urgent Problem of Our Time"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
                     ]]></eg>
                </div3>
            </div2>
            <div2>
                <head>Using <att>xml:base</att>
                </head>
                <p>All [RDF URI references] are subject to <att>xml:base</att>
                    <bibref ref="XML-BASE"/>. Note
                    that this means that in the absence of an <att>xml:base</att> attribute, the document containing the RDF statements is
                    <emph>itself</emph> the base.
                </p>
                <p>An example follows to show how <att>xml:base</att> affects the subject:</p>
                <eg><![CDATA[
<span xml:base="http://internet-apps.blogspot.com/">
    <link about="" rel="dc:creator" href="http://www.blogger.com/profile/1109404" />
    <meta about="" property="dc:title" content="Internet Applications" />
</span>
                ]]></eg>
                <p>The triples generated would be as follows:</p>
                <eg><![CDATA[
<http://internet-apps.blogspot.com/>
   dc:creator 
   <http://www.blogger.com/profile/1109404> .
<http://internet-apps.blogspot.com/>
   dc:title
   "Internet Applications" .
                ]]></eg>
            </div2>
	    <div2>
              <head>Using CURIEs</head>
	      <p>
		In order to allow for the compact expression of RDF
		statements, RDFa uses CURIEs (Compact URIs)
		<bibref ref="CURIE"
		/>. The <att>rel</att>, <att>rev</att>,
		and <att>property</att> attributes accept CURIE-only
		datatypes, while <att>href</att> and <att>about</att>
		accept mixed CURIE/URI data. In particular, the
		following notation is a valid RDFa statement:
	      </p>
	      <eg><![CDATA[
This document is licensed under a 
<a xmlns:cclicenses="http://creativecommons.org/licenses/"
   rel="cc:license"
   href="[cclicenses:by/nc-nd/3.0/]">
  Creative Commons License
</a>.
              ]]></eg>
	      <p>
		which generates the following triple, as expected:
	      </p>
	      
	      <eg><![CDATA[
<> cc:license <http://creativecommons.org/licenses/by/nc-nd/3.0/> .
              ]]></eg>

	    </div2>
      </div1>
      <div1>
	<head>Introduction to the structure of RDFa</head>

    <ednote><name>Ben</name><date>2007-04-06</date><edtext>this introduction should be reworked to feature less (maybe no) LINK and META elements. We should still mention them, but given that there are other ways to express these triples, we should be careful about the focus of this introductory paragraph. We should also explain the core RDF vs. the XHTML-specific profiles.</edtext></ednote>

	<div2>
	  <head>General Approach</head>
	  <p>
	    The main idea behind the syntax for RDFa is that existing
	    data should be easy to update to convey RDF triples. Thus,
	    the bulk of RDFa can be expressed using only attributes
	    applied to existing elements within the XML document,
	    specifically <att>about</att>, <att>rel</att>, <att>rev</att>, <att>property</att>, <att>href</att>,
	    and <att>content</att>. In addition, it should be possible
	    to represent a [triple] using only one XML element. In
	    this way it owes more to 'flat' syntaxes like RDF/N3
	    <bibref ref="N3-PRIMER" /> than it does to RDF/XML
	    <bibref ref="RDF-SYNTAX" />, despite its use of XML.
	  </p>
	  
	  <p>
	    For example, given an XHTML chunk as follows:
	  </p>
	  
	  <eg><![CDATA[
This photo was taken by
<span class="author">Mark Birbeck</span>.
          ]]></eg>

	  <p>
	    a simple attribute augmentation can yield an RDF triple:
	  </p>
	  
	  <eg><![CDATA[
This photo was taken by
<span class="author" about="photo1.jpg" property="dc:creator">Mark Birbeck</span>.
          ]]></eg>

	  <p>
	    which yields:
	  </p>

	  <eg><![CDATA[
<photo1.jpg> dc:creator "Mark Birbeck"^^rdf:XMLLiteral .
          ]]></eg>

	  <p>Note that, in the above example, had "Mark Birbeck" not been
	    enclosed in an existing <att>span</att> element, a new one could
	    have simply been used with <att>about</att>
	    and <att>property</att> as its only two attributes.
	  </p>
	  
	  <p>
	    Similarly, links can be augmented to express RDF triples. Consider an XHTML chunk:
	  </p>


	  <eg><![CDATA[
This photo was taken by
<a href="http://www.blogger.com/profile/1109404">Mark Birbeck</a>.
          ]]></eg>

	  <p>
	    When the RDF object is a URI, the RDF predicate is designated using <att>rel</att>:
	  </p>

	  <eg><![CDATA[
This photo was taken by
<a about="photo1.jpg" rel="dc:creator" 
   href="http://www.blogger.com/profile/1109404">Mark Birbeck</a>.
          ]]></eg>

	  <p>
	    which yields:
	  </p>

	  <eg><![CDATA[
<photo1.jpg> dc:creator <http://www.blogger.com/profile/1109404> .
          ]]></eg>

	  <p>
	    It's important to note that the various RDFa attributes can be used
	    on any existing element of the XML dialect. Note also that one can
	    express a reverse relationship using the <att>rev</att>
	    attribute. For example, if the photo in question is actually a
	    depiction of Mark, one could write:
	  </p>

	  <eg><![CDATA[
This photo was taken by
<a about="photo1.jpg" rev="foaf:img" 
   href="http://www.blogger.com/profile/1109404">Mark Birbeck</a>.
          ]]></eg>

	  <p>which would yield:</p>

	  <eg><![CDATA[
<http://www.blogger.com/profile/1109404> foaf:img <photo1.jpg> .
          ]]></eg>

	   <p>Both relations can be expressed simultaneously:</p>

	   <eg><![CDATA[
This photo was taken by
<a about="photo1.jpg" rel="dc:creator" rev="foaf:img"
   href="http://www.blogger.com/profile/1109404">Mark Birbeck</a>.
           ]]></eg>

	   <p>which then yields both triples:</p>

	   <eg><![CDATA[
<photo1.jpg> dc:creator <http://www.blogger.com/profile/1109404> .
<http://www.blogger.com/profile/1109404> foaf:img <photo1.jpg> .
           ]]></eg>

	   <p>
	     And it's also possible to go further and add the attributes used for
	     denoting statements in which the object is a [literal]:
	   </p>

	   <eg><![CDATA[
This photo was taken by
<a about="photo1.jpg" property="dc:title"
   content="Portrait of Mark" rel="dc:creator"
   rev="foaf:img" href="http://www.blogger.com/profile/1109404">Mark Birbeck</a>.
           ]]></eg>

	   <p>
	     which would then yield:
	   </p>

	   <eg><![CDATA[
<photo1.jpg> dc:creator <http://www.blogger.com/profile/1109404> .
<http://www.blogger.com/profile/1109404> foaf:img <photo1.jpg> .
<photo1.jpg> dc:title "Portrait of Mark" .
           ]]></eg>

	   <p>
	     It's possible to do all of this without ambiguity, since
	     the <att>property</att> attribute always denotes a predicate in a
	     statement in which the object is a [literal], whilst
	     the <att>rel</att> and <att>rev</att> attributes always denote a
	     predicate in a statement in which the object is a [URI reference]. Put
	     a different way, <att>property</att> always works
	     with <att>content</att>, whilst <att>rel</att>
	     and <att>rev</att> work with
	     <att>href</att>.
	   </p>

	   <p>
	     Of course, the more natural way to express the three
	     above triples is to strive to make all metadata literals
	     and URIs meaningful within the host XML
	     dialect. Specifically, in the case of XHTML2, it makes
	     sense to render as much of the useful metadata as
	     possible and use RDFa to mark up this rendered data. The
	     following XHTML thus generates the same triples shown
	     above.
	   </p>

	   <eg><![CDATA[
This photo, entitled 
<span about="photo1.jpg" property="dc:title">Portrait of Mark</span>
was taken by
<a about="photo1.jpg" rel="dc:creator" rev="foaf:img"
   href="http://www.blogger.com/profile/1109404">Mark himself</a>.
           ]]></eg>

	   <p>
       The value of
	     the <att>about</att> attribute is inherited from parent
	     elements. The following XHTML thus generates the very same triples as
	     the XHTML above.
	   </p>
	   
	   <eg><![CDATA[
<div about="photo1.jpg">
  This photo, entitled
  <span property="dc:title">Portrait of Mark</span>
  was taken by
  <a rel="dc:creator" rev="foaf:img" 
     href="http://www.blogger.com/profile/1109404">Mark himself</a>.
</div>
           ]]></eg>
	</div2>
	<div2>
	  <head>Qualifying document components</head>
	  <p>
	    A second feature of RDFa is that it is possible to use
            parts of the host document to provide the [subject] of a
            [triple]. This marks RDFa from other approaches to
            serialising RDF, in that the the same syntax can now be
            used to make statements about parts of a document, and
            external documents.
          </p>

    <ednote><name>Ben</name><date>2007-04-04</date><edtext>the clickability of anything with HREF needs to be explored in non XHTML2. Clarification needed.</edtext></ednote>

	  <p>
	    It is possible to make such statements using the syntax
	    introduced in the examples above:
	  </p>


	  <eg><![CDATA[
<html xmlns:dc="http://purl.org/dc/elements/1.1/">
    <head>
        <title>On <em>Crime and Punishment</em></title>
    </head>
    <body>
        <blockquote id="q1" about="#q1" rel="dc:source" href="urn:isbn:0140449132" >
            <p>
                Rodion Romanovitch! My dear friend! If you go on in this way
                you will go mad, I am positive! Drink, pray, if only a few drops!
            </p>
        </blockquote>
    </body>
</html>
           ]]></eg>
	  <p>
	    However, two problems arise: the <att>href</att> causes
	    the entire quotation to become a clickable link, which may
	    not be the desired visual effect, and only one triple can
	    be expressed. Thus, RDFa provides another mechanism,
	    using the special <att>link</att> or <att>meta</att>
	    element without a specified [subject]. In such cases, the
	    [triple] concerns the parent element. This allows the
	    example above to be recast as follows:
	  </p>

	  <eg><![CDATA[
<html xmlns:dc="http://purl.org/dc/elements/1.1/">
    <head>
        <title>On <em>Crime and Punishment</em></title>
    </head>
    <body>
        <blockquote id="q1">
            <link rel="dc:source" href="urn:isbn:0140449132" />
            <p>
                Rodion Romanovitch! My dear friend! If you go on in this way
                you will go mad, I am positive! Drink, pray, if only a few drops!
            </p>
        </blockquote>
    </body>
</html>
          ]]></eg>

	  <p>
	    This syntax (omitting the <att>about</att> attribute to
	    refer to the parent element) only applies to the
	    elements <att>link</att> and <att>meta</att>, which means
	    that even without an <att>id</att> attribute, the
	    following statement is still 'about'
	    the <att>blockquote</att> element, and not the document as
	    a whole:
	  </p>
	  
	  <eg><![CDATA[
<blockquote>
    <link rel="dc:source" href="urn:isbn:0140449132" />
    <p>
        Rodion Romanovitch! My dear friend! If you go on in this way
        you will go mad, I am positive! Drink, pray, if only a few drops!
    </p>
</blockquote>
          ]]></eg>

	  <p>
	    If more than one piece of metadata needs to be attached to the same
	    element, then additional <att>link</att> or <att>meta</att>
	    elements can be added:
	  </p>
	  
	  <eg><![CDATA[
<blockquote>
       <link rel="dc:source" href="urn:isbn:0140449132" />
       <meta property="dc:creator" content="Fyodor Dostoevsky" />
       <p>
            Rodion Romanovitch! My dear friend! If you go on in this way
            you will go mad, I am positive! Drink, pray, if only a few drops!
       </p>
</blockquote>
          ]]></eg>

	  <p>
            Now we have attached two pieces of metadata to
            the <att>blockquote</att> element -- the source of the
            quote, and its author.
          </p>

	  <note>
	    <p>
	      We say nothing here about how this metadata is used. In
	      the previous example, the information may be of use to
	      an RDFa-aware browser, and it could be made available
	      to the user accessing the page via a mechanism such as
	      tooltips. But it may also be the case that the document
	      is parsed by some external processor and the output
	      stored as a set of [triple]s. In the latter case the
	      [triple]s generated by the previous example would have a
	      [unique anonymous ID] as the subject of each statement,
	      as follows:
	    </p>

	    <eg><![CDATA[
_:a dc:source <urn:isbn:0140449132> .
_:a dc:creator "Fyodor Dostoevsky" .
            ]]></eg>

	    <p>
	      If one wishes a non-anonymous node to represent the blockquote,
	      one only needs to add an additional attribute to
	      the <att>blockquote</att>, namely the usual XML <att>id</att>
	      attribute:
	    </p>
	    
	    
	    <eg><![CDATA[
<blockquote id="q1">
       <link rel="dc:source" href="urn:isbn:0140449132" />
       <meta property="dc:creator" content="Fyodor Dostoevsky" />
       <p>
            Rodion Romanovitch! My dear friend! If you go on in this way
            you will go mad, I am positive! Drink, pray, if only a few drops!
       </p>
</blockquote>
            ]]></eg>

	    <p>
	      which then yields:
	    </p>
	    

	    <eg><![CDATA[
<#q1> dc:source <urn:isbn:0140449132> .
<#q1> dc:creator "Fyodor Dostoevsky" .
            ]]></eg>
	  </note>
	</div2>
	<div2>
	  <head>Relating document components</head>
	  <p>
	    Using qualifying statements, RDFa allows a single XML dialect
	    document to include multiple RDF entities. Relations between the
	    various entities of a given page can also be defined using RDFa
	    notation. 
	  </p>

	  <p>
	    Consider the following XHTML, which defines two RDF entities of
	    type <att>taxo:topic</att>, two RDF entities of
	    type <att>biblio:Publication</att>, metadata pertinent to each
	    publication, including <att>dc:title</att>
	    and <att>dc:creator</att>, and relations of
	    type <att>taxo:topics</att> between the publications and tags:
	  </p>

	  <eg><![CDATA[
<html xmlns:dc="http://purl.org/dc/elements/1.1/">
    <head>
        <title>Mark's Publications</title>
    </head>
    <body>

       <h2>Tags</h2>
       <div id="tag_standards">
          <link rel="rdf:type" href="[taxo:topic]" />
          Standards
       </div>
       <div id="tag_xforms">
          <link rel="rdf:type" href="[taxo:topic]" />
          XForms
       </div>

       <h2>Publications</h2>
       <div id="publication_1">
         <link rel="rdf:type" href="[biblio:Publication]" />
         <link rel="dc:creator" href="http://www.blogger.com/profile/1109404" />
         <meta property="dc:title">A Standards-Based Virtual Machine</meta>
         <link rel="taxo:topics" href="#tag_standards" />
       </div>
       <div id="publication_2">
         <link rel="rdf:type" href="[biblio:Publication]" />
         <link rel="dc:creator" href="http://www.blogger.com/profile/1109404" />
         <meta property="dc:title">XForms and Internet Applications</meta>
         <link rel="taxo:topics" href="#tag_standards" />
         <link rel="taxo:topics" href="#tag_xforms" />
       </div>
    </body>
</html>
          ]]></eg>

	  <p>
	    This yields the expected triples:
	  </p>
	  
	  <eg><![CDATA[
<#tag_standards> rdf:type taxo:topic .
<#tag_xforms> rdf:type taxo:topic .

<#publication_1> rdf:type biblio:Publication .
<#publication_1> dc:creator <http://www.blogger.com/profile/1109404>
<#publication_1> dc:title "A Standards-Based Virtual Machine"^^rdf:XMLLiteral .
<#publication_1> taxo:topics <#tag_standards> .

<#publication_2> rdf:type biblio:Publication .
<#publication_2> dc:creator <http://www.blogger.com/profile/1109404>
<#publication_2> dc:title "XForms and Internet Applications"^^rdf:XMLLiteral .
<#publication_2> taxo:topics <#tag_standards> .
<#publication_2> taxo:topics <#tag_xforms> .
          ]]></eg>

	  <p>
	    Beyond this theoretical example, this application of RDFa is
	    particularly useful for formats like FOAF. (See examples.)
	  </p>
	</div2>
	<div2>
	  <head>Global RDF statements</head>
	  <p>
	    The previous series of examples may mislead one to think that RDFa
	    statements are only contextual, only meant to qualify existing
	    elements. However, as the first examples implied, a
	    fixed <att>about</att> attribute can be used to specify a global
	    subject. It is actually quite easy to make independent, global RDF
	    statements. Statements like:
	  </p>
	  
	  <eg><![CDATA[
This document is licensed under a 
<a about="" rel="cc:license" 
   href="http://creativecommons.org/licenses/by-nc-nd/3.0/">
  Creative Commons
</a>.
          ]]></eg>

	  <p>
	    will produce the same triple no matter where they're located in the document:
	  </p>
	  
	  <eg><![CDATA[
<> cc:license <http://creativecommons.org/licenses/by-nc-nd/3.0/> .
          ]]></eg>
	</div2>
      </div1>
      <div1>
	<head>RDFa in detail</head>
	<p>
	  In this section we look in more detail at the [triple]s that are
	  generated when using RDFa attributes and elements.  We've already
	  said that the aim is to make it possible to generate a [triple] with
	  one element. However, we also saw that parent elements may have an
	  effect on the triple represented by their children elements.  We
	  therefore need to understand how the subject, predicate and object
	  parts of a [triple] are established from our syntax.
	</p>
	<div2>
	  <head>Processing</head>
	  <p>
	    An [&syntax.name; element] is defined as any XML element
	    that contains one or more RDFa
	    attributes: <att>about</att>, <att>property</att>, <att>rel</att>, <att>rev</att>, <att>href</att>, <att>content</att>.
	    Processing proceeds by examining each [RDFa element] in
	    turn. The [RDFa element] under consideration at any time
	    is the [current statement], and its parent element is the
	    [context statement]. Note that the [context statement]
	    does not need to be an [RDFa element]. RDFa also
	    includes a <att>datatype</att> attribute.  The presence of that
	    attribute does not by itself designate an [RDFa element].
	  </p>

	  <p> As each [RDFa element] is examined, the processor tries to establish
      the RDF triples it generates. Each of the attributes <att>rel</att>,
      <att>rev</att>, and <att>property</att> can express one or more triples:
      each accepts space-separated values, and each such value the predicate
      for one triple. It makes sense, then, for the processor to start with
      identifying the predicate of a triple, then to figure out the triple's
      subject and object. </p>

      <ednote><name>Ben</name><date>2007-04-06</date><edtext>A small section here on associating a CURIE/URI with any [RDFa element] could be useful, as that is used at least twice.</edtext></ednote>

	</div2>

	<div2>
	  <head>Establishing the predicate</head>

	  <p> The predicate of a statement is specified using a
      <att>property</att>, <att>rel</att> or <att>rev</att> attribute. These
      attributes can be placed on any element in a document, and -- although
      readability may suffer -- can even co-exist on the same element. Each of
      these attributes accepts space-separated CURIEs, each of which expresses
      exactly one triple. The attribute indicates the type of resolution to
      use for the subject and object of the triple. For simplicity, we assume
      an attribute value of a single CURIE. We explain the space-separated
      multiple-values situation later.</p>

	  <div3>
	    <head>Using the <att>property</att> attribute</head>

	    <p> A <att>property</att> attribute designates a predicate whose
        object is a literal. The object of the triple is determined using
        [literal] object resolution (Section 4.4). The subject of the triple
        is determined using subject resolution (Section 4.3). The following
        example indicates the name of the author responsible for the text
        being quoted: </p>

	    
	    <eg><![CDATA[
<blockquote about="#q1">
    <p>
        Rodion Romanovitch! My dear friend! If you go on in this way
        you will go mad, I am positive! Drink, pray, if only a few drops!
    </p>
    <p>
        by <span property="dc:creator">Fyodor Dostoevsky</span>
    </p>
</blockquote>
            ]]></eg>

	  </div3>
	  <div3>
	    <head>Using the <att>rel</att> attribute</head>

	    <p> A <att>rel</att> attribute designates a predicate whose object is
        a non-literal. The subject of the triple is determined using subject
        resolution (Section 4.3). The object of the triple is determined using
        [URI reference] object resolution (Section 4.4). The following example
        indicates that one 'FOAF person' knows another: </p>

	    <eg><![CDATA[
Daniel <a about="mailto:daniel.brickley@bristol.ac.uk"
          rel="foaf:knows" href="mailto:libby.miller@bristol.ac.uk">knows</a> Libby.
            ]]></eg>

	    <p>The triple generated is:</p>

	    <eg><![CDATA[
<mailto:daniel.brickley@bristol.ac.uk>
  foaf:knows
  <mailto:libby.miller@bristol.ac.uk> .
            ]]></eg>
	  </div3>

	  <div3>
	    <head>Using the <att>rev</att> attribute</head>

	    <p> A <att>rev</att> attribute, like its cousin the <att>rel</att>
        attribute, indicates a predicate whose object is a non-literal, though
        its subject and object resolutions are reversed. The subject of the
        triple is determined using [URI reference] <em>object</em> resolution
        (Section 4.4). The object of the triple is determined using
        <em>subject</em> resolution (Section 4.3). Note that resolution is
        effectively the same as if the <att>rev</att> attribute had been a
        <att>rel</att> attribute with object and subject reversed. The
        following example indicates that one 'FOAF person' knows another: </p>

	    <eg><![CDATA[
<a about="mailto:daniel.brickley@bristol.ac.uk"
   rev="foaf:knows" href="mailto:libby.miller@bristol.ac.uk">Libby</a> knows Daniel.
            ]]></eg>

	    <p>and the [triple] generated is essentially a reversal of our previous example:</p>

	    <eg><![CDATA[
<mailto:libby.miller@bristol.ac.uk>
  foaf:knows
  <mailto:daniel.brickley@bristol.ac.uk> .
            ]]></eg>

	  </div3>

	  <div3>
	    <head>Using both <att>rel</att> and <att>rev</att> attribute</head>
	    <p>
	      It is perfectly acceptable to use both <att>rel</att>
	      and <att>rev</att> attributes within the same
	      element. Predictably, this approach yields two
	      triples, without repeating the subject and object. For example:
	    </p>

	    <eg><![CDATA[
<a about="mailto:daniel.brickley@bristol.ac.uk" 
   rel="foaf:knows" rev="foaf:knows"
   href="mailto:libby.miller@bristol.ac.uk" >Libby</a> and Daniel know each other.
            ]]></eg>

	    <p>expresses:</p>

	    <eg><![CDATA[
<mailto:libby.miller@bristol.ac.uk>
  foaf:knows 
  <mailto:daniel.brickley@bristol.ac.uk> .
<mailto:daniel.brickley@bristol.ac.uk> 
  foaf:knows
  <mailto:libby.miller@bristol.ac.uk> .
            ]]></eg>

	    <p>
	      The predicates need not be the same, of course.
	    </p>

	  </div3>
	  
	  <div3>
	      <head>Multiple Attribute Values</head>
	      <p>
	          The <att>rel</att>, <att>rev</att>, and <att>property</att> attributes accept multiple space-separated CURIEs as a single attribute value. When there is more than one CURIE, then each expresses the exact same triples it would if it were the single CURIE in the attribute value. For example: 
          </p>
          
	    <eg><![CDATA[
This document was authored and published by
<a about="" rel="dc:creator dc:publisher" rel="http://example.org/~markb">
    Mark Birbeck
</a>.
            ]]></eg>
            
        <p>
            is interpreted by performing the normal subject and object resolutions dictated by the <att>rel</att> attribute on both the <att>dc:creator</att> and <att>dc:publisher</att> values. The resulting triples are:
        </p>

	    <eg><![CDATA[
<> dc:creator <http://example.org/~markb> .
<> dc:publisher <http://example.org/~markb> .
            ]]></eg>
          
         <p>
             The same exact reasoning applies to the <att>rev</att> and <att>property</att> attributes.
         </p>
      </div3>
	</div2>

	  <div2>
	    <head>Establishing the object</head>

	    <p> The object of the statement can be set using one of the attributes
        <att>content</att> or <att>href</att>. Which attribute is used depends
        on how the predicate is indicated. If the predicate is set using
        <att>property</att> then the object is a [literal], and its value is
        given by the <att>content</att> attribute or the element content. If
        the predicate is set with the <att>rel</att> attribute, then the
        object is a non-literal whose value depends on the presence and value
        of <att>href</att> attribute. If the predicate is expressed with the
        <att>rev</att> attribute, then the object will be obtained using
        <em>subject resolution</em> as defined in the next section, while this
        section explains how to set that predicate's <em>subject</em>.</p>

	    <div3>
	      <head>Literal object resolution using the <att>content</att> attribute</head>

	      <p>The <att>content</att> attribute can be used to indicate a [plain literal] as follows:</p>
	      
	      <eg><![CDATA[
<meta about="http://internet-apps.blogspot.com/"
      property="dc:creator" content="Mark Birbeck" />
              ]]></eg>

	      <p>
		or, alternatively, using the content of the element (<att>meta</att>
		or other) as an [XMLliteral]:
	      </p>

	      <eg><![CDATA[
<span about="http://internet-apps.blogspot.com/"
      property="dc:creator">Mark Birbeck</span>
              ]]></eg>

	      <p> If the element that carries the <att>property</att> attribute
          also carries a <att>content</att> attribute and is non-empty, the
          value of the <att>content</att> attribute takes precedence and is
          taken to be the object of the triple. More details on determining
          the type of a literal object are provided in Section 5.1. </p>

          </div3>

	    <div3>
	      <head>URI object resolution using the <att>href</att> attribute</head>

	      <p> When a triple predicate has been expressed using the
          <att>rel</att> attribute, the <att>href</att> attribute on the [RDFa
          statement]'s element is used to indicate the object as a [URI
          reference]. Its type, just like that of the <att>about</att>
          attribute, is CURIE/URI: </p>

	      <eg><![CDATA[
<link about="mailto:daniel.brickley@bristol.ac.uk"
      rel="foaf:knows" href="mailto:libby.miller@bristol.ac.uk" />
              ]]></eg>
	
	    </div3>

	    <div3>
	      <head><att>rel</att> without <att>href</att></head>

	      <p> When a triple predicate has been expressed using the
          <att>rel</att> attribute, and no <att>href</att> attribute exists on
          the same [RDFa element], then the CURIE/URI represented by this
          element is used as the object. Specifically, this CURIE/URI is
          affected by the <att>about</att> and <att>id</att> attributes. When
          neither is present, the object is a bnode (bnodes are discussed
          further in Section 5 [REF]). In all cases, the subject resolution
          for child elements is affected: where they do not override the
          subject, their subject is this same CURIE/URI here resolved as the
          object.</p>
          
          <p>
              Consider, for example, a simple fragment of HTML for describing the creator of a web page, with further information about the creator, including his name and email address:
          </p>

	      <eg><![CDATA[
<div rel="dc:creator">
  <span property="foaf:name">Ben Adida</span>
  (<a property="foaf:mbox" href="mailto:ben@adida.net">ben@adida.net</a>)
</div>
              ]]></eg>
              
          <p>
              The above yields the following triples:
          </p>

	      <eg><![CDATA[
<> dc:creator _:div0 .

_:div0 foaf:name "Ben Adida" .
_:div0 foaf:mbox <mailto:ben@adida.net> .
              ]]></eg>
	
	    </div3>

	  </div2>
	<div2>
	  <head>Establishing the subject</head>

	  <p> While the predicate and object resolution are relatively local to
      the RDFa element on which the corresponding attributes reside, subject
      resolution can be a little bit more complicated. Importantly, the
      [context statement] is highly relevant in determining the subject. Note
      that, when the predicate is determined by the <att>rev</att> attribute,
      the subject resolution described here applies to the object of the
      triple under consideration, while the subject is determined using object
      resolution, as described in the previous section. </p>
	  
	   <p> At a high level, the subject of a statement is determined by the
      <att>about</att> attribute, either on the element or on the closest
      parent of that element. Two exceptions to that rule exist. First, if a
      closer parent element includes a <att>rel</att> or <att>rev</att>
      attribute with no <att>href</att>, then the subject is the CURIE/URI
      that corresponds to that parent element (as described previously in
      object resolution.) Second, if the [RDFa element] under consideration is
      a <el>META</el> or <el>LINK</el> without an <att>about</att>, then the
      subject is the immediate parent element's CURIE/URI equivalent.</p>

	  <div3>
	    <head>The <att>about</att> attribute</head>
	    <p>
	      The subject of a triple is usually indicated using the <att>about</att> attribute, as follows:
	    </p>
	    
	    <eg><![CDATA[
Daniel knows
<a about="mailto:daniel.brickley@bristol.ac.uk"
   rel="foaf:knows" href="mailto:libby.miller@bristol.ac.uk">Libby</a>.
   
Libby knows
<a about="mailto:libby.miller@bristol.ac.uk"
   rel="foaf:knows" href="mailto:ian.sealy@bristol.ac.uk">Daniel</a>.
            ]]></eg>
	    
	      <p>
		The value of the <att>about</att> attribute is of type CURIE/URI
		[REF], meaning it can either be a URI, absolute or relative, or a
		CURIE in square brackets. Some example values of an <att>about</att>
		attribute include:
	      </p>

	      <ul>
		<li> <att>#person</att> : the base URI
		with <att>#person</att> appended to it. Refers to the
		XML element with <att>id="person"</att>, if such an
		element exists.</li>
		<li> <att>http://creativecommons.org/licenses/by-nc-nd/3.0/</att>
		: the absolute URI as indicated.</li>
		<li> <att>[finance:GOOG]</att> : the
		CURIE <att>finance:GOOG</att>.</li>
	      </ul>
	    </div3>

	    <div3>
	      <head>Inheriting the <att>about</att> attribute</head>
	      <p>
		Note that this section does not apply to [RDFa statement]s whose
		predicates are defined in <att>meta</att> or <att>link</att>
		elements. Section 4.3.3 deals with <att>meta</att>
		and <att>link</att> specifically.
	      </p>
	      
	      <p>
		If the [RDFa element] that includes the predicate
		attribute does not have an <att>about</att> attribute,
		then the subject of the [triple] is determined by the
		[context statement]'s <att>about</att> attribute. The
		resolution of the <att>about</att> attribute is
		recursive: if the [context statement] has no such
		attribute, then the processor must continue up the DOM
		tree to find the closest ancestor with
		an <att>about</att> attribute.
	      </p>
	      
	    <p>
	        (The recursive search for the closest ancestor may be interrupted if an element is encountered with a <att>rel</att> or <att>rev</att> without a corresponding <att>href</att>. This is described in the next subsection.)
	    </p>
	      
	      <p>
		For example, the following XHTML:
	      </p>
	      
	      <eg><![CDATA[
<div about="photo1.jpg">
  <span class="attribution-line">this photo was taken by
    <span property="dc:creator">Mark Birbeck</span>
  </span>
</div>
              ]]></eg>

	      <p>
		will inherit the <att>about</att> attribute from the
		enclosing <att>div</att> and yield the expected triple:
	      </p>
	      
	      <eg><![CDATA[
<photo1.jpg> dc:creator "Mark Birbeck"^^rdf:XMLLiteral .
              ]]></eg>

	      <p>
		If no such parent is ever found all the way up the DOM tree, then the
		default value for the <att>about</att> attribute is the empty
		string, which effectively indicates the current document.
	      </p>
	      
	    </div3>
	    <div3>
	        <head><att>rel</att> and <att>rev</att> attributes in ancestor elements</head>

	        <p> During the ancestor element traversal, one may encounter an
            element with a <att>rel</att> or <att>rev</att> attribute without
            a corresponding <att>href</att> attribute. As described in object
            resolution, this situation defines a new subject for all its
            children elements, in particular the currently considered [RDFa
            element]. Specifically, the CURIE/URI associated with this
            ancestor element becomes the subject.</p>

        </div3>
	    <div3>
	      <head><att>meta</att> and <att>link</att> elements</head>

	      <p> If an [RDFa statement] is generated by a predicate attribute of
          a <att>meta</att> or <att>link</att> element, and this element does
          not contain an explicit <att>about</att> attribute, subject
          resolution is slightly different. Only the immediate [context
          statement] is considered, whether or not it has its own
          <att>about</att> attribute. </p>
	      
	       <p> The subject is then the CURIE/URI that corresponds to the
          immediate [context statement]. Specifically, the [context statement]
          may have an <att>about</att> attribute, in which case the [RDFa
          statement]'s subject is resolved as the value of this attribute
          (exactly as if the current [RDFa statement] weren't a
          <att>link</att> or <att>meta</att>.) However, if the [context
          statement] does not have an <att>about</att> attribute, the subject
          of the current [RDFa statement] is the parent element itself. If
          this parent element is not identified with <att>xml:id</att>, it is
          treated as a [bnode]. </p>

	      <p>
		For example, the following XHTML:
	      </p>

	      <eg><![CDATA[
<div about="photo1.jpg">
  This photo was taken by <meta property="dc:creator">Mark Birbeck</meta>.
</div>
              ]]></eg>
	      <p>
		will generate one triple corresponding to the <att>property</att>
		attribute of the <att>meta</att> element, whose subject is resolved
		as the value of the <att>about</att> attribute of the immediate
		parent element (<att>div</att>).
	      </p>
	      
	      <eg><![CDATA[
<photo1.jpg> dc:creator "Mark Birbeck" .
              ]]></eg>
	      
	      <p>
		However, the following, slightly different XHTML which includes an extra element between the <att>about</att> and the <el>META</el>:
	      </p>
	      
	      <eg><![CDATA[
<div about="photo1.jpg">
  <span class="attribution-line">
    This photo was taken by
    <meta property="dc:creator">Mark Birbeck</meta>
  </span>.
</div>
              ]]></eg>
	      <p>
		will yield the possibly unexpected:
	      </p>
	      
	      <eg><![CDATA[
_:span0 dc:creator "Mark Birbeck" .
              ]]></eg>

	      <p>
		The <att>meta</att> and <att>link</att> elements should be thought
		of as mechanisms for applying metadata to any existing element in the
		XML document. Thus, to recover the previous triple, one could simply
		switch the <att>meta</att> to a <att>span</att>, which will
		trigger the recursive search up the DOM tree for the
		closest <att>about</att> attribute (this is exactly the same example
		as that of the previous section):
	      </p>
	      
	      <eg><![CDATA[
<div about="photo1.jpg">
  <span class="attribution-line">
    This photo was taken by
    <span property="dc:creator">Mark Birbeck</span>
  </span>.
</div>
              ]]></eg>

	      <div4>
		<head><el>meta</el> or <el>link</el> inside the <el>head</el> in XHTML2</head>
		
		<p>
		  A <el>meta</el> or <el>link</el> without its
		  own <att>about</att> attribute and positioned
		  directly within the <el>head</el> of a document will
		  automatically apply to the document
		  itself. Effectively, the <el>head</el> of an XHTML2
		  document contains an implicit <code>about=""</code>.
		</p>

		<p>
		  Note also that this isn't exactly the same thing as
		  having the subject eventually default -- all the way
		  up the DOM tree -- to the current
		  document. A <el>meta</el> or <el>link</el> element
		  applies to the parent element, never inheriting
		  further up the tree than the <el>head</el> element,
		  in this case. Thus, this additional detail about
		  the <el>head</el> element is not redundant with any
		  other instruction in this document.
		</p>
	      </div4>
	    </div3>
	  </div2>

	  <div2>
	    <head>Summary</head>
	    <p>This section will contain a summary of the syntax.</p>
	  </div2>
	</div1>
	<div1>
	  <head>RDF Concepts</head>

	  <p>
	    Having established the different parts of the syntax of RDFa, we will now look at
            the various aspects of the RDF Abstract Syntax, and see how they can be represented
            in RDFa.
	  </p>

	  <div2>
	    <head>Literals as Objects</head>

	    <p>
	      When a <att>property</att> predicate is used in RDFa, the
	      object is expected to be a literal. This literal can be
	      optionally typed by a <att>datatype</att> attribute within
	      the same RDFa element. The absence or presence of this
	      attribute has a significant impact on the interpretation
	      of the literal.
	    </p>

	    <div3>
	      <head>Without <att>datatype</att></head>
	      <p>
		Without a <att>datatype</att> attribute, the object
		literal will either be a plain literal or an XML
		literal, depending on whether the <att>content</att>
		attribute is used. For example, consider the following
		XHTML with RDFa which designates the author of a web
		page:
	      </p>

	      <eg><![CDATA[
<html xmlns="http://www.w3.org/1999/xhtml">
    <head property="dc:creator" content="Mark Birbeck">
        <title>Internet Applications</title>
    </head>
...
              ]]></eg>

	      <p>
		In this case, with the use of the <att>content</att>
		attribute indicates that the object is a plain
		literal:
	      </p>

	      <eg><![CDATA[
<> dc:creator "Mark Birbeck" .
              ]]></eg>


	      <p>
		On the other hand, the following RDFa will yield a
		slightly different triple:
	      </p>

	      <eg><![CDATA[
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Internet Applications</title>
    </head>
    <body>
	<span property="dc:creator">Mark Birbeck</span>
    </body>
...
              ]]></eg>

	      <p>which yields an XML literal object:</p>

	      <eg><![CDATA[
<> dc:creator "Mark Birbeck"^^rdf:XMLLiteral .
              ]]></eg>

	      <div4>
		<head>XML Literals</head>
		<p>
                  The default <att>rdf:XMLLiteral</att> type plays a
                  significant role. XML documents cannot contain XML
                  mark-up in their attributes, which means it is not
                  possible to represent XML within the
                  <att>content</att> attribute. The following would cause an XML parser to generate an error:
                </p>

		<eg><![CDATA[
<head about="">
    <meta property="dc:title"
	  content="E = mc<sup>2</sup>: The Most Urgent Problem of Our Time" />
</head>
                ]]></eg>

		<p>
		  It does not help to escape the content, since the
		  output would simply be a string of text containing
		  numerous ampersands:
		</p>

		<eg><![CDATA[
<> dc:title
   "E = mc&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;: The Most Urgent Problem of Our Time" .
                ]]></eg>

		<p>
		  RDF does, however, provide a datatype for indicating
                  [XML literal]s. RDFa therefore adds this datatype
                  to any [literal] that is indicated using child text
                  nodes on the [RDFa statement]. For example:
		</p>

		<eg><![CDATA[
<head about="">
    <h2 property="dc:title">
      E = mc<sup>2</sup>: The Most Urgent Problem of Our Time
    </h2>
</head>
                ]]></eg>

		<p>would generate the expected triple:</p>

		<eg><![CDATA[
<> dc:title
   "E = mc<sup>2</sup>: The Most Urgent Problem of Our Time"^^rdf:XMLLiteral .
                ]]></eg>

		<p>
		  Note that the value of this [XML Literal] is the
		  exclusive canonicalization of the RDFa element's
		  value.
		</p>

<ednote><name>Ben</name><date>2006-10-20</date><edtext>as per Elias's email, we need to clarify what this canonicalization is.</edtext></ednote>
		
	      </div4>

	    <div4>
	      <head>Language Tags</head>
	      <p>RDF allows [plain literal]s to have a language tag,
                as illustrated by the following example from
                <bibref ref="RDFTESTS-RDFMS-XMLLANG-TEST006" />:
	      </p>
	      
	      <eg><![CDATA[
<http://example.org/node> <http://example.org/property> "chat"@fr .
    ]]></eg>
	      
	      <p>
		In RDFa the XML language
		attribute -- <att>xml:lang</att> -- is used to add
		this information, whether the plain literal is
		designated by the <att>content</att> attribute, or by
		a <att>datatype</att> value of <code>plaintext</code>:
	      </p>

	      <eg><![CDATA[
<meta about="http://example.org/node"
      property="ex:property" xml:lang="fr" content="chat" />
              ]]></eg>
	      
	      <p>
		Note that the value can be inherited as defined in
                <bibref ref="XML-LANG" />, so the following syntax
                will give the same triple as above:
	      </p>
	      
	      <eg><![CDATA[
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
  <head>
    <title xml:lang="en">Example</title>
    <meta about="http://example.org/node"
	  property="ex:property" content="chat" />
  </head>
  ...
</html>
]]></eg>
	    </div4>

	    </div3>
	    <div3>
	      <head>With <att>datatype</att></head>
	      <p>
                RDF allows [literal]s to be given a data type, as illustrated by the following example from
                <bibref ref="RDFTESTS-DATATYPES-TEST001" />:
              </p>

	      <eg><![CDATA[
<http://example.org/foo>
  <http://example.org/bar>
  "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
              ]]></eg>
	      
	      <p>This can be represented in RDFa as follows:</p>

	      <eg><![CDATA[
<span about="http://example.org/foo"
      property="ex:bar" content="10" datatype="xsd:integer">ten</span>
              ]]></eg>


	      <div4>
		<head>Literal from string value of <att>meta</att></head>

		<p>
		  If the <att>datatype</att> is specified, but
		  no <att>content</att> attribute exists, then the
		  typed literal's value is determined as the
		  concatenation of all textual child elements. For example, the following RDFa:
		</p>

		<eg><![CDATA[
<span about="http://example.org/foo"
      property="dc:creator" datatype="xsd:string">
  <b>M</b>ark <b>B</b>irbeck
</span>.
   ]]></eg>

		<p>
		  will yield the following triple:
		</p>

		<eg><![CDATA[
<http://example.org/foo> dc:creator "Mark Birbeck"^^xsd:string .
   ]]></eg>
	      </div4>
	    </div3>

	    <ednote><name>Ben</name><date>2006-10-20</date>
<edtext>
as per EliasT's comments, explain which datatypes are allowed and emphasize "plaintext."
</edtext>
</ednote>
	  </div2>
	  <div2>
	    <head>Blank nodes</head>
	    <p>
	      A [blank node] is generated explicitly when an [RDFa statement]
	      uses a bnode CURIE as its subject. A [blank node] can be generated
	      more implicitly when an XML element without an <att>about</att>
	      attribute has <att>meta</att> or <att>link</att> children
	      elements, also without <att>about</att> attributes of their own.
	      In the latter case, the [unique anonymous ID] generated to identify
	      the [blank node] is associated with the [context statement] of
	      the <att>meta</att> and <att>link</att> elements. This allows a
	      number of statements to be made about the same [blank node].
	    </p>
	    
	    <p>
	      For example, to establish relationships between a [blank node] and
	      literals or URIs, one can use the implicit [blank node] construction
	      of our earlier example, repeated here:
	    </p>
	    
	    <eg><![CDATA[
<blockquote>
    <link rel="dc:source" href="urn:isbn:0140449132" />
    <meta property="dc:creator" content="Fyodor Dostoevsky" />
    <p>
        Rodion Romanovitch! My dear friend! If you go on in this way
        you will go mad, I am positive! Drink, pray, if only a few drops!
    </p>
</blockquote>
            ]]></eg>

	    <p>This would generate the following [triple]s:</p>
	    
	    <eg><![CDATA[
_:a dc:source <urn:isbn:0140449132> .
_:a dc:creator "Fyodor Dostoevsky" .
            ]]></eg>

	    <p>
	      One could also use the more explicit declaration:
	    </p>
	    
	    <eg><![CDATA[
<blockquote about="[_:a]">
    <p>
        Rodion Romanovitch! My dear friend! If you go on in this way
        you will go mad, I am positive! Drink, pray, if only a few drops!
    </p>
</blockquote>

<link about="[_:a]" 
      rel="dc:source" href="urn:isbn:0140449132" />
<meta about="[_:a]"
      property="dc:creator" content="Fyodor Dostoevsky" />
            ]]></eg>

	    <p>
	      To establish relationships between [blank node]s, the [unique
	      anonymous ID] must be set explicity using a CURIE bnode as subject
	      or object. For example, if our desired output is the following
	      [triple]s:
	    </p>

	    <eg><![CDATA[
_:a foaf:mbox <mailto:daniel.brickley@bristol.ac.uk> .
_:b foaf:mbox <mailto:libby.miller@bristol.ac.uk> .
_:a foaf:knows _:b .
            ]]></eg>

	    <p>
	      we could use the following XHTML:
	    </p>
	    
	    <eg><![CDATA[
<link about="[_:a]" rel="foaf:mbox"
      href="mailto:daniel.brickley@bristol.ac.uk" />
<link about="[_:b]" rel="foaf:mbox"
      href="mailto:libby.miller@bristol.ac.uk" />
<link about="[_:a]" rel="foaf:knows"
      href="[_:b]" />
            ]]></eg>

	    <p>
	      or, alternatively, if we wish to partly render the information in XHTML:
	    </p>
	    
	    <eg><![CDATA[
<div about="[_:a]">
   DanBri can be reached via
   <a rel="foaf:mbox" 
      href="mailto:daniel.brickley@bristol.ac.uk">
     email
   </a>.
   He knows Libby.
   <link rel="foaf:knows" href="[_:b]" />
</div>

<div about="[_:b]">
   Libby can be reached via
   <a rel="foaf:mbox"
      href="mailto:libby.miller@bristol.ac.uk">
     email
   </a>
</div>
           ]]></eg>

	  </div2>

	  <div2>
	    <head>Reification</head>
	    
	    <p>
	      RDFa partially supports reification.
	    </p>
	    
	    <p>
	      During subject resolution (which could be triggered by object
	      resolution for a <att>rev</att> attribute), the processor may
	      traverse up the DOM tree in search of an <att>about</att>
	      attribute. If a <att>link</att> or <att>meta</att> element is
	      encountered before an <att>about</att> attribute is found, and if
	      this <att>link</att> or <att>meta</att> element itself does not
	      have an <att>about</att> attribute, then the subject (or, again in
	      the case of <att>rev</att>, object) is resolved as the [RDFa
	      statement] represented by this <att>link</att> or <att>meta</att>
	      element.
	    </p>

	    <p>
	      For example, the following XHTML:
	    </p>
	    
	    <eg><![CDATA[
<div about="">
  <link rel="cc:license"
	href="http://creativecommons.org/licenses/by-nc-nd/3.0/">
     <meta property="dc:creator" content="Ben Adida" />
  </link>
  <meta property="dc:creator" content="Mark Birbeck" />
</div>
            ]]></eg>

	    <p>
	      will yield the following triples:
	    </p>
	    
	    <eg><![CDATA[
 <> cc:license <http://creativecommons.org/licenses/by-nc-nd/3.0/> .
 <> dc:creator "Mark Birbeck."  
 _:a rdf:type rdf:Statement .
 _:a rdf:subject <> .
 _:a rdf:predicate cc:license .
 _:a rdf:object <http://creativecommons.org/licenses/by-nc-nd/3.0/> .
 _:a dc:creator "Ben Adida" .
            ]]></eg>

	    <p>
	      which means that "Mark Birbeck" is the creator of the current
	      document, that this document is licensed under a Creative Commons
	      license, and that "Ben Adida" is the creator of that licensing
	      statement, <em>not</em> of the document itself.
	    </p>
	  </div2>
	</div1>

	<div1>
	  <head>Examples</head>
	  <div2>
	    <head>Creative Commons</head>
	    <p>
	      One of the advantages of using the same syntax to make general statements as well as statements about a document is
	      that in many cases a document can carry its own metadata. For example, if an XHTML document contains a navigable link
	      to the Creative Commons license, this link can also be used to express metadata:
	    </p>
	    
	    <eg><![CDATA[
<div about="">
    This document is licensed under a
    <a rel="cc:license" 
       href="http://creativecommons.org/licenses/by-sa/2.0/">
        Creative Commons License
    </a>
    which, among other things, requires that you provide 
    attribution to the author,
    <a rel="dc:creator" href="http://ben.adida.net">Ben Adida</a>.
</div>
            ]]></eg>

	    <p>
	      This chunk of XHTML will generate the same triples, no matter what other XHTML contains it:
	    </p>
	    
	    <eg><![CDATA[
<> cc:license <http://creativecommons.org/licenses/by-sa/2.0/> .
<> dc:creator <http://ben.adida.net> .
            ]]></eg>
	  
	  </div2>
	  
	  <div2>
	    <head>FOAF</head>
	  
	    <p>
	      FOAF requires the definition of at least two RDF entities: the FOAF
	      person, and the FOAF homepage, which cannot be the same. Thus, the
	      following XHTML can be used to represent a FOAF record:
	    </p>

	    
	    <eg><![CDATA[
<html xmlns:geo="http://www.w3.org/2003/01/geo/" ...>
    <head>
      <title property="dc:title">Dan's home page</title>
    </head>
    <body>
      <section id="person">
        <span about="[_:geolocation]">
          Dan is located at latitude
          <meta property="geo:lat">51.47026</meta>
          and longitude
          <meta property="geo:long">-2.59466</meta>
        </span>
        <link rel="rdf:type" href="[foaf:Person]" />
        <link rel="foaf:homepage" href="" />
        <link rel="foaf:based_near" href="[_:geolocation]" />
        <h1 property="foaf:name">Dan Brickley</h1>
      </section>
    </body>
</html>
            ]]></eg>

	    <p>
	      which yields the correct FOAF triples:
	    </p>
	    
	    
	    <eg><![CDATA[
<> dc:title "Dan's home page"^^rdf:XMLLiteral .
_:geolocation geo:lat "51.47026"^^rdf:XMLLiteral .
_:geolocation geo:long "-2.59466"^^rdf:XMLLiteral .
<#person> rdf:type foaf:Person .
<#person> foaf:homepage <> .
<#person> foaf:based_near _:geolocation .
<#person> foaf:name "Dan Brickley"^^rdf:XMLLiteral .
            ]]></eg>

	    <p>
	      If one wants to make the <att>foaf:Person</att> a blank node, then
	      the only change required is taking out the <att>id="person"</att>
	      from the <att>span</att> element, which then yields the following
	      triples:
	    </p>

	    <eg><![CDATA[
<> dc:title "Dan's home page" .
_:geolocation geo:lat "51.47026" .
_:geolocation geo:long "-2.59466" .
_:span0 rdf:type foaf:Person .
_:span0 foaf:homepage <> .
_:span0 foaf:based_near _:geolocation .
_:span0 foaf:name "Dan Brickley" .
            ]]></eg>

	  </div2>
	</div1>
	<div1>
	  <head>Rules</head>
	  
	  (not updated yet.)
	</div1>
        <div1>
            <head>Bibliography</head>
            <blist>
                <bibl id="DC" href="http://dublincore.org/">Dublin Core Metadata Initiative (DCMI)</bibl>
                <bibl id="FOAF-PROJECT" href="http://www.foaf-project.org">The FOAF Project</bibl>
                <bibl id="HTML" href="http://www.w3.org/TR/html401/">HTML 4.01 Specification</bibl>
                <bibl id="N-TRIPLES" href="http://www.w3.org/TR/rdf-testcases/#ntriples">RDF Test Cases, N-Triples</bibl>
                <bibl id="N3-PRIMER" href="http://www.w3.org/2000/10/swap/Primer">N3 Primer</bibl>
                <bibl id="RDF-CONCEPTS" href="http://www.w3.org/TR/rdf-concepts/">Resource Description Framework (RDF): Concepts and Abstract Syntax</bibl>
                <bibl id="RDF-SYNTAX" href="http://www.w3.org/TR/rdf-syntax-grammar/">RDF/XML Syntax
                    and Grammar</bibl>
                <bibl id="RDFTESTS-DATATYPES-TEST001" href="http://www.w3.org/2000/10/rdf-tests/rdfcore/datatypes/test001.nt">datatypes/test001.nt</bibl>
                <bibl id="RDFTESTS-RDFMS-XMLLANG-TEST006" href="http://www.w3.org/2000/10/rdf-tests/rdfcore/rdfms-xmllang/test006.nt">rdfms-xmllang/test006.nt</bibl>
                <bibl id="RELAXNG" href="http://www.relaxng.org/">RELAX NG Home Page</bibl>
                <bibl id="SWD-WG" href="http://www.w3.org/2006/07/SWD/">Semantic Web Best Deployment Working Group</bibl>
                
                <bibl id="XHTML" href="http://www.w3.org/TR/xhtml1">XHTML 1.0</bibl>
                <bibl id="XHTML-2.0-LINKTYPES" href="http://www.w3.org/MarkUp/Group/2003/WD-xhtml2-20031029/abstraction.html#dt_LinkTypes">XHTML
                2.0 Link Types</bibl>
                <bibl id="XML-BASE" href="http://www.w3.org/TR/xmlbase/">XML Base</bibl>
                <bibl id="XML-LANG" href="http://www.w3.org/TR/REC-xml/#sec-lang-tag">Extensible Markup Language (XML) 1.0 (Third Edition), Language Identification</bibl>
                <bibl id="XPOINTER-FRAMEWORK" href="http://www.w3.org/TR/xptr-framework/">XPointer Framework</bibl>
                <bibl id="RDFHTML" href="http://w3.org/2001/sw/BestPractices/HTML/">RDF-in-HTML Task Force</bibl>
                <bibl id="SWBPD-WG" href="http://w3.org/2001/sw/BestPractices/">Semantic Web Best Practices and Deployment Working Group</bibl>
                <bibl id="HTML-WG" href="http://w3.org/MarkUp/Group/">HTML Working Group</bibl>
                <bibl id="CURIE" href="http://w3.org/2001/sw/BestPractices/HTML/2005-10-27-CURIE">CURIEs</bibl>
            </blist>
        </div1>

	<div1>
	  <head>Change History</head>
      <p>
          <b>2007-04-06</b>: fixed some of the language to talk about "structure" rather than metadata. Added note regarding space-separated values in predicate-denoting attributes. [BenAdida]
      </p>
	  <p>
	    <b>2006-01-16</b>: made the use of CURIE type
	    for <att>rel</att>,<att>rev</att>,<att>property</att>
	    consistent across document (particularly section 2.4 was
	    erroneous). [BenAdida]
	  </p>
	</div1>
      </body>
    </spec>
