cityofnewyork-us/nycha-development-data-book-evjd-dqpz
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 nycha_development_data_book table in this repository, by referencing it like:

"cityofnewyork-us/nycha-development-data-book-evjd-dqpz:latest"."nycha_development_data_book"

or in a full query, like:

SELECT
    ":id", -- Socrata column ID
    "rad_transferred_date", -- The date when the development underwent a Rental Assistance (RAD) / Permanent Affordability Commitment Together (PACT) conversion.
    "senior_development", -- A senior development where all residents are senior, aged 62 or older, is denoted as "Exclusively". A development where only some buildings are designated for senior residents is denoted as "Partially".
    "tds_", -- The number used by numerous computer applications to identify NYCHA Developments.
    "total_area_sq_ft", -- This number includes land acquired and developed as part of the development for a park or playground to be operated and manintained by the NYC Department of Parks. At State and City Developments, the park or playground is owned by the City of New York. At federal Developments, parks and playgrounds are leased to the City.
    "total_number_of_apartments", -- The total number of apartments at the development including the Section 8 Transition apartments at the LLC1 developments.
    "total_of_fixed_income_household", -- Number of households on fixed income (households with income from Social Security, Supplementary Security Income (SSI), Survivors Insurance, Veterans Benefits, or Pension (as well as other Public or Non Public Benefits), while not earning employment income or receiving Public Assistance.
    "total_population", -- The total number of persons living at the developments, including the Section 8 Transition apartments in the LLC1 developments.
    "type", -- 5 items in this field: Gut Rehab, New Const, New Const (Eld), Rehab, and Rehab (Eld).
    "us_congressional_district", -- Congressional District Number.
    "bldg_coverage_sq_ft", -- The total ground floor area of the building footprints of a development.
    "density", -- Measure of development density as represented by the number of persons per acre.
    "per_rental_room", -- Cost to develop the property divided by the number of rental rooms at the time of original construction.
    "borough", -- Bronx, Brooklyn, Manhattan, Queens, or Staten Island.
    "completion_date", -- The Initial Occupancy Completion Date: The date when the development was at least 95% occupied.
    "electricity_paid_by_residents", -- A "Yes" indicates developments where residents pay for their electricity.
    "private_management", -- A "Yes" indicates developments managed by a private management company.
    "acres", -- The land area of the development including buildings and grounds is shown in acres (one acre equals 43,560 square feet). 
    "avg_monthly_gross_rent", -- This is the average gross monthly rent of the households in each development. The average tenant share of rent for the Section 8 households in the LLC1 developments is included.
    "avg_no_r_r_per_apartment", -- The average number of rental rooms per apartment is the number of rental rooms divided by the number of current units. The Section 8 units in the LLC1 Developments are included.
    "bldg_coverage__", -- This is the building coverage, divided by a development’s total area in square feet. This figure is presented as a percentage. 
    "community_distirct", -- Community District Number.
    "consolidated_tds_", -- Consolidated Tenant Data Systems number.
    "cubage_cu_ft", -- Cubic Space (height x length x width of residential buildings) in all the buildings at a development, expressed as cubic feet. 
    "data_as_of",
    "development", -- Development name.
    "development_cost", -- The sum of the land cost, construction cost and site improvement cost, including fees for architects and engineers at the time of original construction.
    "development_edp_", -- Assigned to a development during the development (construction) period.
    "excluding_park_acres", -- This is the number of acres at a development less the land set aside for a park or playground. For the majority of developments this figure is the same as "acres".
    "federalized_development", -- Date on which City and / or State Developments were transferred to the Federal Program. There are 11 items in this field. They are: 1968/08/29-Fed Tran; 1971/06/29-Fed Tran; 1972/06/29-Fed Tran; 1977/07/01-ATP 1 (abbreviation for Authority Transfer Program); 1978/02/01-ATP 2; 1978/07/01-ATP 3; 1979/08/01-ATP 4; 1980/07/01-ATP 5; 1980/10/01-ATP 7; and 1995/07/13-PTA (abbreviation for Physical Transfer of Assets).
    "hud_amp_", -- Asset Management Project (AMP) numbers.
    "location_street_a", -- For NYCHA Developments that fit into a relatively neat rectangular block or two, these fields should be the four border streets (north, south, east, and west) of the Development. For Developments that are spread over some distance such as West Farms Road Rehab, the streets that best define the location of the development are provided. 
    "location_street_b",
    "location_street_c",
    "location_street_d",
    "net_dev_area_sq_ft", -- This is Square Feet at a Development less the land set aside for a park or playground. For the majority of developments this figure is the same acreage.
    "number_of_current_apartments", -- The number of units available for occupancy in the development as per the January 1, 2024 Dwelling Unit Inventory which is used to track the number of units on the rent roll.
    "program", -- The Programs designations are: Federal, MHOP, Mixed Finance, Mixed Finance/LLC1, Mixed Finance LLC2, Mixed Finance/Non-NYCHA Development.
    "method", -- Two items in this field Conventional and Turnkey.
    "number_of_rental_rooms", -- Rental room count per unit is equal to 2 1/2 plus the number of bedrooms. The number of rental rooms includes balconies and half-bath as half-rooms.
    "number_of_section_8_transition_apartments", -- The total number of apartments transitioned to the Section 8 Program in the LLC1 developments.
    "number_of_non_residential_bldgs", -- The number of non-residential buildings at a development.
    "number_of_stairhalls", -- The number of individual entrances in each development.
    "ny_city_council_district", -- New York City Council District Number.
    "ny_state_assembly_district", -- New York State Assembly District Number.
    "ny_state_senate_district", -- New York State Senate District Number.
    "operating_edp_", -- A number that each development utilize for Operating Costs.
    "percent_fixed_income_households", -- Number of households on fixed income divided by the total number of households.
    "hud__", -- The U.S. Department of Housing and Urban Development (HUD) identification number.
    "population_public_housing", -- The number of persons living in all public housing units. The residents living in the Section 8 Transition units in the LLC1 developments are not included in this population count.
    "number_of_residential_bldgs", -- The number of residential buildings on the grounds that are used for dwelling units.
    "population_section_8_transition", -- The number of persons living in the Section 8 Transition units in the LLC1 developments.
    "number_of_stories" -- The number of floors in each building.
FROM
    "cityofnewyork-us/nycha-development-data-book-evjd-dqpz:latest"."nycha_development_data_book"
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 cityofnewyork-us/nycha-development-data-book-evjd-dqpz 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 cityofnewyork-us/nycha-development-data-book-evjd-dqpz: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 cityofnewyork-us/nycha-development-data-book-evjd-dqpz

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 cityofnewyork-us/nycha-development-data-book-evjd-dqpz:latest

This will download all the objects for the latest tag of cityofnewyork-us/nycha-development-data-book-evjd-dqpz 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 cityofnewyork-us/nycha-development-data-book-evjd-dqpz: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 cityofnewyork-us/nycha-development-data-book-evjd-dqpz: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, cityofnewyork-us/nycha-development-data-book-evjd-dqpz is just another Postgres schema.

Related Documentation:

Loading...