datahub-transportation-gov/advanced-messaging-concept-development-probe-7ee5-ppkq
Loading...

Query the Data Delivery Network

Query the DDN

The easiest way to query any data on Splitgraph is via the "Data Delivery Network" (DDN). The DDN is a single endpoint that speaks the PostgreSQL wire protocol. Any Splitgraph user can connect to it at data.splitgraph.com:5432 and query any version of over 40,000 datasets that are hosted or proxied by Splitgraph.

For example, you can query the advanced_messaging_concept_development_probe table in this repository, by referencing it like:

"datahub-transportation-gov/advanced-messaging-concept-development-probe-7ee5-ppkq:latest"."advanced_messaging_concept_development_probe"

or in a full query, like:

SELECT
    ":id", -- Socrata column ID
    "snapshot_tire_air_pressure", -- The status of the vehicle’s combined tire pressure status. A measure of the relative tire pressure observed. Encoded as per the value set used in SAE J1939.
    "snapshot_yaw_rate", -- A signed value representing degrees rotation per second of the vehicle around its vertical axis. Positive values indicate clockwise rotation of the vehicle around its vertical axis.
    "snapshot_steering_wheel_angle", -- The angle of the driver’s steering wheel, expressed in degrees of rotation from center where positive values represent rotation in the clockwise direction and negative values represent rotation in the counterclockwise direction.
    "snapshot_lateral_acceleration", -- The acceleration along the Y axis or perpendicular to the vehicle's general direction of travel in parallel with a left-to right centerline. Expressed in meters per second squared where negative values indicate the vehicle is accelerating to left.
    "snapshot_longitudinal_acceleration", -- The acceleration along the X axis or the vehicle's direction of travel, which is generally in parallel with a front to rear centerline. Expressed in meters per second squared where negative values indicate deceleration, and possible braking action. 
    "snapshot_heading", -- The heading of the vehicle at the time the snapshot was captured expressed in degrees (0-360) where zero represents “North” and positive values express a heading values in a clockwise direction from “North.”
    "snapshot_elevation", -- The elevation of the vehicle in meters above mean sea level as determined by the OBU GPS when the snapshot was captured.
    "snapshot_longitude", -- The geographic longitude position as determined by the OBU GPS unit when the snapshot was captured expressed as a GPS coordinate.
    "snapshot_latitude", -- The geographic latitude position as determined by the OBU GPS unit when the snapshot was captured, expressed as a GPS coordinate.  
    "snapshot_time", -- The time at which the snapshot was captured expressed as milliseconds UTC time.
    "snapshot_abs_active", -- The status of the vehicle’s ABS where the system was detected to be active.  	0 = Unavailable 	1 = Off 	2 = On 	3 = Engaged 
    "count", -- The total number of snapshots contained in the parent PVD message.
    "elevation", -- The elevation of the vehicle in meters above mean sea level as determined by the OBU GPS when the PVD was sent.
    "heading", -- The heading of the vehicle expressed in degrees (0-360) where zero represents “North” and positive values express a heading values in a clockwise direction from “North.”
    "pvd_message_id", -- A message ID value generated by the OBU that increases sequentially with each new PVD message created starting with 1. Empty
    "speed", -- The vehicle speed in meters per second.
    "snapshot_speed", -- The vehicle’s speed in meters per second at the time the snapshot was captured.
    "snapshot_light_status", -- The status of the vehicle’s external lighting system expressed as a bit field where: 	Bit0 = Off 	Bit1 = Headlight Low Beam 	Bit2 = Headlight High Beam 	Bit3 = Left Turn  	Bit4 = Right Turn 	Bit5 = Hazard 	Bit6 = Automatic Control 	Bit7 = Daytime Running 
    "longitude", -- The geographic longitude position as determined by the OBU GPS unit when the PVD was sent expressed as a GPS coordinate.
    "latitude", -- The geographic latitude position as determined by the OBU GPS unit when the PVD was sent, expressed as a GPS coordinate.  
    "time_received", -- The time at which the PVD was received by the VCC Cloud server in milliseconds UTC time. 
    "time_message_container_created", -- The time at which the PVD message container was created on the OBU prior to being sent to the VCC Cloud server in milliseconds UTC time. Empty
    "snapshot_ambient_air_temperature", -- The temperature of the air outside the vehicle as measured by vehicle sensors and expressed as degrees Celsius. 
    "snapshot_wiper_status", -- The status of the vehicle’s front windshield wipers expressed as: 	Blank = Unavailable 	‘off’ = Off 	‘intermittent’  = Intermittent 
    "snapshot_count_number", -- The snapshot sequence number within the parent PVD message of the data represented in the current row of the CSV data file.
    "test_no", -- The AMCD test number the record was collected during.
    "mode_of_transmission", -- An indication of which mode of transmission was used to transmit the message (DSRC or Cellular) from the OBU to the VCC Cloud server. If received via DSRC: 	1 through 114 = The ID of the RSU used to forward the message to the server  If received via cellular:  	999999 = Cellular  
    "snapshot_vertical_acceleration", -- A data element representing the signed vertical acceleration of the vehicle along the vertical axis in meters per second squared where positive values indicate upward (opposite of gravity) acceleration.
    "snapshot_ambient_air_pressure", -- The pressure of the air outside the vehicle as measured by vehicle sensors and expressed as hPa.
    "obu_id", -- The ID of the OBU that generated and sent the message for the current communication sequence.
    "snapshot_traction_control_state", -- The status of the vehicle’s traction system. If the vehicle is equipped with a TCS, the element reports whether the system was in an Off, On or Engaged state. 	0 = Unavailable 	1 = Off 	2 = On 	3 = Engaged 
    "snapshot_brake_applied_status", -- A bit field representing a binary indication of whether brakes were being applied at each wheel. A component of the brake system status data frame. 	0000 = All off 	0001 = Left front active 	0010 = Left rear active 	0100 = Right front active 	1000 = Right rear active 	1111 = Brake active 
    "snapshot_stability_control_status", -- The status of the vehicle’s stability control system. If the vehicle is equipped with an SCS, the element reports whether the system was in an Off or On state. 	0 = Unavailable 	1 = Off 	2 = On 
    "snapshot_precipitation_sensor" -- The status of the vehicle’s on board sensors that detect the presence of precipitation expressed as: 	0 = None 	1 = Light Mist 	2 = Heavy Mist 	3 = Light Rain 	4 = Rain 	5 = Moderate Rain 	6 = Heavy Rain 	7 = Heavy Downpour 
