-
Notifications
You must be signed in to change notification settings - Fork 1
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
trips, schedules and legs in fptf 2 #61
Comments
Related: #27 |
(Notification @matkoniecz @ialokim, because I can't assign you) |
Thanks @juliuste for pushing things towards the FPTFv2 release and for starting this discussion putting together the different ideas! While I was thinking about the specification changes proposed above, I found it quite difficult to imagine all the object's relations. I've drawn a little schema which you can find here and which will hopefully help us to get a better overview of all the objects and fields defined in FPTF. The schema is a first draft for FPTF v2, so it already includes your suggestions from above and the ones that I am going to add now. Changes regarding FPTF v1 should all be marked by the red color. Feel free to edit the schema as it is made using the open source diagram website draw.io, you only have to click on the little edit icon at the bottom and post a new link in the comments. I will explain my proposals for each FPTF type separately while also commenting @juliuste's ideas from above.
|
@ialokim thank you very much for the detailed answer, will go through everything you wrote in the next few days. 🙂 Just one small thing already, before I forget about it:
I also thought about this but ended up reasoning this way: We already enforce However, I'd agree to make it optional if we also decide to make |
I was not aware of this. But considering your examples given where some API returns e.g. pricing information for some specific leg (or entire journey), I would definitely opt for marking it as optional and same for
|
Alright, after almost 7 months, I finally had time to go through this again 🎉
|
An update on the realtime/prognosed vs. planned/scheduled time data discussions: After talking to many people who have used
I went ahead and created a draft PR for
When any of these items is cancelled,
This proposal makes the following trade-offs:
What do you think? @ialokim @juliuste @matkoniecz |
Why cancelled transit would have still "realtime/prognosed date+time"? I would expect it to have solely scheduled time (as prognosed time for cancelled trip is null if anything). |
So if you, as a consuming developer, just access But if you are interested in the last prognosis available, even though it is cancelled, you would access Does that make sense? |
Okay, I got the idea now as it was unclear to me too. But why not naming it Apart from that, I quite agree with your proposals @derhuerst, but would opt for making the |
Don't worry, it took me 2 months more to answer 👍
Sure, if you can think of a name not that confusing for the attribute, I'd be free for suggestions.
Perhaps we're having slightly different understandings of how the relation between
In my perception, it would not make much sense to add To address your concerns about knowing Take your time to answer 😉 |
As it gets increasingly hard to tell what we actually agree on here, I started writing a draft branch, see #63. What I copied so far:
What's still missing:
|
|
I would go with the second one. |
@juliuste raised the concern that, accessing the realtime/prognosed time and falling back to the planned time from a different field is not as easy as it should. This is probably the most common use case. After discussion, we propose to let Edit: I have adapted #63 to contain the following changes. The schema would look as follows:
When the arrival/departure is cancelled, its fields would look as follows:
|
@ialokim What do you think about #61 (comment) ? |
Thanks for pinging me, I would probably have forgotten about it for some time again. 🙈
This seems reasonable to me. If I got it right,
What about your idea in #61 (comment) of changing it to |
Correct!
We could do this, I see it as a trade-off between ease of use and how-hard-it-is-to-do-things-wrong. 😀 |
Nice, I like your proposal then!
I would vote for something different than simply |
Fine with me, I prefer |
So let's go with |
Wrapping up, the schema would look like this:
When the arrival/departure is cancelled, its fields would look as follows:
|
Why did you explicitly state |
I think it depends on the environment: In some languages & serialisation formats you'd specify as an |
What I wanted to say is that this key should never be set, even when the departure/arrival is not cancelled (at least it does not figure in the table above). That's why it doesn't make sense to have it in the second table either, I'd guess? |
First of all: Quick storytime, to give some context on why I had a few changes of mind regarding our discussion here: A few months back, I had the “chance” to introduce typescript to a medium-sized JavaScript code base that interacted with an FPTF-style API client of ours (both FPTFv1 as well as Now, this is of course still only a pretty small sample on how FPTF objects are used by other people, and it could be that everyone contributing to that codebase (including me) was just plain dumb, but this got me to realize that the current proposal brings a significant mental overhead associated with all non-obvious logic for our attributes that can lead to that kind of bugs. I therefore think that it should be our highest priority to make the properties as obvious and intuitive as possible. This might sound a bit abstract, so I'll try to list some (subjective) findings of mine:
Having this in mind, I propose to adapt our current proposal in the following way (note that for simplicity I only use
Furthermore, if we decide to keep the If two attributes of an object are equal in their availability (if a location's longitude is available, latitude is too; if longitude is not available, latitude is neither), it might make sense to group them into a separate sub-object. We did that for the example for latitudes and longitudes by introducing the Now applying the same logic to the date situation, it might therefore make sense to encapsulate Wrapping up, please let me know what you think, and of course I'm also fine if we decide not to follow up on all of these proposals. Just for convenience and so that we don't forget about anything, I'll add a shortlist for my three proposals here which can be judged more or less independently:
|
@derhuerst @ialokim I think it might make sense for our discussions if we set a deadline for replying (usually I'm the "culplit" who takes too long, so this is also directed at myself 😂), so I'd kindly ask you to give opinions until end of the month (June 30) or let me know that you need longer to reply. Please indicate if this is fine for you or not (thumbs up/down). |
I agree with your reasoning and these proposals. 👍
What would the event look like if only the prognosed time is known? |
Same here 👍
As raised by @derhuerst, I think your proposal about grouping date and delays and therefore be able to require the |
Not 100% sure what you mean by that, because that wouldn't be valid FPTF according to my proposal, since |
@derhuerst ping |
With various APIs, I've seen the "scheduled" date+time to be missing. It won't be possible to fulfil the spec in these cases. |
Hi everybody, here's a lot to catch up for me. I tried to read through the most of it, but please excuse me if I did miss prior discussions to the points I'd like to make. I recently finished an at least usable version of the trias-client (read more about what TRIAS is and why I think it matters here) and while I was trying to incorporate the FPTF, I had to made some changes to get it working for my current own use cases. As there's already a discussion going on regarding a V2 of FPTF, I thought it would make sense to propse my ideas here instead of opening a new issue. Following will be therefore based on the current state of the V2 draft. stopoverStill not sure if I was just not able to realize how to properly use it, but I did not find any possibility to model simple departures for a stop in FPTF. Departure boards are used in nearly every public transport app and provided by every data provider, so I think this is a valid use case. I tried to model departures using the legSame applies to the legs of a journey, where information regarding |
No worries, glad you add your perspective!
Indeed, it was meant as one stopover of a series of stopovers, which are e.g. part of a journey leg. But its definition is, like the rest of FPTF, quite broad: "A So, as long as we keep all
Keep in mind that, by philosophy, FPTF doesn't specify all fields that people have use cases for. Rather, we tried to focus on common fields. So every FPTF-compatible lib is welcome to extend the spec. I can see though how a departure board (or just a departure information in itself) is a very common case! We could specify |
This issue is an attempt to bundle and advance the discussion about major changes to FPTF types in version 2, previously debated in #5, #33 and #42.
General consensus
There are a few points about which there seemed to be general consensus (?):
trip
type (mentioned in this comment)schedule
type to fit together with the newly introducedtrip
type (mentioned in this comment)journey
andstopover
to distinguish between realtime and scheduled dates (mentioned in this comment)However, we didn't agree on any specific specification changes yet, so here's my proposal, please express your opinions!
schedule
,trip
andleg
In my original proposal to introduce a
trip
type, I initially intended to remove theschedule
type entirely. However @derhuerst made the point that in some cases it might actually be useful to have another “aggregator“ type likeschedule
so that a large amount oftrip
s could also be condensed to a smaller amount ofschedule
s (like in GTFS, for example).What I take from this is that we should design both types in a way that one could always generate a consistent dataset using only trips from one using schedules. This doesn't need to work vice versa however, since trips can contain additional data, e.g. realtime information, that doesn't belong to a
schedule
. With this in mind, I came up with the following specification(s):trip
One could discuss adding an optional
schedule
key similar totrip.route
ortrip.line
.schedule
schedule.starts
is an objecttripId -> startTime
now instead of an array. This allows both to translate a schedule into a set of single trips as well as to provide updated realtime information for trips that are part of a schedule (as discussed in #43).Also,
schedule.line
was added to be consistent with the other objects.We could further discuss whether to use timestamps or dates as values in the
starts
object, I kept the timestamps for now.leg
I suggest that we treat
leg
as a separate new type, enabling applications to differentiate between trips, which are associated to the movement of an actual vehicle, meaning that the trip starts where the vehicle/line starts and ends where the line/vehicle movement ends, and legs, which depend on the movement of the passenger.scheduled / realtime data in
leg
andstopover
I applied the proposal from #33 to
leg
andstopover
, giving us the following spec changes:leg
stopover
Again, this is just a proposal based on previous discussions, so please express your opinions!
The text was updated successfully, but these errors were encountered: