Michael Hausenblas, JOANNEUM RESEARCH
Ivan Herman, W3C
Ben Adida, Creative Commons / Harvard University
Bringing the
"Web of Documents"
and the
"Web of Data" (Semantic Web)
closer
distributed under a
<a href="http://creativecommons.org/licenses/by/3.0/">CC License</a>
distributed under a
<a href="http://creativecommons.org/licenses/by-nc/3.0/">CC License</a>
distributed under a <a href="http://creativecommons.org/licenses/by/3.0/"> Creative Commons License </a>
distributed under a
<a rel="license" href="http://creativecommons.org/licenses/by/3.0/">
Creative Commons License
</a>
<h2>The Trouble with Bob</h2> <h3>Alice</h3>
<h2 property="dc:title">The Trouble with Bob</h2> <h3 property="dc:creator">Alice</h3>
<div xmlns:dc="http://purl.org/dc/elements/1.1/">
....
</div>
<div xmlns:dc="http://purl.org/dc/elements/1.1/"> <h2 property="dc:title">The Trouble with Bob</h2> <h3 property="dc:creator">Alice</h3> </div>
<div xmlns:dc="http://purl.org/dc/elements/1.1/"> <h2 property="dc:title">The Trouble with Bob</h2> <h3 property="dc:creator">Alice</h3> <em>April 21st, 2008</em> </div>
<div xmlns:dc="http://purl.org/dc/elements/1.1/">
<h2 property="dc:title">The Trouble with Bob</h2>
<h3 property="dc:creator">Alice</h3>
<em property="dc:date">April 21st, 2008</em>
</div>
<div xmlns:dc="http://purl.org/dc/elements/1.1/">
<h2 property="dc:title">The Trouble with Bob</h2>
<h3 property="dc:creator">Alice</h3>
<em property="dc:date" datatype="xsd:date"
content="20080421">April 21st, 2008</em>
</div>
<div ...> <h2 property="dc:title">The Trouble with Bob</h2> <h3 property="dc:creator">Alice</h3> </div> ... <div ...> <h2 property="dc:title">Jo's Barbecue</h2> <h3 property="dc:creator">Eve</h3> </div>
<div about="/alice/posts/trouble_with_bob"...> <h2 property="dc:title">The Trouble with Bob</h2> <h3 property="dc:creator">Alice</h3> </div> ... <div about="/alice/posts/jos_barbecue"...> <h2 property="dc:title">Jo's Barbecue</h2> <h3 property="dc:creator">Eve</h3> </div>
<div about="/alice/posts/trouble_with_bob"...> <h2 property="dc:title">The Trouble with Bob</h2> <h3 property="dc:creator">Alice</h3> </div>
<div about="/alice/posts/trouble_with_bob"...> <h2 property="dc:title">The Trouble with Bob</h2> <h3 property="dc:creator">Alice</h3> <p>The trouble with Bob is that he takes much better photos than I do:</p> <div> <img src="/bob/photos/sunset.jpg" /> <span>Beautiful Sunset</span> by <a href="/bob/">Bob</a> </div> </div>
<div about="/alice/posts/trouble_with_bob"...> <h2 property="dc:title">The Trouble with Bob</h2> <h3 property="dc:creator">Alice</h3> <p>The trouble with Bob is that he takes much better photos than I do:</p> <div about="/bob/photos/sunset.jpg"> <img src="/bob/photos/sunset.jpg" /> <span property="dc:title">Beautiful Sunset</span> by <a rel="dc:creator" href="/bob/">Bob</a> </div> </div>
<h2 property="dc:title">The Trouble with Bob</h2> ... <div id="comments"> <p id="c_1"> Yes, Bob is an evil-doer. <em>Cindy</em> </p> <p id="c_2"> No way, Bob rocks. <em>Michelle</em> </p> </div>
<h2 property="dc:title">The Trouble with Bob</h2> ... <div id="comments"> <p id="c_1"> Yes, Bob is an evil-doer. <em typeof="foaf:Person">Cindy</em> </p> <p id="c_2"> No way, Bob rocks. <em typeof="foaf:Person">Michelle</em> </p> </div>
<h2 property="dc:title">The Trouble with Bob</h2> ... <div id="comments"> <p id="c_1"> Yes, Bob is an evil-doer. <em typeof="foaf:Person" property="foaf:name"> Cindy</em> </p> <p id="c_2"> No way, Bob rocks. <em typeof="foaf:Person" property="foaf:name"> Michelle</em> </p> </div>
<h2 property="dc:title">The Trouble with Bob</h2> ... <div id="comments"> <p id="c_1" about="#c_1"> Yes, Bob is an evil-doer. <em typeof="foaf:Person" property="foaf:name"> Cindy</em> </p> <p id="c_2" about="#c_2"> No way, Bob rocks. <em typeof="foaf:Person" property="foaf:name"> Michelle</em> </p> </div>
<h2 property="dc:title">The Trouble with Bob</h2> ... <div id="comments"> <p id="c_1" about="#c_1" rel="dc:creator"> Yes, Bob is an evil-doer. <em typeof="foaf:Person" property="foaf:name"> Cindy</em> </p> <p id="c_2" about="#c_2" rel="dc:creator"> No way, Bob rocks. <em typeof="foaf:Person" property="foaf:name"> Michelle</em> </p> </div>
<h2 property="dc:title">The Trouble with Bob</h2> ... <div id="comments"> <p id="c_1" about="#c_1" rel="dc:creator"> Yes, Bob is an evil-doer. <em typeof="foaf:Person" property="foaf:name"> Cindy</em> </p> <p id="c_2" about="#c_2" rel="dc:creator"> No way, Bob rocks. <em typeof="foaf:Person" property="foaf:name"> Michelle</em> </p> </div>
<h2 property="dc:title">The Trouble with Bob</h2>
...
<div id="comments" rel="blog:comment">
<p id="c_1" about="#c_1" rel="dc:creator">
Yes, Bob is an evil-doer.
<em typeof="foaf:Person" property="foaf:name">
Cindy</em>
</p>
<p id="c_2" about="#c_2" rel="dc:creator">
No way, Bob rocks.
<em typeof="foaf:Person" property="foaf:name">
Michelle</em>
</p>
</div>
<h2 property="dc:title">The Trouble with Bob</h2> ... <div id="comments" rel="blog:comment"> <p id="c_1" about="#c_1" rel="dc:creator"> Yes, Bob is an evil-doer. <em typeof="foaf:Person" property="foaf:name"> Cindy</em> </p> <p id="c_2" about="#c_2" rel="dc:creator"> No way, Bob rocks. <em typeof="foaf:Person" property="foaf:name"> Michelle</em> </p> </div>
<span>Ivan Herman</span> Email: <a href="mailto:ivan@w3.org">ivan@w3.org</a> (<span>5ac8032d5f6012aa1775ea2f63e1676bafd5e80b</span>) Phone numbers: phone: <a href="tel:+31-20-5924163">+31-20-5924163</a> mobile: <a href="tel:+31-641044153">+31-641044153</a> fax: +31-20-5924312 <a href="/pgpkey.html">GnuPGP key</a> Misc: I am often on freenode, (acc. name <span>IvanHerman</span> ...
<span property="foaf:name">Ivan Herman</span> Email: <a href="mailto:ivan@w3.org">ivan@w3.org</a> (<span>5ac8032d5f6012aa1775ea2f63e1676bafd5e80b</span>) Phone numbers: phone: <a href="tel:+31-20-5924163">+31-20-5924163</a> mobile: <a href="tel:+31-641044153">+31-641044153</a> fax: +31-20-5924312 <a href="/pgpkey.html">GnuPGP key</a> Misc: I am often on freenode, (acc. name <span>IvanHerman</span> ...
<span property="foaf:name">Ivan Herman</span> Email: <a rel="foaf:mbox" href="mailto:ivan@w3.org">ivan@w3.org</a> (<span>5ac8032d5f6012aa1775ea2f63e1676bafd5e80b</span>) Phone numbers: phone: <a href="tel:+31-20-5924163">+31-20-5924163</a> mobile: <a href="tel:+31-641044153">+31-641044153</a> fax: +31-20-5924312 <a href="/pgpkey.html">GnuPGP key</a> Misc: I am often on freenode, (acc. name <span>IvanHerman</span> ...
<span property="foaf:name">Ivan Herman</span> Email: <a rel="foaf:mbox" href="mailto:ivan@w3.org">ivan@w3.org</a> (<span property="foaf:mbox_sha1sum">5ac8032d5f6012aa1775ea2f63e1676bafd5e80b</span>) Phone numbers: phone: <a href="tel:+31-20-5924163">+31-20-5924163</a> mobile: <a href="tel:+31-641044153">+31-641044153</a> fax: +31-20-5924312 <a href="/pgpkey.html">GnuPGP key</a> Misc: I am often on freenode, (acc. name <span>IvanHerman</span> ...
<span property="foaf:name">Ivan Herman</span> Email: <a rel="foaf:mbox" href="mailto:ivan@w3.org">ivan@w3.org</a> (<span property="foaf:mbox_sha1sum">5ac8032d5f6012aa1775ea2f63e1676bafd5e80b</span>) Phone numbers: phone: <a rel="foaf:phone href="tel:+31-20-5924163">+31-20-5924163</a> mobile: <a rel="foaf:phone href="tel:+31-641044153">+31-641044153</a> fax: +31-20-5924312 <a href="/pgpkey.html">GnuPGP key</a> Misc: I am often on freenode, (acc. name <span>IvanHerman</span> ...
<span property="foaf:name">Ivan Herman</span> Email: <a rel="foaf:mbox" href="mailto:ivan@w3.org">ivan@w3.org</a> (<span property="foaf:mbox_sha1sum">5ac8032d5f6012aa1775ea2f63e1676bafd5e80b</span>) Phone numbers: phone: <a rel="foaf:phone href="tel:+31-20-5924163">+31-20-5924163</a> mobile: <a rel="foaf:phone href="tel:+31-641044153">+31-641044153</a> fax: +31-20-5924312 <a rel="wot:pubkeyAddress" href="/pgpkey.html">GnuPGP key</a> Misc: I am often on freenode, (acc. name <span>IvanHerman</span> ...
<span property="foaf:name">Ivan Herman</span> Email: <a rel="foaf:mbox" href="mailto:ivan@w3.org">ivan@w3.org</a> (<span property="foaf:mbox_sha1sum">5ac8032d5f6012aa1775ea2f63e1676bafd5e80b</span>) Phone numbers: phone: <a rel="foaf:phone href="tel:+31-20-5924163">+31-20-5924163</a> mobile: <a rel="foaf:phone href="tel:+31-641044153">+31-641044153</a> fax: +31-20-5924312 <a rel="wot:pubkeyAddress" href="/pgpkey.html">GnuPGP key</a> Misc: I am often on <span rel="foaf:holdsAccount"> <span about="http://www.freenode.net/irc_servers.shtml" typeof="foaf:OnlineAccount foaf:OnlineChatAccount"> freenode, (acc. name <span property="foaf:accountName">IvanHerman</span> </span> </span> ...
<div about="/articles/cheneys_glasses"> <a rel="dc:source" href=".." property="dc:title"> Enhancement of Reflection in Cheney's Glasses </a> <h3 property="dc:creator">Rick</h3> 1957 diggs <a href="up?article_id=42">up</a> <a href="down?article_id=42">down</a> <a href="bury?article_id=42">bury</a> </div>
<div about="/articles/cheneys_glasses"
xmlns:digg="http://digg.com/vocab/">
<a rel="dc:source" href=".." property="dc:title">
Enhancement of Reflection in Cheney's Glasses
</a>
<h3 property="dc:creator">Rick</h3>
1957 diggs
<a href="up?article_id=42">up</a>
<a href="down?article_id=42">down</a>
<a href="bury?article_id=42">bury</a>
</div>
<div about="/articles/cheneys_glasses" xmlns:digg="http://digg.com/vocab/"> <a rel="dc:source" href=".." property="dc:title"> Enhancement of Reflection in Cheney's Glasses </a> <h3 property="dc:creator">Rick</h3> <span property="digg:score">1957</span> diggs <a href="up?article_id=42">up</a> <a href="down?article_id=42">down</a> <a href="bury?article_id=42">bury</a> </div>
<div about="/articles/cheneys_glasses" xmlns:digg="http://digg.com/vocab/"> <a rel="dc:source" href=".." property="dc:title"> Enhancement of Reflection in Cheney's Glasses </a> <h3 property="dc:creator">Rick</h3> <span property="digg:score">1957</span> diggs <a rel="digg:up" href="up?article_id=42">up</a> <a href="down?article_id=42">down</a> <a href="bury?article_id=42">bury</a> </div>
<div about="/articles/cheneys_glasses" xmlns:digg="http://digg.com/vocab/"> <a rel="dc:source" href=".." property="dc:title"> Enhancement of Reflection in Cheney's Glasses </a> <h3 property="dc:creator">Rick</h3> <span property="digg:score">1957</span> diggs <a rel="digg:up" href="up?article_id=42">up</a> <a rel="digg:down" href="down?article_id=42">down</a> <a rel="digg:bury" href="bury?article_id=42">bury</a> </div>
<div about="/photos/timbl/12345"> <img src="/photos/timbl/12345_medium.jpg" /> <span property="dc:title"> Me and Vint Cert, partying Beijing style </span> <h3 property="dc:creator">DanC</h3> Other Sizes: <a href="12345_small.jpg">small, 300x200</a> <a href="12345_big.jpg">big, 800x600</a> Taken with: <a href="...">Canon Rebel XTi</a> </div>
<div about="/photos/timbl/12345" xmlns:photo="..."> <img src="/photos/timbl/12345_medium.jpg" /> <span property="dc:title"> Me and Vint Cert, partying Beijing style </span> <h3 property="dc:creator">DanC</h3> Other Sizes: <a href="12345_small.jpg">small, 300x200</a> <a href="12345_big.jpg">big, 800x600</a> Taken with: <a rel="photo:camera" href="...">Canon Rebel XTi</a> </div>
<div about="/photos/timbl/12345" xmlns:photo="..."> <img src="/photos/timbl/12345_medium.jpg" /> <span property="dc:title"> Me and Vint Cert, partying Beijing style </span> <h3 property="dc:creator">DanC</h3> Other Sizes: <a rel="photo:alternate" href="12345_small.jpg"> small, 300x200 </a> ...
<div about="/photos/timbl/12345" xmlns:photo="..."> <img src="/photos/timbl/12345_medium.jpg" /> <span property="dc:title"> Me and Vint Cert, partying Beijing style </span> <h3 property="dc:creator">DanC</h3> Other Sizes: <a rel="photo:alternate" href="12345_small.jpg"> small, <span property="photo:dimensions">300x200</span> </a> ...
A complete examples can be accessed in a standalone XHTML+RDFa document (from the RDFa Primer). This document will be used as a base in the following consumption examples.
@prefix dc: <http://purl.org/dc/elements/1.1/>. @prefix foaf: <http://xmlns.com/foaf/0.1/>. @prefix cc: <http://creativecommons.org/ns#>. <http://example.com/alice> cc:license <http://creativecommons.org/licenses/by/3.0/>; <http://example.com/posts/trouble_with_bob> dc:creator "Alice"; dc:title "The trouble with Bob". <http://example.com/alice#me> a foaf:Person; foaf:knows [ a foaf:Person; foaf:homepage <http://example.com/manu>; foaf:name "Manu" ], [ a foaf:Person; foaf:homepage <http://example.com/bob>; foaf:name "Bob" ], [ a foaf:Person; foaf:homepage <http://example.com/eve>; foaf:name "Eve" ]; foaf:mbox <mailto:alice@example.com>; foaf:name "Alice Birpemswick"; foaf:phone <tel:+1-617-555-7332> . </2006/07/SWD/RDFa/primer/sunset.jpg> dc:creator "Bob"; dc:title "Beautiful Sunset" . <http://example.com/posts/jos_barbecue> dc:creator "Eve"; dc:title "Jo's Barbecue" .
Who is the creator of the post with the title "The trouble with Bob"? Answer ...
PREFIX dc: <http://purl.org/dc/elements/1.1/> SELECT ?creator_of_post FROM <http://www.w3.org/2007/08/pyRdfa/extract?uri=http://www.w3.org/2006/07/SWD/RDFa/primer/alice-example.html> WHERE { ?post dc:title ?post_title ; dc:creator ?creator_of_post . FILTER regex(?post_title, "The trouble with Bob", "i") }
Whom the heck knows Alice? Answer ...
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?whom_name ?whom_homepage FROM <http://www.w3.org/2007/08/pyRdfa/extract?uri=http://www.w3.org/2006/07/SWD/RDFa/primer/alice-example.html> WHERE { ?alice rdf:type foaf:Person ; foaf:mbox <mailto:alice@example.com> ; foaf:knows ?whom. ?whom rdf:type foaf:Person ; foaf:name ?whom_name ; foaf:homepage ?whom_homepage . }
Yahoo! SearchMonkey - example: Creative Commons application
How to config your Web server ...
Define self-descriptive RDF-based vocabularies ...
Parsing of a DOM that is updated via Javascript
RDFa for other host languages
Please note that an online version of the tutorial slides is available at:
http://www.w3.org/2008/Talks/1026-ISCW-RDFa/