Skip to content
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

Data structure with sub-objects for mode-specific attributes complexifies the data ingestion #888

Open
pierre-bouffort opened this issue Nov 7, 2023 · 1 comment
Labels
Data Types Changes to the base data_types.md file discussion Feedback is requested on an ongoing basis Passenger Services Passenger Services mode: taxis, TNC, TNP, PTC, paratransit, etc. Schema Implications for JSON Schema or OpenAPI

Comments

@pierre-bouffort
Copy link
Collaborator

As of today, objetcs such as trips and vehicles have in their fields some attribute tables that depend on the mode they relate to. We find this structure to be sort of sub-optimal. Indeed, as explained in the scheme below, we believe an alternate option could be to define the fields in the objects themselves (trips, vehicles, ...) as conditional to the mode.

In practice, this would mean to include the fields in these mode-specific attribute tables (like trip_attributes, vehicle_attributes, ...) directly into the root objects (trip, vehicle, ...) and defining their required/conditional status based on the mode itself.

=> Instead of having objects with mode-specific fields, you end up having mode-specific objects.

image (9)

PS: this would be made possible only if the mode is written in the object, see Issue #887

@pierre-bouffort pierre-bouffort added Schema Implications for JSON Schema or OpenAPI Passenger Services Passenger Services mode: taxis, TNC, TNP, PTC, paratransit, etc. labels Nov 7, 2023
@schnuerle schnuerle added discussion Feedback is requested on an ongoing basis Data Types Changes to the base data_types.md file labels Nov 8, 2023
@schnuerle
Copy link
Member

schnuerle commented Nov 8, 2023

Great write up and I remember having some conversations about what this structure should be. I can see benefits/cons to the way it is now and your proposed new way. With your proposed way you could take it a step further: the 'common fields' could just be moved up to a higher level above the mode, and the acc/fare/trip attributes could be per mode - just as another way to slice it.

Trip
   ( Common Fields)
   Passenger Services Trip
      ( Passenger Services acc/fare/trip attributes )

Of course a change like this would hit a future MDS 3.0 release as it's breaking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Data Types Changes to the base data_types.md file discussion Feedback is requested on an ongoing basis Passenger Services Passenger Services mode: taxis, TNC, TNP, PTC, paratransit, etc. Schema Implications for JSON Schema or OpenAPI
Projects
None yet
Development

No branches or pull requests

2 participants