Operating Hours

(Difference between revisions)

Jump to: navigation, search
(Moving "xHours" to more descriptive page name)
Current revision (20:16, 29 December 2012) (view source)
(needs merging into opening-hours)
 
(14 intermediate revisions not shown.)
Line 1: Line 1:
-
<h1>Operating Hours</h1>
+
<entry-title>Operating Hours</entry-title>
-
This page documents an effort to define a simple, open, and semantic format for marking up the operating hours of stores, restaurants, museums, offices, and other estabishments that have set hours and are open on a regular basis. xHours is closely based on the [[hCalendar]] microformat.
+
'''This and related pages needs to be merged into the more aptly (and OSM-prior art) named "[[opening-hours]]" page(s).''' - [[User:Tantek|Tantek]] 20:16, 29 December 2012 (UTC)
-
This format is '''deprecated'''. It has been recommended that RRULE in [[hCalendar]] be used instead. However, we are working on finding a way to use RRULE to accomplish this smoothly.
+
This is an effort to figure out how to best markup the operating hours (workhours, hours open, etc.) of venues (stores, restaurants, museums, offices, and other establishments) that have set hours and are open on a regular basis.
-
__TOC__
+
Per the [[process]]
-
== Draft specification ==
+
* [[operating-hours-examples]]
 +
* [[operating-hours-formats]]
 +
* [[operating-hours-brainstorming]]
-
=== Editor/Author ===
+
= Operating Hours Brainstorming =
 +
'''This should be moved to [[operating-hours-brainstorming]].'''
 +
 
 +
This section documents a method that can be used to mark up the operating hours of stores, restaurants, museums, offices, and other establishments that have set hours and are open on a regular basis. This is based on the [[hCalendar]] microformat.
 +
 
 +
== Discussion Participants ==
 +
