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.
Johan den Ouden
Smartsite storyteller
Demian Buijs
The art of Smartsite iXperion
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
Ruben Verschueren
30 January 2012, 15:31
I get an 'operation has timed out' error (even for the examples). however if I browse to the uri's...
Marc van Neerven
12 August 2011, 16:50
Added a new (Web-guidelines compliant) download.
Marc van Neerven
12 August 2011, 14:33
Just added an update (3.0) which produces compliant XHTML and has been adapted for strict Web Guidelines...
Johan den Ouden
10 August 2011, 10:38
Uiteraard is bovenstaande code ook in een virtual assembly te gieten zodat een dll niet meer noodzakelijk...
Marc van Neerven
02 August 2011, 14:56
Small update: data retrieved by the Twitter search query has to be encoded for presentation: Replace...

Stay in Touch
Profile
Latest additions
Workbench beta has expired
Hank Brandwijk, 11 January 2012, 16:53
Smartsite iXperion 1.4 build 4 has been released! locked
Twan Meijerink, 02 December 2011, 11:04
The second life of XForms
Marc van Neerven, 04 November 2011, 18:34
How to hide a property in a custom module? locked
Peter van der Waal, 17 October 2011, 09:31
Content, content, content...Waar halen we het vandaan?!
Ad van der Kolk, 07 October 2011, 17:48
Microsoft Certified Partner Logo