<?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 note.name "RDFa Use Cases: Scenarios for Embedding RDF in HTML">
    <!ENTITY version "1.0">
    <!ENTITY XFormsNS "http://www.w3.org/2002/xforms">
    <!ENTITY ne "≠">
    <!ENTITY ouml "ö">
    <!ENTITY times "×">
    <!ENTITY order "£">
    <!ENTITY le "≤">
    <!ENTITY cellback "#d0d9fa">
    <!ENTITY eacute "é">
    <!ENTITY copy "©">
    <!ENTITY sect "§">
    <!ENTITY mdash "&#8212;">
]>
<spec w3c-doctype="draft">
    <header>
        <title>&note.name;</title>
        <w3c-designation>Internal Working Draft</w3c-designation>
        <w3c-doctype>Editors' Draft</w3c-doctype>
        <!-- notice>Notice this!!</notice -->
        <publoc>
	  <loc href="http://www.w3.org/2006/07/SWD/RDFa/scenarios/20070109">http://www.w3.org/2006/07/SWD/RDFa/scenarios/20070109</loc>
        </publoc>
        <prevlocs>
        </prevlocs>
        <latestloc>
    <loc href="http://www.w3.org/2006/07/SWD/RDFa/scenarios">http://www.w3.org/2006/07/SWD/RDFa/scenarios</loc>
        </latestloc>
        <authlist>
            <author>
                <name>Ben Adida</name>
                <affiliation>Creative Commons</affiliation>
                <email href="mailto:ben@adida.net">ben@adida.net</email>
            </author>
            <author>
                <name>Michael Hausenblas</name>
                <affiliation>JOANNEUM RESEARCH</affiliation>
                <email href="mailto:michael.hausenblas@joanneum.at">michael.hausenblas@joanneum.at</email>
            </author>
        </authlist>
        <abstract>
            <p>
                Current web pages, written in HTML, are chock-full of
                structured data. When publishers can express this
                data, and when tools can read it, a new world of user
                functionality becomes available, letting users copy
                and paste 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
                HTML. The rendered data within HTML 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 provides use case scenarios for RDFa. An introduction to implementing RDFa is provided in the <a href="http://www.w3.org/2006/07/SWD/RDFa/Primer/">RDFa Primer</a>, while the details of the syntax are explained in the <a href="http://www.w3.org/2006/07/SWD/RDFa/Syntax/">RDFa Syntax</a>.
      </p>
        </abstract>
        <status>
          <p>This is an internal draft produced by the Semantic Web Deployment Working Group <bibref ref="SWD" />.</p>
      <p>
        This document is for internal review only and is subject
        to change without notice. This document has <em>no formal
        standing within the W3C</em>.
      </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.2 2007/01/09 15:14:37 adida Exp $</emph>
            </p>
        </revisiondesc>
    </header>
    <body>
      <div1>
    <head>Introduction</head>
  
    <p>
