Skip to content

Latest commit

 

History

History
249 lines (182 loc) · 18.5 KB

spec.md

File metadata and controls

249 lines (182 loc) · 18.5 KB

Linked GTFS specification

namespace prefix URI
gtfs: http://vocab.gtfs.org/terms#
dct: http://purl.org/dc/terms/
dcat: http://www.w3.org/ns/dcat#
xsd: http://www.w3.org/2001/XMLSchema#
rdfs: http://www.w3.org/2000/01/rdf-schema#
foaf: http://xmlns.com/foaf/0.1/
schema: http://schema.org/
geo: http://www.w3.org/2003/01/geo/wgs84_pos#

An instance of a gtfs:Feed is a linked GTFS feed that complies to this specification. The mandatory and recommended properties are there to provide meta-data to the feed.

When something is of a type gtfs:Feed, it

Recommended properties:

A gtfs:Agency operates a certain schedule based transport mode.

Mandatory properties:

  • foaf:name - a name for the agency
  • foaf:page - a webpage for the agency
  • gtfs:timeZone - a timezone as a string (e.g., Europe/Brussels or America/Los_Angeles)

Recommended properties:

  • dct:language - the main language of the agency
  • foaf:phone - a single voice telephone number for the specified agency
  • gtfs:fareUrl - the URL of a web page that allows a rider to purchase tickets or other fare instruments for that agency online.

A gtfs:Stop is a physical location where a vehicle stops or leaves. Multiple routes may use the same stop.

Mandatory properties:

Optional properties:

  • dct:identifier - original local identifier within the GTFS ZIP file
  • gtfs:code - a "code": short text or a number that uniquely identifies the stop for passengers. They are often used in phone-based transit information systems or printed on stop signage to make it easier for riders to get a stop schedule or real-time arrival information for a particular stop.
  • dct:description - quality information (sic) describing a stop
  • gtfs:zone - defines the fare zone. Zones are required if you want to provide fare information using a gtfs:FareClass.
  • foaf:page - a page of the stop with more information
  • gtfs:timeZone - timezone the stop is in (if different from the gtfs:Agency)
  • gtfs:parentStation - If this stop is part of a station, add a link to the station
  • gtfs:wheelchairAccessible - a wheelchair accessibility type

A gtfs:Station contains 1 or more instances of gtfs:Stop.

Mandatory properties:

Optional properties:

  • dct:identifier - a "code": short text or a number that uniquely identifies the stop for passengers. They are often used in phone-based transit information systems or printed on stop signage to make it easier for riders to get a stop schedule or real-time arrival information for a particular station.
  • dct:description - quality information (sic) describing a station
  • foaf:page - a page of the station with more information
  • gtfs:timeZone - timezone the stop is in (if different from the gtfs:Agency)
  • gtfs:wheelchairAccessible - a wheelchair accessibility type

Wheelchair accessibility

3 URIs are defined:

A gtfs:Route is a collection of trips which forms a patch a transit vehicle follows.

