datahub-usac/erate-request-for-discount-on-services-discount-upfy-khtr
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 erate_request_for_discount_on_services_discount table in this repository, by referencing it like:

"datahub-usac/erate-request-for-discount-on-services-discount-upfy-khtr:latest"."erate_request_for_discount_on_services_discount"

or in a full query, like:

SELECT
    ":id", -- Socrata column ID
    "entity_nces_code", -- School code assigned by the National Center for Education Statistics (NCES) for a parent entity.
    "child_alternative_dis", -- Alternative discount mechanism used to determine the percentage of National School Lunch Program (NSLP) for the child entity e.g. Survey, sibling match, combination (not CEP) or none.
    "par_students_count", -- Indicates whether the parent’s entity student count is based on an estimate. 
    "par_subtype", -- Subtypes for a parent entity such as charter school, public school, pre-k etc.
    "child_entity_annex_name", -- Annex name associated with the school or library for the child entity. An annex is a classroom or facility that is part of a school or library which is geographically separate but  maintained through the same entity and considered part of that entity by the state.
    "child_entity_type_name", -- Child entity type such as school, library or non-instructional facility (NIF).
    "form_version", -- Form version: original or current.
    "par_entity_type_name", -- Indicates whether the selected entity type for a parent entity is school, library or non-instructional facility (NIF).
    "par_alternative_dis", -- Alternative discount mechanism used to determine the percentage of National School Lunch Program (NSLP) for the parent entity (e.g. Survey, sibling match, combination (not CEP) or none).
    "c2_discount", -- Discount rate applied to Category Two services for the applicant on the FCC Form 471 application. Services discounted by this rate include Internal Connections, Managed Internal Broadband Services (MIBS) and/or Basic Maintenance of Internal Connections. 
    "par_entity_is_urban_or_rural", -- Indicates whether the selected parent entity's school or library resides in a rural or urban area.
    "is_certified_in_window", -- Indicates whether the application has been certified in the window.
    "funding_year", -- Funding year for the application.
    "par_entity_locale_code", -- Code assigned by the Institute of Museum and Library Services (ILMS) based on the population served by a library or library system.
    "par_entity_library_square_footage", -- Square footage of a library.
    "par_entity_state_school_id", -- School number assigned by the state to a school or school district.
    "entity_number_of_students", -- Number of fulltime students for a parent entity.
    "child_student_count", -- Indicates whether the child student count is based on an estimate. 
    "par_entity_annex_name", -- Annex name associated with the parent entity. An annex is a classroom or facility that is part of a school or library which is geographically separate but maintained through the same entity and considered part of that entity by the state.
    "child_entity_state_school_id", -- School number assigned by the state to a school.
    "c1_voice_discount", -- Discount rate applied to Voice services for the applicant on the FCC Form 471 Application. This Category One discount is separate from the discount applied to Data Transmission and/or Internet Access Service.
    "child_entity_is_urban_or_rural", -- Indicates whether the selected child entity's school or library resides in a rural or urban area.
    "ben_state", -- Applicant state.
    "par_endowment", -- Dollar amount of the endowment for the parent entity.
    "child_entity_number_of_students", -- Number of fulltime students for a child entity.
    "child_nslp_students", -- Number of students eligible for National School Lunch Program (NSLP) for a child school.
    "child_nslp_percentage", -- Calculated by dividing the National School Lunch Program (NSLP) students by the total number of students for a school.
    "child_entity_locale_code", -- Code assigned by the Institute of Museum and Library Services (ILMS) based on the population served by a library.
    "par_entity_school_district_number", -- School district number for the library system or library based on the location of the main branch.
    "par_entity_state_lea_id", -- State's Local Education Association (LEA) number assigned to a school, that is a parent entity.
    "child_entity_fscs_code", -- Federal-State Cooperative System (FSCS) code for a public library child entity.
    "child_entity_ben", -- Entity number for the child entity.
    "c1_discount", -- Discount rate applied to Category One services for the applicant on the FCC Form 471 application. Services discounted by this rate include Internet Access Services and / or Data Transmission but do not include Voice Services.
    "child_entity_state_lea_id", -- State's Local Education Association (LEA) number assigned to a school.
    "child_endowment", -- Dollar amount of the endowment for the child entity.
    "par_entity_school_district", -- School district name for the library system or library based on the location of the main branch.
    "application_number", -- Unique application number is generated at the time an applicant begins to file FCC Form 471. Applicants can request funding for multiple services under the same application number. 
    "par_entity_name", -- Parent entity name.
    "par_entity_ben", -- Billed entity number for applicant.
    "par_entity_fscs_code", -- Federal-State Cooperative System (FSCS) code for a public library, that is a parent entity.
    "entity_cep_percentage", -- Percentage of students in the parent entity that are eligible for Community Eligibility Program (CEP).
    "child_entity_name", -- Name of child's entity.
    "child_entity_library_square_footage", -- Square footage of a library.
    "child_entity_school_district", -- School district name if the library is designated as the main branch.
    "child_entity_school_district_number", -- School district number if the library is designated as the main branch.
    "child_entity_nces_code", -- School code assigned by the National Center for Education Statistics (NCES) for a child entity.
    "child_entity_cep_percentage", -- Percentage of students in the child entity that are eligible for Community Eligibility Program (CEP).
    "child_subtype" -- Subtypes for a child entity such as charter school, public school, pre-K etc.
FROM
    "datahub-usac/erate-request-for-discount-on-services-discount-upfy-khtr:latest"."erate_request_for_discount_on_services_discount"
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 datahub-usac/erate-request-for-discount-on-services-discount-upfy-khtr 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 datahub-usac/erate-request-for-discount-on-services-discount-upfy-khtr: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 datahub-usac/erate-request-for-discount-on-services-discount-upfy-khtr

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 datahub-usac/erate-request-for-discount-on-services-discount-upfy-khtr:latest

This will download all the objects for the latest tag of datahub-usac/erate-request-for-discount-on-services-discount-upfy-khtr 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 datahub-usac/erate-request-for-discount-on-services-discount-upfy-khtr: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 datahub-usac/erate-request-for-discount-on-services-discount-upfy-khtr: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, datahub-usac/erate-request-for-discount-on-services-discount-upfy-khtr is just another Postgres schema.

Related Documentation:

Loading...