Query the Data Delivery Network
Query the DDNThe 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 delaware_boat_registrations_by_year
table in this repository, by referencing it like:
"delaware-gov/delaware-boat-registrations-by-year-nzij-zer2:latest"."delaware_boat_registrations_by_year"
or in a full query, like:
SELECT
":id", -- Socrata column ID
"cabin_motorboat_class_2", -- The number of registrations for boats that are recreational cabin motorboats Class 2. The boat length is greater than 26 ft but less than 40 ft.
"personal_watercraft_class", -- The number of registrations for boats that are recreational personal watercraft Class A. The boat length is less than 16 ft.
"open_motorboat_class_2", -- The number of registrations for boats that are recreational open motorboats Class 2. The boat length is greater than 26 ft but less than 40 ft.
"open_motorboat_total", -- The number of registrations for boats with a vessel type of recreational open motorboats.
"sail_only_class_3", -- The number of registrations for boats that are recreational sail only Class 3. The boat length is greater than 40 ft but less than 65 ft.
"class_4", -- The number of registrations for boats that are Class 4. The boat length is equal to or greater than 65 ft
"inboard", -- The number of registrations for boats with an engine type of Inboard.
"stern_drive", -- The number of registrations for boats with an engine type of Stern Drive.
"other_engine_type", -- The number of registrations for boats with an engine type unclassified.
"airboat_total", -- The total number of registrations for boats that are recreational motorized airboats.
"auxilary_sail_class_1", -- The number of registrations for boats that are recreational auxiliary sail Class 1. The boat length is greater than 16 ft but less than 26 ft.
"auxilary_sail_class_2", -- The number of registrations for boats that are recreational auxiliary sail Class 2. The boat length is greater than 26 ft but less than 40 ft.
"inflatable_motorboat_total", -- The number of registrations for boats that are recreational motorized inflatables.
"personal_watercraft_class_1", -- The number of registrations for boats that are recreational personal watercraft Class 1. The boat length is greater than 16 ft but less than 26 ft.
"personal_watercraft_total", -- The number of registrations for boats with a vessel type of recreational personal watercraft.
"pontoon_boat_class_3", -- The number of registrations for boats that are recreational pontoon Class 3. The boat length is greater than 40 ft but less than 65 ft.
"paddlecraft_class_1", -- The number of registrations for boats that are recreational paddlecraft Class 1. The boat length is greater than 16 ft but less than 26 ft.
"rowboat_total", -- The number of registrations for boats with a vessel type recreational rowboat.
"recreational_motorized_total", -- Sum calculation from the total fields in the dataset for recreational motorized boats.
"open_motorboat_class_3", -- The number of registrations for boats that are recreational open motorboats Class 3. The boat length is greater than 40 ft but less than 65 ft.
"pod_drive", -- The number of registrations for boats with an engine type of Pod Drive.
"outboard", -- The number of registrations for boats with an engine type of Outboard.
"class_3", -- The number of registrations for boats that are Class 3. The boat length is greater than 40 ft but less than 65 ft.
"class_a", -- The number of registrations for boats that are Class A. The boat length is less than 16 ft.
"year", -- The year for which registration totals are reported. A registration can be valid for 1 or 3 years.
"rowboat_class_4", -- The number of registrations for boats that are recreational rowboat Class 4. The boat length is equal to or greater than 65 ft
"other_nonmotorized__class_2", -- The number of registrations for boats that are recreational unclassified non-motorized Class 2. The boat length is greater than 26 ft but less than 40 ft.
"other_nonmotorized__class", -- The number of registrations for boats that are recreational unclassified non-motorized Class A. The boat length is less than 16 ft.
"rowboat_class_2", -- The number of registrations for boats that are recreational rowboat Class 2. The boat length is greater than 26 ft but less than 40 ft.
"other_motorized_boat_class_3", -- The number of registrations for boats that are recreational unclassified motorized Class 3. The boat length is greater than 40 ft but less than 65 ft.
"pontoon_boat_class_a", -- The number of registrations for boats that are recreational pontoon Class A. The boat length is less than 16 ft.
"inflatable_motorboat_class_2", -- The number of registrations for boats that are recreational motorized inflatable Class 2. The boat length is greater than 26 ft but less than 40 ft.
"cabin_motorboat_total", -- The total number of registrations for boats that are recreational cabin motorboats.
"cabin_motorboat_class_4", -- The number of registrations for boats that are recreational cabin motorboats Class 4. The boat length is equal to or greater than 65 ft
"auxilary_sail_class_a", -- The number of registrations for boats that are recreational auxiliary sail Class A. The boat length is less than 16 ft.
"airboat_class_a", -- The number of registrations for boats that are recreational motorized airboats of Class A. The boat length is less than 16 ft.
"class_2", -- The number of registrations for boats that are Class 2. The boat length is greater than 26 ft but less than 40 ft.
"other_nonmotorized__class_4", -- The number of registrations for boats that are recreational unclassified non-motorized Class 4. The boat length is equal to or greater than 65 ft
"sail_only_class_4", -- The number of registrations for boats that are recreational sail only Class 4. The boat length is equal to or greater than 65 ft
"sail_only_class_2", -- The number of registrations for boats that are recreational sail only Class 2. The boat length is greater than 26 ft but less than 40 ft.
"sail_only_class_1", -- The number of registrations for boats that are recreational sail only Class 1. The boat length is greater than 16 ft but less than 26 ft.
"paddlecraft_class_4", -- The number of registrations for boats that are recreational paddlecraft Class 4. The boat length is equal to or greater than 65 ft
"paddlecraft_class_3", -- The number of registrations for boats that are recreational paddlecraft Class 3. The boat length is greater than 40 ft but less than 65 ft.
"personal_watercraft_class_2", -- The number of registrations for boats that are recreational personal watercraft Class 2. The boat length is greater than 26 ft but less than 40 ft
"inflatable_motorboat_class_1", -- The number of registrations for boats that are recreational motorized inflatable Class 1. The boat length is greater than 16 ft but less than 26 ft.
"commercial_other_total", -- The total number of registrations for boats with a primary operation type of Commercial Other.
"commercial_fishing_total", -- The total number of registrations for boats with a primary operation type of Commercial Fishing.
"rowboat_class_3", -- The number of registrations for boats that are recreational rowboat Class 3. The boat length is greater than 40 ft but less than 65 ft.
"inflatable_nonmotorized_class_4", -- The number of registrations for boats that are recreational inflatable non-motorized Class 4. The boat length is equal to or greater than 65 ft
"other_motorized_boat_class", -- The number of registrations for boats that are recreational unclassified motorized Class A. The boat length is less than 16 ft.
"recreational_nonmotorized", -- Sum calculation from the total fields in the dataset for recreational non-motorized boats.
"paddlecraft_class_a", -- The number of registrations for boats that are recreational paddlecraft Class A. The boat length is less than 16 ft.
"houseboat_class_4", -- The number of registrations for boats that are recreational houseboats Class 4. The boat length is equal to or greater than 65 ft
"auxilary_sail_class_3", -- The number of registrations for boats that are recreational auxiliary sail Class 3. The boat length is greater than 40 ft but less than 65 ft.
"inflatable_nonmotorized_class", -- The number of registrations for boats that are recreational inflatable non-motorized Class A. The boat length is less than 16 ft.
"commercial_total", -- Sum calculation from the total fields in the dataset commercial vessels.
"charter_fishing_total", -- The total number of registrations for boats with a primary operation type of Charter Fishing.
"other_nonmotorized__class_3", -- The number of registrations for boats that are recreational unclassified non-motorized Class 3. The boat length is greater than 40 ft but less than 65 ft.
"open_motorboat_class_4", -- The number of registrations for boats that are recreational open motorboats Class 4. The boat length is equal to or greater than 65 ft
"houseboat_class_a", -- The number of registrations for boats that are recreational houseboats Class A. The boat length is less than 16 ft.
"inflatable_motorboat_class_3", -- The number of registrations for boats that are recreational motorized inflatable Class 3. The boat length is greater than 40 ft but less than 65 ft.
"inflatable_nonmotorized_class_2", -- The number of registrations for boats that are recreational inflatable non-motorized Class 2. The boat length is greater than 26 ft but less than 40 ft.
"inflatable_nonmotorized_class_1", -- The number of registrations for boats that are recreational inflatable non-motorized Class 1. The boat length is greater than 16 ft but less than 26 ft.
"other_motorized_boat_total", -- The number of registrations for boats with a vessel type recreational unclassified motorized .
"cabin_motorboat_class_1", -- The number of registrations for boats that are recreational cabin motorboats Class 1. The boat length is greater than 16 ft but less than 26 ft.
"commercial_passenger_total", -- The total number of registrations for boats with a primary operation type of Commercial Passenger.
"class_1", -- The number of registrations for boats that are Class 1. The boat length is greater than 16 ft but less than 26 ft.
"ramp_certificate", -- The total number of ramp certificates issued for the year.
"auxilary_sail_class_4", -- The number of registrations for boats that are recreational auxiliary sail Class 4. The boat length is equal to or greater than 65 ft
"personal_watercraft_class_4", -- The number of registrations for boats that are recreational personal watercraft Class 4. The boat length is equal to or greater than 65 ft
"paddlecraft_class_2", -- The number of registrations for boats that are recreational paddlecraft Class 2. The boat length is greater than 26 ft but less than 40 ft.
"other_motorized_boat_class_2", -- The number of registrations for boats that are recreational unclassified motorized Class 2. The boat length is greater than 26 ft but less than 40 ft.
"cabin_motorboat_class_a", -- The number of registrations for boats that are recreational cabin motorboats Class A. The boat length is less than 16 ft.
"pontoon_boat_class_4", -- The number of registrations for boats that are recreational pontoon Class 4. The boat length is equal to or greater than 65 ft
"sail_only_total", -- The number of registrations for boats with a vessel type of recreational sail only.
"sail_only_class_a", -- The number of registrations for boats that are recreational sail only Class A. The boat length is less than 16 ft.
"foreign", -- The number of registrations for boats that are registered in a country other than the USA.
"auxilary_sail_total", -- The total number of registrations for boats that are recreational auxiliary sail
"rowboat_class_a", -- The number of registrations for boats that are recreational rowboat Class A. The boat length is less than 16 ft.
"pontoon_boat_class_2", -- The number of registrations for boats that are recreational pontoon Class 2. The boat length is greater than 26 ft but less than 40 ft.
"airboat_class_2", -- The number of registrations for boats that are recreational motorized airboats of Class 2. The boat length is greater than 26 ft but less than 40 ft.
"other_motorized_boat_class_4", -- The number of registrations for boats that are recreational unclassified motorized Class 4. The boat length is equal to or greater than 65 ft
"houseboat_class_3", -- The number of registrations for boats that are recreational houseboats Class 3. The boat length is greater than 40 ft but less than 65 ft.
"houseboat_class_2", -- The number of registrations for boats that are recreational houseboats Class 2. The boat length is greater than 26 ft but less than 40 ft.
"airboat_class_3", -- The number of registrations for boats that are recreational motorized airboats of Class 3. The boat length is greater than 40 ft but less than 65 ft.
"inflatable_motorboat_class_4", -- The number of registrations for boats that are recreational motorized inflatable Class 4. The boat length is equal to or greater than 65 ft
"paddlecraft_total", -- The number of registrations for boats with a vessel type recreational paddlecraft.
"open_motorboat_class_a", -- The number of registrations for boats that are recreational open motorboats Class A. The boat length is less than 16 ft.
"airboat_class_4", -- The number of registrations for boats that are recreational motorized airboats Class 4. The boat length is equal to or greater than 65 ft
"total", -- The total number of boat registrations reported for the year.
"inflatable_nonmotorized_class_3", -- The number of registrations for boats that are recreational inflatable non-motorized Class 3. The boat length is greater than 40 ft but less than 65 ft.
"personal_watercraft_class_3", -- The number of registrations for boats that are recreational personal watercraft Class 3. The boat length is greater than 40 ft but less than 65 ft.
"pontoon_boat_class_1", -- The number of registrations for boats that are recreational pontoon Class 1. The boat length is greater than 16 ft but less than 26 ft.
"rowboat_class_1", -- The number of registrations for boats that are recreational rowboat Class 1. The boat length is greater than 16 ft but less than 26 ft.
"other_nonmotorized_total", -- The number of registrations for boats with a vessel type recreational unclassified non-motorized.
"airboat_class_1", -- The number of registrations for boats that are recreational motorized airboats of Class 1. The boat length is greater than 16 ft but less than 26 ft.
"inflatable_nonmotorized_total", -- The number of registrations for boats with a vessel type recreational inflatable non-motorized.
"other_motorized_boat_class_1", -- The number of registrations for boats that are recreational unclassified motorized Class 1. The boat length is greater than 16 ft but less than 26 ft.
"stolen", -- The number of boats stolen for the year.
"houseboat_class_1", -- The number of registrations for boats that are recreational houseboats Class 1. The boat length is greater than 16 ft but less than 26 ft.
"other_nonmotorized__class_1", -- The number of registrations for boats that are recreational unclassified non-motorized Class 1. The boat length is greater than 16 ft but less than 26 ft.
"open_motorboat_class_1", -- The number of registrations for boats that are recreational open motorboats Class 1. The boat length is greater than 16 ft but less than 26 ft.
"inflatable_motorboat_class", -- The number of registrations for boats that are recreational motorized inflatable Class A. The boat length is less than 16 ft.
"houseboat_total", -- The number of registrations for boats that are recreational houseboats.
"cabin_motorboat_class_3", -- The number of registrations for boats that are recreational cabin motorboats Class 3. The boat length is greater than 40 ft but less than 65 ft.
"pontoon_boat_total" -- The number of registrations for boats with a vessel type of recreational pontoon.
FROM
"delaware-gov/delaware-boat-registrations-by-year-nzij-zer2:latest"."delaware_boat_registrations_by_year"
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 delaware-gov/delaware-boat-registrations-by-year-nzij-zer2
with SQL in under 60 seconds.
Query Your Local Engine
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; sgr
can 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 clone
and sgr checkout
.
Cloning Data
Because delaware-gov/delaware-boat-registrations-by-year-nzij-zer2: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 delaware-gov/delaware-boat-registrations-by-year-nzij-zer2
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 delaware-gov/delaware-boat-registrations-by-year-nzij-zer2:latest
This will download all the objects for the latest
tag of delaware-gov/delaware-boat-registrations-by-year-nzij-zer2
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 delaware-gov/delaware-boat-registrations-by-year-nzij-zer2: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 delaware-gov/delaware-boat-registrations-by-year-nzij-zer2: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, delaware-gov/delaware-boat-registrations-by-year-nzij-zer2
is just another Postgres schema.