Mandatory properties:

  • gtfs:shortName - The route_short_name contains the short name of a route. This will often be a short, abstract identifier like "32", "100X", or "Green" that riders use to identify a route, but which doesn't give any indication of what places the route serves. At least one of route_short_name or route_long_name must be specified, or potentially both if appropriate. If the route does not have a short name, please specify a route_long_name and use an empty string as the value for this field.
  • gtfs:longName - The route_long_name contains the full name of a route. This name is generally more descriptive than the route_short_name and will often include the route's destination or stop. At least one of route_short_name or route_long_name must be specified, or potentially both if appropriate. If the route does not have a long name, please specify a route_short_name and use an empty string as the value for this field.
  • gtfs:routeType - Links to a certain gtfs:RouteType
  • gtfs:agency - Links to an agency (note that this wasn't mandatory in the GTFS CSV spec)

Optional properties:

  • dct:description - The route_desc field contains a description of a route. Please provide useful, quality information. Do not simply duplicate the name of the route. For example, "A trains operate between Inwood-207 St, Manhattan and Far Rockaway-Mott Avenue, Queens at all times. Also from about 6AM until about midnight, additional A trains operate between Inwood-207 St and Lefferts Boulevard (trains typically alternate between Lefferts Blvd and Far Rockaway)."
  • gtfs:routeUrl - The route_url field contains the URL of a web page about that particular route. This should be different from the agency_url.
  • gtfs:color - In systems that have colors assigned to routes, the gtfs:color field defines a color that corresponds to a route. The color must be provided as a six-character hexadecimal number, for example, 00FFFF. If no color is specified, the default route:color is white (FFFFFF).
  • gtfs:textColor - The textColor property can be used to specify a legible color to use for text drawn against a background of route_color. The color must be provided as a six-character hexadecimal number, for example, FFD700. If no color is specified, the default text color is black (000000).

gtfs:RouteType

gtfs:RouteType is a class to describe the type of transportation used on a route.

Currently, 8 route types are available:

  1. gtfs:LightRail - Tram, Streetcar, Light rail. Any light rail or street level system within a metropolitan area.
  2. gtfs:Subway - Subway, Metro. Any underground rail system within a metropolitan area.
  3. gtfs:Rail - Rail. Used for intercity or long-distance travel.
  4. gtfs:Bus - Bus. Used for short- and long-distance bus routes.
  5. gtfs:Ferry - Ferry. Used for short- and long-distance boat service.
  6. gtfs:CableCar - Cable car. Used for street-level cable cars where the cable runs beneath the car.
  7. gtfs:Gondola - Gondola, Suspended cable car. Typically used for aerial cable cars where the car is suspended from the cable.
  8. gtfs:Funicular - Funicular. Any rail system designed for steep inclines.

gtfs:Trip

A collection of gtfs:StopTimes followed by a transit vehicle.

Mandatory properties:

Optional properties:

  • gtfs:headsign - The trip_headsign field contains the text that appears on a sign that identifies the trip's destination to passengers. Use this field to distinguish between different patterns of service in the same route. If the headsign changes during a trip, you can override the trip_headsign by specifying values for the the stop_headsign field in stop_times.txt.
  • gtfs:shortName - The trip_short_name field contains the text that appears in schedules and sign boards to identify the trip to passengers, for example, to identify train numbers for commuter rail trips. If riders do not commonly rely on trip names, please leave this field blank. A trip_short_name value, if provided, should uniquely identify a trip within a service day; it should not be used for destination names or limited/express designations.
  • gtfs:direction - binary value that indicates the direction of travel for a trip. Use this field to distinguish between bi-directional trips with the same route. (xsd:boolean)
  • gtfs:block - identifies the block to which the trip belongs. A block consists of two or more sequential trips made using the same vehicle, where a passenger can transfer from one trip to the next just by staying in the vehicle
  • gtfs:shape - a link to a shape
  • gtfs:wheelchairAccessible - whether the trip can be accessed by 1 or more wheelchairs.
  • gtfs:bikesAllowed - bikes allowed or not (xsd:boolean)

Mandatory properties:

Optional properties:

  • gtfs:headsign - override gtfs:trip's headsign
  • gtfs:pickupType - how to get on a transit vehicle at a certain time & location
  • gtfs:dropOffType - how to get off a transit vehicle at a certain time & location
  • gtfs:distanceTraveled - Positions a stop as a distance from the first shape point. It represents a real distance traveled along the route in units such as feet or kilometers. This information allows the trip planner to determine how much of the shape to draw when showing part of a trip on the map. The values used for gtfs:distanceTraveled must increase along with gtfs:stopSequence: they cannot be used to show reverse travel along a route.

4 types are defined which are both a gtfs:PickupType and a gtfs:DropOffType

  • gtfs:Regular
  • gtfs:NotAvailable
  • gtfs:MustPhone
  • gtfs:MustCoordinateWithDriver

gtfs:Service

A gtfs:Service identifies a set of dates when a service is available for one or more routes

Mandatory properties:

gtfs:ServiceRule, gtfs:CalendarRule and gtfs:CalendarDateRule

gtfs:CalendarRule

Mandatory properties:

  • gtfs:monday, gtfs:tuesday, gtfs:wednesday, gtfs:thursday, gtfs:friday, gtfs:saturday, gtfs:sunday - booleans whether on
  • dct:temportal - time period in which a startDate and an endDate are given (e.g., using schema:startDate and schema:endDate)

gtfs:CalendarDateRule

Mandatory properties:

  • dct:date - the date the CalendarDateRule applies
  • gtfs:dateAddition - A boolean whether to add (true) or remove (false) a date

gtfs:FareClass

A fare class defines a class of pricing. It's a subclass of schema:PriceSpecification and extends it with transit specific properties.

Mandatory properties

  • schema:price
  • schema:priceCurrency
  • gtfs:paymentMethod: is gtfs:OnBoard or gtfs:BeforeBoarding
  • gtfs:transfers - one of these: gtfs:NoTransfersAllowed, gtfs:OneTransfersAllowed, gtfs:TwoTransfersAllowed, gtfs:UnlimitedTransfersAllowed Optional properties
  • gtfs:transferExpiryTime - time until a transfer expires (in seconds)

gtfs:FareRule

A rule which binds a gtfs:FareClass to a part of the network.

Mandatory properties

  • gtfs:fareClass - links to one gtfs:FareClass

Optional properties (yet mandatory to use at least 1)

  • gtfs:route - the fare class is applicable to this route
  • gtfs:originZone - the fare class is applicable to this originZone
  • gtfs:destinationZone - An optional destinationZone can be given as well
  • gtfs:zone - is applicable only within this gtfs:Zone

gtfs:Zone

A class to describe a zone

Optional properties

  • rdfs:label - a label to give to the specific zone

gtfs:Shape

Discussion: wouldn't it be better to reuse GML?

A shape exists out of different gtfs:ShapePoints.

Mandatory properties:

gtfs:ShapePoint

Mandatory properties:

  • geo:long, geo:lat - longitude an latitude in WGS84
  • gtfs:pointSequence - The gtfs:pointSequence field associates the latitude and longitude of a shape point with its sequence order along the shape. The values must increase along the trip.

Optional properties:

  • gtfs:distanceTraveled - positions a gtfs:shapepoint as a distance traveled along a shape from the first gtfs:ShapePoint.

gtfs:Frequency

Describes a frequency of a stop instead of absolute stop times. If a certain gtfs:StopTime is defined, then these stoptimes define the sequence and the time difference between each stop.

Mandatory properties

  • gtfs:trip - links to the trip which it applies to
  • gtfs:startTime - specifies the time at which service begins with the specified frequency.
  • gtfs:endTime - indicates the time at which service changes to a different frequency (or ceases) at the first stop in the trip.
  • gtfs:headwaySeconds - indicates the time between departures from the same stop (headway) for this trip type, during the time interval specified by start_time and end_time.
  • gtfs:exactTimes: false: Frequency-based trips are not exactly scheduled. true: Frequency-based trips are exactly scheduled.

gtfs:TransferRule

Define additional rules for making connections between routes.

Mandatory properties:

  • gtfs:originStop & gtfs:destinationStop: indicate the this transfer rule applies only when going from this origin to this destination.
  • gtfs:transferType: links to a gtfs:TransferType, when can be: gtfs:RecommendedTransfer, gtfs:EnsuredTransfer, gtfs:MinimumTimeTransfer, or gtfs:NoTransfer
  • gtfs:minimumTransferTime: a non negative number in seconds: This transfer requires a minimum amount of time between arrival and departure to ensure a connection. The time required to transfer is specified by gtfs:minimumTransferTime.