=== Authors ===
* [http://dragotown.com Nick Drago]
* [http://dragotown.com Nick Drago]
 +
* [http://suda.co.uk/ Brian Suda]
-
=== Process ===
+
=== Contributors ===
-
This format is '''deprecated'''. It has been recommended that RRULE in [[hCalendar]] be used instead. However, we are working on finding a way to use RRULE to accomplish this smoothly.
+
== Introduction ==
== Introduction ==
-
This effort came about as a result of:
+
This effort came about as a result of the need for a human and machine readable markup format that can be used to define the operating hours of establishments.
-
* the need for a human and machine readable markup format that can be used to define the operating hours of establishments
+
Stores, businesses, etc. often provide their operating hours on their websites. With the addition of a small bit of markup, they are able to define their operating hours on their websites in such a way that spiders and other aggregators can retrieve such hours, automatically convert them to the iCalendar format, and use this data in any iCalendar application or service.
-
* the belief that the hCalendar format is not fully appropriate (not yet capable, etc.) for defining repeating events to the extent needed
+
-
Stores, businesses, etc. often provide their operating hours on their websites. With the addition of a small bit of markup, they would be able to discuss their operating hours on their websites in such a way that spiders and other aggregators can retrieve such hours, automatically convert them to the iCalendar format, and use this data in any iCalendar application or service.
+
== Using RRULE in hCalendar ==
 +
This was suggested [http://microformats.org/discuss/mail/microformats-discuss/2007-February/008562.html] by Brian. Is this the most appropriate method? --Nick
-
This document proposes the introduction of a format which is a close subset of the [[hCalendar]] microformat, and thus the iCalendar standard, in semantic XHTML. Organizations and businesses can both embed their operating hours directly in their web pages and style them with CSS to make them appear as desired. In addition, this format would enable applications to retrieve such data directly from web pages without having to reference a separate file.
 
-
 
-
== Current example ==
 
-
The website of a national chain of retail stores (we'll call them Store XYZ) features a store locater, in which one enters their city and state and are provided with a listing of stores in their area. Below is an excerpt of one of the listings (slightly modified):
 
<pre>
<pre>
-
<b>Store #5555</b><br>
+
// example definition of operating hours using RRULE in hCalendar
-
Address, City, State, Zip <br>
+
-
<b>Hours:</b> Mon-Sat 10:00am-9:00pm<br>Sun 11:00am-7:00pm
+
-
<br><br>
+
-
<b>This store also features:</b><br>
+
-
- Mobile electronics installation <br>
+
-
</pre>
+
-
== Brainstorming ==
+
<h1>Pardon the Interruption</h1>
-
There are several main components to this listing:
+
<p class="vevent">
-
* Location
+
  <a class="url uid summary"
-
** The establishment name
+
href="http://sports.espn.go.com/...">Pardon the Interruption</a>
-
** The establishment address
+
  is a <span class="category">TV</span> <span
-
* Hours
+
class="category">sports</span> show.
-
** Day of week
+
  <abbr class="dtstart" title="2001-10-22">It airs</abbr>
-
** Open time
+
  <span class="rrule">
-
** Close time
+
        <span class="freq">weekly</span>
 +
    <abbr class="byday" title="mo,tu,we,th,fr">Monday to
 +
Friday</abbr> at <abbr class="byhour" title="5">5:30pm</abbr>
 +
  </span>
-
=== Using iCalendar ===
+
  <!-- timezones should be avoided -->
-
Using the current iCalendar standard, and using the date conventions defined in [http://en.wikipedia.org/wiki/ISO_8601#Time_interval ISO 8601], Store XYZ's store hours could be expressed as an interval:
+
  <abbr class="tzid" title="US-Eastern">ET</abbr> on ESPN.
-
<pre>
+
-
2007-01-01T10:00:00Z/2007-01-01T21:00:00Z
+
-
</pre>
+
-
Note that this defines the hours as an event occurring on January 1, 2007 from 10:00a.m. to 9:00p.m. (21:00).
+
-
Now, to make this event repeat, "R[n]/" is prefixed, with n being defined as 365:
+
  The hosts of the show are longtime friends
-
<pre>
+
  <span class="hcard">
-
R365/2007-01-01T10:00:00Z/2007-01-01T21:00:00Z
+
      <span class="fn n">
 +
          <span class="given-name">Tony</span>
 +
          <span class="family-name">Kornheiser</span>
 +
      </span>
 +
  </span>
 +
  and ... (hCard for Michael Wilbon not shown)
 +
  <span class="description">They discuss - and frequently argue over
 +
- the top stories of the
 +
  day in "sports... and other stuff".</span>
 +
</p>
</pre>
</pre>
-
This would repeat this event 365 times, for the 365 days in a year. However, this is not appropriate, because Store XYZ is open during different hours during different days of the the week.
 
-
 
-
== Solution: using Cron recurring events ==
 
-
Using Cron, if I have a store that is open 9am-5pm M-F and noon to 4:30pm on Saturday, I could write:
 
-
<pre>
 
-
<div class="not-vevent">
 
-
We will be <span class="state">open</span> from
 
-
<span class="cron">
 
-
    <abbr class="hour" title="090000.000Z:170000.000Z">9am to 5pm</abbr>
 
-
    <abbr class="dayofweek"
 
-
title="Monday,Tuesday,Wednesday,Thursday,Friday">M-F</abbr>
 
-
</span>
 
-
  and
 
-
<span class="cron">
 
-
    <abbr class="hour" title="1200Z:1630Z">noon to 4:30</abbr>
 
-
    <abbr class="dayofweek"
 
-
title="Monday,Tuesday,Wednesday,Thursday,Friday">Saturday</abbr>
 
-
</span>
 
-
</div>
 
-
</pre>
 
-
 
-
Essentially, state holds when any of the cron clauses matches. A colon
 
-
indicates a range and a comma indicates junction. Some classes
 
-
(year,month,day,hour, minute, second, etc.) would specify the maximum
 
-
resolution, i.e. what the largest digits mean; e.g. <abbr class="minute"
 
-
title="15,45">every 30 minutes</abbr> as opposed to <abbr class="second"
 
-
title="15,45">every 30 seconds</abbr>.
 
-
 
-
== Problems ==
 
-
* Are the weekday numbers (1-7) appropriate?
 
-
** No, it is not OK because of internationalization. In different cultures the week starts on different days.
 
== References ==
== References ==
Line 98: Line 73:
=== Informative References ===
=== Informative References ===
* [http://en.wikipedia.org/wiki/ISO_8601 Wikipedia article on ISO 8601]
* [http://en.wikipedia.org/wiki/ISO_8601 Wikipedia article on ISO 8601]
 +
* [http://www.xfront.com/microformats/hCalendar_part2.html Tutorial on recurring events in hCalendar]
 +
 +
=== Related ===
 +
* [[operating-hours-examples]]
 +
* [http://microformats.org/discuss/mail/microformats-discuss/2007-February/008562.html Corresponding thread from uf-discuss]

Current revision


This and related pages needs to be merged into the more aptly (and OSM-prior art) named "opening-hours" page(s). - Tantek 20:16, 29 December 2012 (UTC)

This is an effort to figure out how to best markup the operating hours (workhours, hours open, etc.) of venues (stores, restaurants, museums, offices, and other establishments) that have set hours and are open on a regular basis.

Per the process

Contents

Operating Hours Brainstorming

This should be moved to operating-hours-brainstorming.

This section documents a method that can be used to mark up the operating hours of stores, restaurants, museums, offices, and other establishments that have set hours and are open on a regular basis. This is based on the hCalendar microformat.

Discussion Participants

Authors

Contributors

Introduction

This effort came about as a result of the need for a human and machine readable markup format that can be used to define the operating hours of establishments.

Stores, businesses, etc. often provide their operating hours on their websites. With the addition of a small bit of markup, they are able to define their operating hours on their websites in such a way that spiders and other aggregators can retrieve such hours, automatically convert them to the iCalendar format, and use this data in any iCalendar application or service.

Using RRULE in hCalendar

This was suggested [1] by Brian. Is this the most appropriate method? --Nick

// example definition of operating hours using RRULE in hCalendar

<h1>Pardon the Interruption</h1>
<p class="vevent">
  <a class="url uid summary"
href="http://sports.espn.go.com/...">Pardon the Interruption</a>
  is a <span class="category">TV</span> <span
class="category">sports</span> show.
  <abbr class="dtstart" title="2001-10-22">It airs</abbr>
  <span class="rrule">
        <span class="freq">weekly</span>
    <abbr class="byday" title="mo,tu,we,th,fr">Monday to
Friday</abbr> at <abbr class="byhour" title="5">5:30pm</abbr>
  </span>

  <!-- timezones should be avoided -->
  <abbr class="tzid" title="US-Eastern">ET</abbr> on ESPN.

  The hosts of the show are longtime friends
  <span class="hcard">
      <span class="fn n">
          <span class="given-name">Tony</span>
          <span class="family-name">Kornheiser</span>
      </span>
  </span>
  and ... (hCard for Michael Wilbon not shown)
  <span class="description">They discuss - and frequently argue over
- the top stories of the
  day in "sports... and other stuff".</span>
</p>

References

Normative References

Informative References

Related

Operating Hours was last modified: Saturday, December 29th, 2012

Views