• agriculture
  • consumption
  • feed the future
  • food insecurity
  • hunger
  • + 4

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 procotol. Any Splitgraph user can connect to it at 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_mozambique_baseline_population table in this repository, by referencing it like:


or in a full query, like:

    ":id", -- Socrata column ID
    "f01", -- ZIF_No_food_yn
    "groupmember_any", -- Inadequacy in group member
    "c01a_h", -- g3.1a.h Anyone Owns Nonfarm Equip
    "jown_count", -- Inadequacy in ownership of assets
    "c04_b", -- g3.03b. Decide to sell Large Livestock
    "c01b_n", -- g3.1b.n Household owns Transportation
    "c06_c", -- g3.05c. Decide to rent out Small Livestock
    "c01b_b", -- g3.1b.b Household owns Large Livestock
    "c09_n", -- g3.06n. Decide to buy new Transportation
    "ch_20p", -- Condition of disempowerment k
    "c01b_k", -- g3.1b.k Household owns Small Durable
    "d03", -- ZID_Ext_wall_tp
    "c04_d", -- g3.03d. Decide to sell Chicken
    "c01b_j", -- g3.1b.j Household owns Large Durable
    "b02_3", -- g2.02c Input for Livestock raising
    "e02_b", -- g4.02 Speak in public to ensure proper wages
    "c04_e", -- g3.03e. Decide to sell Fish Pond
    "c05_c", -- g3.04c. Decide to give away Small Livestock
    "c01b_h", -- g3.1b.h Household owns Nonfarm Equip
    "c06_h", -- g3.05h. Decide to rent out Nonfarm Equip
    "d10", -- ZID_Electr_yn_2
    "c05_e", -- g3.04e. Decide to give away Fish Pond
    "c05_l", -- g3.04l. Decide to give away Cell Phone
    "d02", -- ZID_Floor_tp
    "c12_b", -- g3.09b. Decide how to use money from Informal lender
    "d06", -- ZID_Drink_water_src
    "c01a_b", -- g3.1a.b Anyone Owns Large Livestock
    "c01b_c", -- g3.1b.c Household owns Small Livestock
    "c06_g", -- g3.05g. Decide to rent out Farm Equip - mech
    "c02_n", -- g3.02n. Owns most of Transportation
    "ci", -- Individual disempowerment score
    "c09_f", -- g3.06f. Decide to buy new Farm Equip - non mech
    "c01a_n", -- g3.1a.n Anyone Owns Transportation
    "b01_6", -- g2.01f Participate in Fishing or fishpond culture
    "c01b_g", -- g3.1b.g Household owns Farm Equip - mech
    "a12", -- ZIG1_Int_alone
    "b01_4", -- g2.01d Participate in Non-farm
    "f05", -- ZIF_Whl_day_no_eat_yn
    "c04_m", -- g3.03m. Decide to sell Other Land
    "c06_f", -- g3.05f. Decide to rent out Farm Equip - non mech
    "c01a_i", -- g3.1a.i Anyone Owns House
    "c06_e", -- g3.05e. Decide to rent out Fish Pond
    "c09_a", -- g3.06a. Decide to buy new Agriculture
    "c02_g", -- g3.02g. Owns most of Farm Equip - mech
    "c01b_e", -- g3.1b.e Household owns Fish Pond
    "c02_f", -- g3.02f. Owns most of Farm Equip - non mech
    "b01_3", -- g2.01c Participate in Livestock raising
    "c11_b", -- g3.08b. Decide to borrow from Informal lender
    "c12_a", -- g3.09a. Decide how to use money from NGO
    "f04", -- ZIF_Sleep_hungry_freq
    "b03_2", -- g2.03b Input for spend money from Cash crop farming
    "c06_i", -- g3.05i. Decide to rent out House
    "c10_e", -- g3.07e. Taken any loans from Group
    "c04_a", -- g3.03a. Decide to sell Agriculture
    "c01a_k", -- g3.1a.k Anyone Owns Small Durable
    "c02_b", -- g3.02b. Owns most of Large Livestock
    "c06_b", -- g3.05b. Decide to rent out Large Livestock
    "b03_1", -- g2.03a Input for spend money from Food crop farming
    "b02_6", -- g2.02f Input for Fishing or fishpond culture
    "f04b", -- g6.02 How satisfied, scale of 1-10
    "b03_6", -- g2.03f Input for spend money from Fishing or fishpond culture
    "c02_k", -- g3.02k. Owns most of Small Durable
    "c01a_l", -- g3.1a.l Anyone Owns Cell Phone
    "c02_c", -- g3.02c. Owns most of Small Livestock
    "c05_f", -- g3.04f. Decide to give away Farm Equip - non mech
    "b01_2", -- g2.01b Participate in Cash crop farming
    "c05_n", -- g3.04n. Decide to give away Transportation
    "c06_d", -- g3.05d. Decide to rent out Chicken
    "c05_d", -- g3.04d. Decide to give away Chicken
    "c04_c", -- g3.03c. Decide to sell Small Livestock
    "wt_weai_2", -- WEAI weight for Females
    "c11_a", -- g3.08a. Decide to borrow from NGO
    "f06", -- ZIF_Whl_day_no_eat_freq
    "c09_g", -- g3.06g. Decide to buy new Farm Equip - mech
    "c02_h", -- g3.02h. Owns most of Nonfarm Equip
    "d01", -- ZID_Roof_tp
    "d07", -- ZID_Electr_yn
    "c10_b", -- g3.07b. Taken any loans from Informal lender
    "b01_5", -- g2.01e Participate in Wage and salary employment
    "b02_2", -- g2.02b Input for Cash crop farming
    "feelinputdecagr", -- Inadequacy in input in productive decisions
    "f03", -- ZIF_Sleep_hungry_yn
    "c11_d", -- g3.08d. Decide to borrow from Friends
    "weaiwght", -- WEAI gender specific weight
    "c05_a", -- g3.04a. Decide to give away Agriculture
    "ci_gap_20p", -- Individual empowerment gap for women without parity
    "c12_d", -- g3.09d. Decide how to use money from Friends
    "d09", -- ZID_Drink_water_src_2
    "c12_e", -- g3.09e. Decide how to use money from Group
    "c09_d", -- g3.06d. Decide to buy new Chicken
    "wt_weai_1", -- WEAI weight for Males
    "c06_m", -- g3.05m. Decide to rent out Other Land
    "c09_c", -- g3.06c. Decide to buy new Small Livestock
    "c04_k", -- g3.03k. Decide to sell Small Durable
    "speakpublic_any", -- Inadequacy in speaking in public
    "e02_c", -- g4.03 Speak in public to protest
    "c05_b", -- g3.04b. Decide to give away Large Livestock
    "c05_k", -- g3.04k. Decide to give away Small Durable
    "c01a_m", -- g3.1a.m Anyone Owns Other Land
    "b02_4", -- g2.02d Input for Non-farm
    "b03_4", -- g2.03d Input for spend money from Non-farm
    "c06_j", -- g3.05j. Decide to rent out Large Durable
    "c05_j", -- g3.04j. Decide to give away Large Durable
    "c04_n", -- g3.03n. Decide to sell Transportation
    "urbrur", -- Urban Rural - 1:urban; 2:rural
    "c02_i", -- g3.02i. Owns most of House
    "e02_a", -- g4.01 Speak in public to help decide
    "d04", -- ZID_Rooms_num
    "c12_c", -- g3.09c. Decide how to use money from Formal lender
    "leisuretime", -- Inadequacy in leisure
    "c04_l", -- g3.03l. Decide to sell Cell Phone
    "c02_j", -- g3.02j. Owns most of Large Durable
    "c06_n", -- g3.05n. Decide to rent out Transportation
    "c06_l", -- g3.05l. Decide to rent out Cell Phone
    "b03_3", -- g2.03c Input for spend money from Livestock raising
    "c01a_f", -- g3.1a.f Anyone Owns Farm Equip - non mech
    "c11_c", -- g3.08c. Decide to borrow from Formal lender
    "d11", -- ZID_Fuel_src_2
    "npoor_z105", -- Inadequacy in workload
    "c09_k", -- g3.06k. Decide to buy new Small Durable
    "id_code", -- ZIG1_Respondent_id
    "c04_h", -- g3.03h. Decide to sell Nonfarm Equip
    "c02_e", -- g3.02e. Owns most of Fish Pond
    "incdec_count", -- Inadequacy in control over use of income
    "a06", -- ZIA_Household Type
    "c09_m", -- g3.06m. Decide to buy new Other Land
    "credjanydec_any", -- Inadequacy in access to and decisions on credit
    "d05", -- ZID_Toilet_tp
    "c04_i", -- g3.03i. Decide to sell House
    "a05", -- ZIG1_Sex_g1
    "c05_m", -- g3.04m. Decide to give away Other Land
    "c01a_j", -- g3.1a.j Anyone Owns Large Durable
    "c04_f", -- g3.03f. Decide to sell Farm Equip - non mech
    "c09_j", -- g3.06j. Decide to buy new Large Durable
    "c09_h", -- g3.06h. Decide to buy new Nonfarm Equip
    "c10_c", -- g3.07c. Taken any loans from Formal lender
    "c09_e", -- g3.06e. Decide to buy new Fish Pond
    "c05_h", -- g3.04h. Decide to give away Nonfarm Equip
    "c09_i", -- g3.06i. Decide to buy new House
    "c01b_l", -- g3.1b.l Household owns Cell Phone
    "c01b_a", -- g3.1b.a Household owns Agriculture
    "c01a_a", -- g3.1a.a Anyone Owns Agriculture
    "b02_1", -- g2.02a Input for Food crop farming
    "ci_above_20p", -- Individual indicator that woman lacks gender parity
    "c06_a", -- g3.05a. Decide to rent out Agriculture
    "c05_i", -- g3.04i. Decide to give away House
    "c04_j", -- g3.03j. Decide to sell Large Durable
    "raiprod_any", -- Inadequacy in autonomy in production
    "c01b_i", -- g3.1b.i Household owns House
    "a04", -- Primary Secondary
    "c01a_c", -- g3.1a.c Anyone Owns Small Livestock
    "c10_d", -- g3.07d. Taken any loans from Friends
    "c04_g", -- g3.03g. Decide to sell Farm Equip - mech
    "c02_d", -- g3.02d. Owns most of Chicken
    "c01b_f", -- g3.1b.f Household owns Farm Equip - non mech
    "c11_e", -- g3.08e. Decide to borrow from Group
    "d08", -- ZID_Fuel_src
    "c01b_m", -- g3.1b.m Household owns Other Land
    "b02_5", -- g2.02e Input for Wage and salary employment
    "c01a_g", -- g3.1a.g Anyone Owns Farm Equip - mech
    "c10_a", -- g3.07a. Taken any loans from NGO
    "b03_5", -- g2.03e Input for spend money from Wage and salary employment
    "c02_a", -- g3.02a. Owns most of Agriculture
    "c05_g", -- g3.04g. Decide to give away Farm Equip - mech
    "c09_l", -- g3.06l. Decide to buy new Cell Phone
    "c09_b", -- g3.06b. Decide to buy new Large Livestock
    "c01a_d", -- g3.1a.d Anyone Owns Chicken
    "c01a_e", -- g3.1a.e Anyone Owns Fish Pond
    "f02", -- ZIF_No_food_freq
    "c01b_d", -- g3.1b.d Household owns Chicken
    "c02_m", -- g3.02m. Owns most of Other Land
    "c02_l", -- g3.02l. Owns most of Cell Phone
    "jrightanyagr", -- Inadequacy in purchase,sale, or transfer of assets
    "c06_k", -- g3.05k. Decide to rent out Small Durable
    "b01_1" -- g2.01a Participate in Food crop farming
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-mozambique-baseline-population-7dr5-x8hy with SQL in under 60 seconds.

This repository is an "external" repository. That means it's hosted elsewhere, in this case at When you queryusaid-gov/feed-the-future-mozambique-baseline-population-7dr5-x8hy: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"

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, 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-mozambique-baseline-population-7dr5-x8hy" \
  --handler-options '{
    "domain": "",
    "tables": {
        "feed_the_future_mozambique_baseline_population": "7dr5-x8hy"

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-mozambique-baseline-population-7dr5-x8hy is just another Postgres schema.

Related Documentation: