ny-gov/child-and-dependent-care-credit-by-place-of-b535-hiv4
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 child_and_dependent_care_credit_by_place_of table in this repository, by referencing it like:

"ny-gov/child-and-dependent-care-credit-by-place-of-b535-hiv4:latest"."child_and_dependent_care_credit_by_place_of"

or in a full query, like:

SELECT
    ":id", -- Socrata column ID
    "credit_amount_claimed_two_qualifying_persons_000_", -- Amount of credit claimed for two qualifying persons, in thousands of dollars
    "average_credit_two_qualifying_persons", -- Average credit for two qualifying persons
    "notes", -- d/ - Tax Law secrecy provisions prohibit the disclosure of the data; reported as a blank in the dataset
    "number_of_claims_three_or_more_qualifying_persons", -- Count of the number of credit claims for three or more qualifying persons
    "average_credit_head_of_household_filing_status", -- Average credit for taxpayers with Head of Household Filing Status
    "average_credit_three_or_more_qualifying_persons", -- Average credit for three or more qualifying persons
    "credit_amount_claimed_single_filing_status_000", -- Amount of credit claimed for taxpayers with Single Filing Status, in thousands of dollars
    "credit_type", -- Type of Credit: NYC CDCC – New York City Child and Dependent Care Credit (data beginning in 2008);  NYS CDCC – New York State Child and Dependent Care Credit (beginning in 2002)
    "average_credit_single_filing_status", -- Average credit for taxpayers with Single Filing Status
    "place_of_residence", -- Name of the New York State County or New York City County, NYS Unclassified +, All Other +, or Total.   Notes -- NYS Unclassified +: Place of Residence cannot be determined from return;  All Other + : Includes returns with out-of-state addresses for State credit or non-New York City addresses for City credit
    "county", -- Name of County, Not Applicable, or Total
    "number_of_claims_total", -- Count of the number of credits claims, total all taxpayers Note: For tax year 2008, the Total includes 6 credit claims totaling $3,510 where number of qualifying persons could not be determined. For the following tax years, the Total includes certain credit claims and credit amounts where the filing status could not be determined on separately submitted IT-216 forms:  2006 – 8 credit claims totaling $4,251;  2005 – 83 credit claims totaling $76,188;  2004 – 1,879 credit claims totaling $1.3 million;  2003 – 2,875 credit claims totaling $2 million;  2002 – 3,128 credit claims totaling $1.5 million
    "credit_amount_claimed_total_000", -- Amount of credit claimed, total all taxpayers, in thousands of dollars
    "average_credit_total", -- Average credit, all taxpayers
    "average_credit_two_or_more_qualifying_persons", -- Average credit for two or more qualifying persons
    "credit_amount_claimed_three_or_more_qualifying_persons_000_", -- Amount of credit claimed for three or more qualifying persons, in thousands of dollars
    "number_of_claims_one_qualifying_person", -- Count of the number of credit claims for one qualifying person
    "number_of_claims_mfj_qw_filing_status", -- Count of the number of credit claims for taxpayers with Married Filing Joint or Qualified Widow(er) Filing Status
    "credit_amount_claimed_mfj_qw_filing_status_000", -- Amount of credit claimed for taxpayers with Married Filing Joint or Qualified Widow(er) Filing Status, in thousands of dollars
    "place_of_residence_sort_order", -- Sort order on Place of Residence
    "credit_amount_claimed_head_of_household_filing_status_000", -- Amount of credit claimed for taxpayers with Head of Household Filing Status, in thousands of dollars
    "credit_amount_claimed_one_qualifying_person_000", -- Amount of credit claimed for one qualifying person, in thousands of dollars
    "number_of_claims_head_of_household_filing_status", -- Count of the number of credit claims for taxpayers with Head of Household Filing Status
    "average_credit_one_qualifying_person", -- Average credit for one qualifying person
    "number_of_claims_two_or_more_qualifying_persons", -- Count of the number of credit claims for two or more qualifying persons
    "number_of_claims_single_filing_status", -- Count of the number of credit claims for taxpayers with Single Filing Status
    "average_credit_mfj_qw_filing_status", -- Average credit for taxpayers with Married Filing Joint or Qualified Widow(er) Filing Status
    "credit_amount_claimed_two_or_more_qualifying_persons_000", -- Amount of credit claimed for two or more qualifying persons, in thousands of dollars
    "number_of_claims_two_qualifying_persons", -- Count of the number of credit claims for two qualifying persons
    "tax_year" -- Tax Year
FROM
    "ny-gov/child-and-dependent-care-credit-by-place-of-b535-hiv4:latest"."child_and_dependent_care_credit_by_place_of"
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 ny-gov/child-and-dependent-care-credit-by-place-of-b535-hiv4 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 ny-gov/child-and-dependent-care-credit-by-place-of-b535-hiv4: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 ny-gov/child-and-dependent-care-credit-by-place-of-b535-hiv4

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 ny-gov/child-and-dependent-care-credit-by-place-of-b535-hiv4:latest

This will download all the objects for the latest tag of ny-gov/child-and-dependent-care-credit-by-place-of-b535-hiv4 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 ny-gov/child-and-dependent-care-credit-by-place-of-b535-hiv4: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 ny-gov/child-and-dependent-care-credit-by-place-of-b535-hiv4: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, ny-gov/child-and-dependent-care-credit-by-place-of-b535-hiv4 is just another Postgres schema.

Related Documentation:

Loading...