datahub-transportation-gov/wyoming-cv-pilot-traveler-information-message-6nxx-nmxk
Icon for Socrata external plugin

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 wyoming_cv_pilot_traveler_information_message table in this repository, by referencing it like:

"datahub-transportation-gov/wyoming-cv-pilot-traveler-information-message-6nxx-nmxk:latest"."wyoming_cv_pilot_traveler_information_message"

or in a full query, like:

SELECT
    ":id", -- Socrata column ID
    "travelerdataframe", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/regions/GeographicalPath/
    "travelerdataframe_starttime", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/startTime
    "travelerdataframe_1", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/sspLocationRights
    "travelerdataframe_name", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/regions/GeographicalPath/name
    "travelerdataframe_msgid_lat", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/msgId/position/lat
    "travelerdataframe_lanewidth", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/regions/GeographicalPath/laneWidth
    "travelerdataframe_id", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/regions/GeographicalPath/id
    "travelerdataframe_direction", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/regions/GeographicalPath/direction
    "travelerdataframe_desc_nodes", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/regions/GeographicalPath/description/path/offset/xy/nodes/NodeXY
    "travelerdataframe_anchor_2", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/regions/GeographicalPath/anchor/long
    "travelerdataframe_anchor_1", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/regions/GeographicalPath/anchor/lat
    "metadata_request_snmp_mode", -- Mode. Provided by the requester and used by the ODE to access the RSUs via the SNMP interface.
    "metadata_request_snmp", -- ISO string for message delivery start time. Provided by the requester and used by the ODE to access the RSUs via the SNMP interface.
    "metadata_rmd_rxsource", -- Source that the vehicle originally received the message from (Sat, RSU, RV)
    "metadata_rmd_speed", -- Speed of vehicle when receiving the message
    "metadata_serialid_bundlesize", -- Size of the bundle within the processed file
    "metadata_sanitized", --  Boolean value indicating whether the data has been sanitized by the Privacy Module
    "metadata_schemaversion", --  Version of the metadata schema
    "metadata_generatedat", --  Closest time to which the record was created, either signed or received by the generatedBy source in UTC format. This information is taken from the communication header.
    "travelerinformation_timestamp", -- payload/data/MessageFrame/value/TravelerInformation/timeStamp
    "travelerdataframe_url", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/url
    "travelerinformation_packetid", -- payload/data/MessageFrame/value/TravelerInformation/packetID
    "travelerdataframe_content_genericsign_sequence", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/content/genericSign/SEQUENCE
    "travelerdataframe_content_speedlimit_sequence", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/content/speedLimit/SEQUENCE
    "travelerdataframe_desc_scale", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/regions/GeographicalPath/description/path/scale
    "travelerdataframe_content", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/content/advisory/SEQUENCE
    "metadata_request_snmp_1", -- ISO string for message delivery stop time. Provided by the requester and used by the ODE to access the RSUs via the SNMP interface.
    "metadata_rmd_heading", -- Heading of vehicle when receiving the message
    "metadata_rmd_elevation", -- Elevation of vehicle when receiving the message
    "metadata_receivedat", -- Time ODE received the data in UTC format
    "metadata_serialid_serialnumber", -- Combined identifier within open stream
    "metadata_payloadtype", -- ODE specific Java class identifying the type of payload included with the message
    "messageid", -- payload/data/MessageFrame/messageId
    "metadata_recordgeneratedby", -- Source of the record, whether [OBU, RSU, TMC].
    "metadata_serialid_recordid", -- Record identier within the bundle
    "metadata_serialid_streamid", -- Stream that process the original log file
    "travelerdataframe_3", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/sspMsgRights2
    "travelerdataframe_content_exitservice_sequence", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/content/exitService/SEQUENCE
    "travelerdataframe_msgid", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/msgId/position/elevation
    "metadata_request_snmp_enable", -- Enable RSU: 1 = true, 0 = false. Provided by the requester and used by the ODE to access the RSUs via the SNMP interface.
    "metadata_request_snmp_interval", -- Interval. Provided by the requester and used by the ODE to access the RSUs via the SNMP interface.
    "metadata_request_snmp_rsuid", -- OID of the RSU. Provided by the requester and used by the ODE to access the RSUs via the SNMP interface.
    "travelerdataframe_msgid_1", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/msgId/roadSignID/mutcdCode
    "travelerdataframe_closedpath", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/regions/GeographicalPath/closedPath
    "travelerdataframe_anchor", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/regions/GeographicalPath/anchor/elevation
    "travelerdataframe_startyear", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/startYear
    "travelerinformation_msgcnt", -- payload/data/MessageFrame/value/TravelerInformation/msgCnt
    "metadata_request_snmp_msgid", -- Message ID. Provided by the requester and used by the ODE to access the RSUs via the SNMP interface.
    "travelerdataframe_content_workzone_sequence", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/content/workZone/SEQUENCE
    "metadata_logfilename", -- Name of the original file that deposited the message into the ODE
    "metadata_recordtype", -- Type of message
    "metadata_rmd_longitude", -- Longitude of vehicle when receiving the message
    "travelerdataframe_content_itis", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/content/itis
    "travelerdataframe_msgid_2", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/msgId/roadSignID/viewAngle
    "travelerdataframe_frametype", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/frameType
    "metadata_request_rsus", -- Parameters provided by the requester and used by the ODE to send messages the Roadside Units.
    "travelerdataframe_durationtime", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/durationTime
    "travelerdataframe_priority", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/priority
    "datatype", -- The data type.
    "travelerdataframe_ssptimrights", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/sspTimRights
    "metadata_rmd_latitude", -- Latitude of vehicle when receiving the message
    "metadata_request_snmp_status", -- RSU Status. Provided by the requester and used by the ODE to access the RSUs via the SNMP interface.
    "metadata_securityresultcode", -- Status of IEEE 1609.2 security validation.
    "travelerinformation_urlb", -- payload/data/MessageFrame/value/TravelerInformation/urlB
    "travelerdataframe_2", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/sspMsgRights1
    "travelerdataframe_msgid_long", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/msgId/position/long
    "metadata_serialid_bundleid", --  Bundle identifier
    "travelerdataframe_msgid_crc", -- payload/data/MessageFrame/value/TravelerInformation/dataFrames/TravelerDataFrame/msgId/roadSignID/crc
    "metadata_request_snmp_channel" -- SNMP channel. Provided by the requester and used by the ODE to access the RSUs via the SNMP interface.
