Johan Blok


Johan Blok

Semantics for mere humans

Now that we have created semantic information, readable by machines (or rather, marked certain information as such), is there any way of benefiting as an ordinary human being? I believe so. I will outline one simple example and you will get the idea. After having created a semantic event in the previous blog post, we will extend the functionality by creating an "Add to Calendar" feature to the website. This link will create an entry in (let's say) Microsoft Outlook.

To do this, first some preparations.

Create a File Type 'Internet Calendar' with file extension .ics and mime type 'text/calendar' (which you may have to add to your environment as well).

Create an application page of this File Type.

Now create a Translation with some parameters that we can call in a way similar to this:

Smartsite SXML CopyCode image Copy Code
{icalendar("20100614T170000","20100614T230000","Kennissessie met Smartsite","Kennissessie",Delft,3,"P0D1H0M")}

The aguments listed here are:

  • startdate
  • enddate
  • description
  • summary
  • location
  • priority
  • trigger

and refer to the Microformat hCalendar. For more information: http://microformats.org/wiki/hcalendar. Of course, it is up to you to add other arguments that may be relevant. Some arguments require some obscure format, so you may want to create some indirection here. 'P0D1H0M' is the notation for a trigger (reminder), that will go off 0 days, 1 hour and 0 minutes before the actual start of the event.

The replacement for the translation is something like this:

Smartsite SXML CopyCode image Copy Code
<se:text>
BEGIN:vCalendar
VERSION:2.0
METHOD:PUBLISH
BEGIN:vEvent
DTSTART:{translation.arg(startdate,default='01-01-2010',rem='Start date for event')}
DTEND:{translation.arg(enddate,default='01-01-2010',rem='End date for event')}
UID:{itemdata.field('code')}
DTSTAMP:{datetime.now()}
DESCRIPTION:{translation.arg(description,default='unknown',rem='Description for event')}
SUMMARY:{translation.arg(summary,default='unknown',rem='Summary for event')}
LOCATION:{translation.arg(location,default='unknown',rem='Location for event')}
PRIORITY:{translation.arg(priority,default='3',rem='Priority for event')}
BEGIN:vAlarm
TRIGGER;RELATED=START:{translation.arg(trigger,default='P0DT0H15M',rem='Alert trigger for event')}
ACTION:DISPLAY
DESCRIPTION:Reminder
END:vAlarm
END:vEvent
END:vCalendar
</se:text>

When the application page is rendered, the arguments are entered and the final output will be:

Smartsite SXML CopyCode image Copy Code
BEGIN:vCalendar
VERSION:2.0
METHOD:PUBLISH
BEGIN:vEvent
DTSTART:20090314T170000
DTEND:20090314T230000
UID:GUID-107EF6A74C4C4CFF9B8BA81CC7872DAA
DTSTAMP:2010-05-25T12:34:56
DESCRIPTION:Kennissessie met Smartsite
SUMMARY:Kennissessie
LOCATION:Delft
PRIORITY:3
BEGIN:vAlarm
TRIGGER;RELATED=START:P0D1H0M
ACTION:DISPLAY
DESCRIPTION:Reminder
END:vAlarm
END:vEvent
END:vCalendar

By linking from the semantic event to this application page, you will have created a human benefit of all your semantic work.

The ultimate way to merge all this together might be to create a generic content type Event, and provide several renditions of this content type: HTML with the mark-up illustrated in previous blog posts, as a Microformat, as an RSS feed (?), et cetera.

Of course, you can do this with other Microformats as well. Happy experimenting!

 

Posted by Johan Blok on Tuesday, May 25, 2010 12:14:28 PM
Johan den Ouden - Wednesday, May 26, 2010 9:32 AM

Nice!

You are not allowed to post here.
All Blogs
Johan Blok
Features, projects, ambitions
Ad van der Kolk
About van alles en nog wat
Vincent Baaij
Showing it, Making sites with it, Adapting it, Refining it, Telling about it, Selling it, Investigating it, Teaching it and Expanding it.
Marc Derksen
What is happening at Smartsite R&D.
Marc van Neerven
Marc's shared thoughts...
Twan Meijerink
About new projects, quality assurance and me ;-)
Douwe de Wilde
About security, maybe more...
Mike Perquin
About WCF, Outscaling, database maintenance (SQL server), etc.
René Pronk
while (true);
Erwin Rijss
About building sites and more...
Recent Blog Comments
Michel Rutten
19 August 2010, 11:19
Hartstikke mooi! De Config Editor wordt steeds nuttiger. Dit kan veel tijd besparen bij het oplossen...
Michel Rutten
18 August 2010, 17:10
Very nice! Up until now, SCF does not support state interchange between separate but related smartlets,...
Johan den Ouden
23 June 2010, 14:39
Mooie latijnse tekst!
Johan den Ouden
03 June 2010, 11:35
Klinkt erg goed!
Johan den Ouden
26 May 2010, 09:32
Nice!

Stay in Touch
Profile
Latest additions
...proudly presents: Smartsite iXperion Faceted Search
Johan Blok, 06 September 2010, 11:43
Smartsite iXperion 1.2 build 4 has been released locked
Twan Meijerink, 03 September 2010, 14:37
Programma kennissessie 7 september
Johan Blok, 18 August 2010, 15:59
Forum shows deleted items locked
Theo van Lieshout, 18 August 2010, 14:43
Four new features that will make Smartlets even more powerful
Marc van Neerven, 09 August 2010, 11:41
Microsoft Certified Partner Logo