FROM
    "datahub-transportation-gov/advanced-messaging-concept-development-probe-7ee5-ppkq:latest"."advanced_messaging_concept_development_probe"
LIMIT 100;

Connecting to the DDN is easy. All you need is an existing SQL client that can connect to Postgres. As long as you have a SQL client ready, you'll be able to query datahub-transportation-gov/advanced-messaging-concept-development-probe-7ee5-ppkq with SQL in under 60 seconds.

Query Your Local Engine

Install Splitgraph Locally
bash -c "$(curl -sL https://github.com/splitgraph/splitgraph/releases/latest/download/install.sh)"
 

Read the installation docs.

Splitgraph Cloud is built around Splitgraph Core (GitHub), which includes a local Splitgraph Engine packaged as a Docker image. Splitgraph Cloud is basically a scaled-up version of that local Engine. When you query the Data Delivery Network or the REST API, we mount the relevant datasets in an Engine on our servers and execute your query on it.

It's possible to run this engine locally. You'll need a Mac, Windows or Linux system to install sgr, and a Docker installation to run the engine. You don't need to know how to actually use Docker; sgrcan manage the image, container and volume for you.

There are a few ways to ingest data into the local engine.

For external repositories, the Splitgraph Engine can "mount" upstream data sources by using sgr mount. This feature is built around Postgres Foreign Data Wrappers (FDW). You can write custom "mount handlers" for any upstream data source. For an example, we blogged about making a custom mount handler for HackerNews stories.

For hosted datasets (like this repository), where the author has pushed Splitgraph Images to the repository, you can "clone" and/or "checkout" the data using sgr cloneand sgr checkout.

Cloning Data

Because datahub-transportation-gov/advanced-messaging-concept-development-probe-7ee5-ppkq:latest is a Splitgraph Image, you can clone the data from Spltgraph Cloud to your local engine, where you can query it like any other Postgres database, using any of your existing tools.

First, install Splitgraph if you haven't already.

Clone the metadata with sgr clone

This will be quick, and does not download the actual data.

sgr clone datahub-transportation-gov/advanced-messaging-concept-development-probe-7ee5-ppkq

Checkout the data

Once you've cloned the data, you need to "checkout" the tag that you want. For example, to checkout the latest tag:

sgr checkout datahub-transportation-gov/advanced-messaging-concept-development-probe-7ee5-ppkq:latest

This will download all the objects for the latest tag of datahub-transportation-gov/advanced-messaging-concept-development-probe-7ee5-ppkq and load them into the Splitgraph Engine. Depending on your connection speed and the size of the data, you will need to wait for the checkout to complete. Once it's complete, you will be able to query the data like you would any other Postgres database.

Alternatively, use "layered checkout" to avoid downloading all the data

The data in datahub-transportation-gov/advanced-messaging-concept-development-probe-7ee5-ppkq:latest is 0 bytes. If this is too big to download all at once, or perhaps you only need to query a subset of it, you can use a layered checkout.:

sgr checkout --layered datahub-transportation-gov/advanced-messaging-concept-development-probe-7ee5-ppkq:latest

This will not download all the data, but it will create a schema comprised of foreign tables, that you can query as you would any other data. Splitgraph will lazily download the required objects as you query the data. In some cases, this might be faster or more efficient than a regular checkout.

Read the layered querying documentation to learn about when and why you might want to use layered queries.

Query the data with your existing tools

Once you've loaded the data into your local Splitgraph Engine, you can query it with any of your existing tools. As far as they're concerned, datahub-transportation-gov/advanced-messaging-concept-development-probe-7ee5-ppkq is just another Postgres schema.

Related Documentation:

Loading...