Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

schema.org has two ways to represent openingHours - need unified documentation and cornercase tweak #245

Open
danbri opened this Issue Jan 21, 2015 · 12 comments

Comments

@danbri
Copy link
Contributor

danbri commented Jan 21, 2015

http://schema.org/openingHours
http://schema.org/OpeningHoursSpecification

(e.g. how to say closed all day xmas)

We added a complex opening hours construct from Good Relations without documenting how it fits with the existing single property openingHours micro-notation. That was a mistake.

Migrating issue from https://www.w3.org/2011/webschema/track/issues/22

    http://schema.org/CivicStructure has openingHours, whose value is said to be a Duration,
    "The opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas ',' separating each day. Day or time ranges are specified using a hyphen '-'.
    - Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su.
    - Times are specified using 24:00 time. For example, 3pm is specified as 15:00. 
    - Here is an example: <time itemprop="openingHours" datetime="Tu,Th 16:00-20:00">Tuesdays and Thursdays 4-8pm</time>. 
    - If a business is open 7 days a week, then it can be specified as <time itemprop="openingHours" datetime="Mo-Su">Monday through Sunday, all day</time>."

    As part of the GoodRelations addition, there is also openingHoursSpecification which takes http://schema.org/OpeningHoursSpecification structures as a value.

    The differences should be explained, and perhaps converged.
@danbri

This comment has been minimized.

Copy link
Contributor Author

danbri commented Jan 21, 2015

There are subtleties, e.g. how multiple entries interact, esp. when combining the two different approaches.

@danbri

This comment has been minimized.

Copy link
Contributor Author

danbri commented Mar 16, 2015

See also #372

@unor

This comment has been minimized.

Copy link
Contributor

unor commented May 23, 2015

See also #534 for past midnight opening hours

@betehess

This comment has been minimized.

Copy link
Contributor

betehess commented Nov 23, 2015

Is there any plan to revisit this issue?

OpeningHoursSpecification's intent seems to be exclusively capturing the intended opening hours:

the reasoning about when a shop will be open will become extremely complex. When I designed the OpeningHoursSpecification in GoodRelations, my assumption was that points of sale typically promise when they open, but not, when they close.

From what I've seen, this is not how a business actually advertises its hours of operations. It would rather follow that pattern:

  1. we are generally open on those days of the week
  2. but we'll have special opening hours on those days
  3. and we'll be exceptionally closed on those days

One the one hand, openingHours already captures 1 pretty well but doesn't help with 2 and 3.

Also, note that the specified format for the Text value for openingHours is actually not HTML5-valid: the <time property="schema:openingHours" datetime="Tu,Th 16:00-20:00">Tuesdays and Thursdays 4-8pm</time> snippet results in "Error: Bad value Tu,Th 16:00-20:00 for attribute datetime on element time: The literal did not satisfy the time-datetime format" in validator.nu.

On the other hand, OpeningHoursSpecification captures either 1 or 2, but never both at the same time. And it was made clear that it was not meant to capture 3 anyway.

So here is a proposal that addresses the above scenario:

  1. make it explicit that openingHours captures the general opening hours
  2. make it explicit that openingHoursSpecification captures general and/or explicit opening hours
  3. create two new properties specialOpeningHours and specialClosingDay, where special makes it explicit that we are overriding the default openingHours or openingHoursSpecification
  4. make it clear that OpeningHoursSpecification is more about the data/range specification than opening hours per se, as it can be used for weekly opening days, one-off opening days, and closing days

I believe this is reusing the existing ontology as much as possible while capturing what's really wanted. Now, if deprecation is a thing that we can consider, I would also:

  • get rid of the special (and not HTML5-valid) Text format for openingHours and prefer OpeningHoursSpecification instead
  • get rid of both openingHours and openingHoursSpecification and replace it with a more explicit generalOpeningHours
@danbri

This comment has been minimized.

Copy link
Contributor Author

danbri commented Nov 23, 2015

Thanks for the detailed suggestion. This is definitely worth some energy, and I think your sense of the issues is pretty accurate. In particular I entirely agree that we should make clear that the basic structure is typical/general opening hours, to allow for exceptions. RDF-like languages do not deal very happily with defaults/exceptions, and putting "typical" into the property definition is a pragmatic way of handling the problem of over-riding defaults.

I suspect there are some more related issues scattered around in the tracker and I'll try to make a summary. I remember vacation closing being a problem when trying to work up some demos for museums based on their existing homepage content.

Regarding HTML there was a thread (I think on the WHATWG list with Hixie) a while back about getting the "simpler" text representation documented to a level that would make it citable in the HTML specs. It would be good to have a clearer account of the syntax rules and the expressivity differences between the long form and short form (e.g. pairs of equivalent examples...).

@vholland

This comment has been minimized.

Copy link
Contributor

vholland commented Nov 24, 2015

+1 to the use cases @betehess listed. The children's museum in my town lists all 3 types of hours on their site: general hours, extended school vacation hours, and exceptional closings for holidays. It would be nice to get this in a simple, structured format.

betehess added a commit to betehess/schemaorg that referenced this issue Dec 8, 2015

Refined semantics of OpeningHoursSpecification and added specialOpeni…
…ngHoursSpecification property -- implements schemaorg#245

* OpeningHoursSpecification now says
  * how to specify late night opening (if a value for closes is less
    than the value for opens, then the specification hours span to the
    next day)
  * how to specify a closing day (no opens property defined)
* specialOpeningHoursSpecification allows to override typical hours

@danbri danbri removed the type:enhancement label Mar 7, 2016

@danbri

This comment has been minimized.

Copy link
Contributor Author

danbri commented Apr 21, 2016

@mdoudoroff

This comment has been minimized.

Copy link

mdoudoroff commented Jun 2, 2017

I don’t know whether this is a documentation problem or a specification problem, but it’s not obvious how to correctly specify opening hours that extend beyond 24:00, which are common with bars and nightclubs.

@betehess

This comment has been minimized.

Copy link
Contributor

betehess commented Jun 2, 2017

@mdoudoroff openingHours is silent about it but here is what OpeningHoursSpecification says:

If the value for the closes property is less than the value for the opens property then the hour range is assumed to span over the next day.

@mdoudoroff

This comment has been minimized.

Copy link

mdoudoroff commented Jun 4, 2017

Thank you, betehess: I of course missed that sentence completely since I fully expected to find that info within the properties descriptions and examples, rather than the top matter. (sigh)

@timbotron

This comment has been minimized.

Copy link

timbotron commented Feb 23, 2018

Just chiming in, also found it pretty confusing to have both seemingly identical attributes.

Does anyone know if Google penalizes you if you have both? From this: https://developers.google.com/search/docs/data-types/local-business#business_hours it seems like it prefers http://schema.org/OpeningHoursSpecification

@k00ni

This comment has been minimized.

Copy link

k00ni commented Nov 26, 2018

Hi, any news about this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.