uWaterloo / OpenData

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

Listing Courses by Faculty or Include Faculty inside Subjects #109

Closed RaunaqSuri closed 10 years ago

RaunaqSuri commented 10 years ago

Is there any way that we can list courses by the faculty that they are in (e.g AHS or Engineering or Math). If not, is it possible if we can include which faculty a subject belongs in when one calls /codes/subjects ?

KartikTalwar commented 10 years ago

@lkmorlan Do you know if the academic groups are tied directly to the subjects? cc/ @nathanv

lkmorlan commented 10 years ago

Subjects are owned by units. Units are owned by groups.

Every subject is owned by a unit. Almost every unit is owned by a group.

KartikTalwar commented 10 years ago

Thanks for the clarification @lkmorlan! The data we have right now is just an export of subjects, units and groups. Is it possible to get an export of the same data with those parent relations?

lkmorlan commented 10 years ago

That data is included here: https://github.com/uWaterloo/api-documentation/blob/master/v2/codes/subjects.md https://github.com/uWaterloo/api-documentation/blob/master/v2/codes/units.md https://github.com/uWaterloo/api-documentation/blob/master/v2/codes/groups.md

For subjects, "unit" would be better as "unit_code".

KartikTalwar commented 10 years ago

@RaunaqSuri so to clarify, the way data is officially organized, things aren't as straight forward as Faculties->Subjects. A somewhat close relation is groups are like faculties, and each group has units. But a unit can exist by itself and not have a parent group. (see raw data). And each unit has subject associated to them. You can also run into cases where things might fall into 2 categories (need to double check).

The best way to make sense of this is for you to look at the data as Groups->Units->Subjects. I'll try to add another column to the subjects response that has the associated group info but as mentioned before, that value can be null.

RaunaqSuri commented 10 years ago

I figured out how to get the data. Thanks!

KartikTalwar commented 10 years ago

Mind letting me know what you did?

RaunaqSuri commented 10 years ago

Haha, it was quite roundabout, but I first got the groups, used the data from that to get the units, then from that to get subjects then from that to get courses.

KartikTalwar commented 10 years ago

Gotcha, haha. Well, now the subjects endpoint includes the unit and group information. So hopefully it might be of help to you or others

RaunaqSuri commented 10 years ago

Haha that definitely does cut my code down by a lot. Thanks!