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

Use methods for the base URIs instead #72

Open
pietercolpaert opened this issue Nov 21, 2018 · 2 comments
Open

Use methods for the base URIs instead #72

pietercolpaert opened this issue Nov 21, 2018 · 2 comments

Comments

@pietercolpaert
Copy link
Member

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"
  }
}
@pietercolpaert
Copy link
Member Author

pietercolpaert commented Nov 23, 2018

Resolve strategy is merged into development!

@pietercolpaert
Copy link
Member Author

@Bertware has a similar problem where he just has the entire URI as part of a GTFS file.

We should allow different strategies for URIStrategy.js and allow people to extend that class. The command line interface should allow to select a different strategy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant