Repository navigation
Description
A quick proposal based on discussion in #240.
Schema.org doesn't currently have a way to express recurring events.
While it will always be useful to share data on individual instances, e.g. the event happening this Tuesday at 6pm. There are also scenarios where it is useful to be able to share a general rule, e.g. this event happens at 6pm every Tuesday.
Use cases include sharing data about physical activities, e.g. regular gym classes or similar events.
iCalendar already refines a model and terms for expressing recurring events. And this
is independently supported in libraries like rrecurjs. We could draw on this to define a similar model for schema.org
The proposal is to define a new schedule property, a EventSchedule type and some additional properties for describing the schedule.
The schedule property will be associated with Events. It will allow the description of a schedule, expressed as a recurrence rule for describing the frequency of upcoming events.
The EventSchedule type will have properties based on those in iCalendar. But in the below, the naming has been aligned with existing schema.org properties.
startTime- the existing property, date/time at which the schedule startsendTime- existing property, date/time at which the schedule endsfrequency- "daily", "monthly", "yearly"day- DayOfWeekmonth- month of the yearhour- hourminute- minutecount- optionally specfiy the number of recurring eventsexceptionRule- repeating property, specifies date-times when the schedule doesn't apply, equivalent toexrulein ical
I think this covers the core aspects of a schedule. I may have missed something essential (am not an iCal expert) but I think this type of rule will cover many use cases so worth considering.
This structure can be easily expressed in, e.g. JSON-LD, but may be trickier in RDFa. I've not tried that yet, but wanted to float this for discussion.
Activity
magico commentedon Jan 9, 2017
Hi ldodds,
Thanks for putting this together. I had some comments on your proposal:
startTime: if you’re referring to the date when the schedule starts thenstartDatemay be more appropiateendTime: as above. May be worth mentioning that if noendDateis specified then it’s assumed the event has been scheduled indefinitelyfrequency: what’s the expected type here? An easy way may be to specify a number, so it knows how many to skipday: a distinction betweenDayOfWeek(e.g. to create a schedule on every Monday) andDayOfMonth(a new type) may be useful.hour&minute: I would usestartTimeandendTimeinstead, both with Time as the expected typecount: because we’re already specifyingstartDate,endDate, and thefrequency, I am not sure we need count as it can be calculated.As mentioned above,
DayOfMonthwould be a new type that would have 1 to 31 as possibilities (http://schema.org/1, http://schema.org/2, http://schema.org/3, etc)Also, I would change the names around so
eventScheduleis the property fromEventandScheduleis the new type.I’ve put together some examples of how it may work with different schedules:
Every 3rd Monday from 9am to 10am
Every 1st and 15th of every month from 9am to 10am
Every working day of the week twice, from 9am to 10am and then from 2pm to 3pm
Thoughts?
ldodds commentedon Jan 16, 2017
Hi,
I'm not convinced by changing daily/weekly/monthly frequency indicators for numbers though. Specifying the unit seems clear to me.
danbri commentedon Jan 17, 2017
This all looks pretty sensible. Any thoughts on how it relates to our existing (two!) mechanisms for opening hours?
magico commentedon Jan 17, 2017
@ldodds The only reason I suggested numbers as frequency indicators is because I didn't think the daily/weekly/monthly indicators would work as well with schedules such as "every 3 mondays". Happy to be proved wrong though.
ldodds commentedon Jan 20, 2017
I'll post an updated proposal here in next few days or so incorporating comments. @danbri I'll also highlight overlaps with opening hours.
rdebourbon commentedon Mar 13, 2017
This looks pretty good. My only lingering queries would be:
danbri commentedon Mar 13, 2017
ping @ldodds - any updates?
magico commentedon Mar 13, 2017
This makes sense. +1
ldodds commentedon Mar 14, 2017
Revised Proposal
THIS IS THE LATEST VERSION OF THE PROPOSAL.
I've left the original proposal and discussion intact above, but will revise this comment in line with ongoing discussion. Please add comments below.
Goal
Provide a means to define scheduled events. The primary use case is to describe schedules for things like:
The goal isn't to offer the full flexibility of iCalendar, so the features described here are a subset of iCalendars recurrence rules. Alignment with iCalendar is preserved where possible. It's a tried and tested model.
Summary of Proposed Changes
Scheduletype for describing scheduleseventScheduleproperty to associate anEventto aSchedule. The value can be an array to allow for definition of several schedules.ScheduleeventScheduleGenerally speaking it is preferable to publish data about individual events, but this isn't always helpful. For example it may be more useful to
publish and share a schedule rather than an endless set of web pages.
The
eventScheduleproperty associates aSchedulewith anEvent.The property can be specified instead of a specific start and end time to indicate that the event occurs on a regular basis. All other aspects of
a recurring event, e.g. its description, location, etc can be captured using existing properties.
The value of the
eventScheduleproperty can be a singleScheduleor an array ofScheduleinstance to allow for multiple schedules tobe specified.
ScheduleSchedules draw on the trade and tested approach defined in iCalendar. So, in line with iCalendar we need to specify
exrule.We can specify the period when an
Scheduleis active using existing properties:startDate-DateorDateTimethat the schedule starts, not the eventendDate-DateorDateTimethat the schedule startsInstead of specifying an
endDatewe might instead want to specify how many events will take place:count- optionally specfiy the number of recurring events. positive integerWe can describe the rule for generating events using some additional new properties:
frequency- one of a fixed set of values: "hourly", "daily", "weekly", "monthly", "yearly"interval- how often the events occur. a positive integerbyDay- day of the week. refers to a[DayOfWeek](https://schema.org/DayOfWeek)byMonthDay- day of the month. positive integer,1-31byMonth- month of the year,1-12We can define exception using a new property:
exceptDate- value is aDateorDateTimevalue, or an array of such values, that specifiy when an event won't take place. Can be repeated to describe multiple exception.Some iCalendar features that are not supported:
byMinuteorbyHourbySetPossupportrdate, e.g. listing individual dates when an event will occur. In Schema.org we can handle this by specifying multiple events or repeating date/date-time propertiesexceptRule, e.g. defining a rule to capture exceptionsUseful icalendar references on rrule and recur.
Worked Examples
Using those proposed by @magicomartinez
Every 3rd Monday from 9am to 10am
The 1st and 15th of every month from 9am to 10am
Starting daily from 24th December, between 9am-10am for 10 occurances
Every other day, from 24th December 2016, forever
Every working day of the week twice, from 9am to 10am and then from 2pm to 3pm
ldodds commentedon Mar 14, 2017
@rdebourbon @magicomartinez I'm not sure it makes sense to specify frequency using the duration support in ISO 8601. Is there a reason to prefer that over the (revised) specification.
@rdebourbon also there's already the duration property of an event. That could be specified on the Event rather than the schedule as normal.
For setup/teardown, that might be something we need to consider as part of OpenActive as it doesn't necessarily apply to Schema.org's more general Event support?
rdebourbon commentedon Mar 14, 2017
@ldodds - My rationale around specifying it in something other than an integer was to avoid any potential confusion / misinterpretation around the original frequency as an integer. An ISO 8601 duration string also effectively combines frequency and interval into a single standard well described type.
@ldodds - The duration of an event can vary at the session level. In fact, experience has taught me that quite a few properties typically defined at the event level can vary at the session level (eg location). An example of varying duration though is often encountered when defining schedules for peak / off peak periods - which again can have different recurrence rules. Eg Peak period sessions are 30minutes long every 30minutes between XX:XX and YY:YY on days F,Sa. Off peak they are 60minutes every 120minutes between AA:AA and BB:BB on days M,W,F. Noticing that Friday occurs in both peak & off-peak so needs complimentary recurrence rules defined depending on the actual dates involved.
jamiefoale commentedon Mar 14, 2017
Hi guys,
Is there a way we can include a provision for bank holidays? Theres a big inconsistency between venues about whether they are / aren't open and I know many recurring activities are not held on bank holidays, but some are.
It doesnt seem like it is on Schema.org but Im thinking something along the lines of
“bankHoliday": "yes"
Thanks
nickmhalliday commentedon Mar 14, 2017
From an entirely non technical perspective - how do the proposals above - or whatever we incline towards get piloted or tested with some users? There is a bit of a risk in putting lots of work into features / formats that are not used and that we miss others that will be found useful. No doubt you have an approach to this already that I am not aware of.....
rdebourbon commentedon Mar 14, 2017
@jamiefoale I would expect that Bank Holidays and other closures would be handled via an "exceptDate" array of values. This allows for greatest flexibility from an underlying data structure. If we include a "bankHoliday" attribute we then potentially need to clarify how a particular data source determines bank holidays. In this instance a more generic exception list is probably easiest for everyone involved.
Having said that, @ldodds, would it be a good idea to allow for an optional reason text for the exception so that venues / operators can distinguish between expected closures and unexpected changes to the schedule?
nickevansuk commentedon Mar 28, 2017
Great point @rdebourbon around cancellation, I wonder if that question can be framed even more broadly:
Assuming we have a recurrence rule in place, how do we associate additional property values to a particular occurance. Examples include:
What this leads me to wonder is whether there's a parent-child model where the "master" event specifies a number of properties including a recurrence rule, and "override" events are provided in an array similar to exceptDate, but with an array of type Event. Each Event would inherit the properties of the master, and only include additional properties required (such as "cancelled" and "cancellation reason", or "location", or simply an "available spaces" integer).
This would potentially reduce the size of data payload required to cater for e.g. Recurring sessions which include availability.
32 remaining items
Fixed typo, "occur[r]ing". #1457
Added Schedule from #1457
danbri commentedon Aug 16, 2017
Ok this is published now at schema.org (as 'pending', which means we want more review, discussion, implementor feedback e.g. w.r.t. mappings to ical, how to integrate with opening hours at least cross-referencing documentation, possible applicability in iot.schema.org, etc etc.).
https://schema.org/docs/releases.html#g1457
Let's leave this issue open to continue the discussion! Thanks Leigh et al for getting us to this milestone :)
EdB2 commentedon Feb 2, 2018
Here's hoping
repeatCountandexceptDatewon't be required. My purpose is 12-step recovery group meetings. These are not the type of schedule that has an end date (that we know of anyway). We say "Friday at 6PM" with an understanding that it will be every Friday (noexceptDate) forever (norepeatCount). For real-world context, once when the church we were in burned down we held our meeting in the parking lot until we could find a new home. The Schedule was kept, the Location eventually changed :)BTW just wrapping my tired old brain around this stuff. Way cool ... but dynamically calling all the meetings for the next week as "Events" seems silly ... so thanks much for the work y'all have done towards make a Schedule a thing :)
thadguidry commentedon Feb 2, 2018
@EdB2 Everything is optional in Schema.org technically, its consumers of the data that place restrictions where they see fit.
Ah, interesting use case with 12-step recovery groups ! Also, I see that use case as similar to perhaps a curriculum at a college where there's a final completion event of graduation after proceeding through all the courses (step 12 - "Carrying the message of the 12 Steps to others in need" is basically, "using the knowledge", just as students typically do after graduation.
@danbri Perhaps this also brings about the need for a narrower type "CourseSchedule" based on evidence in issues:
#195 - Course, CourseInstance, EducationEvent [Schema.org Course Extension]
#930 - Request for suitable classes/properties to represent "school term"
#1497 - Course Vocab add attribute to define expected time to take course
? dunno, but something we should investigate more within those 3.
ldodds commentedon Apr 19, 2018
@danbri can I suggest we close this issue? The original proposal is now part of pending. Further iteration can happen in separate issues?
Can I ask what the process is for pending to move to live?
nickevansuk commentedon Jun 21, 2018
Sorry just to pick up as I noticed this was closed, two things to raise:
durationandbyDayCan I pick up on the above ( #1457 (comment))
I notice that there is broad support and agreement in this thread for:
durationbeing part ofSchedulebyDayaccepting iCal format, e.g. "2TH"But neither of these seem to have made it through to pending (and both are useful, e.g. see openactive/modelling-opportunity-data#2 (comment)).
Timezone
One further issue we are starting to see with implementors creating significant errors: the current Schedule proposal does not include timezone.
linked-k commentedon Sep 1, 2018
I'm not sure if this is the correct place but I also noticed a couple of few other things.
There are some inconsistencies in the https://pending.schema.org/Schedule specs and examples as well as with the original proposal here.
We have startTime/endTime missing, which could be represented as a Duration and I assume this is the reason why "eventSchedule" property is in there.
However, the documentation of it and the examples doesn't match.
On the other hand we have those mentioned in the release notes https://schema.org/docs/releases.html#g1457
What's the idea there?
startDate/endDate for the validity of the Schedule (not the Event duration), are also missing. what's the idea here?
I also have a suggestion for exceptDate to accept Duration as a value, as in my case I need to express a period of holidays there.
peter-dolkens commentedon Sep 1, 2018
danbri commentedon Feb 19, 2019
@ldodds can you help us with updating the spec if needed, and any evidence of adoption - especially consuming applications that use rather than just publish this vocabulary?
GeertThijs commentedon Apr 3, 2019
I have some questions:
ldodds commentedon Feb 28, 2020
@danbri I'm going to defer to @thill-odi who is leading the specification work on OpenActive and can give you concrete examples.
A quick look at the current docs suggest that they aren't correct. They should mention start/end Time and Date.
Basically, I'd expect Schema.org to be reflecting most, if not all of the recommended approach that we have in the OpenActive documentation:
https://www.openactive.io/modelling-opportunity-data/#publishing-event-schedules
OpenActive will likely have its own conformance criteria but I was hoping that the core Schedule model could end up in Schema.org.
I notice that the id/url template stuff is also not yet in Schema.org. I think that's useful on consumer side.
DamonHD commentedon Oct 10, 2021
Did I miss something? (Likely!)
Is there any way yet of specifying the last Tuesday of every month? (Guess who has been asked to manage such an event and would now like to put up a page for with with correct metadata?)
Is it byDay = "-1TU" and repeatFrequency= "P1M"?
Rgds
Damon
m4rrc0 commentedon Aug 4, 2024
For reference for anyone landing here looking for "last day of month" syntax, as far as I understand the docs, @DamonHD is correct because the docs for
byDaysays:And the iCal's docs says:
Meaning this should be valid.
{ "@type": "Schedule", "startDate": "2016-12-24", "endDate": "2017-12-25", "frequency": "P1M", "byDay": "-1FR", "startTime": "14:00", "endTime": "15:00" }It would be really useful to add a note to the
byDaydocs stating that this is the way to go for this kind of data.