Tutorials

From RDFaWiki

Jump to: navigation, search

Contents

General Presentations and Slides

  • Talks about RDFa, the old page that we should move over here now.
  • ccREL, the Creative Commons Rights Expression Language, which is mostly an RDFa tutorial.

Best Practices

Friend-of-a-friend (FOAF)

The Friend of a friend (FOAF) vocabulary is used to mark up people and their relationships with one another. An example of how to use it with RDFa is available at Getting started with RDFa: Creating a basic FOAF profile.

(Note that Mark Birbeck gives permission for the core of this tutorial to be imported to this section, if anyone has the time to do it.)

vCard

Using the vCard vocabulary one can express for example a business card . The full example can be viewed at Michael's page.

<h2>Business Card</h2>
<div about="http://sw-app.org/mic.xhtml#i" typeof="foaf:Person">
...
<div rel="ov:businessCard">
	<div about="http://sw-app.org/mic.xhtml#businesscard" typeof="vcard:VCard">
		<div rel="vcard:org">
		<div about="http://sw-app.org/mic.xhtml#org" typeof="vcard:Organization">
		<span property="vcard:street-address" datatype="xsd:string">
			Digital Enterprise Research Institute (DERI),<br />
			National University of Ireland, Galway<br />

		</span>
		<span rel="owl:sameAs" resource="http://dbpedia.org/resource/Digital_Enterprise_Research_Institute" />
	</div>
	</div>		
	<div rel="vcard:workAdr">
	<div about="http://sw-app.org/mic.xhtml#postaladress" typeof="vcard:Address">
		<span property="vcard:street-address">IDA Business Park, Lower Dangan</span>,<br />
		<span property="vcard:locality">Galway</span>,
		<span property="vcard:country-name">Ireland</span>
		</div>
	</div>	
	Tel.: <span property="vcard:workTel">+353 91 495730</span>
	</div>
</div>
...
</div>

We note that ov:businessCard connects the business card (http://sw-app.org/mic.xhtml#businesscard) to a foaf:Agent (http://sw-app.org/mic.xhtml#i).

vEvent

The events vocabulary for RDF was defined from 2002 by Dan Connolly and Libby Miller in RDF Calendar. Its use is identified by including the following declaration in your document, for instance as an attribute on the <html> element: xmlns:event="http://www.w3.org/2002/12/cal#"

The markup for an event, in this case a TV program, can then look like this:

<div typeof="event:Vevent">
  <h3 property="event:summary">Have I Got Old News For You</h3>
  <p property="event:location">BBC2</p>
  <p><span property="event:dtstart" content="2008-06-28T21:00:00">Saturday 28 June,
     9</span>-<span property="event:dtend" content="2008-06-28T21:30:00">9.30pm</span></p>
  <p property="event:description">Team captains Paul Merton and Ian Hislop
     are joined by returning guest host Jeremy Clarkson and
     panellists Danny Baker and Germaine Greer for the
     topical news quiz. <abbr title="in stereo">[S]</abbr></p>
 </div>

There are no requirements on the order of enclosed elements. For instance here is a description of a conference:

<div typeof="event:Vevent">
  <h3 property="event:summary">WWW 2009</h3>
  <p property="event:description">18th International World Wide Web Conference</p>
  <p>To be held from <span property="event:dtstart" content="2009-04-20">20th April 2009</span>
     until <span property="event:dtend" content="2009-04-24">24th April</span>, in
  <span property="event:location">Madrid, Spain</span>.</p>
 </div>

If you want to validate your page, then replace the DOCTYPE you use with

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
 "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">

Sounds and Music

Music websites and blogs are a great means of discussing new music and audio recordings in general. There are a number of music services on the Internet and until now there hasn't been a great way of expressing the semantics behind sounds, songs, and music on the web. The following tutorial discusses how to mark up sounds, songs and music on the web:

Marking up Audio Recordings in RDFa

Movies, Television and Video

As movie, television and video websites gain in popularity, making computers understand what we are discussing online becomes increasingly important. There are a number of video services on the Internet and until now there has not been a great way of expressing the semantics behind movies, television and video on the web. The following tutorial discusses how to mark up movies, television and video on the web:

Marking up Video Recordings in RDFa

Commerce

Commerce is a major part of the Web's ecosystem where many enjoy buying and selling goods from each other via the Internet. Marking up the semantics of commerce are important when attempting to enhance the usability of the web. For example, being able to ask a search engine for the best price for a particular DVD movie would save many people a great amount of time when attempting to purchase movies. For those that sell items through the web, marking up competitive prices in a machine-readable format will help drive traffic to their website.

Marking up Prices in RDFa

RSS 1.0

RDF Site Summary 1.0 (RSS 1.0) defines an RDF vocabulary for news feed. We have a a step by step tutorial.

Semantically-Interlinked Online Communities (SIOC)

The Semantically-Interlinked Online Communities (SIOC) vocabulary is used to mark up discussion on the Web, such as blogs, online forums, mailing lists, etc.

Geolocations

The Basic Geo Vocabulary can be used to quickly indicate where things are. We have a step by step tutorial.

There is also an example of how this may be done using the Geo Microformat from hCard called hCard+RDFa.

Further resources

See also the RDFa Recipes page.

If you want to dive-in deeper, you may also want to have a look at the RDFa publications page.

In the following, resources regarding specific topics or domains are listed.

Healthcare & Life Sciences

Guidelines for Developing Tutorials

  • Clearly define the problem in the title
  • Expand on the title in the first paragraph so people know if they are reading the right thing
  • Use a real world example of content as a starting point
  • Incrementally annotate it in the SIMPLEST WAY POSSIBLE that addresses the problem statement
  • Use fragments for examples - complete documents are intimidating and hard to read
  • Never Never Never mention a triple nor a Bnode!
    • Ben: I disagree with this. Certainly showing how to mark things up is the priority, but talking about triples is a good thing. Let's not underestimate people.