+ All Categories
Home > Documents > Welp…eecs.csuohio.edu/~sschung/CIS408/ProjectYelpMongo... · Yelp’s ademic Challenge datasets...

Welp…eecs.csuohio.edu/~sschung/CIS408/ProjectYelpMongo... · Yelp’s ademic Challenge datasets...

Date post: 31-May-2020
Category:
Upload: others
View: 2 times
Download: 0 times
Share this document with a friend
14
Welp… By: James Saporito Corinne Dmitruk
Transcript
Page 1: Welp…eecs.csuohio.edu/~sschung/CIS408/ProjectYelpMongo... · Yelp’s ademic Challenge datasets have a large amount of information Originally the idea was just to open the json

Welp…

By: James SaporitoCorinne Dmitruk

Page 2: Welp…eecs.csuohio.edu/~sschung/CIS408/ProjectYelpMongo... · Yelp’s ademic Challenge datasets have a large amount of information Originally the idea was just to open the json

Platforms We Used

Bootstrap - client side styling

AngularJS - client side responsive

ASP.NET - server side implementation (because selling your soul to Microsoft is

fun)

Yelp API - to get pictures from their database (these are not included in the

datasets they give as a download)

MongoDB - for the database to hold the Yelp JSON data

Page 3: Welp…eecs.csuohio.edu/~sschung/CIS408/ProjectYelpMongo... · Yelp’s ademic Challenge datasets have a large amount of information Originally the idea was just to open the json

Challenges We Faced

Yelp’s Academic Challenge datasets have a large amount of information

Originally the idea was just to open the json files given to us through C# and query with Linq to

Json.

This worked for samples of the dataset but not the whole thing, when opening the file in C# there

would be an “Out of Memory Exception”

The reviews json file was too big to be opened in Notepad++ (it’s (close to) 4GB)

Solution: switched to MongoDB since it meant to solve this problem

Page 4: Welp…eecs.csuohio.edu/~sschung/CIS408/ProjectYelpMongo... · Yelp’s ademic Challenge datasets have a large amount of information Originally the idea was just to open the json

MongoDB

Easier than expected to set up

Easy as…

1 2

3

J(a)SON This is why we don’t let Corinne make PowerPoints

3.22 GB takes a looooooooong time………..

*Insert Excitement*

[ ,

,

,

Page 5: Welp…eecs.csuohio.edu/~sschung/CIS408/ProjectYelpMongo... · Yelp’s ademic Challenge datasets have a large amount of information Originally the idea was just to open the json

Calling MongoDB From ASP.NET

A query through ASP.NET looks something like:.....

var filter = new BsonDocument("categories", new BsonDocument("$eq", "Food"));

var busFoodResult = business.Find(filter).Sort("{stars: -1}").Limit(50).ToList();

BsonDocument is basically making another Json object

Filter is looking for a record in the database where under categories, food is part of the list.

Sorting by the amount of stars. If we would have used a 1 it would be ascending, we used -1 which is

descending

We are limiting the amount of records returning to the server, too much data would make it slow.

You can also use linq to query MongoDb, if you really wanted to

Page 6: Welp…eecs.csuohio.edu/~sschung/CIS408/ProjectYelpMongo... · Yelp’s ademic Challenge datasets have a large amount of information Originally the idea was just to open the json

AngularJS

To start you need to declare an app and there you can configure routing

Declare dependencies

ngRoute is required to

actually do the routingThis is the

default

Any other routes

come after the

default

If the route can’t be found

this is how it knows

where to go

Page 7: Welp…eecs.csuohio.edu/~sschung/CIS408/ProjectYelpMongo... · Yelp’s ademic Challenge datasets have a large amount of information Originally the idea was just to open the json

AngularJS

Super simple method calling the server looks like:

Page 8: Welp…eecs.csuohio.edu/~sschung/CIS408/ProjectYelpMongo... · Yelp’s ademic Challenge datasets have a large amount of information Originally the idea was just to open the json

Using the Yelp API

● Data set didn’t include photos

● EXAMPLE: “GET https://api.yelp.com/v3/businesses/{id goes here}”

● Yelp token in the header

● Returns information in JSON

● Extract the “image_url” from the JSON and insert it into the HTML

Page 9: Welp…eecs.csuohio.edu/~sschung/CIS408/ProjectYelpMongo... · Yelp’s ademic Challenge datasets have a large amount of information Originally the idea was just to open the json
Page 10: Welp…eecs.csuohio.edu/~sschung/CIS408/ProjectYelpMongo... · Yelp’s ademic Challenge datasets have a large amount of information Originally the idea was just to open the json
Page 11: Welp…eecs.csuohio.edu/~sschung/CIS408/ProjectYelpMongo... · Yelp’s ademic Challenge datasets have a large amount of information Originally the idea was just to open the json
Page 12: Welp…eecs.csuohio.edu/~sschung/CIS408/ProjectYelpMongo... · Yelp’s ademic Challenge datasets have a large amount of information Originally the idea was just to open the json
Page 13: Welp…eecs.csuohio.edu/~sschung/CIS408/ProjectYelpMongo... · Yelp’s ademic Challenge datasets have a large amount of information Originally the idea was just to open the json

Future Work

Pagination for the table

So instead of just limiting to 50, each page can be 50 and can jump through all of the records

Increase performance

Pages could load faster

Page 14: Welp…eecs.csuohio.edu/~sschung/CIS408/ProjectYelpMongo... · Yelp’s ademic Challenge datasets have a large amount of information Originally the idea was just to open the json

...I wanna know…Can you show me?....

Where to get the Driver for MongoDB to use in ASP.NET: https://docs.mongodb.com/ecosystem/drivers/csharp/

Wanna query MongoDB with ASP.NET? Go here!:

https://www.codementor.io/pmbanugo/working-with-mongodb-in-net-1-basics-g4frivcvz

Need to know how to import the data in the first place? https://docs.mongodb.com/getting-started/shell/import-data/

Oh, right, don’t you need to get the data before you import it? https://www.yelp.com/dataset_challenge

(Disney reference)


Recommended