Current web pages, written in HTML, are chock-full of structured data. When
publishers can express this data, and when tools can read it, a new world of
user functionality becomes available, letting users copy and paste 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 that expresses this structured data using a set
    of elements and attributes that embed RDF in HTML. An important
    goal of RDFa is to achieve this RDF embedding without repeating
    existing HTML content when that content <em>is</em> the
    structured data.
  </p>
  
  <p>
          An HTML document marked up with RDFa constructs is a valid
          HTML Document. RDFa is about using HTML compatible
          constructs and extensions to specify RDF 'content'. It is not
          about embedding RDF/XML syntax into HTML documents.
  </p>

  <p>
   This document presents the major use cases where embedding
   structured data in HTML using RDFa provides significant
   benefit. Each use case explores how publishers, tool
   builders, and consumers benefit from RDFa. In parallel, the
   reader is encouraged to look at the <a href="http://www.w3.org/2006/07/SWD/RDFa/Primer/">RDFa
   Primer</a> and <a href="http://www.w3.org/2006/07/SWD/RDFa/Syntax/">RDFa Syntax</a>.
  </p>

  <p>
    We note that RDFa makes use of XML namespaces. In this document,
    we assume, for simplicity's sake, that the following namespaces
    are defined: <att>dc</att> for Dublin Core, <att>foaf</att> for
    FOAF, <att>cc</att> for Creative Commons, and <att>xsd</att> for
    XML Schema Definitions:
    
    <ul>
      <li><att>dc</att>: http://purl.org/dc/elements/1.1/</li> 
      <li><att>foaf</att>: http://xmlns.com/foaf/0.1/</li> 
      <li><att>cc</att>: http://web.resource.org/cc/</li> 
    </ul>
  </p>

  <p>
    In this document, we consider Publishers, Tool Builders, and Users. For simplicity, we give our fictitious users first names whose first letter matches their role: Paul, Patrick, and Peter are publishers, Tim, Tod, and Tara and tool builders, and Ursula is a user.
  </p>
  <div2>
    <head>Audience</head>
    <p>
      This document assumes a reader who has reasonable experience
      with HTML. Prior experience with RDF is not necessary, as
      the important concepts are explained along the way.
    </p>
  </div2>

  <div2>
    <head>An Overview of the Use Cases</head>

    <ol>

      <li><specref ref="use-case-1" />: Paul maintains a blog and wishes to
        "mark up" his existing page with structure so that tools can pick up
        his blog post tags, authors, titles, and his blogroll. In particular,
        his HTML blog should be usable as its own structured feed.</li>

      <li><specref ref="use-case-2" />: Paul sometimes gives talks on
      various topics, and announces them on his blog. He would like to
      mark up these announcements with proper scheduling information,
      so that RDFa-enabled agents can automatically obtain the
      scheduling information and add it to the browsing user's
      calendar. Importantly, some of the rendered data might be more
      informal than the machine-readable data required to produce a
      calendar event.
      </li>

      <li><specref ref="use-case-3" />: Tod sells an HTML-based content
        management system, where all documents are processed and edited as
        HTML, sent from one editor to another, and eventually published and
        indexed. He would like to build up the editorial metadata within the
        HTML document itself, so that it is easier to manage and less likely
        to be lost.</li>

      <li><specref ref="use-case-4" />: Tara runs a video
      sharing web site. When Paul wants to blog about a video,
      he can paste a chunk of HTML provided by Tara directly
      into his blog. The video is then available inline, in his
      blog, along with any licensing information (Creative
      Commons?) about the video.</li>

      <li><specref ref="use-case-5" />: Ursula is looking for a
      new apartment and some items with which to furnish it. She
      browses various RDFa-enabled web pages, including
      apartment listings, furniture stores, kitchen appliances,
      etc. Every time she finds an item she likes, she can point
      to it, right-click, copy it to her Web Clipboard, and
      paste it into her apartment-hunting page, where it can be
      organized, sorted, categorized. Any additional features of
      the HTML that are not structured, e.g. links to photos,
      are conserved by the copy-and-paste.</li>

      <li><specref ref="use-case-6" />: Tim runs a Semantic
      Wiki, where users contribute content in Wiki markup or
      using a WYSIWYG tool. In all cases, Tim produces
      HTML+RDFa, so that users like Ursula can copy and paste
      the structured content. In particular, Ursula may be
      pasting her apartment-and-furnishing finds into a Semantic
      Wiki.</li>

      <li><specref ref="use-case-7" />: Patrick writes a science
      blog where he discusses proteins, genes, and chemicals. As
      he has very little control over the layout&mdash;he's
      using a fairly constrained hosting provider&mdash;,
      Patrick adds RDFa to indicate the scientific components
      he's working with. Ulrich, a scientist, can browse
      Patrick's site with an RDFa-aware browser and
      automatically cross-reference the proteins and genes that
      Patrick is talking about.</li>
    </ol>
  </div2>

      </div1>

      <div1 id="use-case-1">
  <head>Use Case #1 &mdash; Basic Structured Blogging</head>

  <p>
    Paul maintains a blog and wishes to "mark up" his existing
    page with structure so that tools can pick up his blog post
    tags, authors, titles, and his blogroll, and so that he does
    not need to maintain a parallel version of his data in
    "structured format." He could use microformats
    <bibref ref="MF" />, but he wishes to combine existing
    vocabularies and, at some point in the future, add his own
    extensions, too. Thus, he uses RDFa to embed FOAF and Dublin
    Core properties.
  </p>

    <eg><![CDATA[<html>
    <head><title>Paul's Blog</title></head>
    <body>
...
    <div id="www2007_talk" about="#www2007_talk"
	 xmlns:dc="http://purl.org/dc/elements/1.1/title">
    <h2 property="dc:title">My WWW2007 Talk</h2>
    a post by <span property="dc:creator">Paul</span>.
    <p>
        I'm giving a talk at the WWW2007 Conference about structured blogging.
    </p>

    </div>
...
    <div id="blogroll" about="#me"
	 xmlns:foaf="http://xmlns.com/foaf/0.1/">
      <ul>
	<li> <a rel="foaf:knows" href="http://example.org/tim#me">Tim</a></li>
	<li> <a rel="foaf:knows" href="http://example.org/Ursula#me">Ursula</a></li>
...
	<li> <a rel="foaf:knows" href="http://example.org/tod#me">Tod</a></li>
      </ul>
    </div>
...
    </body>
</html>
]]></eg>
<br />
(<a href="scenario-1.html">html</a>)

    <p> A user with an RDFa-aware browser can automatically pick up Paul's
    list of acquaintances. An RDFa-aware newsreader can use the HTML page
    itself as a newsfeed, rather than seek out a separate, parallel RSS or
    Atom file. </p>
    
     <p> Importantly, if Paul edits one of his blog posts, the corresponding
    structured data is also automatically updated, since it is, in fact, the
    exact same data in the exact same file. The RDFa-aware newsreader will
    automatically pick up the updated title, content, and tags.</p>

      </div1>

      <div1 id="use-case-2">
  <head>Use Case #2 &mdash; Publishing an Event - Overriding Some of the Rendered Data</head>

  <p>
