W3C home > Mailing lists > Public > public-vocabs@w3.org > October 2011

Re: LocalBusiness - openinghours. How to denote exceptions (like holidays? )

From: Martin Hepp <martin.hepp@ebusiness-unibw.org>
Date: Wed, 12 Oct 2011 15:53:40 +0200
Cc: public-vocabs@w3.org
Message-Id: <7D337452-4E07-4BE6-8FB6-FBDB9F8062DA@ebusiness-unibw.org>
To: Geert-Jan Brits <gbrits@gmail.com>
Hi,
what you can do is attach more granular opening hours information using GoodRelations (http://purl.org/goodrelations/) as an extension for schema.org.
By means of the validFrom/validThrough property, you can specify individual opening hours on the level of single days, too.
This should already work as of now. It may not be displayed by all search engines, but due to their generic Microdata parser, they should be able to handle it.

Example:

<div itemscope itemtype="http://schema.org/Place" itemid="#store">
  <link itemprop="http://www.w3.org/1999/02/22-rdf-syntax-ns#type" 
        href="http://purl.org/goodrelations/v1#Location" />
  <span itemprop="name">Hepp's Happy Burger Restaurant</span>
  <div itemprop="http://purl.org/goodrelations/v1#hasOpeningHoursSpecification" itemscope 
       itemtype="http://purl.org/goodrelations/v1#OpeningHoursSpecification">
Opening hours: Mo-Fri,
     <link itemprop="hasOpeningHoursDayOfWeek" 
           href="http://purl.org/goodrelations/v1#Monday" />
     <link itemprop="hasOpeningHoursDayOfWeek" 
           href="http://purl.org/goodrelations/v1#Tuesday" />
     <link itemprop="hasOpeningHoursDayOfWeek" 
           href="http://purl.org/goodrelations/v1#Wednesday" />
     <link itemprop="hasOpeningHoursDayOfWeek" 
           href="http://purl.org/goodrelations/v1#Thursday" />
     <link itemprop="hasOpeningHoursDayOfWeek" 
           href="http://purl.org/goodrelations/v1#Friday" />
     <meta itemprop="opens" content="08:00:00">8:00 a.m. -
     <meta itemprop="closes" content="20:00:00">8:00 p.m.
  </div>
</div>

If you have the same opening hours for all public holidays, use this:

<div itemscope itemtype="http://schema.org/Place" itemid="#store">
  <link itemprop="http://www.w3.org/1999/02/22-rdf-syntax-ns#type" 
        href="http://purl.org/goodrelations/v1#Location" />
  <span itemprop="name">Hepp's Happy Burger Restaurant</span>
  <div itemprop="http://purl.org/goodrelations/v1#hasOpeningHoursSpecification" itemscope 
       itemtype="http://purl.org/goodrelations/v1#OpeningHoursSpecification">
Opening hours on public holidays:,
     <link itemprop="hasOpeningHoursDayOfWeek" 
           href="http://purl.org/goodrelations/v1#PublicHolidays" />
     <meta itemprop="opens" content="08:00:00">8:00 a.m. -
     <meta itemprop="closes" content="20:00:00">8:00 p.m.
  </div>
</div>

If you want to specify opening hours for special periods, e.g. Sundays in December 2011, use this:

<div itemscope itemtype="http://schema.org/Place" itemid="#store">
  <link itemprop="http://www.w3.org/1999/02/22-rdf-syntax-ns#type" 
        href="http://purl.org/goodrelations/v1#Location" />
  <span itemprop="name">Hepp's Happy Burger Restaurant</span>
  <div itemprop="http://purl.org/goodrelations/v1#hasOpeningHoursSpecification" itemscope 
       itemtype="http://purl.org/goodrelations/v1#OpeningHoursSpecification">
     <time itemprop="validFrom" datetime="2011-12-01T00:00:00Z"></time> 
     <time itemprop="validThrough" datetime="2011-12-31T23:59:59Z"></time> 
Opening hours on Sundays in December 2011: 
     <link itemprop="hasOpeningHoursDayOfWeek" 
           href="http://purl.org/goodrelations/v1#Sunday" />
     <meta itemprop="opens" content="08:00:00">8:00 a.m. -
     <meta itemprop="closes" content="20:00:00">8:00 p.m.
  </div>
</div>

Best

Martin
On Oct 12, 2011, at 12:15 AM, Geert-Jan Brits wrote:

> Hi all, 
> 
> New to this mailinglist, and to digesting all that's in schema.org and related efforts. Finally a defacto standard that the community at large seems to be embracing.. (hopefully)
> 
> First of all is this the correct place to be discussing revisions to the various schema's? 
> 
> While glancing over the various schema's I noticed that LocalBusiness.openinghours, doesn't seem to support 'exceptional days' (like holidays)  in which the openinghours might be different from the standard openinghours derived form dayOfWeek. Has this issue already been raised? (in some ticket repo or something  I might not be aware off? ) 
> 
> Coming from the Leisure/travel branche, I come across these type of irregularities pretty often, and feel there's a need to address them properly from the start. 
> 
> For a pretty thorough (and ongoing) discussion on openinghours have a look at : 
> http://wiki.openstreetmap.org/wiki/Talk:Key:opening_hours
> 
> some other issues raised: http://www.mail-archive.com/code4lib@listserv.nd.edu/msg10670.html
> 
> So before providing my 2 cents on how the openinghours-definition could be modified/extended: is there some ongoing discussion that you're aware of, that is already doing this? 
> 
> Thanks, 
> Geert-Jan
Received on Wednesday, 12 October 2011 13:54:10 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 22 May 2012 06:48:56 GMT