Course:CPSC312-2019-Peanut-Gallery

From UBC Wiki

Authors

Albert Yip, Christine Song

What is the problem?

Peanut Gallery generates a list of restaurant recommendations within UBC taken from the Yelp API and constrained to criteria given by the user.

What is the something extra?

Peanut Gallery will have the addition of a filtration tool for those that have too many - defined by user input - food safety violations (taken from Hedgehog Disclosure).

There have been a recent increase in food safety problems across UBC, and it would be helpful to be able to add this as an additional constraint variable on any restaurant recommendations. A user will input the threshold value for the maximum number of food safety violations any given restaurant may have which includes both critical and non-critical violations, a factor we will parse and pattern-match on user queries.

What did we learn from doing this?

We learned it is very simple to use HTTP within Prolog. It boiled down to leveraging the `http` library (`http/json` and `http/http_open`) and providing the appropriate header arguments (eg. for authorization). Similarly, we discovered it was trivial to implement pruning and massaging of data to fit our functional requirements. With the Yelp JSON responses, we were able to parse it to fit our internal internal representation. From this, we were able to uncover similarities within the Hedgehog dataset, and merge them appropriately. This required manipulation of JSON, which we found to be unintuitive, as opposed to within an OOP setting. As a result, we had to use verbose pattern matching. Additionally, we often found it difficult to debug, especially when dealing with HTTP requests. A simple query would devolve into a complex query tree when we made an HTTP request. The fact that we were not able to set break points or watch certain pieces of code/behaviour seems to be the main contributing issue. Overall, we found Prolog to be a beautiful language, allowing for very strong manipulation of relations and data handling. However, we believe certain scenarios might not fit Prolog's use case, such as when you need to deal with large scale applications or changing requirements.

Links to code etc

https://github.com/ongsemble/peanut-gallery