edmonton-ca/bike-ridership-edmonton-insight-community-nhbh-yj57
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 bike_ridership_edmonton_insight_community table in this repository, by referencing it like:

"edmonton-ca/bike-ridership-edmonton-insight-community-nhbh-yj57:latest"."bike_ridership_edmonton_insight_community"

or in a full query, like:

SELECT
    ":id", -- Socrata column ID
    "q15_household_income_study_profiling_questionnaire_2014", -- Profiling question, one response selected by respondent. - Which of the following categories best describes your total household income in 2014 before taxes? || Possible Answers: Under $20,000/$20,000 to $29,999/$30,000 to $39,999/$40,000 to $49,999/$50,000 to $59,999/$60,000 to $79,999/$80,000 to $99,999/$100,000 to $149,000/$150,000 and over/Prefer not to answer
    "q14b_secondary_transportation_study_profiling_questionnaire_201", -- Profiling question, one response selected by respondent. - What is your secondary mode of transportation? || Possible Answers: Car/truck/Van as DRIVER/Car/truck/van as PASSENGER/Public Transit/Walk/Bicycle/Only have one mode of transportation/Other (Specify)
    "q3_own_rent_study_profiling_questionnaire_2014", -- Profiling question, one response selected by respondent. - Do you own or rent your primary residence in the City of Edmonton? || Possible Answers: Own/Rent
    "biking_comfort2_major_street_with_two_lanes_in_each_directi_000", -- Respondents were asked to rank the following on a scale. Question: Major street with two lanes in each direction, on-street parking, traffic speeds of 50 to 60 km/hour, and a bike lane separated from parked cars by a median?? || Possible Answers: 4 Very comfortable/3 Somewhat comfortable/2 Somewhat uncomfortable/1 Very uncomfortable
    "biking_comfort_neighbourhood_commercial_shopping_street_with_on", -- Respondents were asked to rank the following on a scale. Question: Neighbourhood commercial shopping street with one lane in each direction, traffic speeds of 40 to 50 km/hr, on-street car parking and no reserved bike lane?? || Possible Answers: 4 Very comfortable/3 Somewhat comfortable/2 Somewhat uncomfortable/1 Very uncomfortable
    "biking_comfort_a_quiet_residential_street_with_bike_route_signs", -- Respondents were asked to rank the following on a scale. Question: A quiet residential street with bike route signs and shared-use lane or sharrow markings?? || Possible Answers: 4 Very comfortable/3 Somewhat comfortable/2 Somewhat uncomfortable/1 Very uncomfortable
    "biking_comfort_a_path_or_trail_separated_from_the_street", -- Respondents were asked to rank the following on a scale. Question: A path or trail separated from the street? || Possible Answers: 4 Very comfortable/3 Somewhat comfortable/2 Somewhat uncomfortable/1 Very uncomfortable
    "bike_agreement_many_of_the_places_i_need_to_get_to_regularly_ar", -- Respondents were asked to rank the following on a scale. Question: Many of the places I need to get to regularly are within biking distance of my home? || Possible Answers: 4 Strongly agree/3 Somewhat agree/2 Somewhat disagree/1 Strongly disagree
    "why_ride_bike_commuting_to_work_or_school", -- Respondents were asked to select all that apply. Question:  Why do you ride a bike?-Commuting to work or school || Possible Answers: Yes (1)/No (0)
    "biker_ridership_winter", -- Respondents were asked to select one response. Question: How often do you ride a bike during the winter? || Possible Answers: Daily/4 or more times a week/2 to 3 times a week/Once a week/Once a month/Never ride a bike
    "completiondate", -- Date/Time the respondent finished the survey.
    "q17_city_employee_study_profiling_questionnaire_2014", -- Profiling question, one response selected by respondent. - Do you work for the City of Edmonton? || Possible Answers: Yes/No
    "q14a_primary_transportation_study_profiling_questionnaire_2014", -- Profiling question, one response selected by respondent. - What is your primary mode of transportation? || Possible Answers: Car/truck/Van as DRIVER/Car/truck/van as PASSENGER/Public Transit/Walk/Bicycle/Other (Specify)
    "q12_employment_status_study_profiling_questionnaire_2014", -- Profiling question, one response selected by respondent. - What is your current employment status? || Possible Answers: Employed full-time (30+ hours a week)/Employed part-time (0-30 hours a week)/Homemaker/Post-secondary student/High School Student/Unemployed/Permanently unable to Work/Retired/Other (Specify)
    "browsertype", -- System Captured, Browser used by the respondent. Question: Browser Type? - BrowserType || Possible Answers: Internet Explorer/Firefox/Safari/Google Chrome/Opera/Android/BlackBerry/Unknown
    "ostype", -- System Captured, OS used by the respondent. Question: OS Type? - OSType || Possible Answers: Mac (OS X)/Linux/Windows/iOS/Android/BlackBerry/Unknown
    "bike_agreement_i_don_t_have_time_to_bike_places_instead_of_driv", -- Respondents were asked to rank the following on a scale. Question: I don’t have time to bike places instead of driving? || Possible Answers: 4 Strongly agree/3 Somewhat agree/2 Somewhat disagree/1 Strongly disagree
    "bike_agreement_i_would_like_to_learn_how_to_drive_a_vehicle_mor", -- Respondents were asked to rank the following on a scale. Question: I would like to learn how to drive a vehicle more safely with cyclists in traffic? || Possible Answers: 4 Strongly agree/3 Somewhat agree/2 Somewhat disagree/1 Strongly disagree
    "bike_agreement_i_would_like_to_travel_by_bike_more_than_i_do_no", -- Respondents were asked to rank the following on a scale. Question: I would like to travel by bike more than I do now? || Possible Answers: 4 Strongly agree/3 Somewhat agree/2 Somewhat disagree/1 Strongly disagree
    "why_ride_bike_to_go_shopping_dine_out_run_errands_visit_people_", -- Respondents were asked to select all that apply. Question:  Why do you ride a bike?-To go shopping, dine out, run errands, visit people, go to a movie or similar activities (transportation trips) || Possible Answers: Yes (1)/No (0)
    "age_rollup_detailed_study_profiling_questionnaire_2014", -- Profiling question, Based on birthdate entered by Respondent. System Determined. Question: Age Rollup? -  || Possible Answers: Under 15/15-17/18-24/25-29/30-34/35-39/40-44/45-49/50-54/55-59/60-64/65-69/70-74/75-79/80 and over
    "fsa_study_profiling_questionnaire_2014", -- Forward Sortation Area (first 3 characters of postal code)
    "q13_volunteer_study_profiling_questionnaire_2014", -- Profiling question, one response selected by respondent. - In the last 12 months, did you do any activities without pay on behalf of a group or an organization as a volunteer? || Possible Answers: Yes/No
    "q11_home_language_study_profiling_questionnaire_2014", -- Profiling question, one response selected by respondent. - What is the primary language spoken in your household? || Possible Answers: English/Arabic/Cantonese/Spanish/Panjabi (Punjabi)/French/German/Mandarin/Tagalog (Pilipino, Filipino)/Ukrainian/Other (Specify)
    "q9a_edmonton_study_profiling_questionnaire_2014", -- Profiling question, one response selected by respondent. - How long have you lived in Edmonton? || Possible Answers: Less than 1 year/Between 1 to 2 years/Between 3 to 5 years/Greater than 5 years/I do not live in Edmonton
    "q8_born_canada_study_profiling_questionnaire_2014", -- Profiling question, one response selected by respondent. - Were you born in Canada? || Possible Answers: Yes/No
    "q7_children_study_profiling_questionnaire_2014", -- Profiling question, one response selected by respondent. - Do you have children 18 or under living at home? || Possible Answers: Yes/No
    "gender_study_profiling_questionnaire_2014", -- Profiling question, one response selected by respondent. - Are you…? || Possible Answers: Male/Female/Other/I prefer not to answer
    "devicetype", -- System Captured, Device used by the respondent. Question: Device Type? - DeviceType || Possible Answers: Tablet/Desktop/Phone
    "biking_comfort2_major_street_with_two_lanes_in_each_directi_001", -- Respondents were asked to rank the following on a scale. Question: Major street with two lanes in each direction, on-street parking, traffic speeds of 50 to 60 km/hour, and a reserved bike lane?? || Possible Answers: 4 Very comfortable/3 Somewhat comfortable/2 Somewhat uncomfortable/1 Very uncomfortable
    "biking_comfort2_a_major_street_with_two_lanes_in_each_direction", -- Respondents were asked to rank the following on a scale. Question: A major street with two lanes in each direction, on-street parking, traffic speeds of 50 to 60 km/hour, and no reserved bike lane?? || Possible Answers: 4 Very comfortable/3 Somewhat comfortable/2 Somewhat uncomfortable/1 Very uncomfortable
    "biking_comfort_a_quiet_residential_street", -- Respondents were asked to rank the following on a scale. Question: A quiet residential street? || Possible Answers: 4 Very comfortable/3 Somewhat comfortable/2 Somewhat uncomfortable/1 Very uncomfortable
    "bike_agreement_i_would_like_to_learn_how_to_ride_a_bike_more_sa", -- Respondents were asked to rank the following on a scale. Question: I would like to learn how to ride a bike more safely in traffic? || Possible Answers: 4 Strongly agree/3 Somewhat agree/2 Somewhat disagree/1 Strongly disagree
    "bike_agreement_i_have_been_biking_more_often_because_of_the_bik", -- Respondents were asked to rank the following on a scale. Question: I have been biking more often because of the bike lanes that have been installed.? || Possible Answers: 4 Strongly agree/3 Somewhat agree/2 Somewhat disagree/1 Strongly disagree
    "bike_agreement_there_is_so_much_traffic_along_streets_near_my_h", -- Respondents were asked to rank the following on a scale. Question: There is so much traffic along streets near my home that it would make it difficult or unpleasant to ride a bike.? || Possible Answers: 4 Strongly agree/3 Somewhat agree/2 Somewhat disagree/1 Strongly disagree
    "bike_agreement_i_would_ride_a_bike_more_often_if_i_felt_safer_r", -- Respondents were asked to rank the following on a scale. Question: I would ride a bike more often if I felt safer riding on the road? || Possible Answers: 4 Strongly agree/3 Somewhat agree/2 Somewhat disagree/1 Strongly disagree
    "why_ride_bike_recreation_or_leisure_enjoyment", -- Respondents were asked to select all that apply. Question:  Why do you ride a bike?-Recreation or leisure enjoyment || Possible Answers: Yes (1)/No (0)
    "bike_ridership", -- Respondents were asked to select one response. Question: How often do you ride a bike during the spring/summer/fall? || Possible Answers: Daily/4 or more times a week/2 to 3 times a week/Once a week/Once a month/Never ride a bike
    "responsedate", -- Date/Time the respondent first opened/started the survey.
    "q16_education_study_profiling_questionnaire_2014", -- Profiling question, one response selected by respondent. - What is the highest level of education you have completed? || Possible Answers: Elementary/grade school graduate/High school graduate/College / technical school graduate/University undergraduate degree/Post-graduate degree/Professional school graduate (e.g. medicine, dentistry, veterinary medicine, optometry)
    "q10_own_business_study_profiling_questionnaire_2014", -- Profiling question, one response selected by respondent. - Do you own a business in the City of Edmonton? || Possible Answers: Yes/No
    "biking_comfort_residential_street_with_bike_route_signs_and_sha", -- Respondents were asked to rank the following on a scale. Question: Residential street with bike route signs and shared-use lane or sharrow markings, and things like traffic diverters that slow down and discourage car traffic?? || Possible Answers: 4 Very comfortable/3 Somewhat comfortable/2 Somewhat uncomfortable/1 Very uncomfortable
    "biking_comfort2_a_neighbourhood_commercial_shopping_street_with", -- Respondents were asked to rank the following on a scale. Question: A neighbourhood commercial shopping street with one lane in each direction, traffic speeds of 40 to 50 km/hour, on-street car parking and a reserved bike lane?? || Possible Answers: 4 Very comfortable/3 Somewhat comfortable/2 Somewhat uncomfortable/1 Very uncomfortable
    "why_ride_bike_other_reasons" -- Respondents were asked to select all that apply. Question:  Why do you ride a bike?-Other reasons || Possible Answers: Yes (1)/No (0)
FROM
    "edmonton-ca/bike-ridership-edmonton-insight-community-nhbh-yj57:latest"."bike_ridership_edmonton_insight_community"
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/bike-ridership-edmonton-insight-community-nhbh-yj57 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 edmonton-ca/bike-ridership-edmonton-insight-community-nhbh-yj57: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 edmonton-ca/bike-ridership-edmonton-insight-community-nhbh-yj57

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 edmonton-ca/bike-ridership-edmonton-insight-community-nhbh-yj57:latest

This will download all the objects for the latest tag of edmonton-ca/bike-ridership-edmonton-insight-community-nhbh-yj57 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 edmonton-ca/bike-ridership-edmonton-insight-community-nhbh-yj57: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 edmonton-ca/bike-ridership-edmonton-insight-community-nhbh-yj57: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, edmonton-ca/bike-ridership-edmonton-insight-community-nhbh-yj57 is just another Postgres schema.

Related Documentation:

Loading...