health-data-ny-gov/certificate-of-need-applications-beginning-1974-h343-jwie
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 certificate_of_need_applications_beginning_1974 table in this repository, by referencing it like:

"health-data-ny-gov/certificate-of-need-applications-beginning-1974-h343-jwie:latest"."certificate_of_need_applications_beginning_1974"

or in a full query, like:

SELECT
    ":id", -- Socrata column ID
    "council_name_6", -- Name of the Committee or Council that took an action.
    "council_name_2", -- Name of the Committee or Council that took an action.
    "proposed_operator_county_name", -- County of the proposed operator.
    "application_received_year", -- 4 digit year that the CON application was received.
    "council_date_1", -- Date the recommendation or decision was made by the Committee or Council.
    "council_name_1", -- Name of the Committee or Council that took an action.
    "proposed_operator_name", -- Name of the proposed operator.
    "submission_type_s", -- Defines the type of application submitted.
    "council_date_4", -- Date the recommendation or decision was made by the Committee or Council.
    "current_operator_zip_code", -- Zip Code of the current operator.
    "council_date_6", -- Date the recommendation or decision was made by the Committee or Council.
    "council_date_2", -- Date the recommendation or decision was made by the Committee or Council.
    "council_name_3", -- Name of the Committee or Council that took an action.
    "acs_letter_sent_date", -- Date the “All contingencies satisfied” letter was issued (related to Construction projects).
    "council_name_5", -- Name of the Committee or Council that took an action.
    "council_name_9", -- Name of the Committee or Council that took an action.
    "project_site_state", -- State of the project site (always New York State).
    "application_received_date", -- Date CON application was received.
    "current_operator_state", -- State of the current operator.
    "council_action_10", -- The recommendation or decision of the Committee or Council.
    "acknowledgement_date", -- Date the CON application was determined to be minimally complete and reviewable.
    "facility_type", -- A description of the type of facility.
    "council_action_4", -- The recommendation or decision of the Committee or Council.
    "main_site_facility_identifier", -- Facility ID of the Facility's main site.
    "main_site_facility_name", -- Name of the Facility's main site.
    "main_site_address_line1", -- Address Line 1 of the Facility's main site.
    "council_name_8", -- Name of the Committee or Council that took an action.
    "main_site_county_name", -- County where the Facility's main site is located.
    "project_site_facility_identifier", -- Facility ID of the project site (if applicable).
    "council_name_4", -- Name of the Committee or Council that took an action.
    "director_action", -- Name of the Committee or Council that took an action.
    "council_action_5", -- The recommendation or decision of the Committee or Council.
    "proposed_operator_state", -- State of the proposed operator.
    "project_description", -- Brief narrative description of the project
    "region", -- Health Systems Agency service area.
    "assigned_contstruction_completion_date", -- Date construction is scheduled to be completed, as submitted by the applicant.
    "proposed_operator_zip_code", -- Zip Code of the proposed operator.
    "proposed_operator_address_line2", -- Address Line 2 of the proposed operator.
    "facility_name", -- The current facility name or the applicant-submitted proposed facility name
    "council_action_3", -- The recommendation or decision of the Committee or Council.
    "actual_construction_start_date", -- Actual date construction was started.
    "project_cost", -- Capital cost of project, identified by the applicant, at the time of CON submission
    "project_status_date", -- The last date the status of the project changed.
    "council_date_9", -- Date the recommendation or decision was made by the Committee or Council.
    "council_action_2", -- The recommendation or decision of the Committee or Council.
    "project_site_city", -- City where the project site is located.
    "council_action_9", -- The recommendation or decision of the Committee or Council.
    "main_site_state", -- State of the Facility's main site (always New York State).
    "council_action_8", -- The recommendation or decision of the Committee or Council.
    "council_date_10", -- Date the recommendation or decision was made by the Committee or Council.
    "council_action_6", -- The recommendation or decision of the Committee or Council.
    "project_site_address_line1", -- Address Line 1 of the project site.
    "project_site_county_name", -- County where the project site is located.
    "council_date_7", -- Date the recommendation or decision was made by the Committee or Council.
    "council_name_7", -- Name of the Committee or Council that took an action.
    "proposed_operator_operating_certificate_number", -- Operating Certificate number of the proposed operator (if applicable).
    "current_operator_address_line2", -- Address Line 2 of the current operator.
    "assigned_construction_start_date", -- Date construction is scheduled to be started, as submitted by the applicant.
    "facility_id", -- Site specific facility identification number
    "con_project_number", -- Project / Certificate of Need (CON) application number
    "council_name_10", -- Name of the Committee or Council that took an action.
    "current_operator_operating_certificate_number", -- Operating Certificate number of the current operator of the facility.
    "project_site_zip_code", -- Zip Code where the project site is located.
    "council_action_7",
    "current_operator_name", -- Name of the current operator of the facility.
    "director_action_date", -- Date of the Director Action
    "project_site_facility_name", -- Name or proposed name of the project site.
    "review_level", -- Defines the type of CON application review (Full, Administrative, Limited).
    "council_action_1", -- The recommendation or decision of the Committee or Council.
    "application_received_month", -- The month number that the CON application was received.
    "council_date_5", -- Date the recommendation or decision was made by the Committee or Council.
    "main_site_city", -- City where the Facility's main site is located.
    "current_operator_address_line1", -- Address Line 1 of the current operator.
    "current_operator_city", -- City of the current operator.
    "current_operator_county_name", -- County of the current operator.
    "proposed_operator_address_line1", -- Address Line 1 of the proposed operator.
    "council_date_8", -- Date the recommendation or decision was made by the Committee or Council.
    "project_status", -- Status of a project (e.g., Under Review, Told to Contact Area Office).
    "main_site_address_line2", -- Address Line 2 of the Facility's main site.
    "phc_final_approval_letter_sent", -- Date the PHHPC Final Approval letter was issued (related to Establishment projects).
    "actual_construction_completion_date", -- Actual date construction was completed.
    "main_site_zip_code", -- Zip Code where the Facility's main site is located.
    "project_site_address_line2", -- Address Line 2 of the project site.
    "council_date_3", -- Date the recommendation or decision was made by the Committee or Council.
    "initial_review_date", -- Date the CON application was initially reviewed for acceptability and minimal completeness.
    "revision_reason", -- Significant change to the project, from the original submission, prior to approval.
    "proposed_operator_city" -- City of the proposed operator.
FROM
    "health-data-ny-gov/certificate-of-need-applications-beginning-1974-h343-jwie:latest"."certificate_of_need_applications_beginning_1974"
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 health-data-ny-gov/certificate-of-need-applications-beginning-1974-h343-jwie 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 health-data-ny-gov/certificate-of-need-applications-beginning-1974-h343-jwie: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 health-data-ny-gov/certificate-of-need-applications-beginning-1974-h343-jwie

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 health-data-ny-gov/certificate-of-need-applications-beginning-1974-h343-jwie:latest

This will download all the objects for the latest tag of health-data-ny-gov/certificate-of-need-applications-beginning-1974-h343-jwie 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 health-data-ny-gov/certificate-of-need-applications-beginning-1974-h343-jwie: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 health-data-ny-gov/certificate-of-need-applications-beginning-1974-h343-jwie: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, health-data-ny-gov/certificate-of-need-applications-beginning-1974-h343-jwie is just another Postgres schema.

Related Documentation:

Loading...