" /> TechnicaLee Speaking: March 2006 Archives

« January 2006 | Main | April 2006 »

March 30, 2006

SPARQL Calendar Demo: Step-by-step Example

This is the third in a series of entries about the SPARQL calendar demo. If you haven't already, you can read the previous entry.

On #swig yesterday, bengee noted that he was unable to get the calendar demo to work. We didn't have a chance to delve into the particulars, but I'm pretty confident that the reason was the lack of a good answer to one of these two questions:

  1. What in the world do I do with this thing?
  2. How can I get this to work with my data?

The answer to the second question is that there are a number of conventions that data needs to observe for it to display properly in the calendar demo. I'll discuss those conventions as I go through the rest of this series, but most of them are also presented briefly on SparqlCalendarDemoUsage ESW wiki page. So without further ado, here is a walkthrough of using the SPARQL calendar demo:

  1. Navigate to the demo
  2. Add one or more URLs that resolve to FOAF files. For this walkthrough, click the add Alice link to add the Alice (demo) persona's FOAF file to the dataset. A list of people appears: in this case, we see Alice, along with URIs for Bob and myself.
  3. (optional) Click discover more people. This follows the FOAF breadcrumbs protocol to build the dataset and find more people, and more information on already known people. In this case, we discover the names of Bob and myself, and also find DanC and Elias.
  4. Make sure that April (2006) is displayed on the calendar. If attempting this in March, click the big right arrow next to the calendar to advance to April.
  5. Check the checkboxes next to Alice and Bob.
  6. Click refresh in the Calendars section of the righthand column to display all of Alice's and Bob's calendar events. You should see several events for each of them.
  7. With Alice and Bob still checked, click on refresh in the Shared interests section of the righthand column to display the foaf:interests that Alice and Bob have in common. In this case, both Alice and Bob are interested in theater and in jazz.
  8. Check the checkbox next to Theater.
  9. Click the what can we do together? link. In this case, this shows that there's a performance of Arcadia going on in Boston, Massachusetts (mouseover events to see their location) from April 26–29. Because both Alice and Bob will be in Boston on April 28 and because both share an interest in theater, this event is shown as an activity that both people might enjoy attending together.

The mocked up data should work at least through the end of April. I'll update this space as I update the demo data to keep the demo personas functional.

March 29, 2006

SPARQL Calendar Demo: Following the Breadcrumbs

This is the second in a series of entries about the SPARQL calendar demo. If you haven't already, you can read the previous entry.

The calendar demo assumes a paradigm whereby the larger the RDF dataset being queried, the more questions can be asked and the more complete the answers are likely to be. New graphs can be added to the dataset in three ways:

  1. The Add button in the top right
  2. The discover more people link
  3. The SPARQL query that populates the People panel

While the first of these three actions grows the dataset directly (the URI is added as a default graph), the second two are examples of simple breadcrumbs protocols. From the tabulator 'about' page:

A breadcrumbs protocol is convention by which information is left to allow another to follow. When the information provider follows the convention on the breadcrumbs to leave, and an information seeker follows the convention on what links to follow, then the protocol that the seeker will be able to solve certain sorts of problem.
In fact, the discover more people link uses exactly the FOAF-link breadcrumbs-protocol example given in the tabulator 'about' page; for all triples p rdfs:seeAlso u, if p has rdf:type foaf:Person then we add u as a default graph in our dataset.

The other breadcrumbs protocol used was developed for this demo and is invoked as part of the SPARQL query that populates the People panel in the righthand column of the demo. In the absence of any widely-accepted manner of associating FOAF data with calendar data, we adopted this protocol as a convention for locating calendars; for all triples p rdfs:seeAlso u, if p has rdf:type foaf:Person and u has rdf:type <http://www.w3.org/2002/12/cal/icaltzd#Vcalendar>, then we add u as a named graph in our dataset for future queries involving calendars.

In future entries, I'll examine this and the other SPARQL queries in the calendar demo in detail. I'll also look in more detail at this convention, its drawbacks, and possible alternatives. For now, the first lesson that we learned creating this demo was a simple one: finding more data → finding more answers.

March 28, 2006

SPARQL Calendar Demo: Overview

Elias and I gave a lightning presentation of our SPARQL calendar demo at the W3C Tech Plenary SWIG meeting in Mandelieu. Albeit short and glossing over many of the important sticking points that we encountered while creating it, the demo was well received. Since then, we've spent some time polishing up some rough ends (e.g. at the conference the spotty Internet connection required us to rig the demo to run off local copies of FOAF and calendar data accessed via a locally running Joseki service) and have posted the calendar demo for people to play with and discuss. The demo can be accessed live online and an archive of the HTML, JavaScript, and CSS that comprise the demo can be freely downloaded and used.

The two relevant ESW wiki pages contain some details about the demo, but I'd like to spend my next few blog entries presenting some of the lessons that I learned from writing the calendar demo. Almost none of these lessons are new, but as the DAWG prepares to move SPARQL towards CR status (and with the birth of the new public-sparql-dev mailing list), I feel it's worthwhile to present them here. I welcome any comments, opinions, or discussions.

For now, just an overview.

Recently, TimBL and co.'s tabulator has received a great deal of attention as a possible incarnation of a semantic web browser. In my view, the tabulator presents the power of the interconnected semantic web by allowing a user to browse the data arbitrarily and then to tabulate any particular slice through the data. In one breath I could use the tabulator to display my students' contact information (a people-centric view), and in the next I could pivot within the same data and display a course-enrollment tabulation (a course-centric view).

For semantic-web technologies to succeed and thrive—particularly within enterprises—I feel that the capability to build query- and report-based applications is as important as (and complementary to) browser-based applications. Even in the presence of a web of domain-neutral data, we must be able to formulate and evaluate domain-specific, often complex queries. SPARQL, naturally, is the query language of choice for these queries. Of course, we can still benefit (greatly!) from the semantic relations and connectivity of semantic-web data, especially as it enables a new ease of integration (at the query level) of disparate data sources.

The SPARQL calendar demo, then, is an exercise in writing non-trivial SPARQL queries to integrate disparate data sources in answering domain-centric questions. We also took advantage of our work with Kendall on a draft specification of a JSON serialization of SPARQL SELECT and ASK query results, as we crafted the demo as a largely stateless, AJAX-driven web application. Currently, the calendar demo can answer the following requests:

  1. What people exist in a given RDF dataset?
  2. Show me all the calendar events of (some of) these people.
  3. What are the shared interests of (some of) these people?
  4. Show me events fitting (some of) these shared interests that we can all attend together.

More on the nitty-gritty of the calendar demo to follow...