From W3C Wiki

This SPARQL Calendar Demo demonstrates the use of SPARQL queries over AJAX to integrate data from a myriad of native RDF and non-RDF sources. Currently, it finds calendar information from FOAF files, discovers shared interests between people, and suggests events that people with shared interests can attend together.

The SPARQL calendar demo can be seen running live and you can also download the component HTML, CSS, and JavaScript. (It is released under MIT License.) Tips on SparqlCalendarDemoUsage are also available.

Main Points

  • JSON output for SPARQL SELECT queries
    • enables easy and quick JavaScript access of query answers (semantic web meets Web 2.0)
  • More complex SPARQL queries work
    • Useful for asking questions against growing RDF Datasets
  • Query non-RDF sources via GETtable conversion services, but beware query complications!
    • Examples: XSLT, ics2rdf


  • No client-side model -- pure SPARQL SELECT application, asks queries of an ever-growing dataset
  • Dataset grows as new URLs are discovered -- successive SPARQL queries query ever-growing datasets

URL Discovery

  • follow rdfs:seeAlso of foaf:knows objects (fall back on URI of foaf:knows object itself)
  • find any rdfs:seeAlso URIs which are rdf:type'd as ical:Vcalendar's -- these become named graphs (see sticking points)
  • find any objects of foaf:interest -- these become named graphs

Getting RDF in a Non-RDF World

  • Want to be able to SPARQL query ICS files, RSS feeds from
  • Solution: Application has enough knowledge to wrap SPARQL graph URIs (FROM, FROM NAMED) in conversion services (ics2rdf python, w3c XSLT service)

Data Sources

  • FOAF files
  • iCal files (ics2rdf)
  • RSS feeds (W3C XSLT service with custom stylesheet)
  • hCalendar microformat (Life Lint)

The Queries

  • Find all people in the dataset along with their names, calendars, and interests
  • Find all calendar events for particular people
  • Find interests that are shared between particular people
  • Find shared interests that are happening at shared locations for particular people

Sticking Points

  • No conventional way (it seems) of relating people to the events that make up their calendars:
    • DanC uses foaf:currentProject to point to ical:Vevent's
    • Tantek embeds hCalendar microformat entries in his home page that can be run through a service like Life Lint to extract iCal RDF from it;
    • We use the (non-semantic) rdfs:seeAlso to point from our own foaf:Person's to a document containing our ical:Vcalendar and ical:Vevents)
  • We need to jump through hoops in our SPARQL queries because the URLs of calendars and interests do NOT equal the URLs of the corresponding graphs, due to the RDF-conversion-wrapping that we're doing (show query example)
  • Use multiple SPARQL OPTIONAL clauses to do simple predicate precedence choices (e.g. favor foaf:name over rdfs:label or dc:title when displaying a person)
  • This is just a time-oriented view of RDF query results: would like to have it play nice with the tabulator, and be able to include this sort of query output as just one view when browsing semweb data
  • Stale data leads to failed queries -- we adapt to failed queries by using HTTP HEAD requests to prune bad URLs from our dataset

Obligatory Screenshot