pa-gov/post-secondary-completions-total-awardsdegrees-sy-jqcu-bcsg
Icon for Socrata external plugin

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 post_secondary_completions_total_awardsdegrees_sy table in this repository, by referencing it like:

"pa-gov/post-secondary-completions-total-awardsdegrees-sy-jqcu-bcsg:latest"."post_secondary_completions_total_awardsdegrees_sy"

or in a full query, like:

SELECT
    ":id", -- Socrata column ID
    "doctor_s_degree_professional_practice", -- A doctor's degree that is conferred upon completion of a program providing the knowledge and skills for the recognition, credential, or license required for professional practice. The degree is awarded after a period of study such that the total time to the degree, including both pre-professional and professional preparation, equals at least six full-time equivalent academic years. Some of these degrees were formerly classified as firstprofessional and may include: Chiropractic (D.C. or D.C.M.); Dentistry (D.D.S. or D.M.D.); Law (J.D.); Medicine (M.D.); Optometry (O.D.); Osteopathic Medicine (D.O); Pharmacy (Pharm.D.); Podiatry (D.P.M., Pod.D., D.P.); or, Veterinary Medicine (D.V.M.), and others, as designated by the awarding institution.
    "institution_name", -- The name of the institution. 
    "associate_s_degree", -- An award that normally requires at least 2 but less than 4 years of full-time equivalent college work.
    "master_s_degree", -- An award that requires the successful completion of a program of study of at least the full-time equivalent of 1 but not more than 2 academic years of work beyond the bachelor's degree. Some of these degrees, such as those in Theology (M.Div., M.H.L./Rav) that were formerly classified as "firstprofessional", may require more than two full-time equivalent academic years of work.
    "bachelor_s_degree", -- An award (baccalaureate or equivalent degree, as determined by the Secretary, U.S. Department of Education) that normally requires at least 4 but not more than 5 years of full-time equivalent college-level work. This includes all bachelor's degrees conferred in a 5-year cooperative (work-study) program. A cooperative plan provides for alternate class attendance and employment in business, industry, or government; thus, it allows students to combine actual work experience with their college studies. Also includes bachelor's degrees in which the normal 4 years of work are completed in 3 years.
    "doctor_s_degree_other", -- A doctor's degree that does not meet the definition of a doctor's degree - research/scholarship or a doctor's degree - professional practice.
    "year", -- School Year
    "doctor_s_degree_research_scholarship", -- A Ph.D. or other doctor's degree that requires advanced work beyond the master's level, including the preparation and defense of a dissertation based on original research, or the planning and execution of an original project demonstrating substantial artistic or scholarly achievement. Some examples of this type of degree may include Ed.D., D.M.A., D.B.A., D.Sc., D.A., or D.M, and others, as designated by the awarding institution.
    "unit_id" -- Unique identification number assigned to postsecondary institutions surveyed through the Integrated Postsecondary Education Data System (IPEDS). Also referred to as UNITID or IPEDS ID.
FROM
    "pa-gov/post-secondary-completions-total-awardsdegrees-sy-jqcu-bcsg:latest"."post_secondary_completions_total_awardsdegrees_sy"
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 pa-gov/post-secondary-completions-total-awardsdegrees-sy-jqcu-bcsg with SQL in under 60 seconds.

This repository is an "external" repository. That means it's hosted elsewhere, in this case at data.pa.gov. When you querypa-gov/post-secondary-completions-total-awardsdegrees-sy-jqcu-bcsg:latest on the DDN, we "mount" the repository using the socrata mount handler. The mount handler proxies your SQL query to the upstream data source, translating it from SQL to the relevant language (in this case SoQL).

We also cache query responses on the DDN, but we run the DDN on multiple nodes so a CACHE_HIT is only guaranteed for subsequent queries that land on the same node.

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 (like this repository), 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, where the author has pushed Splitgraph Images to the repository, you can "clone" and/or "checkout" the data using sgr cloneand sgr checkout.

Mounting Data

This repository is an external repository. It's not hosted by Splitgraph. It is hosted by data.pa.gov, and Splitgraph indexes it. This means it is not an actual Splitgraph image, so you cannot use sgr clone to get the data. Instead, you can use the socrata adapter with the sgr mount command. Then, if you want, you can import the data and turn it into a Splitgraph image that others can clone.

First, install Splitgraph if you haven't already.

Mount the table with sgr mount

sgr mount socrata \
  "pa-gov/post-secondary-completions-total-awardsdegrees-sy-jqcu-bcsg" \
  --handler-options '{
    "domain": "data.pa.gov",
    "tables": {
        "post_secondary_completions_total_awardsdegrees_sy": "jqcu-bcsg"
    }
}'

That's it! Now you can query the data in the mounted table like any other Postgres table.

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, pa-gov/post-secondary-completions-total-awardsdegrees-sy-jqcu-bcsg is just another Postgres schema.