cdc-gov/covid19-vaccinations-in-the-united-unsk-b7fc
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 covid19_vaccinations_in_the_united table in this repository, by referencing it like:

"cdc-gov/covid19-vaccinations-in-the-united-unsk-b7fc:latest"."covid19_vaccinations_in_the_united"

or in a full query, like:

SELECT
    ":id", -- Socrata column ID
    "bivalent_booster_65plus_pop_pct", -- Percent of people ages 65+ with an updated (bivalent) booster dose
    "bivalent_booster_65plus", -- Total number of people ages 65+ with an updated (bivalent) booster dose
    "bivalent_booster_12plus_pop_pct", -- Percent of people ages 12+ with an updated (bivalent) booster dose
    "dist_bivalent_mod", -- Total number of updated (bivalent) Moderna booster doses distributed
    "dist_bivalent_pfr", -- Total number of updated (bivalent) Pfizer booster doses distributed
    "admin_bivalent_mod", -- Total number of updated (bivalent) Moderna booster doses administered
    "admin_bivalent_pfr", -- Total number of updated (bivalent) Pfizer booster doses administered
    "second_booster_unk_manuf", -- Total number of people who have received a second booster dose from another manufacturer
    "second_booster_65plus_vax_pct", -- Percentage of people ages 65+ with a first booster dose who received a second booster dose based on the jurisdiction where recipient lives
    "second_booster_65plus", -- Total number of people ages 65+ who have received a second booster dose based on the jurisdiction where recipient lives
    "additional_doses_unk_manuf", -- Total number of people with a completed primary series who have received an unknown or other booster (or additional) dose. 
    "additional_doses_pfizer", -- Total number of people with a completed primary series who have received a Pfizer booster (or additional) dose.
    "additional_doses_moderna", -- Total number of people with a completed primary series who have received a Moderna booster (or additional) dose.
    "additional_doses_65plus_vax_pct", -- Percent of people 65+ who completed a primary series and have received a booster (or additional) dose. 
    "additional_doses_65plus", -- Total number of people 65+ who completed a primary series and have received a booster (or additional) dose.
    "additional_doses_18plus_vax_pct", -- Percent of people 18+ who completed a primary series and have received a booster (or additional) dose.
    "additional_doses_18plus", -- Total number of people 18+ who completed a primary series and have received a booster (or additional) dose.
    "additional_doses_5plus_vax_pct", -- Percent of people 5+ who completed a primary series and have received a booster (or additional) dose.
    "additional_doses_vax_pct", -- Percent of people who completed a primary series and have received a booster (or additional) dose.
    "additional_doses", -- Total number of people who completed a primary series and have received a booster (or additional) dose.
    "series_complete_unk_manuf_3", -- Total number of people 65+ who received two doses from an unknown or other two-dose vaccine manufacturer.
    "series_complete_moderna_65plus", -- Total number of people 65+ who completed a Moderna primary series
    "series_complete_janssen_65plus", -- Total number of people 65+ with the J&J/Janssen vaccine.
    "series_complete_unk_manuf_2", -- Total number of people 18+ who received two doses from an unknown or other two-dose vaccine manufacturer
    "series_complete_moderna_18plus", -- Total number of people 18+ who completed a Moderna primary series
    "series_complete_janssen_18plus", -- Total number of people 18+ with the J&J/Janssen vaccine.
    "series_complete_unk_manuf_1", -- Total number of people 12+ who received two primary series doses from an unknown or other two-dose vaccine manufacturer 
    "series_complete_pfizer_12plus", -- Total number of people 12+ who completed a Pfizer primary series
    "series_complete_moderna_12plus", -- Total number of people 12+ who completed a Moderna primary series
    "series_complete_janssen_12plus", -- Total number of people 12+ with the J&J/Janssen vaccine 
    "series_complete_unk_manuf_5plus", -- Total number of people 5+ who received two primary series doses from an unknown or other two-dose vaccine manufacturer 
    "series_complete_moderna_5plus", -- Total number of people 5+ who completed a Moderna primary series
    "series_complete_janssen_5plus", -- Total number of people 5+ with the J&J/Janssen vaccine 
    "series_complete_unk_manuf", -- Total number of people who received two primary series doses from an unknown or other two-dose vaccine manufacturer
    "series_complete_novavax", -- Total number of people who completed a Novavax primary series
    "series_complete_moderna", -- Total number of people who completed a Moderna primary series 
    "series_complete_janssen", -- Total number of people with the J&J/Janssen vaccine 
    "series_complete_65plus", -- Total number of people 65+ with a completed primary series (have second dose of a two-dose vaccine or one dose of a single-dose vaccine) based on the jurisdiction where recipient lives
    "series_complete_18plus", -- Total number of people 18+ with a completed primary series (have second dose of a two-dose vaccine or one dose of a single-dose vaccine) based on the jurisdiction where recipient lives
    "series_complete_12pluspop", -- Percent of people 12+ with a completed primary series (have second dose of a two-dose vaccine or one dose of a single-dose vaccine) based on the jurisdiction where recipient lives
    "series_complete_12plus", -- Total number of people 12+ with a completed primary series (have second dose of a two-dose vaccine or one dose of a single-dose vaccine) based on the jurisdiction where recipient lives
    "series_complete_5pluspop_pct", -- Percent of people 5+ with a completed primary series (have second dose of a two-dose vaccine or one dose of a single-dose vaccine) based on the jurisdiction where recipient lives
    "series_complete_pop_pct", -- Percent of people with a completed primary series (have second dose of a two-dose vaccine or one dose of a single-dose vaccine) based on the jurisdiction where recipient lives
    "series_complete_yes", -- Total number of people with a completed primary series (have second dose of a two-dose vaccine or one dose of a single-dose vaccine) based on the jurisdiction where recipient lives
    "administered_dose1_recip_65pluspop_pct", -- Percent of population ages 65+ with at least one dose based on the jurisdiction where recipient lives
    "administered_dose1_recip_65plus", -- Total number of people ages 65+ with at least one dose based on the jurisdiction where recipient lives
    "administered_dose1_recip_18plus", -- Total number of people ages 18+ with at least one dose based on the jurisdiction where recipient lives
    "administered_dose1_recip_12pluspop_pct", -- Percent of population ages 12+ with at least one dose based on the jurisdiction where recipient lives
    "administered_dose1_recip_5pluspop_pct", -- Percent of population ages 5+ with at least one dose based on the jurisdiction where recipient lives
    "administered_dose1_recip_5plus", -- Total number of people ages 5+ with at least one dose based on the jurisdiction where recipient lives
    "administered_dose1_recip", -- Total number of people with at least one dose based on the jurisdiction where recipient lives
    "recip_administered", -- Total number of doses administered based on the jurisdiction where recipient lives
    "admin_per_100k_65plus", -- Total number of doses administered per 100,000 people ages 65+ 
    "admin_per_100k_18plus", -- Total number of doses administered per 100,000 people ages 18+
    "admin_per_100k_12plus", -- Total number of doses administered per 100,000 people ages 12+ 
    "admin_per_100k_5plus", -- Total number of doses administered per 100,000 people ages 5+
    "admin_per_100k", -- Total number of doses administered per 100,000 census population based on the jurisdiction where recipient lives
    "administered_pfizer", -- Total number of Pfizer-BioNTech doses administered
    "administered_65plus", -- Total number of doses administered to people ages 65+ based on the jurisdiction where administered
    "administered_18plus", -- Total number of doses administered to people ages 18+ based on the jurisdiction where administered
    "administered_12plus", -- Total number of doses administered to people ages 12+ based on the jurisdiction where administered
    "administered_5plus", -- Total number of doses administered to people ages 5+ based on the jurisdiction where administered
    "distributed_per_100k_18plus", -- Total number of doses delivered per 100,000 people ages 18+
    "distributed_per_100k_5plus", -- Total number of doses delivered per 100,000 people ages 5+ 
    "distributed_unk_manuf", -- Total number of doses delivered from other manufacturers
    "distributed_novavax", -- Total number of Novavax doses delivered
    "distributed_pfizer", -- Total number of Pfizer-BioNTech doses delivered
    "mmwr_week", -- The week of the epidemiologic year as defined by the Morbidity and Mortality Weekly Report (https://ndc.services.cdc.gov/wp-content/uploads/MMWR_week_overview.pdf). 
    "date", -- Date data are reported on CDC COVID Data Tracker (https://covid.cdc.gov/covid-data-tracker/#vaccinations)
    "bivalent_booster_18plus", -- Total number of people ages 18+ with an updated (bivalent) booster dose
    "administered", -- Total number of administered doses based on the jurisdiction (state/territory) where administered
    "administered_novavax", -- Total number of Novavax doses administered
    "distributed_per_100k_12plus", -- Total number of doses delivered per 100,000 people ages 12+ 
    "distributed_moderna", -- Total number of Moderna doses delivered 
    "distributed_janssen", -- Total number of J&J/Janssen doses delivered
    "distributed", -- Total number of delivered doses
    "location", -- Jurisdiction  (State/Territory/Federal Entity)
    "bivalent_booster_12plus", -- Total number of people ages 12+ with an updated (bivalent) booster dose
    "bivalent_booster_5plus_pop_pct", -- Percent of people ages 5+ with an updated (bivalent) booster dose
    "administered_bivalent", -- Total number of people who have received an updated (bivalent) booster dose since September 1, 2022
    "second_booster_moderna", -- Total number of people who have received a second booster dose manufactured by Moderna
    "second_booster_janssen", -- Total number of people who have received a second booster dose manufactured by J&J/Janssen
    "second_booster_50plus_vax_pct", -- Percentage of people ages 50+ with a first booster dose who received a second booster dose based on the jurisdiction where recipient lives
    "second_booster_50plus", -- Total number of people ages 50+ who have received a second booster dose based on the jurisdiction where recipient lives
    "second_booster", -- Total number of people who have received a second booster dose in the US
    "additional_doses_janssen", -- Total number of people with a completed primary series who have received a Janssen booster (or additional) dose.
    "additional_doses_50plus_vax_pct", -- Percent of people 50+ who completed a primary series and have received a booster (or additiuonal) dose.
    "additional_doses_12plus_vax_pct", -- Percent of people 12+ who completed a primary series and have received a booster (or additional) dose.
    "additional_doses_12plus", -- Total number of people 12+ who completed a primary series and have received a booster (or additional) dose.
    "additional_doses_5plus", -- Total number of people 5+ who completed a primary series and have received a booster (or additional) dose.
    "series_complete_pfizer_5plus", -- Total number of people 5+ who completed a Pfizer primary series 
    "series_complete_65pluspop", -- Percent of people 65+ with a completed primary series (have second dose of a two-dose vaccine or one dose of a single-dose vaccine) based on the jurisdiction where recipient lives
    "series_complete_18pluspop", -- Percent of people 18+ with a completed primary series (have second dose of a two-dose vaccine or one dose of a single-dose vaccine) based on the jurisdiction where recipient lives
    "series_complete_5plus", -- Total number of people 5+ with a completed primary series (have second dose of a two-dose vaccine or one dose of a single-dose vaccine) based on the jurisdiction where recipient lives
    "administered_dose1_recip_18pluspop_pct", -- Percent of population ages 18+ with at least one dose based on the jurisdiction where recipient lives
    "administered_janssen", -- Total number of J&J/Janssen doses administered
    "dist_per_100k", -- Delivered doses per 100,000 census population
    "bivalent_booster_18plus_pop_pct", -- Percent of people ages 18+ with an updated (bivalent) booster dose
    "administered_dose1_pop_pct", -- Percent of population with at least one dose based on the jurisdiction where recipient lives
    "administered_unk_manuf", -- Total number of administered doses from other manufacturers
    "administered_moderna", -- Total number of Moderna doses administered
    "administered_dose1_recip_12plus", -- Total number of people ages 12+ with at least one dose based on the jurisdiction where recipient lives
    "distributed_per_100k_65plus", -- Total number of doses delivered per 100,000 people ages 65+
    "additional_doses_50plus", -- Total number of people 50+ who completed a primary series and have received a booster (or additional) dose.
    "series_complete_pfizer_65plus", -- Total number of people 65+ who completed a Pfizer primary series
    "series_complete_pfizer", -- Total number of people who completed a Pfizer primary series
    "bivalent_booster_5plus", -- Total number of people ages 5+ with an updated (bivalent) booster dose
    "second_booster_pfizer", -- Total number of people who have received a second booster dose manufactured by Pfizer-BioNTech
    "series_complete_pfizer_18plus" -- Total number of people 18+ who completed a Pfizer primary series
FROM
    "cdc-gov/covid19-vaccinations-in-the-united-unsk-b7fc:latest"."covid19_vaccinations_in_the_united"
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 cdc-gov/covid19-vaccinations-in-the-united-unsk-b7fc with SQL in under 60 seconds.

This repository is an "external" repository. That means it's hosted elsewhere, in this case at data.cdc.gov. When you querycdc-gov/covid19-vaccinations-in-the-united-unsk-b7fc: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 data.cdc.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 \
  "cdc-gov/covid19-vaccinations-in-the-united-unsk-b7fc" \
  --handler-options '{
    "domain": "data.cdc.gov",
    "tables": {
        "covid19_vaccinations_in_the_united": "unsk-b7fc"
    }
}'

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, cdc-gov/covid19-vaccinations-in-the-united-unsk-b7fc is just another Postgres schema.