uWaterloo / OpenData

Help and Support for University of Waterloo Open Data Initiative
https://api.uwaterloo.ca
90 stars 12 forks source link

Incorrect response from /courses #199

Closed timweri closed 5 years ago

timweri commented 5 years ago

The response from https://api.uwaterloo.ca/v2/courses.json contains an incorrect entry.

The data field contains

{"course_id":"013949","subject":"GER","catalog_number":"774","title":"Topics in German Literature and Culture Before 1700"},
{"course_id":"013949","subject":"GER","catalog_number":"774`","title":"German Literature and Culture Before 1700"}

I assume these two entries refer two the same course. The extra ` must have come from scraping error.

lkmorlan commented 5 years ago

I think course_id is supposed to be unique. To catch this sort of error, the system should log an error when it would generate a duplicate.

timweri commented 5 years ago

I'm not sure if course_id is meant to be unique. So I found at least a pair of courses with the same course_id but different subject and catalog_number. Everything else is the same so I assume they are the same course, just listed under different faculty.

{"course_id":"000135","subject":"AMATH","catalog_number":"873","title":"Introduction to Quantum Field Theory"},
{"course_id":"000135","subject":"PHYS","catalog_number":"703","title":"Introduction to Quantum Field Theory"}

After looking these two courses up, both of them exist on uwaterloo's website and both have the same course_id. I think this is confirmed when each course lists the other one as a crosslisting when you query each one individually:

{"course_id":"000135","subject":"AMATH","catalog_number":"873","title":"Introduction to Quantum Field Theory",...,"prerequisites":"AMATH 673 or PHYS 701 or equivalent",...,"crosslistings":"PHYS 703",...}

and

{"course_id":"000135","subject":"PHYS","catalog_number":"703","title":"Introduction to Quantum Field Theory","prerequisites":"PHYS 701 or consent of instructor",...,"crosslistings":"AMATH 873",...}
lkmorlan commented 5 years ago

Yes, it will be the same for cross-listed courses.

sbobkin commented 5 years ago

Hi,

Sorry for the late response, I was away on leave.

To answer the root question first, a course_id is not unique across time. It is unique within one specific term. The existing v2 of the API has issues in the data model that don't address this.

I'd suggest if possible switching to the newer version of the API that we are building out, by reading the post here https://wiki.uwaterloo.ca/display/UWAPI/Getting+Started+-+OpenAPI and the associated getting started page https://wiki.uwaterloo.ca/display/UWAPI/Getting+Started+-+OpenAPI

Courses is a currently implemented data set. It resolves this issue, and several others. Because of how fundamental some of the assumptions were made incorrectly in the v2 API model this will not be back fixed.

timweri commented 5 years ago

Hi,

Sorry for the late response, I was away on leave.

To answer the root question first, a course_id is not unique across time. It is unique within one specific term. The existing v2 of the API has issues in the data model that don't address this.

I'd suggest if possible switching to the newer version of the API that we are building out, by reading the post here https://wiki.uwaterloo.ca/display/UWAPI/Getting+Started+-+OpenAPI and the associated getting started page https://wiki.uwaterloo.ca/display/UWAPI/Getting+Started+-+OpenAPI

Courses is a currently implemented data set. It resolves this issue, and several others. Because of how fundamental some of the assumptions were made incorrectly in the v2 API model this will not be back fixed.

It's great to hear that a new API version is being built. I'll definitely switch to it if there's no planned big changes to how querying works. Also I am unable to access the given link. Even https://wiki.uwaterloo.ca is not accessible.

Thanks for your reply!

kpaxman commented 5 years ago

It should be noted that wiki.uwaterloo.ca is configured to be not accessible from off-campus.

sbobkin commented 5 years ago

I'll definitely switch to it if there's no planned big changes to how querying works

The current endpoints, and the near future planned additions are carbon copies of an existing private API. We will make significant effort to not introduce breaking changes outside of a new version.

It should be noted that wiki.uwaterloo.ca is configured to be not accessible from off-campus.

Yea, we will have to tackle that in the future -- for now I think there is some benefit to having the smoothest path be for UW on-campus audience and some resource/time constraints.

timweri commented 5 years ago

I'll definitely switch to it if there's no planned big changes to how querying works

The current endpoints, and the near future planned additions are carbon copies of an existing private API. We will make significant effort to not introduce breaking changes outside of a new version.

It should be noted that wiki.uwaterloo.ca is configured to be not accessible from off-campus.

Yea, we will have to tackle that in the future -- for now I think there is some benefit to having the smoothest path be for UW on-campus audience and some resource/time constraints.

It should be noted that wiki.uwaterloo.ca is configured to be not accessible from off-campus.

Ohhhh. That's a bit inconvenient since I'm on coop right now. But anyway thanks for your help.