Paul sometimes gives talks on various topics, and announces them on
      his blog, as well as on a static page of his web site that
      archives all of the talks he's given. He would like to mark up
      these announcements with proper scheduling information, so that
      RDFa-enabled agents can automatically obtain the scheduling
      information and add it to the browsing user's
      calendar. Importantly, some of the rendered data might be more
      informal than the machine-readable data required to produce a
      calendar event.
  </p>
  
    <eg><![CDATA[...
    <div id="www2007_talk" about="#www2007_talk" class="cal:Vevent"
	 xmlns:cal="http://www.w3.org/2002/12/cal/ical#"
	 xmlns:dc="http://purl.org/dc/elements/1.1/">

    <h2 property="dc:title">My WWW2007 Talk</h2>
    a post by <span property="dc:creator">Paul</span>.

    <p>
        I'm giving a talk at the WWW2007 Conference about
	<span property="cal:summary">structured blogging</span>,
	on
	<span property="cal:dtstart" content="20060509T1000-0800">
	  the second day of the conference at 10
	</span>.
    </p>

    </div>
...
]]></eg>
<br />
(<a href="scenario-2.html">html</a>)

<p>
When Ursula points her RDFa-enabled web browser to Paul's blog, she
notices a calendar icon next to the event description. By clicking on
it, she gets the option to add the event to her calendar of
choice.
</p>

<p>
  Note that the rendered HTML uses informal language to describe the
  scheduling of the event, i.e. "the second day of the conference,"
  while the structured data contains the complete iCal timestamp.
</p>
      </div1>
      <div1 id="use-case-3">
  <head>Use Case #3 &mdash; Content Management Metadata</head>

  <p>
    Tod sells an HTML-based content management system, where all
    documents are processed and edited as HTML, sent from one
    editor to another, and eventually published and indexed. He
    would like to build up the editorial metadata within the
    HTML document itself, so that the metadata is never lost.
  </p>

  <p> For this purpose, Tod's software uses RDFa with non-rendered metadata,
using the document's <att>HEAD</att>. Peter, one of Tod's customers, runs Foo
Magazine, which ships content to aggregators and business partners using XHTML
2, whose structural features make it easy to group components of an article
(e.g. pictures, recipes, sidebars of book excerpts) into individual elements
of an XHTML file. As Peter performs editorial tasks using Tod's content
management system, metadata properties are added to the <el>HEAD</el> of the
document. These data are not rendered, but they can be extracted using a
generic RDFa parser. Peter can thus insert a block of workflow and rights
reuse metadata about the document and its components at a single point in the
XHTML file and then ship the document off to a business partner.
  </p>

  <p>
  The sample
