usaid-gov/feed-the-future-nepal-baseline-household-survey-nvx5-5f2f
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_nepal_baseline_household_survey table in this repository, by referencing it like:

"usaid-gov/feed-the-future-nepal-baseline-household-survey-nvx5-5f2f:latest"."feed_the_future_nepal_baseline_household_survey"

or in a full query, like:

SELECT
    ":id", -- Socrata column ID
    "g404_k", -- Is there a GROUP in your community K Other specify
    "credjanydec_any",
    "weaiwght",
    "pbs_id", -- Unique household ID
    "f06", -- How often did this happen in the past 4 weeks 30 days
    "f02", -- How often did this happen in the past 4 weeks 30 days
    "zid_toilet_tp_2", -- What kind of toilet facility does the household have
    "d03", -- Exterior Walls
    "zi_start_dt",
    "a17", -- A17 Team and interviewer s code number
    "wt_weai_2",
    "zia_district_cd", -- A05 District
    "zia_cluster_cd", -- A02 Cluster number
    "g05_e", -- G5 05 Regarding livestock raising I do what I do because I personally think it is the right thing to do
    "g04_b", -- G5 04 Regarding getting inputs for agricultural production I do what I do so others don t think poorly of me
    "g03_e", -- G5 03 My actions in livestock raising are partly because I will get in trouble with someone if I act differently
    "g02_e", -- To what extent do you feel you can make your own personal decisions regarding these aspects of household life if you want ed to D Livestock raising
    "g01_h", -- When decisions are made regarding the following aspects of household life who is it that normally takes the decision F Major household expenditures such as a large appliance for the house like refrigerator
    "g01_b", -- When decisions are made regarding the following aspects of household life who is it that normally takes the decision A Getting inputs for agricultural production
    "e07_f", -- G4 05 Are you an active member of this trade and business association
    "e07_k", -- G4 05 Are you an active member of this grp exst spec
    "e07_c", -- G4 05 Are you an active member of this forest user s group
    "g404_g", -- Is there a GROUP in your community G Civic groups improving community or charitable group helping others
    "e02_a", -- Do you feel comfortable speaking up in public to help decide on infrastructure like small wells roads water supplies to be built in your community
    "c12_b", -- G3 09 Who makes the decision about what to do with the money item borrowed from informal lender
    "c09_g", -- G3 06 Who contributes most to decisions regarding a new purchase of mechanized farm equipment
    "c09_c", -- G3 06 Who contributes most to decisions regarding a new purchase of small livestock
    "c06_c", -- G3 05 Who would you say can decide to mortgage or rent out small livestock most of the time
    "c06_b", -- G3 05 Who would you say can decide to mortgage or rent out large livestock most of the time
    "c05_e", -- G3 04 Who would you say can decide whether to give away fish pond or fishing equipment most of the time
    "c05_a", -- G3 04 Who would you say can decide whether to give away agricultural land most of the time
    "c02_g", -- G3 02 Who would you say owns most of the mechanized farm equipment
    "c02_f", -- G3 02 Who would you say owns most of the non mechanized farm equipment
    "c02_d", -- G3 02 Who would you say owns most of the chickens ducks turkeys or pigeons
    "c01b_n", -- How many of ITEM does your household currently have N Means of transportation bicycle motorcycle car
    "c01b_m", -- How many of ITEM does your household currently have M Other land not used for agricultural purposes pieces residential or commercial land
    "c01b_l", -- How many of ITEM does your household currently have L Cell phone
    "c01b_g", -- How many of ITEM does your household currently have G Farm equipment mechanized
    "b03_5", -- G2 03 How much input did you have in decisions on the use of income generated from wage and salary employment
    "b02_5", -- G2 02 How much input did you have in making decisions about wage and salary employment
    "b01_3", -- Did you singular participate in ACTIVITY in the past 12 months that is during the last one two cropping seasons C Livestock raising
    "zid_toilet_tp_oth_sp",
    "d05", -- D05 a What is the main type of toilets your household uses
    "zia_visit2_dt", -- A19 Date of second visit dd mm yyyy
    "g02_g", -- To what extent do you feel you can make your own personal decisions regarding these aspects of household life if you want ed to E Your own singular wage or salary employment
    "g02_i", -- To what extent do you feel you can make your own personal decisions regarding these aspects of household life if you want ed to G Minor household expenditures such as food for daily consumption or other household needs
    "g02_h", -- To what extent do you feel you can make your own personal decisions regarding these aspects of household life if you want ed to F Major household expenditures such as a large appliance for the house like refrigerator
    "e07_j", -- G4 05 Are you an active member of this other women s group
    "g404_h", -- Is there a GROUP in your community H Local government
    "a06", -- Type of household
    "c11_d", -- G3 08 Who made the decision to borrow from friends or relatives
    "c10_a", -- Has anyone in your household taken any loans or borrowed cash in kind from SOURCE in the past 12 months A Non governmental organization NGO
    "c09_i",
    "c09_e", -- G3 06 Who contributes most to decisions regarding a new purchase of fish pond or fishing equipment
    "c09_b", -- G3 06 Who contributes most to decisions regarding a new purchase of large livestock
    "c06_f", -- G3 05 Who would you say can decide to mortgage or rent out non mechanized farm equipment most of the time
    "c06_e", -- G3 05 Who would you say can decide to mortgage or rent out fish pond or fishing equipment most of the time
    "c06_d", -- G3 05 Who would you say can decide to mortgage or rent out chickens ducks turkeys or pigeons most of the time
    "c05_j",
    "c05_f", -- G3 04 Who would you say can decide whether to give away non mechanized farm equipment most of the time
    "c05_c", -- G3 04 Who would you say can decide whether to give away small livestock most of the time
    "c04_j",
    "c04_e", -- G3 03 Who would you say can decide whether to sell fish pond or fishing equipment most of the time
    "c04_d", -- G3 03 Who would you say can decide whether to sell chickens ducks turkeys or pigeons most of the time
    "c04_a", -- G3 03 Who would you say can decide whether to sell agricultural land most of the time
    "c02_k", -- G3 02 Who would you say owns most of the small consumer durables
    "c02_j", -- G3 02 Who would you say owns most of the large consumer durables
    "c02_h", -- G3 02 Who would you say owns most of the nonfarm business equipment
    "c02_e", -- G3 02 Who would you say owns most of the fish ponds or fishing equipment
    "c02_c", -- G3 02 Who would you say owns most of the small livestock
    "c01b_k", -- How many of ITEM does your household currently have K Small consumer durables radio cookware
    "c01b_h", -- How many of ITEM does your household currently have H Nonfarm business equipment blacksmith cobbler tailor auto repair shop
    "c01b_d", -- How many of ITEM does your household currently have D Chickens Ducks Turkeys Pigeons
    "c01a_g", -- Does anyone in your household currently have any ITEM G Farm equipment mechanized
    "c01a_e", -- Does anyone in your household currently have any ITEM E Fish pond or fishing equipment
    "b03_1", -- G2 03 How much input did you have in decisions on the use of income generated from food crop farming
    "b02_6", -- G2 02 How much input did you have in making decisions about Fishing or fishpond culture
    "b01_1", -- Did you singular participate in ACTIVITY in the past 12 months that is during the last one two cropping seasons A Food crop farming crops that are grown primarily for household food consumption
    "a04",
    "speakpublic_any",
    "c02_b", -- G3 02 Who would you say owns most of the large livestock
    "c09_n",
    "aa",
    "c06_k",
    "zid_roof_tp_oth_sp",
    "g01_d", -- When decisions are made regarding the following aspects of household life who is it that normally takes the decision C Taking crops to the market or not
    "c01a_j", -- Does anyone in your household currently have any ITEM J Large consumer durables fridge TV sofa
    "c11_b", -- G3 08 Who made the decision to borrow from informal lender
    "c09_j",
    "c04_g", -- G3 03 Who would you say can decide whether to sell mechanized farm equipment most of the time
    "b02_2", -- G2 02 How much input did you have in making decisions about cash crop farming
    "c06_g", -- G3 05 Who would you say can decide to mortgage or rent out mechanized farm equipment most of the time
    "c10_c", -- Has anyone in your household taken any loans or borrowed cash in kind from SOURCE in the past 12 months C Formal lender bank financial institution
    "c05_n",
    "g04_c", -- G5 04 Regarding the types of crops to grow I do what I do so others don t think poorly of me
    "g05_d", -- G5 05 Regarding taking crops to the market or not I do what I do because I personally think it is the right thing to do
    "c06_h",
    "urbrur", -- Urban rural
    "g404_j", -- Is there a GROUP in your community J Other women s group only if it does not fit into one of the other categories
    "d07", -- D07 Does this household have electricity
    "g02_d", -- To what extent do you feel you can make your own personal decisions regarding these aspects of household life if you want ed to C Taking crops to the market or not
    "a05", -- G1 03 Sex of respondent
    "c05_l",
    "e02_c", -- G4 03 Do you feel comfortable speaking up in public to protest the misbehavior of authorities or elected officials
    "raiprod_any",
    "c04_c", -- G3 03 Who would you say can decide whether to sell small livestock most of the time
    "zia_int_outcome", -- A21 Final outcome of interview enter code
    "ci_gap",
    "c01b_a", -- How many of ITEM does your household currently have A Agricultural land pieces plots
    "c04_i",
    "ci_above",
    "g02_b", -- To what extent do you feel you can make your own personal decisions regarding these aspects of household life if you want ed to A Getting inputs for agricultural production
    "c01a_a", -- Does anyone in your household currently have any ITEM A Agricultural land pieces plots
    "c06_i",
    "c01a_n", -- Does anyone in your household currently have any ITEM N Means of transportation bicycle motorcycle car
    "ea_20p",
    "jrightanyagr",
    "g01_g", -- When decisions are made regarding the following aspects of household life who is it that normally takes the decision E Your own singular wage or salary employment
    "c09_k",
    "e07_h", -- G4 05 Are you an active member of this local government
    "d01", -- Roof top material outer covering
    "c09_m",
    "jown_count",
    "g02_c", -- To what extent do you feel you can make your own personal decisions regarding these aspects of household life if you want ed to B The types of crops to grow for agricultural production
    "b02_1", -- G2 02 How much input did you have in making decisions about food crop farming
    "c04_h",
    "d08", -- D08 What is the main source of cooking fuel for your household
    "g404_b", -- Is there a GROUP in your community B Water users group
    "zid_floor_tp_oth_sp",
    "gpi",
    "e02_b", -- Do you feel comfortable speaking up in public to ensure proper payment of wages for public works or other similar programs
    "c09_f", -- G3 06 Who contributes most to decisions regarding a new purchase of non mechanized farm equipment
    "f05", -- In the past 4 weeks 30 days did you or any household member go a whole day and night without eating anything at all because there was not enough food
    "e07_e", -- G4 05 Are you an active member of this mutual help or insurance group
    "c01a_b", -- Does anyone in your household currently have any ITEM B Large livestock oxen cattle
    "b03_4", -- G2 03 How much input did you have in decisions on the use of income generated from non farm activities
    "c05_b", -- G3 04 Who would you say can decide whether to give away large livestock most of the time
    "c04_m",
    "groupmember_any",
    "g01_i", -- When decisions are made regarding the following aspects of household life who is it that normally takes the decision G Minor household expenditures such as food for daily consumption or other household needs
    "c01b_f", -- How many of ITEM does your household currently have F Farm equipment non mechanized
    "c06_a", -- G3 05 Who would you say can decide to mortgage or rent out agricultural land most of the time
    "c01b_i", -- How many of ITEM does your household currently have I House and other structures
    "g404_e", -- Is there a GROUP in your community E Mutual help or insurance group including burial societies
    "zid_ext_wall_tp_oth_sp",
    "c09_l",
    "ch_20p",
    "c06_m",
    "b01_4", -- Did you singular participate in ACTIVITY in the past 12 months that is during the last one two cropping seasons D Non farm economic activities Small business self employment buy and sell
    "zid_fuel_src_oth_sp",
    "d04", -- D04 How many rooms are there in this dwelling
    "b02_4", -- G2 02 How much input did you have in making decisions about non farm activities
    "zid_feces_present", -- Is there human feces in the house compound or rightoutside the compound
    "modd_missing", -- Missing all elements from module D
    "zid_drink_water_src_other_1",
    "c06_n",
    "g404_a", -- Is there a GROUP in your community A Agricultural livestock fisheries producer s group including marketing groups
    "c06_l",
    "b03_2", -- G2 03 How much input did you have in decisions on the use of income generated from cash crop farming
    "zia_region_cd", -- A06 Region
    "zid_fuel_src_2",
    "b03_3", -- G2 03 How much input did you have in decisions on the use of income generated from livestock raising
    "c11_a", -- G3 08 Who made the decision to borrow from non governmental organization
    "c10_d", -- Has anyone in your household taken any loans or borrowed cash in kind from SOURCE in the past 12 months D Friends or relatives
    "g04_e", -- G5 04 Regarding livestock raising I do what I do so others don t think poorly of me
    "zid_drink_water_src_other", -- Please specify drinking water source
    "he",
    "zid_toilet_tp_obsrv", -- D05 b ENUMERATOR OBSERVE DO NOT ASK Is there a toilet
    "zia_visit2_yn", -- Was a second visit necessary to complete the interview
    "ci",
    "c05_m",
    "b01_6", -- Did you singular participate in ACTIVITY in the past 12 months that is during the last one two cropping seasons F Fishing or fishpond culture
    "c01a_h", -- Does anyone in your household currently have any ITEM H Nonfarm business equipment blacksmith cobbler tailor auto repair shop
    "c05_k",
    "c09_a", -- G3 06 Who contributes most to decisions regarding a new purchase of agricultural land
    "g404_d", -- Is there a GROUP in your community D Credit or microfinance group including SACCOs merry go rounds VSLAs
    "npoor_z105",
    "f03", -- In the past 4 weeks 30 days did you or any household member go to sleep at night hungry because there was not enough food
    "c09_h",
    "e07_g", -- G4 05 Are you an active member of these civic groups
    "c04_l",
    "c04_n",
    "c01a_f", -- Does anyone in your household currently have any ITEM F Farm equipment non mechanized
    "g404_f", -- Is there a GROUP in your community F Trade and business association
    "rp",
    "f04", -- How often did this happen in the past 4 weeks 30 days
    "g404_i", -- Is there a GROUP in your community I Religious group
    "c11_c", -- G3 08 Who made the decision to borrow from formal lender
    "wt_weai_1",
    "b01_2", -- Did you singular participate in ACTIVITY in the past 12 months that is during the last one two cropping seasons B Cash crop farming crops that are grown primary for sale in the market
    "b01_5", -- Did you singular participate in ACTIVITY in the past 12 months that is during the last one two cropping seasons E Wage and salary employment in kind or monetary work both agriculture and other wage work
    "c02_n", -- G3 02 Who would you say owns most of the means of transportation
    "e07_i", -- G4 05 Are you an active member of this religious group
    "c06_j",
    "c10_b", -- Has anyone in your household taken any loans or borrowed cash in kind from SOURCE in the past 12 months B Informal lender
    "leisuretime",
    "c05_h",
    "country",
    "c01b_b", -- How many of ITEM does your household currently have B Large livestock oxen cattle
    "g05_b", -- G5 05 Regarding getting inputs for agricultural production I do what I do because I personally think it is the right thing to do
    "c01a_l", -- Does anyone in your household currently have any ITEM L Cell phone
    "c01a_m", -- Does anyone in your household currently have any ITEM M Other land not used for agricultural purposes pieces residential or commercial land
    "g01_c", -- When decisions are made regarding the following aspects of household life who is it that normally takes the decision B The types of crops to grow for agricultural production
    "g03_d", -- G5 03 My actions in taking crops to the market or not are partly because I will get in trouble with someone if I act differently
    "c01a_d", -- Does anyone in your household currently have any ITEM D Chickens Ducks Turkeys Pigeons
    "c12_c", -- G3 09 Who makes the decision about what to do with the money item borrowed from formal lender
    "feelinputdecagr",
    "b03_6", -- G2 03 How much input did you have in decisions on the use of income generated from Fishing or fishpond culture
    "incdec_count",
    "c02_m", -- G3 02 Who would you say owns most of the other non agricultural land
    "c12_d", -- G3 09 Who makes the decision about what to do with the money item borrowed from friends or relatives
    "c01b_j", -- How many of ITEM does your household currently have J Large consumer durables fridge TV sofa
    "c09_d", -- G3 06 Who contributes most to decisions regarding a new purchase of chickens ducks turkeys or pigeons
    "c01a_c", -- Does anyone in your household currently have any ITEM C Small livestock goats pigs sheep
    "modf_missing", -- Missing all elements from module F
    "zid_water_src_seasonal", -- D06 bDo you use the main drinking water source allyear or only part of the year
    "hp",
    "g404_c", -- Is there a GROUP in your community C Forest users group
    "a12", -- G1 06 Ability to be interviewed alone
    "c04_f", -- G3 03 Who would you say can decide whether to sell non mechanized farm equipment most of the time
    "c04_b", -- G3 03 Who would you say can decide whether to sell large livestock most of the time
    "d02", -- Floor material
    "c02_i", -- G3 02 Who would you say owns most of the houses and other structures
    "g03_b", -- G5 03 My actions in getting inputs for agricultural production are partly because I will get in trouble with someone if I act differently
    "c05_i",
    "c10_e", -- Has anyone in your household taken any loans or borrowed cash in kind from SOURCE in the past 12 months E Group based micro finance or lending including VSLAs SACCOs merry go rounds
    "zig1_respondent_id",
    "c01a_k", -- Does anyone in your household currently have any ITEM K Small consumer durables radio cookware
    "zia_supervisor_cd", -- A22 Name code of supervisor
    "g04_d", -- G5 04 Regarding taking crops to the market or not I do what I do so others don t think poorly of me
    "e07_b", -- G4 05 Are you an active member of this water user s group
    "e07_d", -- G4 05 Are you an active member of this credit or microfinance group
    "zia_location_cd", -- A03 Ward
    "c12_a", -- G3 09 Who makes the decision about what to do with the money item borrowed from non governmental organization
    "c02_l", -- G3 02 Who would you say owns most of the cell phones
    "g05_c", -- G5 05 Regarding the types of crops to grow I do what I do because I personally think it is the right thing to do
    "d06", -- D06 aWhat is the main source of drinking water formembers of your household
    "b02_3", -- G2 02 How much input did you have in making decisions about livestock raising
    "f01", -- In the past 4 weeks 30 days was there ever no food to eat of any kind in your house because of lack of resources to get food
    "c02_a", -- G3 02 Who would you say owns most of the agricultural land
    "c05_g", -- G3 04 Who would you say can decide whether to give away mechanized farm equipment most of the time
    "c05_d", -- G3 04 Who would you say can decide whether to give away chickens ducks turkeys or pigeons most of the time
    "c01a_i", -- Does anyone in your household currently have any ITEM I House and other structures
    "f04b", -- G6 02 How satisfied are you with your available time for leisure activities like visiting neighbors watching TV listening to the radio seeing movies or doing sports
    "e07_a", -- G4 05 Are you an active member of this agricultural livestock fisheries producer s group
    "c11_e", -- G3 08 Who made the decision to borrow from group based micro finance or lending
    "g01_e", -- When decisions are made regarding the following aspects of household life who is it that normally takes the decision D Livestock raising
    "g03_c", -- G5 03 My actions in the types of crops to grow are partly because I will get in trouble with someone if I act differently
    "c04_k",
    "c12_e", -- G3 09 Who makes the decision about what to do with the money item borrowed from group based micro finance or lending
    "c01b_e", -- How many of ITEM does your household currently have E Fish pond or fishing equipment
    "c01b_c" -- How many of ITEM does your household currently have C Small livestock goats pigs sheep
FROM
    "usaid-gov/feed-the-future-nepal-baseline-household-survey-nvx5-5f2f:latest"."feed_the_future_nepal_baseline_household_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-nepal-baseline-household-survey-nvx5-5f2f 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-nepal-baseline-household-survey-nvx5-5f2f: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-nepal-baseline-household-survey-nvx5-5f2f" \
  --handler-options '{
    "domain": "data.usaid.gov",
    "tables": {
        "feed_the_future_nepal_baseline_household_survey": "nvx5-5f2f"
    }
}'

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-nepal-baseline-household-survey-nvx5-5f2f is just another Postgres schema.