FROM
    "datahub-transportation-gov/wyoming-cv-pilot-traveler-information-message-6nxx-nmxk:latest"."wyoming_cv_pilot_traveler_information_message"
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/wyoming-cv-pilot-traveler-information-message-6nxx-nmxk with SQL in under 60 seconds.

This repository is an "external" repository. That means it's hosted elsewhere, in this case at datahub.transportation.gov. When you querydatahub-transportation-gov/wyoming-cv-pilot-traveler-information-message-6nxx-nmxk:latest on the DDN, we "mount" the repository using the socrata mount handler. The mount handler proxies your SQL query to the upstream data source, translating it from SQL to the relevant language (in this case SoQL).

We also cache query responses on the DDN, but we run the DDN on multiple nodes so a CACHE_HIT is only guaranteed for subsequent queries that land on the same node.

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 (like this repository), 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, where the author has pushed Splitgraph Images to the repository, you can "clone" and/or "checkout" the data using sgr cloneand sgr checkout.

Mounting Data

This repository is an external repository. It's not hosted by Splitgraph. It is hosted by datahub.transportation.gov, and Splitgraph indexes it. This means it is not an actual Splitgraph image, so you cannot use sgr clone to get the data. Instead, you can use the socrata adapter with the sgr mount command. Then, if you want, you can import the data and turn it into a Splitgraph image that others can clone.

First, install Splitgraph if you haven't already.

Mount the table with sgr mount

sgr mount socrata \
  "datahub-transportation-gov/wyoming-cv-pilot-traveler-information-message-6nxx-nmxk" \
  --handler-options '{
    "domain": "datahub.transportation.gov",
    "tables": {
        "wyoming_cv_pilot_traveler_information_message": "6nxx-nmxk"
    }
}'

That's it! Now you can query the data in the mounted table like any other Postgres table.

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/wyoming-cv-pilot-traveler-information-message-6nxx-nmxk is just another Postgres schema.