XHTML shown here contains metadata about the document itself, about one
subcomponent (a recipe) and about a subcomponent of that subcomponent (a
picture within the recipe): </p>

    <eg><![CDATA[<html xmlns:fm="http://www.foomagazine.com/ns#"
      xmlns:pr="http://prismstandard.org/1.0#"
      xmlns:dc="http://purl.org/rss/1.0/">

 <head>
  <meta property="fm:newsStandDate">2006-04-03</meta>
  <meta property="pr:coverDate">2007-02-24</meta>
  <meta about="#recipe13941">
   <meta property="fm:ComponentID">XZ3214</meta>
   <meta property="fm:ComponentType">Recipe</meta>
   <meta property="fm:RecipeID">r003423</meta>
  </meta>
  <meta about="http://www.foomagazine.com/img/342.jpg">
    <meta property="dc:creator">Joe Smith</meta>
    <meta property="pr:embargoDate">2007-03-12</meta>
  </meta>
 </head>

 <body>
  <h>Add Some Tex Mex Sizzle to Your Kid's Lunch</h>
  <section id='recipe22143'>
   <h>Amigo Corn Dogs</h>
    <img id="pic9932" src="http://www.foomagazine.com/img/342.jpg"/>

  ...

  </section>

  <section id='recipe13941'>
   <h>EZ Bean Tacos</h>

  ...

  </section>

 ...
 </body>
 </html> 
]]></eg>
      </div1>

      <div1 id="use-case-4">
  <head>Use Case #4 &mdash; Self-Contained HTML Chunks</head>

  <p>
    Tara runs a video sharing web site. Paul frequently blogs
    about videos. Some are his own, which he distributes
    exclusively, while others are videos from Tara's site which
    he reviews. When Paul wants to blog about a video from
    Tara's site, he can paste a chunk of HTML provided by Tara
    directly into his blog:
  </p>
    <eg><![CDATA[
<div about="http://example.org/tara/video_123"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:cc="http://creativecommons.org/ns#">

  <object width="425" height="350">
    <param name="movie" value="http://example.org/tara/video_123"></param>
    <param name="wmode" value="transparent"></param>
    <embed src="http://example.org/tara/video_123"
     type="application/x-shockwave-flash" wmode="transparent"
     width="425" height="350">
    </embed>
  </object>

  <span property="dc:title">The US Constitution, a Documentary</span>

  available under a
  <a rel="license" href="http://creativecommons.org/licenses/by/2.5/">
    CC License
  </a>. Please provide credit to
  <span property="cc:attributionName dc:creator">Tara</span>.
</div>
]]></eg>
        <p>
    In the example above, the video available
    at <code>http://example.org/tara/video_123</code> has four
    properties, a <code>dc:title</code> of "The US Constitution,
    a Documentary," <code>license</code>
    of <code>http://creativecommons.org/licenses/by/2.5/</code>,
    and <code>cc:attributionName</code> as well
    as <code>dc:creator</code> both "Tara."
  </p>


  <p> When Paul uses this markup, the video is then available inline, in his
blog, along with this structured title and licensing information about the
video. A user browsing Paul's blog with an RDFa-aware browser can tell that
the video shared from Tara's site is licensed under Creative Commons.</p>

  <p> Note specifically that the RDFa markup allows Paul to display, within a
single HTML page, multiple videos, each with its own license, title, and other
structured information. The videos excerpted from Tara's site may be available
under a Creative Commons license, while Paul's own videos are licensed under
different terms.</p>

  </div1>

      <div1 id="use-case-5">
  <head>Use Case #5 &mdash; Web Clipboard</head>

  <p>
    Ursula is looking for a new apartment and some items with
    which to furnish it. She browses various RDFa-enabled web
    pages, including apartment listings, furniture stores,
    kitchen appliances, etc. Every time she finds an item she
    likes, she can point to it, right-click, copy it to her Web
    Clipboard, and paste it into her apartment-hunting page,
    where it can be organized, sorted, categorized. Any
    additional features of the HTML that are not structured,
    e.g. links to photos, are conserved by the copy-and-paste.
  </p>

	<p> More specifically, when a browser's DOM representation of
an HTML document includes structured data expressed using RDFa, an
RDFa-aware agent can copy that node's contained HTML chunk, along with
all relevant structure. For example, using the HTML from
<specref ref="use-case-1" />, one can copy the HTML+RDFa corresponding
to the first blog post, resulting in the following chunk of HTML
stored in the clipboard: </p>

<eg><![CDATA[
<div about="http://www.w3.org/2006/07/SWD/RDFa/scenarios/scenario-1.html#www2007_talk" >
  <h2 property="dc:title">My WWW2007 Talk</h2>
  a post by <span property="dc:creator">Paul</span>.
  <p>
    I'm giving a talk at the WWW2007 Conference about structured blogging.<br />    
  </p>
</div>
]]>
</eg>

<p>
  Notice how the reference in the <att>about</att> is absolute, a transformation performed by the RDFa agent 
  during the copy operation. Notice also how any existing HTML links, images, etc. are also copied.
  Thus, when Ursula pastes the content into her own page, she keeps all of the useful HTML rendering and structured data.
</p>

<p>
The information Ursula aggregates can then be managed using any set of existing RDF tools for querying, sorting, and navigating.  
</p>
      </div1>

  <div1 id="use-case-6">
  <head>Use Case #6 &mdash; Semantic Wiki</head>

  <p> Tim runs a Semantic Wiki (as  <bibref ref="SMW" />) where users contribute content in Wiki markup
  or using a WYSIWYG tool. In all cases, Tim produces HTML+RDFa, so that users
  like Ursula can copy the data from the Semantic Wiki to paste it into other
  web pages, exactly as in <specref ref="use-case-4" />. A sample Wiki markup snippet
  giving some details about Ursula might look like: 
  </p>

