Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid URL error when using "grid view" URL syntax #147

Closed
tomschenkjr opened this issue Nov 20, 2017 · 0 comments
Closed

Invalid URL error when using "grid view" URL syntax #147

tomschenkjr opened this issue Nov 20, 2017 · 0 comments
Assignees
Milestone

Comments

@tomschenkjr
Copy link
Contributor

Socrata's new landing page involved some rearranging of how URL's are structured. Namely, landing pages now mostly displays metadata about a dataset. To access the "grid view" (the "old" view), which shows much of the raw data, you must add /data to the end of the URL. For instance, the landing page for Chicago salaries are:

https://data.cityofchicago.org/Administration-Finance/Current-Employee-Names-Salaries-and-Position-Title/xzkq-xp2w

While the grid view is:

https://data.cityofchicago.org/Administration-Finance/Current-Employee-Names-Salaries-and-Position-Title/xzkq-xp2w/data

But, anyone copying/pasting the grid view URL will receive an error for an invalid Socrata URL. Here is the minimally reproducible error:

> landing_page_url <- "https://data.cityofchicago.org/Administration-Finance/Current-Employee-Names-Salaries-and-Position-Title/xzkq-xp2w"
> d <- read.socrata(landing_page_url)    # This will work
> grid_view_url <- "https://data.cityofchicago.org/Administration-Finance/Current-Employee-Names-Salaries-and-Position-Title/xzkq-xp2w/data"
> d <- read.socrata(grid_view_url)    # This will fail
Error in validateUrl(url, app_token) : 
  data is not a valid Socrata dataset unique identifier.

First, we will need to decide if we want to support the /data suffix. We currently support 2 URL structures: valid SoDA URLs and "human-readable" URLs as they appear in the browser. This would be a modification to the latter. But, it may make it easier for users who simply want to copy/paste a URL into the read.socrata() function to make it easy to retrieve data.

If we do support it, we must fully support it for future versions and would likely need to support different permutations if they're rolled out. For instance, if future URL syntaxes end with /graph or /lens or '/dashboard`, then we may need to support those as well.

An inbetween solution is simply throwing a more descriptive warning when encountering /data, so we neither support it but give users more descriptions.

To date, we have not received any errors on this and haven't seen anything reported on StackOverflow, so I believe urgency is low.

Interested in discussing preferences for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants