edmonton-ca/edmontonians-perception-survey-city-design-and-uhk5-49bk
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 edmontonians_perception_survey_city_design_and table in this repository, by referencing it like:

"edmonton-ca/edmontonians-perception-survey-city-design-and-uhk5-49bk:latest"."edmontonians_perception_survey_city_design_and"

or in a full query, like:

SELECT
    ":id", -- Socrata column ID
    "qd6_what_is_the_primary_language_spoken_in_your_household", --  Profiling question. Question: What is the primary language spoken in your household? || Possible Answers: English|French|Others 
    "d2tot_total_children_in_hh", --  Question: Total number of children in your household? 
    "qe_fsa", --  Forward Sortation Area (first 3 characters of postal code) 
    "q6j_how_much_do_you_agree_or_disagree_about_the_city_of_edmonto", --  Question:  How much do you agree or disagree about the City of Edmonton. - The city is culturally diverse || Possible Answers: 5 - Strongly Agree|4 - Agree|3 - Neither agree or disagree|2 - Disagree|1 - Strongly Disagree|Don't know 
    "q6e_how_much_do_you_agree_or_disagree_about_the_city_of_edmonto", --  Question:  How much do you agree or disagree about the City of Edmonton. - The city is clean and generally free from litter || Possible Answers: 5 - Strongly Agree|4 - Agree|3 - Neither agree or disagree|2 - Disagree|1 - Strongly Disagree|Don't know 
    "q6c_how_much_do_you_agree_or_disagree_about_the_city_of_edmonto", --  Question:  How much do you agree or disagree about the City of Edmonton. - The transit system is well designed and attractive || Possible Answers: 5 - Strongly Agree|4 - Agree|3 - Neither agree or disagree|2 - Disagree|1 - Strongly Disagree|Don't know 
    "q6a_how_much_do_you_agree_or_disagree_about_the_city_of_edmonto", --  Question:  How much do you agree or disagree about the City of Edmonton. - Streets are well designed || Possible Answers: 5 - Strongly Agree|4 - Agree|3 - Neither agree or disagree|2 - Disagree|1 - Strongly Disagree|Don't know 
    "q5_how_much_do_you_agree_or_disagree_that_edmonton_is_a_well_de", --  Question: How much do you agree or disagree that Edmonton is a well-designed, attractive city? || Possible Answers: 5 - Strongly Agree|4 - Agree|3 - Neither agree or disagree|2 - Disagree|1 - Strongly Disagree|Don't know 
    "qd5b_which_of_the_following_best_describes_your_total_personal_", --  Profiling question. Question: Which of the following best describes your total personal annual income before taxes? || Possible Answers: Less than $20,000|Between $20,000 and $29,999|Between $30,000 and $49,999|Between $50,000 and $79,999|Between $80,000 and $119,999|$120,000 or more|Prefer not to answer 
    "qd5a_which_of_the_following_best_describes_your_total_annual_ho", --  Profiling question. Question: Which of the following best describes your total annual household income before taxes? || Possible Answers: Less than $20,000|Between $20,000 and $29,999|Between $30,000 and $49,999|Between $50,000 and $79,999|Between $80,000 and $119,999|$120,000 or more|Prefer not to answer 
    "qd4_are_you_currently", --  Profiling question. Question: Which of the following best describes your employment status, are you currently... || Possible Answers: Working full time|Working part time|A student|Not working outside the home|Retired|Prefer not to answer 
    "qd3_what_is_the_highest_level_of_education_you_have_achieved", --  Profiling question. Question: What is the highest level of education you have achieved?? || Possible Answers: Less than high school|Graduated high school|Graduated college, technical or vocational school|Graduated university|Prefer not to answer 
    "d2b_between_10_and_17_years_of_age", --  Question: How many people in your household are: Between 10 and 17 years of age 
    "q6m_how_much_do_you_agree_or_disagree_about_the_city_of_edmonto", --  Question:  How much do you agree or disagree about the City of Edmonton. - The city has well-maintained business districts || Possible Answers: 5 - Strongly Agree|4 - Agree|3 - Neither agree or disagree|2 - Disagree|1 - Strongly Disagree|Don't know 
    "q6l_how_much_do_you_agree_or_disagree_about_the_city_of_edmonto", --  Question:  How much do you agree or disagree about the City of Edmonton. - It is an environmentally responsible city || Possible Answers: 5 - Strongly Agree|4 - Agree|3 - Neither agree or disagree|2 - Disagree|1 - Strongly Disagree|Don't know 
    "q6h_how_much_do_you_agree_or_disagree_about_the_city_of_edmonto", --  Question:  How much do you agree or disagree about the City of Edmonton. - The city is a great place for entertainment and fun || Possible Answers: 5 - Strongly Agree|4 - Agree|3 - Neither agree or disagree|2 - Disagree|1 - Strongly Disagree|Don't know 
    "q6f_how_much_do_you_agree_or_disagree_about_the_city_of_edmonto", --  Question:  How much do you agree or disagree about the City of Edmonton. - The city parks and recreation areas are well maintained || Possible Answers: 5 - Strongly Agree|4 - Agree|3 - Neither agree or disagree|2 - Disagree|1 - Strongly Disagree|Don't know 
    "q6b_how_much_do_you_agree_or_disagree_about_the_city_of_edmonto", --  Question:  How much do you agree or disagree about the City of Edmonton. - Streets are well maintained || Possible Answers: 5 - Strongly Agree|4 - Agree|3 - Neither agree or disagree|2 - Disagree|1 - Strongly Disagree|Don't know 
    "calldurationinseconds", --  Duration of the call in seconds 
    "qd10_and_what_type_of_residence_do_you_live_in", --  Profiling question. Question: What type of residence do you live in? || Possible Answers: House|Duplex|Four-plex|Apartment|Condo|Townhouse|Other 
    "qd8_did_you_vote_in_the_most_recent_municipal_election_for_the_", --  Profiling question. Question: Did you vote in the most recent municipal election for the City of Edmonton? || Possible Answers: Yes|No|I was not eligible 
    "qd7_do_you_work_for_the_city_of_edmonton", --  Profiling question. Question: Do you work for the City of Edmonton? || Possible Answers: Yes|No 
    "d7_which_of_the_following_best_describes_your_marital_status_ar", --  Profiling question. Question: Which of the following best describes your marital status? Are you... || Possible Answers: Single, never married|Married or common law|Separated, divorced, widowed|Don't know/Prefer not to answer 
    "d2d_over_65_years_of_age", -- Question: How many people in your household are: Over 65 years of age 
    "d2c_between_18_and_65_years_of_age", -- Question: How many people in your household are: Between 18 and 65 years of age 
    "d2a_under_10_years_of_age", --  Question: How many people in your household are: Under 10 years of age 
    "d1a_as_different_people_may_have_different_views_and_needs_the_", --  Question: As different people may have different views and needs, including yourself, how many people are there in your household? 
    "qd_how_long_have_you_lived_in_edmonton", --  Profiling question. Question: How long have you lived in Edmonton? || Possible Answers: Less than 6 months|6 months to less than 1 year|1 year to less than 3 years|3 years to less than 5 years|5 years or more 
    "d3_age", --  Profiling question. Question: Your age? || Possible Answers: Under 18 years old|18 - 24|25 - 34|35 - 44|45 - 54|55 - 64|65 years and over|Refused 
    "q6o_how_much_do_you_agree_or_disagree_about_the_city_of_edmonto", --  Question:  How much do you agree or disagree about the City of Edmonton. - There are parks and green spaces spread throughout the city || Possible Answers: 5 - Strongly Agree|4 - Agree|3 - Neither agree or disagree|2 - Disagree|1 - Strongly Disagree|Don't know 
    "q6n_how_much_do_you_agree_or_disagree_about_the_city_of_edmonto", --  Question:  How much do you agree or disagree about the City of Edmonton. - The city has attractive streetscaping such as, flower pots, lighting, furniture, signage, etc. || Possible Answers: 5 - Strongly Agree|4 - Agree|3 - Neither agree or disagree|2 - Disagree|1 - Strongly Disagree|Don't know 
    "q6k_how_much_do_you_agree_or_disagree_about_the_city_of_edmonto", --  Question:  How much do you agree or disagree about the City of Edmonton. - The city is a great place to visit || Possible Answers: 5 - Strongly Agree|4 - Agree|3 - Neither agree or disagree|2 - Disagree|1 - Strongly Disagree|Don't know 
    "q6i_how_much_do_you_agree_or_disagree_about_the_city_of_edmonto", --  Question:  How much do you agree or disagree about the City of Edmonton. - The city is open and welcoming to newcomers || Possible Answers: 5 - Strongly Agree|4 - Agree|3 - Neither agree or disagree|2 - Disagree|1 - Strongly Disagree|Don't know 
    "q6d_how_much_do_you_agree_or_disagree_about_the_city_of_edmonto", --  Question:  How much do you agree or disagree about the City of Edmonton. - Public spaces like parks and squares are desirable places to visit || Possible Answers: 5 - Strongly Agree|4 - Agree|3 - Neither agree or disagree|2 - Disagree|1 - Strongly Disagree|Don't know 
    "qdr_city_quadrant", --  Profiling question. Question: City Quadrant? || Possible Answers: NW|NE|SE|SW|Other 
    "qd11_were_you", --  Profiling question. Question: Were you? || Possible Answers: Born in Canada|Moved to Canada from somewhere else 
    "qd9_do_you_currently_own_or_rent_your_place_of_residence", --  Profiling question. Question: Do you currently own or rent your place of residence? || Possible Answers: Own|Rent 
    "completion_date", --  Date the respondent did the survey 
    "q6g_how_much_do_you_agree_or_disagree_about_the_city_of_edmonto", --  Question:  How much do you agree or disagree about the City of Edmonton. - There is a wide range of housing available || Possible Answers: 5 - Strongly Agree|4 - Agree|3 - Neither agree or disagree|2 - Disagree|1 - Strongly Disagree|Don't know 
    "d1_gender" --  Profiling question. Question: Your gender? || Possible Answers: Female|Male 
FROM
    "edmonton-ca/edmontonians-perception-survey-city-design-and-uhk5-49bk:latest"."edmontonians_perception_survey_city_design_and"
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 edmonton-ca/edmontonians-perception-survey-city-design-and-uhk5-49bk with SQL in under 60 seconds.

This repository is an "external" repository. That means it's hosted elsewhere, in this case at data.edmonton.ca. When you queryedmonton-ca/edmontonians-perception-survey-city-design-and-uhk5-49bk: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.edmonton.ca, 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 \
  "edmonton-ca/edmontonians-perception-survey-city-design-and-uhk5-49bk" \
  --handler-options '{
    "domain": "data.edmonton.ca",
    "tables": {
        "edmontonians_perception_survey_city_design_and": "uhk5-49bk"
    }
}'

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, edmonton-ca/edmontonians-perception-survey-city-design-and-uhk5-49bk is just another Postgres schema.