We should be able to use the (Semantic) Web to find out when businesses are open for business.

This is part of a bigger picture: we probably also want to know about their Web site(s), product lines, physical locations, contact details etc. Using RDF, we can tackle the problem in separate chunks, which loosly correspond to RDF vocabularies or 'ontologies'.

Our scenario here is a desire to represent information about local businesses, in particular their opening hours. To illustrate the broader potential we can add in a bit more information, perhaps geo markup for location, or a photo of their physical premises.

This writeup began life as a thread in the RdfCalendar discussions, and has been migrated to the Wiki for collaborative development.

Related: RdfCalendar RestaurantRecommendation EventDiscovery SKICal project 79 Use Cases for Godseye

Scenario

Restaurant opening hours.

This particular example stems from buying food from Urban Gourmet, via from a restaurant info aggregator in Somerville, MA, USA. This site lists the menus and other info for local restaurants. The menus are currently images of paper menus, so there is scope for progress there. See also chefmoz for more RDF/food work.

The bit of the restaurant listing that relates to RdfCalendar concerns is where it says, "Currently [OPEN]", based on info about opening hours. Their summary for the 'Urban Gourmet' restaurant is:

Monday

Closed

Tuesday

4:00pm - 11:00pm

Wednesday

11:30am - 11:00pm

Thursday

11:30am - 11:00pm

Friday

11:30am - 11:00pm

Saturday

11:30am - 11:00pm

Sunday

11:30am - 11:00pm

So longwinded question unpacked: how do we express this in RDF? Can we use recurrence rules expressed over ical in RDF as the basis? Is extra vocabulary needed?

Previous discussion (work to date):

So, we have an RDF/XML representation of some opening hours.

What does this gain us beyond the syntax we already have from iCalendar? It must do more than use up some extra bandwidth... ;)

How does that look in practice?

Opening Hours in RDF/XML

Here is the bare 'opening hours' data, translated into RDF with no additions.

<rdf:RDF
  xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
  xmlns='http://www.w3.org/2002/12/cal/ical#'
  xmlns:i='http://www.w3.org/2002/12/cal/ical#'
  xmlns:x='http://www.w3.org/2002/12/cal/prod_apple#'
>  <Vcalendar>
    <component>
    <Vevent>
      <dtstart rdf:parseType='Resource'>
        <dateTime>2003-01-01T16:00:00</dateTime>
      </dtstart>
      <dtend rdf:parseType='Resource'>
        <dateTime>2003-01-01T23:00:00</dateTime>

      </dtend>
      <rrule rdf:parseType='Resource'>
      <byday>TU</byday>
      <freq>WEEKLY</freq>
      <interval>1</interval>
      </rrule>
    </Vevent>

    </component>
    <component>
    <Vevent>
      <dtstart rdf:parseType='Resource'>
        <dateTime>2003-01-01T11:30:00</dateTime>
      </dtstart>
      <dtend rdf:parseType='Resource'>
        <dateTime>2003-01-01T23:00:00</dateTime>

      </dtend>
      <rrule rdf:parseType='Resource'>
      <byday>WE,TH,FR,SA,SU</byday>
      <freq>WEEKLY</freq>
      <interval>1</interval>
      </rrule>
    </Vevent>

    </component>
  </Vcalendar>
</rdf:RDF>

Extending the Example

Let's start extending things, using some additional RDF vocabularies. (excuse the indenting, and the fact that I just made up some new stuff for FOAF to fit the example)

<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF
  xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
  xmlns='http://www.w3.org/2002/12/cal/ical#'
  xmlns:i='http://www.w3.org/2002/12/cal/ical#'
  xmlns:x='http://www.w3.org/2002/12/cal/prod_apple#'
  xmlns:dc='http://purl.org/dc/elements/1.1/'
  xmlns:wn='http://xmlns.com/wordnet/1.6/'
  xmlns:foaf='http://xmlns.com/foaf/0.1/'
  xmlns:g='http://www.w3.org/2003/01/geo/wgs84_pos#'
>

<wn:Shop>
  <!--todo: fix up a more plausible example -->
  <foaf:homepage>
    <rdf:Description rdf:about="http://example.com/asite">
      <dc:title>The ... homepage</dc:title>
      <dc:description>
         The ... website describes this ... restaurant which ... ...
      </dc:description>
    </rdf:Description>
  </foaf:homepage>
  <foaf:depiction rdf:resource="http://example.com/shop1.jpg"/>
  <g:lat>50</g:lat> <!-- whoa! the web site is at 50,50? no, the store is, right? -->
  <g:long>50</g:long> <!-- right! my indenting of the xml was wrong, that's all... -->
  <g:alt>0</g:alt>
  <foaf:openingHours>
  <Vcalendar>
    <component>
    <Vevent>
      <dtstart rdf:parseType='Resource'>
        <dateTime>2003-01-01T16:00:00</dateTime>
      </dtstart>
      <dtend rdf:parseType='Resource'>
        <dateTime>2003-01-01T23:00:00</dateTime>

      </dtend>
      <rrule rdf:parseType='Resource'>
      <byday>TU</byday>
      <freq>WEEKLY</freq>
      <interval>1</interval>
      </rrule>
    </Vevent>

    </component>
    <component>
    <Vevent>
      <dtstart rdf:parseType='Resource'>
        <dateTime>2003-01-01T11:30:00</dateTime>
      </dtstart>
      <dtend rdf:parseType='Resource'>
        <dateTime>2003-01-01T23:00:00</dateTime>

      </dtend>
      <rrule rdf:parseType='Resource'>
      <byday>WE,TH,FR,SA,SU</byday>
      <freq>WEEKLY</freq>
      <interval>1</interval>
      </rrule>
    </Vevent>

    </component>
  </Vcalendar>
  </foaf:openingHours>
  </wn:Shop>
</rdf:RDF>


Editorial Notes and Scribbles

I migrated this to Wiki in hope that others might flesh out the example(s). I also need some meta-help, ie. finding out how best to quote markup examples in the moinmoin wiki syntax. --DanBri

I added the XMl... initially pretty rough, i got muddled about which example

Wishlist

The "what does this gain us" section is a little weak.

Let's beef it up a little, in order to understand the nature, and extent, of RDF's cool-ness.

Okay: What kind of free tools? Specificly? How do they help us understand / communicate / whatever the business hours use case?

The further example of data mixing is good, but this should be explained up above as well. You want to say: "For example, you could automatically overlap the business hours with the business hours in your daily planner. This works, because there's an OWL description on the Internet that tells how to automatically translate this business hours language into the sort of business hours that your daily planner can understand."

So we want to explain that: "We can use the description of hours given by the business, and reuse the concept in our own documents."

Question: Why is this true here, but not elsewhere? What's so special about RDF that makes it so we can do this, where elsewhere we don't get to?

Outsider Comments

I'm looking for exactly this xml, but this seems to be very complex, and going off in different tangents. Here are my use cases:

OpeningHoursUseCase (last edited 2006-12-14 14:44:00 by cadbury)