Context
We want to support notices in the NeTEx import and OTP data model.
https://enturas.atlassian.net/wiki/spaces/PUBLIC/pages/728727624/framework#framework-Notice
In NeTEx you can add a notice to just about any element, but what we want to support is the following.
- TimeTabledPassingTime (StopTime)
- StopPointInJourneyPattern
- JourneyPattern
- ServiceJourney (Trip)
- Line (Route)
StopPointInJourneyPattern needs to be treated in a special way, because the element does not exist in GTFS (or the OTP model). The solution is to attach the notice to all the corresponding StopTimes.
Graph changes
We need to keep a multimap called NoticesByElement which connects each element to each notices. This avoids having to change each element that can possible contain a notice.
We could also connect element ids to notices, but that would require each StopTime element to have an id, which takes up a lot of memory. Using the object reference itself requires equals and hashcode to be properly implemented.
I have added a marker interface (NoticeAssignable) to all elements that can contain notices. The map that connects elements to notices then ends up looking like this:
Multimap<NoticeAssignable, Notice>
API changes
In both GraphQL APIs (GTFS and Transmodel API) it should be possible to navigate to the corresponding notice from each element that is supported. The REST API is not changed.
Context
We want to support notices in the NeTEx import and OTP data model.
https://enturas.atlassian.net/wiki/spaces/PUBLIC/pages/728727624/framework#framework-Notice
In NeTEx you can add a notice to just about any element, but what we want to support is the following.
StopPointInJourneyPattern needs to be treated in a special way, because the element does not exist in GTFS (or the OTP model). The solution is to attach the notice to all the corresponding StopTimes.
Graph changes
We need to keep a multimap called NoticesByElement which connects each element to each notices. This avoids having to change each element that can possible contain a notice.
We could also connect element ids to notices, but that would require each StopTime element to have an id, which takes up a lot of memory. Using the object reference itself requires equals and hashcode to be properly implemented.
I have added a marker interface (NoticeAssignable) to all elements that can contain notices. The map that connects elements to notices then ends up looking like this:
Multimap<NoticeAssignable, Notice>
API changes
In both GraphQL APIs (GTFS and Transmodel API) it should be possible to navigate to the corresponding notice from each element that is supported. The REST API is not changed.