Query the Data Delivery Network
Query the DDNThe 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_recipient_details_and_commitments
table in this repository, by referencing it like:
"datahub-usac/erate-recipient-details-and-commitments-avi8-svp9:latest"."erate_recipient_details_and_commitments"
or in a full query, like:
SELECT
":id", -- Socrata column ID
"original_allocation", -- Cost allocation for the recipient of service for Category Two products and services.
"is_school_library_independent", -- A school/library is listed as independent (Yes) if it is not part of a school district/library system.
"ros_urban_rural_status", -- User-entered urban/rural status for the recipient.
"form_471_status_name", -- Current status of the FCC Form 471. It can be used to filter the following statuses: Certified and Committed.
"funding_year", -- Funding year for the FCC Form 471.
"form_471_upload_speed_unit_name", -- Upload speed units ( Mbps or Gbps) for the FRN line item service.
"form_471_frn_status_name", -- Status of the funding request. It includes pending, funded, denied or cancelled.
"form_471_frn_fiber_sub_type_name", -- Fiber subtypes for fiber FRNs. Options include maintenance and operation, network equipment, network equipment and maintenance, or special construction.
"ros_status", -- Indicates if an organization is active (open) or closed.
"ros_physical_zipcode", -- Zip code for the recipient.
"organization_entity_type_name", -- Applicant type including: school, school district, library, library system, or consortia.
"post_discount_applicant_share", -- Total applicant share of eligible costs for the funding year after applying a discount for the FRN line item.
"ros_entity_type", -- The type of the recipient of service entity including school district, school, library system, library, consortium, and non-instructional facility (NIF).
"chosen_category_of_service", -- Category of service for the funding requested.
"form_471_service_type_name", -- FRN service type including Voice; Data Transmission and/or Internet Access; Basic Maintenance of Internal Connections; Internal Connections; or Managed Internal Broadband Services.
"ros_physical_city", -- City where the recipient is located.
"ros_entity_number", -- The number of the recipient of service assigned by USAC.
"form_471_download_speed_unit_name", -- Internet download speed unit (e.g. Mbps or Gbps) for FRN line item.
"org_city", -- Applicant city.
"org_congressional_district", -- Congressional district in which the applicant is located.
"is_certified_in_window", -- Indicates whether the application has been certified during the FCC Form 471 application filing window.
"form_471_product_name", -- Product or service type for the FRN line Item. Examples include: ATM, data plan for portable device, OC-1, connectors, DS-4, and frame relay.
"monthly_recurring_unit_eligible_costs", -- Total monthly eligible costs for the FRN line item.
"qty_allocation", -- Number of lines allocated to a recipient of service for Category One services.
"ros_physical_address", -- Street address where the recipient is located.
"ros_physical_county", -- County where the recipient is located.
"ros_number_of_full_time_students", -- The total number of full-time students for the recipient school.
"org_zipcode", -- Applicant zip code.
"application_number", -- Unique application number generated at the time an applicant begins to file the FCC Form 471 application. Applicants can request funding for multiple services under the same application number.
"pending_reason", -- Indicates the review status of the Funding request. Pending Reason is limited to Current (Committed) forms.
"upload_speed", -- Internet upload speed of the connection for the FRN line item. It can be used to filter list of FRN line items with certain range of upload speed.
"download_speed", -- Internet download speed of the connection for the FRN line item. It can be used to filter list of FRN line items with certain range of download speed.
"total_monthly_cost", -- Total pre-discounted monthly charges for the FRN line item.
"total_eligible_recurring_costs", -- Total pre-discounted eligible recurring charges for the FRN line item.
"total_one_time_cost", -- Pre-discounted non-recurring charges for the FRN line item.
"one_time_ineligible_cost", -- Total one time ineligible costs for the FRN line item.
"ros_physical_state", -- U.S. state or territory where the recipient is located.
"org_address1", -- Applicant street address line 1.
"spin_name", -- Service provider name for the FRN.
"form_471_function_name", -- Additional information about the FRN line item service or product. Examples include: routers, switches, copper, fiber, wireless, cabling/connectors, and racks.
"form_471_frn_fiber_type_name", -- Fiber type for fiber FRNs including Lit Fiber, Dark Fiber, or Self Provisioned Fiber.
"ros_entity_name", -- The name of the recipient of service.
"ros_physical_zipcode_ext", -- Four-digit ZIP code extension for the recipient if applicable.
"ros_square_footage", -- Total interior area of the recipient library measured in square footage.
"ros_total_number_of_part_time_students", -- The total number of part-time students for the recipient school.
"ros_peak_number_of_part_time_students", -- The peak number of part-time students for the recipient school.
"ros_number_of_nslp_students", -- Number of students or calculated number of students eligible for the National School Lunch Program (NSLP) at the recipient school.
"organization_name", -- 10-digit number that the FCC assigns to a business or individual that registers with the FCC.
"total_eligible_one_time_costs", -- Total pre-discount eligible one-time charges of a funding request.
"dis_pct", -- Discount rate applied to service or equipment for the FRN.
"ros_subtype", -- Describes the type of school or library. Examples include: Public School, Private School, Research Library, Bookmobile, etc.
"ros_physical_address_2", -- Additional recipient address information if applicable.
"ros_latitude", -- System-generated latitude coordinate of the recipient based on the physical address.
"ros_longitude", -- System-generated longitude coordinate of the recipient based on the physical address.
"ros_congressional_district", -- Congressional district in which the recipient is located.
"billed_entity_number", -- E-Rate Billed Entity Number for the FCC Form 471 applicant.
"org_state", -- Applicant state.
"funding_request_number", -- Unique funding request number associated with the FCC Form 471.
"form_471_line_item_number", -- Funding request line item number can be used to filter the records associated to a specific FRN line item.
"spin_number", -- Unique nine-digit number assigned to identify the service provider.
"monthly_recur_ineligible_cost", -- Total monthly ineligible costs for the FRN line item.
"monthly_quantity", -- Number of units for the FRN line item monthly recurring costs.
"total_monthly_eligible_recurring_costs", -- Pre-discounted eligible monthly charges for the FRN line item.
"months_of_service", -- Number of months during the funding year for the FRN line item service.
"one_time_eligible_costs", -- Total one time eligible costs for the FRN line item.
"one_time_quantity", -- Quantity for the one-time costs for the FRN line item.
"pre_discount_extended_eligible_line_item_costs", -- Total eligible costs for the funding year prior to applying a discount for the FRN line item.
"post_discount_extended_eligible_line_item_costs", -- Total eligible costs for the funding year after applying a discount for the FRN line item.
"tribal_type" -- Indicates if the school or library is maintained by a tribal government.
FROM
"datahub-usac/erate-recipient-details-and-commitments-avi8-svp9:latest"."erate_recipient_details_and_commitments"
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-recipient-details-and-commitments-avi8-svp9
with SQL in under 60 seconds.
Query Your Local Engine
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; sgr
can 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 clone
and sgr checkout
.
Cloning Data
Because datahub-usac/erate-recipient-details-and-commitments-avi8-svp9: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-recipient-details-and-commitments-avi8-svp9
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-recipient-details-and-commitments-avi8-svp9:latest
This will download all the objects for the latest
tag of datahub-usac/erate-recipient-details-and-commitments-avi8-svp9
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-recipient-details-and-commitments-avi8-svp9: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-recipient-details-and-commitments-avi8-svp9: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-recipient-details-and-commitments-avi8-svp9
is just another Postgres schema.