<eg><![CDATA[
== About Me ==
My name is Ursula Er, I live in [foaf:location::Norway|Norge] and I am [foaf:age:=32 years];
in my spare time I test ice creams, e.g. I am the reviewer of [dc:creator::DailyIcecreamNorway|Best icecream in Norway - reviewed daily.].
]]>
</eg>

	<p>The above shown Wiki markup then gets transformed into HTML+RDFa automatically into:</p>
<eg><![CDATA[
<h2>About Me</h2>
<p>My name is Ursula Er, I live in <a href="../Norway" rel="foaf:location">Norge</a> and I am <span property="foaf:age" datatype="xsd:integer">32</span> years; 
in my spare time I test ice creams, e.g. I am the reviewer of <a href="../DailyIcecreamNorway" rel="dc:creator">Best icecream in Norway - reviewed daily.</a>.
]]>
</eg>
  
   <p> In addition, Tim allows users to embed HTML+RDFa directly into a Wiki page by means of a macro.
   In particular, Ursula may be pasting her apartment-and-furnishing finds into a Semantic Wiki.
   </p>

      </div1>

      <div1 id="use-case-7">
  <head>Use Case #7 &mdash; Advanced Structured Publishing for Scientists</head>

  <p>
    Patrick writes web-based science articles where he discusses
    proteins, genes, and chemicals. As he has very little control over
    the layout&mdash;he's using a fairly constrained hosting
    provider&mdash;, Patrick adds RDFa to indicate the scientific
    components he's working with. Ulrich, a scientist, can browse
    Patrick's site with an RDFa-aware browser and automatically
    cross-reference the proteins and genes that Patrick is talking
    about.
  </p>
  
  <p>
    Specifically, Patrick may write the following blog post:
  </p>

  <eg><![CDATA[
  <div xmlns:uniprot="urn:lsid:uniprot.org:ontology:" about="[uniprot:P30089]" class="uniprot:Protein">
    Let's talk about the
    <span property="uniprot:name">
      Corticotropin-lipotropin precursor
    </span> protein, aka
    <span property="uniprot:mnemonic">
      UPA3_HUMAN
    </span>.
    
    I was reading the other day about....
  </div>]]>
  </eg>

  <p>
    Ulrich runs an RDFa-aware web browser, e.g. Firefox with a GreaseMonkey plugin, which provides automatic popups with additional information for all proteins appropriately marked up using RDFa. When he visits Patrick's blog post, Ulrich can point to the protein name in the blog post and get a pop-up window which automatically retrieves information about the protein from public RDF databases, including related proteins, genes, and publications.
  </p>
      </div1>


      <div1>
          <head>Acknowledgments</head>
        <p>
    The editors gratefully acknowledge contributions from:
    <ul>
      <li> Mark Birbeck</li>
      <li> Jeremy Carroll</li>
      <li> Steven Pemberton</li>
      <li> Guus Schreiber</li>
      <li> Ralph Swick</li>
      <li> Elias Torres</li>
    </ul>
        </p>
      </div1>
  <div1>
    <head>Bibliography</head>
        <blist>
	        <bibl id="SMW" href="http://www.aifb.uni-karlsruhe.de/Publikationen/showPublikation_english?publ_id=1055">Semantic Wikipedia</bibl>
	  		<bibl id="MF" href="http://www.microformats.org/">Microformats</bibl>
    		<bibl id="FOAF" href="http://www.foaf-project.org/">The Friend of a Friend (FOAF) Project</bibl>
    		<bibl id="SWD" href="http://www.w3.org/2006/07/SWD/">The Semantic Web Deployment Working Group</bibl>
          	<bibl id="RDFHTML" href="http://www.w3.org/2001/sw/BestPractices/HTML/">RDF-in-HTML Task Force</bibl>
          	<bibl id="SWBPD-WG" href="http://www.w3.org/2001/sw/BestPractices/">Semantic Web Best Practices and Deployment Working Group</bibl>
          	<bibl id="HTML-WG" href="http://www.w3.org/MarkUp/Group/">HTML Working Group</bibl>
          	<bibl id="ICAL-RDF" href="http://www.w3.org/TR/rdfcal/">RDF Calendar Interest Group Note</bibl>
          	<bibl id="VCARD-RDF" href="http://www.w3.org/TR/vcard-rdf">Representing vCard Objects in RDF/XML</bibl>
        </blist>
  </div1>
    </body>
</spec>
