Suppose we have descriptions of two meetings that we want to syndicate as an RSS 1.0 channel. One event is a physical meeting with two attendees at RDFWeb HQ, on 2002-01-04 at 10am GMT. The other is a teleconference with three attendees at 5pm GMT.
The following follows the guidellines for creating RSS 1.0
channels and modules.
RSS 1.0 uses RDF, which can be thought of as a
specific set of design conventions for XML. This
requires that we write down a standard introduction to the file, stating
that it is XML and RDF, and that we are using certain shorthands for the
various namespaces used:
<?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cal="http://ilrt.org/discovery/2001/10/cal-drafts/cal-core.rdf#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns="http://purl.org/rss/1.0/" > |
Then we write down the standard RSS 1.0 format for describing the channel or group of links that we are syndicating. rdf:about points to the url of the channel itself.
<channel rdf:about="http://example.com/calendar/test1"> |
The channel must have a url, a title and a description. The link tag does not need to be the same as the rdf:about tag (it could link to the parent site for example).
<title>Today's events</title>
<link>http://example.com/calendar/test1</link>
<description>
Events today
</description>
|
It can also have an image url associated with it.
| <image rdf:resource="http://www.math.kth.se/optsyst/bilder/calendar_small.gif"/> |
We also need to write down a contents list for the channel. "Seq" is just a sequence or ordered list. "li" is like the html li tag, an element of a list. Each event must have a url associated with it - this is the part in the resource= attribute.
<items>
<rdf:Seq>
<rdf:li resource="http://example.com/calendar/test1#1" />
<rdf:li resource="http://example.com/calendar/test1#2" />
</rdf:Seq>
</items>
|
That's the end of the channel tag. So far this is identical to the ordinary proceedure for RSS 1.0 channels.
</channel> |
Now we can say more about the things we've said are in the channel. We can say more about the image, which should have the same url in rdf:about as we had in <image rdf:resource above. It should have a title, a link, and a description.
<image rdf:about="http://www.math.kth.se/optsyst/bilder/calendar_small.gif">
<title>example.com</title>
<link>http://example.com</link>
<url>http://www.math.kth.se/optsyst/bilder/calendar_small.gif</url>
</image>
|
Then we want to talk about the items, or contents of the channel themselves. For each item we use rdf:about to refer to the urls of the items as used in the contents. As usual in RSS 1.0, the item must have a title, link and description.
<item rdf:about="http://example.com/calendar/test1#1">
<title>Event 1</title>
<link>http://example.com/calendar/test1#1</link>
<description>
This is event 1: a meeting
</description>
|
Now we can start adding information about the calendar information associated with this item. The meeting has a start date-time, which points to an object of type Date-time. The Date-time has a textual rdf:value associated with it, a string representing the date-time in RFC 8601 format. The Z represents UTC, equivalent to GMT. For other timezones a slightly more complex representation is required (example here; see also issues).
<cal:dtstart> <cal:Date-time> <rdf:value>20020104T10:00:00Z<rdf:value/> </cal:Date-time> </cal:dtstart> |
Date time end (cal:dtend) is very similar.
<cal:dtend> <cal:Date-time> <rdf:value>20020104T11:00:00Z<rdf:value/> </cal:Date-time> </cal:dtend> |
Then we can add information about people attending the meeting. iCalendar represents people by their email address. Which is why the Cal-address object has an rdf:about tag pointing to the mail address of the person it represents. Here there is also some additional information about the attendees, using the foaf ("friend of a friend") vocabulary.
<cal:attendee> <cal:Cal-address rdf:about="mailto:libby.miller@bristol.ac.uk"> <foaf:mbox rdf:resource="mailto:libby.miller@bristol.ac.uk" /> <foaf:name>libby</foaf:name> <cal:role>chair</cal:role> </cal:Cal-address> </cal:attendee> <cal:attendee> <cal:Cal-address rdf:about="mailto:damian@yahoo.com"> <foaf:mbox rdf:resource="mailto:damian@yahoo.com" /> <foaf:name>damian</foaf:name> </cal:Cal-address> </cal:attendee> |
Location points at a Geo object, which here just has a name, but could have latitude and longitude attached to it.
<cal:location> <cal:Geo> <foaf:name>front room, RDFWeb HQ</foaf:name> </cal:Geo> </cal:location> |
That's the end of the item.
</item> |
The second event is much the same except that there are three attendees and no location as it's a teleconference.
<item rdf:about="http://example.com/calendar/test1#2">
<title>Event 2</title>
<link>http://example.com/calendar/test1#2</link>
<description>
This is event 2: a teleconference
</description>
<cal:dtstart>
<cal:Date-time>
<rdf:value>20020104T17:00:00Z<rdf:value/>
</cal:Date-time>
</cal:dtstart>
<cal:dtend>
<cal:Date-time>
<rdf:value>20020104T18:30:00Z<rdf:value/>
</cal:Date-time>
</cal:dtend>
<cal:attendee>
<cal:Cal-address>
<foaf:mbox rdf:resource="mailto:libby.miller@bristol.ac.uk" />
<foaf:name>libby</foaf:name>
<cal:role>chair</cal:role>
</cal:Cal-address>
</cal:attendee>
<cal:attendee>
<cal:Cal-address>
<foaf:mbox rdf:resource="mailto:damian@yahoo.com" />
<foaf:name>damian</foaf:name>
</cal:Cal-address>
</cal:attendee>
<cal:location>
<cal:Geo>
<foaf:name>kitchen, RDFWeb HQ</foaf:name>
</cal:Geo>
</cal:location>
</item>
|
That's the end of the second item
</rdf:RDF> |
That's the end of the file.
Here's an example of an item which uses a timezone identifier instead of UTC. The timezone url refers to a different file, because describing timezones is complex. Here's an example of a timezone file.
<item rdf:about="http://example.com/calendar/test1#2">
<title>Event 3</title>
<link>http://example.com/calendar/test1#2</link>
<description>
This is event 2: a teleconference
</description>
<cal:dtstart>
<cal:Date-time>
<rdf:value>20020104T17:00:00<rdf:value/>
<cal:Tzid rdf:resource="http://ilrt.org/discovery/2001/06/content/tz/GMT.rdf" />
</cal:Date-time>
</cal:dtstart>
<cal:dtend>
<cal:Date-time>
<rdf:value>20020104T18:30:00<rdf:value/>
<cal:Tzid rdf:resource="http://ilrt.org/discovery/2001/06/content/tz/GMT.rdf" />
</cal:Date-time>
</cal:dtend>
</item>
|