ny-gov/new-york-state-economic-incentive-tax-credit-4skq-w2i6
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 new_york_state_economic_incentive_tax_credit table in this repository, by referencing it like:

"ny-gov/new-york-state-economic-incentive-tax-credit-4skq-w2i6:latest"."new_york_state_economic_incentive_tax_credit"

or in a full query, like:

SELECT
    ":id", -- Socrata column ID
    "usage_restriction", -- Refundable: Refundable tax credits are those where if the amount of the credit exceeds tax liability, the taxpayer will receive a refund for the difference. A taxpayer may also choose to have part, or all of the refund amount applied as an estimated payment for the next tax period. Non-refundable: A non-refundable tax credit is a tax credit that can only reduce a taxpayer’s liability zero (or the fixed dollar minimum under Article 9-A or Article 33). Generally, the amount of a non-refundable credit that exceeds a taxpayer’s liability is automatically forfeited by the taxpayer. Carryforward: Carryforward credits allows taxpayers to take advantage of unused non-refundable credit amounts. Any amount of credit not deducted against the current year’s tax may be carried forward for a specified number of years or indefinitely depending on the credit and used to offset liability in those years
    "tax_year", -- The year of the tax return on which the tax credit is claimed: this is typically the year in which the activity generating the tax credit takes place (exceptions include the brownfield redevelopment credit and the film production and post-production credits).
    "tax_article", -- The dataset contains data for personal income tax taxpayers filing under Article 22 of the Tax Law, taxpayers filing as general business corporations under Article 9-A, and insurance companies filing under Article 33.
    "notes", -- d/ - Tax Law secrecy provisions prohibit the disclosure of the data for instances of less than 3 taxpayers. Disclosure identifies whether the data in columns have a value but is not reported. 1/ For certain non-refundable credits, amounts not fully used in one year may be carried over for a limited duration or indefinitely. Consequently, usage in a tax year could be from activity in prior years. 2/ Chapter 56 of the Laws of 2011 created the New York Youth Works Tax Credit Program. Chapter 56 of the Laws of 2015 renamed the program the Urban Youth Jobs Program Tax Credit. Chapter 59 of the Laws of 2017 further renamed the program the New York Youth Jobs Program Tax Credit. 3/ Credit expired; usage is from amounts carried forward from prior tax years. 4/ Credit refundable to new businesses only. 5/ Article 9-A taxpayers who, as mortgagee, paid special additional mortgage recording tax on residential mortgages in any tax year beginning on or after January 1, 2015, may elect to treat the unused portion of the credit attributable to those mortgages as an overpayment of tax to be credited or refunded, rather than as a carryforward.
    "credit_name", -- Name of the credit.
    "external_agency", -- Credit administering agency. DEC – Department of Environmental Conservation; ESD – Empire State Development; DOL – Department of Labor; HCR – Division of Housing and Community Renewal; DHSES - Division of Homeland Security and Emergency Services; OASAS – Office of Addiction Services and Supports; OPRHP – Office of Parks, Recreation and Historic Preservation
    "external_administration", -- An external agency administers the credit by issuing a certificate that displays: 1/ Credit amount; 2/ Costs used to compute the credit; 3/ Eligibility 
    "amount_of_credit", -- The amount of the credit used, refunded and/or applied as an overpayment to the next year’s tax.
    "number_of_taxpayers" -- Number of taxpayers with credit used, refunded and/or applied as an overpayment to the next year’s tax. Taxpayers who claim certain business credits on their personal income tax returns do so by virtue of being sole proprietors or as recipients of credit that originated with flow-through entities (i.e., S corporations, limited liability companies, or partnerships). Therefore, personal income tax data is actual filers, not entities or businesses. Consequently, developing the total count of businesses or entities claiming credits is not possible.
FROM
    "ny-gov/new-york-state-economic-incentive-tax-credit-4skq-w2i6:latest"."new_york_state_economic_incentive_tax_credit"
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/new-york-state-economic-incentive-tax-credit-4skq-w2i6 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/new-york-state-economic-incentive-tax-credit-4skq-w2i6: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/new-york-state-economic-incentive-tax-credit-4skq-w2i6

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/new-york-state-economic-incentive-tax-credit-4skq-w2i6:latest

This will download all the objects for the latest tag of ny-gov/new-york-state-economic-incentive-tax-credit-4skq-w2i6 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/new-york-state-economic-incentive-tax-credit-4skq-w2i6: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/new-york-state-economic-incentive-tax-credit-4skq-w2i6: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/new-york-state-economic-incentive-tax-credit-4skq-w2i6 is just another Postgres schema.

Related Documentation:

Loading...