-
Notifications
You must be signed in to change notification settings - Fork 6
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
ScheduledSession <-> Event reclassification #264
Comments
Further note on this:
The reason for reflecting the structure of "orderedItem": [
{
"@type": "OrderItem",
"acceptedOffer": {
"@type": "Offer",
"@id": "https://example.com/events/452#/offers/878"
},
"orderedItem": {
"@type": "ScheduledSession",
"@id": "https://example.com/events/452/subEvents/132"
}
}
] This is in contrast with the referencing approach used in feeds, which uses the "data": {
"@context": "https://openactive.io/",
"@type": "ScheduledSession",
"@id": "https://id.ourparks.org.uk/api/session-series/1234#/subEvent/C5EE1E55-2DE6-44F7-A865-42F268A82C63",
"superEvent": "https://id.ourparks.org.uk/api/session-series/1234",
...
} A move towards internal consistency would be to use the following in the Orders feed (and also potentially in C1, C2, B, P etc too): "orderedItem": [
{
"@type": "OrderItem",
"acceptedOffer": "https://example.com/events/452#/offers/878",
"orderedItem": "https://example.com/events/452/subEvents/132"
}
] A move towards external consistency would be to use the following in all feeds and APIs (as per this example): "orderedItem": [
{
"@type": "OrderItem",
"acceptedOffer": { "@id": "https://example.com/events/452#/offers/878" },
"orderedItem": { "@id": "https://example.com/events/452/subEvents/132" }
}
] Both of the above approaches are valid JSON-LD (https://www.w3.org/TR/json-ld/#advanced-concepts), however the latter does not require changes to the Although |
Given that |
An issue with using the same Another option here is to simply use the Replacement within the Orders feed when a booked event changes type. This would mean that the |
Reviewing this thread, it doesn't appear to me that there are any good options for changing The chief difficulty is that at the very least we're forcing data consumers to consume all feeds, on the off-chance that one of the items they've harvested has changed It would be possible to get around this to some degree by ensuring all changes are listed in the Orders feed, but problems of modelling arise: if the change from e.g. On reflection, the guidance should simply be that changes in
This implies that all Interfaces that allow users to change |
Further alternative solutions are considered below: Potential Solution 1: Represent the “Event” as a SessionSeries with a Schedule with repeat count 1Issues:
Potential Solution 2: Represent the “Event” as a SessionSeries without a Schedule and with a single ScheduledSession, and rename “SessionSeries” to something that infers both.Advantages:
Issues:
Potential Solution 3: “Delete and recreate the opportunity” with a new opportunity using a new @type and @id. Use a mechanism similar Open Booking API “Replacement” when an opportunity changes an @type and @id to update the data user with the new @idAdvantages:
Issues:
Potential Solution 4: Combine types in the same feed - e.g.
|
Background
The types of opportunities in OpenActive have a specific semantic meaning:
SessionSeries
andScheduledSession
: This is an event (usually 1 or 2 hours in duration), that happens with some regularity. It is expected that if a user attends one of these events, that they would find another event in the series happening soon afterwards. [ref]Event
: These events are one-off occurrences, e.g. a fun run organised by a local group may run as a standalone event on a particular date or an organisation that runs many individual events e.g. Human Race, Race for Life, International Women's Day. [ref]CourseInstance
: Courses generally involve an upfront commitment to a number of sessions, with a consistent attendee group and/or organisers for the duration of the course. [ref]Within booking systems, the difference between an
Event
and aScheduledSession
is usually as subtle as whether theEvent
is part of a recurrence rule - often the user can tick a box to say "repeat every Tuesday" as they can in Google Calendar, and anEvent
then becomes aScheduledSession
.The current guidance for this scenario is for the booking system to remove the
Event
from theirEvent
s feed, and add it into theirSessionSeries
/ScheduledSession
s feed.According to Bookwhen this is not an uncommon occurrence, e.g. an organiser scheduling the first
Event
, and then deciding to add a recurrence to it afterwards for it to become part of aSessionSeries
. Potentially bookings have already been made against theEvent
when this happens.Challenges
Within the booking system an
Event
and aSessionSeries
/ScheduledSession
are usually represented by the same underlying structure. Forcing the same underlying structure to output two feeds can create extra work for the booking system, and also is in opposition to one of the principles of RPDE (which exists for the same reason):When an
Event
becomes aScheduledSession
and visa versa, the current guidance implies that the item be marked asdeleted
in its current feed, and a new item (with a new@id
) be added to a new feed. When the Open Booking API is implemented, changing the@id
of an item will break Change of Logistics Notifications (openactive/open-booking-api#138) (e.g. if anEvent
becomes aScheduledSession
then itslocation
is updated).Potential solutions
If we want to retain the semantics of
Event
and its subclasses, given that it is possible for systems to switch between the types after bookings have been made, one potential solution is to allow an opportunity to have its@type
changed, while maintaining its@id
.The feed split could then be:
SessionSeries
ScheduledSession
+Event
(where this feed contains both types, with the same@id
namespace used for both)When an
Event
becomes aScheduledSession
in the second feed, it is then linked to the schedule it is now part of (SessionSeries
). When aScheduledSession
becomes anEvent
in the second feed, it is effectively unlinked from the schedule, as it is a one-off session.(N.B in the case of Bookwhen this doesn’t actually help as their Events feed and ScheduledSession feed are driven from two different underlying database tables)
Further investigation is required to determine whether having a JSON-LD object change
@type
while maintaining its@id
is (a) allowable and (b) best practiceThe text was updated successfully, but these errors were encountered: