usaid-gov/feed-the-future-uganda-populationbased-survey-eju3-igzd
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 feed_the_future_uganda_populationbased_survey table in this repository, by referencing it like:

"usaid-gov/feed-the-future-uganda-populationbased-survey-eju3-igzd:latest"."feed_the_future_uganda_populationbased_survey"

or in a full query, like:

SELECT
    ":id", -- Socrata column ID
    "c04_e", -- g3 03e Decide to sell Fish Pond
    "f02", -- ZIF No food freq
    "zia_cluster_cd", -- ZIA Cluster cd
    "g04_b", -- g5 04b Input to buy avoid think poorly
    "c01b_d", -- g3 1b d Household owns Chicken
    "a06", -- Household type derived by module C data
    "c09_f", -- g3 06f Decide to buy new Farm Equip non mech
    "c05_d", -- g3 04d Decide to give away Chicken
    "c01a_n", -- g3 1a n Anyone Owns Transportation
    "urbrur", -- Urban Rural 1 urban 2 rural
    "c01b_c", -- g3 1b c Household owns Small Livestock
    "e07_f", -- g4 05f Active member of any trade and business association
    "c06_c", -- g3 05c Decide to rent out Small Livestock
    "b03_6", -- g2 03f Input for spend money from Fishing or fishpond culture
    "c06_e", -- g3 05e Decide to rent out Fish Pond
    "weaiwght", -- Gender specific WEAI weight
    "c01b_n", -- g3 1b n Household owns Transportation
    "g03_c", -- g5 03c Crops to grow avoid trouble
    "c06_g", -- g3 05g Decide to rent out Farm Equip mech
    "feelinputdecagr", -- Inadequacy in input in productive decisions
    "c04_c", -- g3 03c Decide to sell Small Livestock
    "c11_c", -- g3 08c Decide to borrow from Formal lender
    "zia_district_cd", -- ZIA District cd
    "wt_weai_1", -- WEAI weight for Males
    "b03_4", -- g2 03d Input for spend money from Non farm
    "c02_a", -- g3 02a Owns most of Agriculture
    "ci_gap", -- Individual empowerment gap for women without parity
    "c04_g", -- g3 03g Decide to sell Farm Equip mech
    "credjanydec_any", -- Inadequacy in access to and decisions on credit
    "b03_2", -- g2 03b Input for spend money from Cash crop farming
    "c02_i", -- g3 02i Owns most of House
    "b02_4", -- g2 02d Input for Non farm
    "c11_b", -- g3 08b Decide to borrow from Informal lender
    "c01b_a", -- g3 1b a Household owns Agriculture
    "c01b_m", -- g3 1b m Household owns Other Land
    "c10_d", -- g3 07d Taken any loans from Friends
    "g04_c", -- g5 04c Crops to grow avoid think poorly
    "g01_c", -- g5 01c Crops to grow whose Decision
    "e07_j", -- g4 05j Active member of any other womens group
    "g404_h", -- g4 04h Is there a local government
    "zia_region_cd", -- ZIA Region cd
    "c01a_m", -- g3 1a m Anyone Owns Other Land
    "b02_1", -- g2 02a Input for Food crop farming
    "c01b_e", -- g3 1b e Household owns Fish Pond
    "d05", -- ZID Toilet tp
    "c12_b", -- g3 09b Decide how to use money from Informal lender
    "c05_n", -- g3 04n Decide to give away Transportation
    "c05_m", -- g3 04m Decide to give away Other Land
    "g01_h", -- g5 01h Major HH Exp whose Decision NOT in STATA
    "c01a_c", -- g3 1a c Anyone Owns Small Livestock
    "jown_count", -- Inadequacy in ownership of assets
    "c02_d", -- g3 02d Owns most of Chicken
    "c05_e", -- g3 04e Decide to give away Fish Pond
    "c05_g", -- g3 04g Decide to give away Farm Equip mech
    "g404_f", -- g4 04f Is there a trade and business association
    "c11_a", -- g3 08a Decide to borrow from NGO
    "c06_i", -- g3 05i Decide to rent out House
    "b01_2", -- g2 01b Participate in Cash crop farming
    "c06_d", -- g3 05d Decide to rent out Chicken
    "c06_n", -- g3 05n Decide to rent out Transportation
    "g404_g", -- g4 04g Is there a civic or charitable group
    "c01b_h", -- g3 1b h Household owns Nonfarm Equip
    "c09_m", -- g3 06m Decide to buy new Other Land
    "c02_g", -- g3 02g Owns most of Farm Equip mech
    "c04_d", -- g3 03d Decide to sell Chicken
    "g02_g", -- g5 02g Wage personal Decision
    "e02_c", -- g4 03 Speak in public to protest
    "c09_g", -- g3 06g Decide to buy new Farm Equip mech
    "g404_c", -- g4 04c Is there a forest users group
    "g02_c", -- g5 02c Crops to grow personal Decision
    "g404_j", -- g4 04j Is there a other womens group
    "c04_i", -- g3 03i Decide to sell House
    "c10_a", -- g3 07a Taken any loans from NGO
    "c02_b", -- g3 02b Owns most of Large Livestock
    "e07_a", -- g4 05a Active member of any agricultural livestock fisheries producer group
    "e07_c", -- g4 05c Active member of any forest users group
    "f06", -- ZIF Whl day no eat freq
    "c06_k", -- g3 05k Decide to rent out Small Durable
    "c09_e", -- g3 06e Decide to buy new Fish Pond
    "c09_k", -- g3 06k Decide to buy new Small Durable
    "groupmember_any", -- Inadequacy in group member
    "g404_b", -- g4 04b Is there a water users group
    "e07_k", -- g4 05k Active member of any other
    "a05", -- ZIG1 Sex g1
    "e07_h", -- g4 05h Active member of any local government
    "c09_h", -- g3 06h Decide to buy new Nonfarm Equip
    "c04_l", -- g3 03l Decide to sell Cell Phone
    "c12_c", -- g3 09c Decide how to use money from Formal lender
    "g05_d", -- g5 05d Market reflect own value
    "g404_d", -- g4 04d Is there a credit or microfinance group
    "c02_l", -- g3 02l Owns most of Cell Phone
    "g04_d", -- g5 04d Market avoid think poorly
    "e02_a", -- g4 01 Speak in public to help decide
    "c12_a", -- g3 09a Decide how to use money from NGO
    "d01", -- ZID Roof tp
    "g404_a", -- g4 04a Is there a agricultural livestock fisheries producer group
    "c01a_f", -- g3 1a f Anyone Owns Farm Equip non mech
    "pbs_id", -- PBS ID
    "b02_3", -- g2 02c Input for Livestock raising
    "g02_d", -- g5 02d Market personal Decision
    "c05_h", -- g3 04h Decide to give away Nonfarm Equip
    "e07_e", -- g4 05e Active member of any mutual felp or insurance group
    "f04", -- ZIF Sleep hungry freq
    "g404_k", -- g4 04k Is there a other
    "c02_j", -- g3 02j Owns most of Large Durable
    "rp", -- Average empowerment gap for women without parity
    "a04", -- Primary Secondary
    "c01b_b", -- g3 1b b Household owns Large Livestock
    "c09_a", -- g3 06a Decide to buy new Agriculture
    "e07_b", -- g4 05b Active member of any water users group
    "c11_e", -- g3 08e Decide to borrow from Group
    "f04b", -- g6 02 How satisfied scale of 1 10
    "c05_f", -- g3 04f Decide to give away Farm Equip non mech
    "d07", -- ZID Electr yn
    "b01_5", -- g2 01e Participate in Wage and salary employment
    "b03_5", -- g2 03e Input for spend money from Wage and salary employment
    "ci", -- Individual disempowerment score
    "speakpublic_any", -- Inadequacy in speaking in public
    "c02_h", -- g3 02h Owns most of Nonfarm Equip
    "b01_4", -- g2 01d Participate in Non farm
    "c01a_j", -- g3 1a j Anyone Owns Large Durable
    "g02_e", -- g5 02e Livestock raising personal Decision
    "g02_h", -- g5 02h Major HH Exp personal Decision NOT in STATA
    "e02_b", -- g4 02 Speak in public to ensure proper wages
    "c06_f", -- g3 05f Decide to rent out Farm Equip non mech
    "d06", -- ZID Drink water src
    "g05_c", -- g5 05c Crops to grow reflect own value
    "e07_d", -- g4 05d Active member of any credit or microfinance group
    "c01a_l", -- g3 1a l Anyone Owns Cell Phone
    "c09_i", -- g3 06i Decide to buy new House
    "b02_6", -- g2 02f Input for Fishing or fishpond culture
    "c10_c", -- g3 07c Taken any loans from Formal lender
    "c06_j", -- g3 05j Decide to rent out Large Durable
    "b02_2", -- g2 02b Input for Cash crop farming
    "f01", -- ZIF No food yn
    "c01a_a", -- g3 1a a Anyone Owns Agriculture
    "raiprod_any", -- Inadequacy in autonomy in production
    "b03_1", -- g2 03a Input for spend money from Food crop farming
    "b01_3", -- g2 01c Participate in Livestock raising
    "aa", -- Average empowerment score of women not yet empowered
    "c12_e", -- g3 09e Decide how to use money from Group
    "modf_missing", -- Missing all elements from F
    "c05_j", -- g3 04j Decide to give away Large Durable
    "g02_i", -- g5 02i Minor HH Exp personal Decision is g02 h in STATA
    "g404_e", -- g4 04e Is there a mutual felp or insurance group
    "g04_e", -- g5 04e Livestock raising avoid think poorly
    "b03_3", -- g2 03c Input for spend money from Livestock raising
    "g05_b", -- g5 05b Input to buy reflect own value
    "b01_1", -- g2 01a Participate in Food crop farming
    "b02_5", -- g2 02e Input for Wage and salary employment
    "c01b_f", -- g3 1b f Household owns Farm Equip non mech
    "c01b_k", -- g3 1b k Household owns Small Durable
    "c02_c", -- g3 02c Owns most of Small Livestock
    "c02_m", -- g3 02m Owns most of Other Land
    "c04_a", -- g3 03a Decide to sell Agriculture
    "c05_a", -- g3 04a Decide to give away Agriculture
    "c05_b", -- g3 04b Decide to give away Large Livestock
    "c05_c", -- g3 04c Decide to give away Small Livestock
    "c06_a", -- g3 05a Decide to rent out Agriculture
    "c09_b", -- g3 06b Decide to buy new Large Livestock
    "c11_d", -- g3 08d Decide to borrow from Friends
    "a12", -- ZIG1 Int alone
    "g01_b", -- g5 01b Input to buy whose Decision
    "g01_d", -- g5 01d Market whose Decision
    "g01_i", -- g5 01i Minor HH Exp whose Decision is g01 h in STATA
    "g03_b", -- g5 03b Input to buy avoid trouble
    "d04", -- ZID Rooms num
    "wt_weai_2", -- WEAI weight for Females
    "jrightanyagr", -- Inadequacy in purchase sale or transfer of assets
    "ch_20p", -- Individual indicator that woman has not achieved empowerment
    "ci_above", -- Individual indicator that woman lacks gender parity
    "he", -- of women empowered
    "c01a_b", -- g3 1a b Anyone Owns Large Livestock
    "c01a_k", -- g3 1a k Anyone Owns Small Durable
    "c01b_i", -- g3 1b i Household owns House
    "c01b_l", -- g3 1b l Household owns Cell Phone
    "c02_f", -- g3 02f Owns most of Farm Equip non mech
    "c02_k", -- g3 02k Owns most of Small Durable
    "c02_n", -- g3 02n Owns most of Transportation
    "c06_l", -- g3 05l Decide to rent out Cell Phone
    "c12_d", -- g3 09d Decide how to use money from Friends
    "g01_e", -- g5 01e Livestock raising whose Decision
    "d03", -- ZID Ext wall tp
    "c06_h", -- g3 05h Decide to rent out Nonfarm Equip
    "d08", -- ZID Fuel src
    "c04_j", -- g3 03j Decide to sell Large Durable
    "ea_20p", -- Population value of 5DE
    "gpi", -- Population value of GPI
    "c09_j", -- g3 06j Decide to buy new Large Durable
    "c01a_e", -- g3 1a e Anyone Owns Fish Pond
    "leisuretime", -- Inadequacy in leisure
    "c01b_j", -- g3 1b j Household owns Large Durable
    "c01a_h", -- g3 1a h Anyone Owns Nonfarm Equip
    "e07_i", -- g4 05i Active member of any religious group
    "incdec_count", -- Inadequacy in control over use of income
    "c04_m", -- g3 03m Decide to sell Other Land
    "country", -- ZIG1 Country
    "g03_e", -- g5 03e Livestock raising avoid trouble
    "g02_b", -- g5 02b Input to buy personal Decision
    "c10_e", -- g3 07e Taken any loans from Group
    "c01a_d", -- g3 1a d Anyone Owns Chicken
    "c05_i", -- g3 04i Decide to give away House
    "b01_6", -- g2 01f Participate in Fishing or fishpond culture
    "c05_l", -- g3 04l Decide to give away Cell Phone
    "c10_b", -- g3 07b Taken any loans from Informal lender
    "c01a_i", -- g3 1a i Anyone Owns House
    "f05", -- ZIF Whl day no eat yn
    "c02_e", -- g3 02e Owns most of Fish Pond
    "g404_i", -- g4 04i Is there a religious group
    "npoor_z105", -- Inadequacy in workload
    "c09_d", -- g3 06d Decide to buy new Chicken
    "g03_d", -- g5 03d Market avoid trouble
    "e07_g", -- g4 05g Active member of any civic or charitable group
    "c04_h", -- g3 03h Decide to sell Nonfarm Equip
    "c06_b", -- g3 05b Decide to rent out Large Livestock
    "c04_n", -- g3 03n Decide to sell Transportation
    "c09_l", -- g3 06l Decide to buy new Cell Phone
    "f03", -- ZIF Sleep hungry yn
    "modd_missing", -- Missing all elements from D
    "g05_e", -- g5 05e Livestock raising reflect own value
    "c04_f", -- g3 03f Decide to sell Farm Equip non mech
    "c06_m", -- g3 05m Decide to rent out Other Land
    "c01b_g", -- g3 1b g Household owns Farm Equip mech
    "c04_b", -- g3 03b Decide to sell Large Livestock
    "hp", -- of women with gender parity
    "c09_c", -- g3 06c Decide to buy new Small Livestock
    "c09_n", -- g3 06n Decide to buy new Transportation
    "zia_int_outcome", -- ZIA Int outcome
    "c04_k", -- g3 03k Decide to sell Small Durable
    "d02", -- ZID Floor tp
    "g01_g", -- g5 01g Wage whose Decision
    "c05_k", -- g3 04k Decide to give away Small Durable
    "c01a_g" -- g3 1a g Anyone Owns Farm Equip mech
FROM
    "usaid-gov/feed-the-future-uganda-populationbased-survey-eju3-igzd:latest"."feed_the_future_uganda_populationbased_survey"
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/feed-the-future-uganda-populationbased-survey-eju3-igzd 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/feed-the-future-uganda-populationbased-survey-eju3-igzd: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/feed-the-future-uganda-populationbased-survey-eju3-igzd" \
  --handler-options '{
    "domain": "data.usaid.gov",
    "tables": {
        "feed_the_future_uganda_populationbased_survey": "eju3-igzd"
    }
}'

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/feed-the-future-uganda-populationbased-survey-eju3-igzd is just another Postgres schema.