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

Review the Q4 modifications to the GTFS specification #1079

Closed
isabelle-dr opened this issue Dec 20, 2021 · 2 comments
Closed

Review the Q4 modifications to the GTFS specification #1079

isabelle-dr opened this issue Dec 20, 2021 · 2 comments
Labels
GTFS Reference Used for Adding or changing rules that belong in the GTFS reference

Comments

@isabelle-dr
Copy link
Contributor

isabelle-dr commented Dec 20, 2021

Review modifications that happened in Q4 that might need modifications in the validator.

Pr's to review

@isabelle-dr isabelle-dr added the GTFS Reference Used for Adding or changing rules that belong in the GTFS reference label Dec 20, 2021
@isabelle-dr isabelle-dr changed the title Review modifications to the spec merged in Q4 Review the Q4 modifications to the GTFS specification Dec 23, 2021
@isabelle-dr isabelle-dr modified the milestones: v3.2.1, v3.3.0 - rule improvements, Rule improvements Jan 9, 2022
@isabelle-dr
Copy link
Contributor Author

isabelle-dr commented Mar 15, 2022

Review of The primary and Foreign ID fields

agency.txt ✅

  • specification
    • agency_id: Primary Key
  • validator: same

stops.txt ✅

  • specification
    • stop_id: Primary Key
    • parent_station: Foreign key referencing stops.stop_id
    • level_id: Foreign key referencing levels.level_id
  • validator: same

routes.txt ✅

  • specification
    • route_id: Primary Key
    • agency_id: Foreign key referencing agency_agency_id
  • validator: same
    • route_id: PrimaryKey

trips.txt ✅

  • specification:
    • route_id: Foreign key referencing routes.route_id
    • service_id: Foreign key referencing calendar.service_id or calendar_dates.service_id
    • trip_id: Primary Key
    • shape_id: Foreign key referencing shapes.shape_id
  • validator: doesn't describe service_id as a foreign key referring to calendar.service_id or calendar_dates.service_id, but there is a piece of custom code that will trigger the ForeignKeyViolationNotice if the service_id referenced in trips.txt does not exist in either calendar.txt or calendar_date.txt

stop_times.txt ✅

  • specification
    • trip_id: & stop_sequence: primary key
    • trip_id: foreign key referencing trips.trip_id
    • stop_id: foreign key referencing stops.stop_id
  • validator: same

calendar.txt ✅

  • specification
    • service_id: primary key
  • validator: same

calendar_dates.txt ❌

  • specification
    • service_id & date: primary key
    • service_id: foreign key referencing calendar.service_id or ID (this depends on how these files are used)
  • validator: no mention of keys

fare_attributes.txt ✅

  • specification
    • fare_id: Primary key
    • agency_id: foreign key referencing agency.agency_id
  • validator: same

fare_rules.txt ✅

  • specification
    • all fields are primary keys
    • fare_id: foreign key referencing fare_attributes.fare_id
    • route_id: foreign key referencing routes.route_id
    • origin_id: foreign key referencing stops.zone_id
    • destination_id: foreign key referencing stops.zone_id
    • contains_id: foreign key referencing stops.zone_id
  • validator: only defines the foreign keys in the schema, and the uniqueness of each line is covered by DuplicateFareRuleZoneIdFieldsNotice

shapes.txt ✅

  • specification
    • shape_id & shape_pt_sequence: primary key
  • validator: same

frequencies.txt ❌

  • specification
    • trip_id, start_time: primary key
    • trip_id: foreign key referencing trips.trip_id
  • validator: trip_id is described as a foreign key but there is no mention of primary keys

transfers.txt ❌

  • specification
    • from_stop_id, to_stop_id, from_trip_id, to_trip_id, from_route_id, to_route_id: the primary key
    • all of these fields are foreign keys
  • validator: no mention of primary keys. there are missing fields, but it's because of the second piece added in Q4 (transfers for routes and trips)

pathways.txt ✅

  • specification
    • pathway_id: primary key
    • from_stop_id: foreign key referencing stops.stop_id
    • to_stop_id: foreign key referencing stops.stop_id
  • validator: same

levels.txt ✅

  • specification
    • level_id: primary key
  • validator: same

translations.txt ❌

  • specification
    • all fields are a primary key
    • record_id: foreign key referencing to multiple fields. There is a custom rule to check for key violations: TranslationForeignKeyViolationNotice
    • record_sub_id: foreign key referencing to multiple fields.
  • validator

feed_info.txt ✅

  • specification
    • no primary key or foreign key
  • validator: same

attributions.txt ✅

  • specification
    • attribution_id: primary key
    • agency_id: foreign key referencing agency.agency_id
    • route_id: foreign key referencing route.route_id
    • trip_id: foreign key referencing trips.trip_id
  • validator: same

Issue opened to followup:

@isabelle-dr
Copy link
Contributor Author

isabelle-dr commented Mar 15, 2022

Trip to trip and route to route transfers

Additional fields in transfers.txt

  • from_trip_id - optional - Foreign ID
  • to_trip_id - optional - Foreign ID
  • from_route_id - optional - Foreign ID
  • to_route_id - optional - Foreign ID

No additional rules needed

Issue opened to followup:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GTFS Reference Used for Adding or changing rules that belong in the GTFS reference
Projects
None yet
Development

No branches or pull requests

1 participant