Open nickevansuk opened 3 years ago
Given all current implementers of OpeningHoursSpecification
are engaged in OpenActive Open Booking API implementation, the tooling has been updated to reflect dayOfWeek
as an array based on the above, to allow implementers to make a quick change that will ensure implementation consistency going forward across the OpenActive ecosystem. This is a breaking change within the validator, however it is not a breaking change within the modelling specification as this property and the OpeningHoursSpecification
type were previously underspecified.
Please comment if this creates issues, as dayOfWeek
can be made available as both a single value and an array within the tooling, though this would be at the expense of adding complexity to the next version of the specification for the sake of backwards compatibility with the previous de facto standard.
Following discussion in the W3C Community Group call on 13 January 2021 this has been moved into "Agreed in scope for next revision" for 2.1
Proposer
imin, MCRactive
Use Case
Opening hours are frequently provided in a condensed format, such as the below:
[1] [2] [3]
[4]
[5]
[6]
[7]
Why is this not covered by existing properties?
The current version of the specification does not specify a model profile for
OpeningHoursSpecification
, instead relying on the less restrictive schema.org model definition. OpenActive tooling had previously assumed thatOpeningHoursSpecification
withindayOfWeek
was a single value.Efforts to document the use of
OpeningHoursSpecification
have revealed that common use of this online is to providedayOfWeek
as an array.Proposal
To create convergence in implementation, it is proposed that
OpeningHoursSpecification
be defined with the Modelling Opportunity Data specification as follows, in line with Google's own recommendations:Required properties
Text
"@type": "OpeningHoursSpecification"
DayOfWeek
Defines the days of the week upon which the
opens
andcloses
values are specified. Note this property is optional when used withinspecialOpeningHoursSpecification
.Example
"dayOfWeek": [
"https://schema.org/Saturday",
"https://schema.org/Sunday"
]
Time
The closing time. Set "00:00" for the value of
opens
andcloses
to indicated thePlace
is closed on the specified days. Note this property is required when used withinspecialOpeningHoursSpecification
.Example
"closes": "17:00"
Time
The opening time. Set "00:00" for the value of
opens
andcloses
to indicated thePlace
is closed on the specified days. Note this property is required when used withinspecialOpeningHoursSpecification
.Example
"opens": "09:00"
Note that
dayOfWeek
is defined above only as an array, following the OpenActive convention of having each property defined as either a single value or an array, to increase usability of the data and specifications.Optional properties
Date
The date when the item becomes valid. The item will be valid at the beginning of the specified day.
Example
"validFrom": "2018-01-22"
Date
The date after which the item is no longer valid. The item will cease to be valid at the end of the specified day.
Example
"validThrough": "2018-01-27"
specialOpeningHoursSpecification
It is also proposed that use of schema.org's existing
specialOpeningHoursSpecification
property be defined within the specification, as follows:Usage and processing
It is proposed that the specification should also include processing and usage specification for the following, in line with Google's own recommendations:
1) Definition of "Open all day" as
"opens": "00:00", "closes": "23:59"
2) Definition of "Closed all day" as"opens": "00:00", "closes": "00:00"
3) Usage example of "late opening hours" as"opens": "18:00", "closes": "03:00"
4) Use and definition of"dayOfWeek": [ "https://schema.org/PublicHolidays" ]
as "a placeholder for all official public holidays in thelocation
in which thePlace
is located. It can be used to indicate opening hours on public holidays, overriding general opening hours for the day of the week on which a public holiday occurs". 5) Use ofvalidFrom
andvalidThrough
to specify seasonal opening hours withinopeningHoursSpecification
(optional), and override applicability withinspecialOpeningHoursSpecification
(required). 6) Use and definition anOpeningHoursSpecification
withinspecialOpeningHoursSpecification
with an undefineddayOfWeek
as representing "every day".Example
This allows the following example, assuming it is also closed during January due to COVID-19, to be easily and concisely specified in JSON:
[7]