Live Transit API/Data Model

Vehicle Position and Bus Stop ETA
Bus Position data comes from the OrbCAD SmartTraveler database and describes the position and status of a bus at a given point in time.

The positional records which must be extracted contain:

Sign message data also comes from the OrbCAD database and reflects a text message that should be visible on a particular bus stop sign.

The sign message records which must be extracted contain:

Extract Transform Load (ETL) Options
Two methods for extracting bus position/arrival data were evaluated:
 * 1) Using triggers and user defined procedures to push data directly from the SQL Server instance to the CouchDB node.
 * 2) Using an application (also located in the DMZ) to connect to the SQL Server instance and poll for data changes.

In the interest of minimal latency, the usage of event based triggers and user defined procedures is recommended. This will ensure that the information is propagated quickly to the CouchDB node as soon as a change is made.

As the bus position and scheduling data come from two different sources, care must be taken to ensure that database keys for common data elements, such as stop_id, route_id, etc, remain in sync. The system assumes referential integrity is preserved through Transit's existing ETL processes.

Facility and Schedule Data
Transit facility and schedule data is made available by Montgomery County, and is maintained in the TRAPEZE system. This data changes infrequently and consists of:
 * Bus stop locations
 * Bus routes
 * Bus schedule times

The static data is already available as a set of files in GTFS format, exported from the Montgomery County scheduling system.

Given the infrequency of changes in this information, the most logical way to import this data will be to provide a web page where these files may be uploaded whenever the schedule is changed.

Metadata and Interface Description Documentation
Each resource URL will provide self documentation and metadata.

An HTTP OPTIONS request to a given resource will return an RDF document:
 * This document will be in the DC (dublin core) namespace
 * This document will be encoded in JSON or XML depending on the format requested by the client.
 * This document will provide a property referencing a location where human-readable documentation of the resource may be accessed