Skip to content

Use methods for the base URIs instead #72

Description

@pietercolpaert

After thinking about this with @smazzoleni, we need to have any flexibility for the baseURIs to be generated with any kind of javascript functionality instead of only uri templates.

The solution we favored was to make the baseURIs.json config file a JS file with methods instead. Every kind of GTFS file will need to extend this class into their own system.

One such class could actually be an implementation where a config file can be taken account (for backwards compatibility) with URI templates, and possibly link it as follows for slightly more functionality (idea by @smazzoleni):

{
  "stop": "http://data.gtfs.org/example/stops/{stop_id}",
  "route": "http://data.gtfs.org/example/routes/{route_short_id}",
  "trip": "http://data.gtfs.org/example/trips/{trip_id}/{trip_startTime}",
  "connection": "http://example/linkedconnections.org/connections/{trip_startTime}/{departureStop}/{trip_id}",
  "resolve": {
    "route_short_id": "connection.trip.route.route_id.substring(0,5)",
    "trip_id": "connection.trip.trip_id",
    "trip_startTime": "format(connection.trip.startTime, 'YYYYMMDDTHHMM');",
    "departureStop": "connection.departureStop"
  }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions