healthdata-gov/hhs-covid19-monthly-outcome-survey-wave-07-6wrq-qkxb
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 hhs_covid19_monthly_outcome_survey_wave_07 table in this repository, by referencing it like:

"healthdata-gov/hhs-covid19-monthly-outcome-survey-wave-07-6wrq-qkxb:latest"."hhs_covid19_monthly_outcome_survey_wave_07"

or in a full query, like:

SELECT
    ":id", -- Socrata column ID
    "cv2_4_senses", -- CV2_4_Senses: Decreased sense of smell and taste
    "weights", -- Weights: Weights
    "politicalideo", -- politicalideo: Political ideology
    "race", -- race: Race
    "ppreg4", -- ppreg4: U.S. Census Region 4
    "ppgender", -- ppgender: Gender
    "ppeducat", -- ppeducat: Education -- categorical
    "cv14_4", -- CV14_4: Washed or sanitized hands frequently
    "cv14_1", -- CV14_1: Kept social distance from others
    "cv12_3_depressed", -- CV12_3_Depressed: Self feeling down, depressed, or hopeless
    "cv3_4_senses", -- CV3_4_Senses: Decreased sense of smell and taste
    "cv11_2_worrying", -- CV11_2_Worrying: Household not able to stop worrying
    "cv11_1_nervous", -- CV11_1_Nervous: Household nervous, anxious, on edge
    "cv10_2_home_schooled", -- CV10_2_Home_schooled: home schooled children
    "cv9_3_cares", -- CV9_3_CARES: CARES Act check
    "cv8c", -- CV8c: Current insurance coverage
    "cv7b", -- CV7b: Healthcare worker
    "cv6c_rec", -- CV6c_Rec: Current employment status
    "cv6b", -- CV6b: Employment status changed since COVID pandemic
    "cv5_5_video", -- CV5_5_Video: Consulted with healthcare provider using video chat
    "cv8b", -- CV8b: Insurance changed since COVID pandemic
    "cv4_3_no", -- CV4_3_No: No COVID diagnosis
    "cv4_2_family", -- CV4_2_Family: Family COVID diagnosis
    "cv4_1_self", -- CV4_1_Self: Self COVID diagnosis
    "cv3_3_breath", -- CV3_3_Breath: Shortness of breath
    "cv3_2_cough", -- CV3_2_Cough: Dry cough
    "cv3_1_fever", -- CV3_1_Fever: Fever
    "cam6_vaccwait", -- CAM6_VaccWait: Wait to get vaccinated
    "cv2_5_flu", -- CV2_5_Flu: Flu symptoms
    "cv2_1_fever", -- CV2_1_Fever: Fever
    "cv2_2_cough", -- CV2_2_Cough: Dry cough
    "cv10_3_work_from_home", -- CV10_3_Work_from_home: worked from home more than before the pandemic
    "cv15", -- CV15: Wash hands yesterday
    "cv5_7_none", -- CV5_7_None: None of the above
    "cv1", -- CV1: Physical health
    "cv2_3_breath", -- CV2_3_Breath: Shortness of breath
    "cv9_2_covid_enhanced", -- CV9_2_COVID_enhanced: COVID related enhanced unemployment benefits
    "cam7_vaccbel_5", -- CAM7_VaccBel_5: Worried side effects
    "cv10_1_children_home", -- CV10_1_Children_home: kept children home from school
    "cv9_4_none", -- CV9_4_None: None
    "cam7_vaccbel_1", -- CAM7_VaccBel_1: COVID vaccine likelihood
    "cam5a_vacclike", -- CAM5a_VaccLike: Vaccine Likelihood
    "public_id", -- public_id: Unique Identifier
    "cv9_1_unemployment_benefits", -- CV9_1_Unemployment_benefits: Unemployment benefits
    "cv5_6_chat", -- CV5_6_Chat: Consulted with healthcare provider using chat, text, or email
    "income", -- income: Income
    "cv12_1_nervous", -- CV12_1_Nervous: Self nervous, anxious, on edge
    "cv13", -- CV13: Time spent at home
    "cv5_4_phone", -- CV5_4_Phone: Consulted with healthcare provider over the phone
    "cv12_4_little_interest", -- CV12_4_Little_interest: Self little interest or pleasure
    "cv11_4_little_interest", -- CV11_4_Little_interest: Household little interest or pleasure
    "cv5_2_urgent_care", -- CV5_2_Urgent_care: Urgent care facility
    "cv14_5", -- CV14_5: None of the above
    "cv14_2", -- CV14_2: Wore a mask
    "cam11_par2", -- CAM11_par2: Once they are eligible, how soon will your child(ren) under the age
    "cv7a", -- CV7a: Essential worker
    "cv10_4_return_to_work", -- CV10_4_Return_to_work: returned to work after temporary closure
    "cv3_5_flu", -- CV3_5_Flu: Flu symptoms
    "cv16", -- CV16: Wash hands time
    "cv14_3", -- CV14_3: Avoided enclosed spaces
    "cam11_par1", -- CAM11_par1: If you have any children ages 12-17 select their vaccination status
    "agecat", -- agecat: Age category
    "cam7_vaccbel_2", -- CAM7_VaccBel_2: Worried COVID from vaccine
    "cv12_2_worrying", -- CV12_2_Worrying: Self not able to stop worrying
    "cv5_1_hospital", -- CV5_1_Hospital: Hospital or emergency room
    "cam5_vaccuptake", -- CAM5_VaccUptake: Vaccine Uptake
    "cv11_3_depressed", -- CV11_3_Depressed: Household feeling down, depressed, or hopeless
    "cv8a", -- CV8a: Insurance coverage prior to COVID pandemic
    "cam7_vaccbel_3", -- CAM7_VaccBel_3: Immunity from exposure
    "cv5_3_doctor", -- CV5_3_Doctor: Visited doctor's office
    "cam7_vaccbel_6", -- CAM7_VaccBel_6: Worse side effects
    "xurbanicity", -- xurbanicity: Urbanicity
    "parent", -- parent: Parent
    "cv10_5_none", -- CV10_5_None: None
    "cv6a_rec" -- CV6a_Rec: Employment status prior to COVID pandemic
FROM
    "healthdata-gov/hhs-covid19-monthly-outcome-survey-wave-07-6wrq-qkxb:latest"."hhs_covid19_monthly_outcome_survey_wave_07"
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 healthdata-gov/hhs-covid19-monthly-outcome-survey-wave-07-6wrq-qkxb 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 healthdata-gov/hhs-covid19-monthly-outcome-survey-wave-07-6wrq-qkxb: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 healthdata-gov/hhs-covid19-monthly-outcome-survey-wave-07-6wrq-qkxb

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 healthdata-gov/hhs-covid19-monthly-outcome-survey-wave-07-6wrq-qkxb:latest

This will download all the objects for the latest tag of healthdata-gov/hhs-covid19-monthly-outcome-survey-wave-07-6wrq-qkxb 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 healthdata-gov/hhs-covid19-monthly-outcome-survey-wave-07-6wrq-qkxb: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 healthdata-gov/hhs-covid19-monthly-outcome-survey-wave-07-6wrq-qkxb: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, healthdata-gov/hhs-covid19-monthly-outcome-survey-wave-07-6wrq-qkxb is just another Postgres schema.

Related Documentation:

Loading...