usaid-gov/data-on-food-consumption-in-zinder-and-maradi-in-qdau-cju2
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 data_on_food_consumption_in_zinder_and_maradi_in table in this repository, by referencing it like:

"usaid-gov/data-on-food-consumption-in-zinder-and-maradi-in-qdau-cju2:latest"."data_on_food_consumption_in_zinder_and_maradi_in"

or in a full query, like:

SELECT
    ":id", -- Socrata column ID
    "h606_23", -- parabolic antenna decoder did you purchase in the past 12 months
    "h602_10", -- iron do you own
    "f00m", -- MODULE F START MINUTE
    "f10_4", -- F10 4 Do you do anything to the water to make it safer to drink
    "h604_28", -- musical instrument what is the age
    "h401_064", -- none
    "h601_11", -- 151 CODE gas stove
    "h607_19", -- air conditioner split how much did you pay in the past 12 months
    "h604_22", -- tape player CD DVD what is the age
    "f18h", -- MODULE F FINISH HOUR
    "h605_32", -- video camera value in FCFA
    "h602_07", -- simple mattress do you own
    "h601_08", -- 148 CODE bed and mattress
    "a13in", -- INTERVIEWER NUMBER FOR FINAL VISIT
    "h601_20", -- 160 CODE simple radio radio cassette
    "h601_33", -- 173 CODE generator
    "h604_23", -- parabolic antenna decoder what is the age
    "h604_29", -- landline telephone what is the age
    "h604_12", -- oil stove what is the age
    "b21m", -- MODULE B FINISH MINUTE
    "h603_31", -- computer how many do you own
    "f17_10", -- F17 List five critical moments for handwashing
    "h402_058", -- Did you consume any in the past 12 months
    "h607_28", -- musical instrument how much did you pay in the past 12 months
    "h603_27", -- camera how many do you own
    "h606_22", -- tape player CD DVD did you purchase in the past 12 months
    "h607_14", -- moulinex food processor how much did you pay in the past 12 months
    "h602_34", -- wheelbarrow do you own
    "h603_03", -- chair how many do you own
    "f17_6", -- F17 List five critical moments for handwashing
    "a04a", -- A04a COMMUNE NAME
    "h601_16", -- 156 CODE improved stove
    "h607_11", -- gas stove how much did you pay in the past 12 months
    "h402_063", -- none
    "h604_32", -- video camera what is the age
    "h601_24", -- 164 CODE private car not used for business
    "h604_19", -- air conditioner split what is the age
    "h606_11", -- gas stove did you purchase in the past 12 months
    "f01a", -- F01A HOUSEHOLD NUMBER
    "h607_21", -- television set how much did you pay in the past 12 months
    "h601_30", -- 170 CODE portable telephone
    "a20y", -- A20 YEAR OF DATA ENTRY
    "h602_27", -- camera do you own
    "h603_07", -- simple mattress how many do you own
    "h605_24", -- private car not used for business value in FCFA
    "f15", -- F15 Observe presence of water at the place of handwashing
    "a19", -- A19 OFFICE EDITOR CODE
    "f17_9", -- F17 List five critical moments for handwashing
    "h602_08", -- bed and mattress do you own
    "h606_31", -- computer did you purchase in the past 12 months
    "h607_25", -- moped how much did you pay in the past 12 months
    "h403_062", -- How much did they cost FCFA
    "a14_5", -- A14 5 Line Number of Respondant to Household Questionnaire
    "h601_21", -- 161 CODE television set
    "f17_2", -- F17 List five critical moments for handwashing
    "h501", -- H501 What is ownership status of house
    "h606_04", -- table did you purchase in the past 12 months
    "h606_20", -- simple radio radio cassette did you purchase in the past 12 months
    "h602_29", -- landline telephone do you own
    "h601_29", -- 169 CODE landline telephone
    "h603_29", -- landline telephone how many do you own
    "h607_34", -- wheelbarrow how much did you pay in the past 12 months
    "h607_30", -- portable telephone how much did you pay in the past 12 months
    "c01b", -- C01B VILLAGE NUMBER
    "h603_22", -- tape player CD DVD how many do you own
    "h605_21", -- television set value in FCFA
    "h607_15", -- gas cooker how much did you pay in the past 12 months
    "h607_10", -- iron how much did you pay in the past 12 months
    "f17_4", -- F17 List five critical moments for handwashing
    "h602_21", -- television set do you own
    "f10_5", -- F10 5 Do you do anything to the water to make it safer to drink
    "h603_16", -- improved stove how many do you own
    "h601_06", -- 146 CODE simple bed
    "h604_21", -- television set what is the age
    "h604_02", -- living room set armchairs tables what is the age
    "h603_21", -- television set how many do you own
    "h403_056", -- How much did they cost FCFA
    "h605_29", -- landline telephone value in FCFA
    "h603_30", -- portable telephone how many do you own
    "h605_30", -- portable telephone value in FCFA
    "h605_31", -- computer value in FCFA
    "h601_32", -- 172 CODE video camera
    "h602_32", -- video camera do you own
    "h604_33", -- generator what is the age
    "h605_34", -- wheelbarrow value in FCFA
    "vn", -- A02 VILLAGE NUMBER
    "a13d", -- DAY OF FINAL VISIT
    "a14_3", -- A14 3 Total Eligible Farmers
    "a17", -- A17 SUPERVISOR CODE
    "a20", -- A20 DATA ENTRY OPERATOR CODE
    "a20d", -- A20 DAY OF DATA ENTRY
    "b00h", -- MODULE B START HOUR
    "b00m", -- MODULE B START MINUTE
    "f00h", -- MODULE F START HOUR
    "f01b", -- F01B VILLAGE NUMBER
    "f02", -- F02 LINE NUMBER OF RESPONDENT
    "f04", -- F04 What is main source of drinking water
    "f06", -- F06 How long does it take to go there get water and come back
    "f08", -- F08 In the last two weeks was water available from this source for an entire day or longer
    "f09", -- F09 Do you do anything to the water to make it safer to drink
    "f10_3", -- F10 3 Do you do anything to the water to make it safer to drink
    "f10_7", -- F10 7 Do you do anything to the water to make it safer to drink
    "f10_8", -- F10 8 Do you do anything to the water to make it safer to drink
    "f10_9", -- F10 9 Do you do anything to the water to make it safer to drink
    "f13", -- F13 How many households share the toilet facility
    "f17_3", -- F17 List five critical moments for handwashing
    "g00h", -- MODULE G START HOUR
    "c00m", -- MODULE C START MINUTE
    "c01a", -- C01A HOUSEHOLD NUMBER
    "c01c", -- C01C LINE NUMBER FROM HOUSEHOLD ROSTER COLUMN 6
    "h603_25", -- moped how many do you own
    "h603_28", -- musical instrument how many do you own
    "h605_23", -- parabolic antenna decoder value in FCFA
    "h605_17", -- refrigerator freezer value in FCFA
    "h601_25", -- 165 CODE moped
    "h601_23", -- 163 CODE parabolic antenna decoder
    "h606_13", -- sewing machine did you purchase in the past 12 months
    "h603_18", -- fan how many do you own
    "h602_30", -- portable telephone do you own
    "h402_057", -- Did you consume any in the past 12 months
    "h602_17", -- refrigerator freezer do you own
    "h602_24", -- private car not used for business do you own
    "h603_32", -- video camera how many do you own
    "h602_22", -- tape player CD DVD do you own
    "h606_29", -- landline telephone did you purchase in the past 12 months
    "h602_11", -- gas stove do you own
    "h601_27", -- 167 CODE camera
    "h601_31", -- 171 CODE computer
    "h602_12", -- oil stove do you own
    "h607_26", -- bicycle how much did you pay in the past 12 months
    "h605_20", -- simple radio radio cassette value in FCFA
    "h607_05", -- dining table and chairs how much did you pay in the past 12 months
    "h601_26", -- 166 CODE bicycle
    "h607_06", -- simple bed how much did you pay in the past 12 months
    "h504a", -- If you rented this dwelling today how much rent would you receive Periodicity
    "h401_058", -- 428 CODE for construction materials or large masonry repairs cement bricks etc
    "b21h", -- MODULE B FINISH HOUR
    "f17_8", -- F17 List five critical moments for handwashing
    "h601_01", -- 141 CODE armchair
    "h603_19", -- air conditioner split how many do you own
    "h603_01", -- armchair how many do you own
    "h402_059", -- Did you consume any in the past 12 months
    "h601_34", -- 174 CODE wheelbarrow
    "h602_01", -- armchair do you own
    "h605_14", -- moulinex food processor value in FCFA
    "h602_04", -- table do you own
    "h402_062", -- Did you consume any in the past 12 months
    "f14", -- F14 Show me where members of your household most often wash their hands
    "h601_07", -- 147 CODE simple mattress
    "h602_19", -- air conditioner split do you own
    "a18", -- A18 FIELD COORDINATOR CODE
    "h607_32", -- video camera how much did you pay in the past 12 months
    "h603_04", -- table how many do you own
    "h607_20", -- simple radio radio cassette how much did you pay in the past 12 months
    "h605_19", -- air conditioner split value in FCFA
    "h605_18", -- fan value in FCFA
    "h604_05", -- dining table and chairs what is the age
    "h401_062", -- 432 CODE for expenses for studies and architecture connection expenses electricity water phone
    "f10_1", -- F10 1 Do you do anything to the water to make it safer to drink
    "f16", -- F16 Observe presence of soap detergent or other cleansing agent at the place for handwashing
    "h601_22", -- 162 CODE tape player CD DVD
    "h603_05", -- dining table and chairs how many do you own
    "h604_16", -- improved stove what is the age
    "h606_15", -- gas cooker did you purchase in the past 12 months
    "h601_15", -- 155 CODE gas cooker
    "h607_04", -- table how much did you pay in the past 12 months
    "h402_056", -- Did you consume any in the past 12 months
    "h601_13", -- 153 CODE sewing machine
    "h607_22", -- tape player CD DVD how much did you pay in the past 12 months
    "h607_27", -- camera how much did you pay in the past 12 months
    "f07", -- F07 Is water available from this source all year round
    "h603_09", -- other furniture how many do you own
    "h601_28", -- 168 CODE musical instrument
    "f10_6", -- F10 6 Do you do anything to the water to make it safer to drink
    "h603_14", -- moulinex food processor how many do you own
    "h602_14", -- moulinex food processor do you own
    "h607_13", -- sewing machine how much did you pay in the past 12 months
    "h605_13", -- sewing machine value in FCFA
    "h603_12", -- oil stove how many do you own
    "h601_12", -- 152 CODE oil stove
    "h604_11", -- gas stove what is the age
    "h605_10", -- iron value in FCFA
    "h603_10", -- iron how many do you own
    "h607_09", -- other furniture how much did you pay in the past 12 months
    "h604_09", -- other furniture what is the age
    "h607_08", -- bed and mattress how much did you pay in the past 12 months
    "h605_08", -- bed and mattress value in FCFA
    "h607_07", -- simple mattress how much did you pay in the past 12 months
    "h605_07", -- simple mattress value in FCFA
    "h604_07", -- simple mattress what is the age
    "h605_06", -- simple bed value in FCFA
    "h603_06", -- simple bed how many do you own
    "h605_05", -- dining table and chairs value in FCFA
    "h601_05", -- 145 CODE dining table and chairs
    "h605_04", -- table value in FCFA
    "h604_04", -- table what is the age
    "h601_04", -- 144 CODE table
    "h607_03", -- chair how much did you pay in the past 12 months
    "h605_03", -- chair value in FCFA
    "h604_03", -- chair what is the age
    "h602_03", -- chair do you own
    "h605_01", -- armchair value in FCFA
    "h604_01", -- armchair what is the age
    "h505b", -- How much do you pay to rent this dwelling Amount in FCFA
    "h503", -- How many years ago was this house built How old is it Age in years
    "h502", -- If you sold this dwelling today how much would you receive for it Amount in FCFA
    "h403_064", -- none
    "h403_063", -- none
    "h403_061", -- How much did they cost FCFA
    "h401_061", -- 431 CODE for expenses to acquire land or a dwelling
    "h403_060", -- How much did they cost FCFA
    "h401_060", -- 430 CODE for labor and expenses for construction large repairs to the dwelling masonry electricity etc
    "h403_059", -- How much did they cost FCFA
    "h403_058", -- How much did they cost FCFA
    "h401_057", -- 420 CODE for expenses to move house
    "id",
    "h605_12", -- oil stove value in FCFA
    "g00m", -- MODULE G START MINUTE
    "h605_33", -- generator value in FCFA
    "h601_10", -- 150 CODE iron
    "h605_15", -- gas cooker value in FCFA
    "h605_11", -- gas stove value in FCFA
    "h607_29", -- landline telephone how much did you pay in the past 12 months
    "a14", -- A14 FINAL OUTCOME OF INTERVIEW
    "h607_23", -- parabolic antenna decoder how much did you pay in the past 12 months
    "h602_06", -- simple bed do you own
    "h403_057", -- How much did they cost FCFA
    "h505a", -- How much do you pay to rent this dwelling Periodicity
    "h603_26", -- bicycle how many do you own
    "h604_08", -- bed and mattress what is the age
    "h602_31", -- computer do you own
    "c00h", -- MODULE C START HOUR
    "h601_17", -- 157 CODE refrigerator freezer
    "h601_14", -- 154 CODE moulinex food processor
    "h601_19", -- 159 CODE air conditioner split
    "h604_26", -- bicycle what is the age
    "g70m", -- MODULE G FINISH MINUTE
    "h606_12", -- oil stove did you purchase in the past 12 months
    "c02", -- C02 Was yesterday an unusual or special day
    "h601_03", -- 143 CODE chair
    "h604_24", -- private car not used for business what is the age
    "h604_17", -- refrigerator freezer what is the age
    "h605_09", -- other furniture value in FCFA
    "h601_09", -- 149 CODE other furniture
    "h606_30", -- portable telephone did you purchase in the past 12 months
    "a13y", -- YEAR OF FINAL VISIT
    "h606_03", -- chair did you purchase in the past 12 months
    "h606_10", -- iron did you purchase in the past 12 months
    "h604_31", -- computer what is the age
    "h402_061", -- Did you consume any in the past 12 months
    "h606_25", -- moped did you purchase in the past 12 months
    "h602_16", -- improved stove do you own
    "h605_28", -- musical instrument value in FCFA
    "h607_17", -- refrigerator freezer how much did you pay in the past 12 months
    "f17_5", -- F17 List five critical moments for handwashing
    "f10_2", -- F10 2 Do you do anything to the water to make it safer to drink
    "h606_02", -- living room set armchairs tables did you purchase in the past 12 months
    "h602_25", -- moped do you own
    "h606_34", -- wheelbarrow did you purchase in the past 12 months
    "a20m", -- A20 MONTH OF DATA ENTRY
    "h606_14", -- moulinex food processor did you purchase in the past 12 months
    "h601_02", -- 142 CODE living room set armchairs tables
    "h606_16", -- improved stove did you purchase in the past 12 months
    "h604_30", -- portable telephone what is the age
    "h607_12", -- oil stove how much did you pay in the past 12 months
    "h401_063", -- none
    "h603_15", -- gas cooker how many do you own
    "h603_13", -- sewing machine how many do you own
    "h605_16", -- improved stove value in FCFA
    "hh", -- A01 HOUSEHOLD NUMBER
    "g70h", -- MODULE G FINISH HOUR
    "h606_33", -- generator did you purchase in the past 12 months
    "h602_26", -- bicycle do you own
    "h603_23", -- parabolic antenna decoder how many do you own
    "h606_17", -- refrigerator freezer did you purchase in the past 12 months
    "c06", -- C06 Any vegetables
    "h607_18", -- fan how much did you pay in the past 12 months
    "h604_10", -- iron what is the age
    "h606_18", -- fan did you purchase in the past 12 months
    "h606_01", -- armchair did you purchase in the past 12 months
    "h604_18", -- fan what is the age
    "h607_02", -- living room set armchairs tables how much did you pay in the past 12 months
    "f17_7", -- F17 List five critical moments for handwashing
    "h604_20", -- simple radio radio cassette what is the age
    "h401_056", -- 419 CODE for expenses for pilgramage
    "member_id", -- Household member ID for merging with other modules
    "f17_1", -- F17 List five critical moments for handwashing
    "c04", -- C04 Any foods made from wheat maize rice sorghum or millet
    "h606_21", -- television set did you purchase in the past 12 months
    "h606_32", -- video camera did you purchase in the past 12 months
    "h602_05", -- dining table and chairs do you own
    "h603_20", -- simple radio radio cassette how many do you own
    "h602_15", -- gas cooker do you own
    "h606_19", -- air conditioner split did you purchase in the past 12 months
    "h601_18", -- 158 CODE fan
    "h602_09", -- other furniture do you own
    "h607_33", -- generator how much did you pay in the past 12 months
    "h606_09", -- other furniture did you purchase in the past 12 months
    "h402_064", -- none
    "h604_14", -- moulinex food processor what is the age
    "a04b", -- A04b DEPARTMENT NAME
    "h605_02", -- living room set armchairs tables value in FCFA
    "c05", -- C05 Any foods made from roots or tubers
    "h604_25", -- moped what is the age
    "h605_27", -- camera value in FCFA
    "h607_01", -- armchair how much did you pay in the past 12 months
    "h606_08", -- bed and mattress did you purchase in the past 12 months
    "a13m", -- MONTH OF FINAL VISIT
    "h603_02", -- living room set armchairs tables how many do you own
    "h401_059", -- 429 CODE for other construction or large repair materials tile wood planks slats etc
    "h504b", -- If you rented this dwelling today how much rent would you receive Amount in FCFA
    "h604_34", -- wheelbarrow what is the age
    "f05", -- F05 Where is that water source located
    "h606_06", -- simple bed did you purchase in the past 12 months
    "h604_06", -- simple bed what is the age
    "f18m", -- MODULE F FINISH MINUTE
    "h606_24", -- private car not used for business did you purchase in the past 12 months
    "a14_1", -- A14 1 Total Number of Visits
    "h604_13", -- sewing machine what is the age
    "h606_05", -- dining table and chairs did you purchase in the past 12 months
    "h603_08", -- bed and mattress how many do you own
    "h604_15", -- gas cooker what is the age
    "f11", -- F11 What kind of toilet facility do members of your household usually use
    "h607_16", -- improved stove how much did you pay in the past 12 months
    "h606_07", -- simple mattress did you purchase in the past 12 months
    "h602_13", -- sewing machine do you own
    "h603_17", -- refrigerator freezer how many do you own
    "h602_20", -- simple radio radio cassette do you own
    "h603_24", -- private car not used for business how many do you own
    "reg", -- A05 REGION
    "f12", -- F12 Does your household share the toilet facility with other households
    "h602_33", -- generator do you own
    "h607_24", -- private car not used for business how much did you pay in the past 12 months
    "h605_25", -- moped value in FCFA
    "h602_28", -- musical instrument do you own
    "h603_33", -- generator how many do you own
    "h605_26", -- bicycle value in FCFA
    "h604_27", -- camera what is the age
    "h606_28", -- musical instrument did you purchase in the past 12 months
    "h606_27", -- camera did you purchase in the past 12 months
    "h605_22", -- tape player CD DVD value in FCFA
    "a14_2", -- A14 2 Total Women 15 49 yrs
    "h607_31", -- computer how much did you pay in the past 12 months
    "h602_02", -- living room set armchairs tables do you own
    "h606_26", -- bicycle did you purchase in the past 12 months
    "h602_23", -- parabolic antenna decoder do you own
    "a14_4", -- A14 4 Total Children Under 5
    "h603_34", -- wheelbarrow how many do you own
    "h602_18", -- fan do you own
    "h402_060", -- Did you consume any in the past 12 months
    "h603_11" -- gas stove how many do you own
FROM
    "usaid-gov/data-on-food-consumption-in-zinder-and-maradi-in-qdau-cju2:latest"."data_on_food_consumption_in_zinder_and_maradi_in"
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 usaid-gov/data-on-food-consumption-in-zinder-and-maradi-in-qdau-cju2 with SQL in under 60 seconds.

This repository is an "external" repository. That means it's hosted elsewhere, in this case at data.usaid.gov. When you queryusaid-gov/data-on-food-consumption-in-zinder-and-maradi-in-qdau-cju2: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.usaid.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 \
  "usaid-gov/data-on-food-consumption-in-zinder-and-maradi-in-qdau-cju2" \
  --handler-options '{
    "domain": "data.usaid.gov",
    "tables": {
        "data_on_food_consumption_in_zinder_and_maradi_in": "qdau-cju2"
    }
}'

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, usaid-gov/data-on-food-consumption-in-zinder-and-maradi-in-qdau-cju2 is just another Postgres schema.