COSC 416 - Special Topics in Databases
Assignment 6 -  SenseiDB

In this assignment we will experiment with SenseiDB and its Browse Query Language (BQL).

Sample outputs are below:

Tutorial

To use Sensei, login using SSH to gpu1.ddl.ok.ubc.ca with your Novell account. Type /srv/sensei/bin/sensei-shell.sh localhost 50020 to get the Sensei shell to enter and run BQL queries.

You can also open your browser of choice and go to http://gpu1.ddl.ok.ubc.ca:50020/ to see the companion web-console if you prefer to use it to interact with the sensei cluster.

Task #1 (2 marks) - How Many of the Following...

How many of the following "features" are supported by SenseiDB?

  1. Create / Insert / Delete
  2. Negative numbers
  3. Join operations
  4. Full-text integration
  5. Dynamic sorting
  6. Hadoop bootstrapping

A. 0  	B. 1 	C. 3 	D. 5 	E. 6

Task #2 (3 marks) - Schema, Schema, Who's Got the Schema?

Given the following schema:

<table uid="id" delete-field="" skip-field="">
    <column name="gid" type="int" />
    <column name="gname" type="string" />
    <column name="pubname" type="string" />
    <column name="releasedate" type="date" />
    <column name="maxplayers" type="int" />
    <column name="rating" type="float" />
    <column name="genre" type="string" multi="true" delimiter=","/>
</table>

And the associated sample table:

+--------+-----------+---------+-------------+--------------+----------+----------+
|  gid   |   gname   | pubname | releasedate |  maxplayers  |  rating  |  genre   |
+--------+-----------+---------+-------------+--------------+----------+----------+
|   1.0  | Wii Sports| Nintendo|  2006-11-19 |      4       |    3.5   | sports,  |
|        |           |         |             |              |          | family   |
|   2    | Mario Kart| Nintendo|  2008-04-10 |      4       |    4.2   | racing,  |
|        |           |         |             |              |          | family,  |
|        |           |         |             |              |          | action   |
|   3    | Wii Fit   | Nintendo|  2008-12-01 |      2       |   -1.2   | exercise,|
|        |           |         |             |              |          | health,  |
|        |           |         |             |              |          | family,  |
|        |           |         |             |              |          |2008-12-01|
+--------+-----------+---------+-------------+--------------+----------+----------+

How many violations of the schema are present in the sample table and what are they?

Task #3 (5 marks) - Add a New Game

Write a JSON statement that could be used to add a game data event into a SenseiDB table using the schema presented in Task 2. Don't actually add the new game, just write the JSON statement.

Task #4 (5 marks) - List all of the Games

Write a BQL query that will list all the game records. There should be s459 records printed.

Task #5 (5 marks) - List all Games with Rating 0, 1, 3, or 4

Write 3 different BQL queries that list all of the games with a rating of either 0, 1, 3, or 4 (i.e., not equal to 2 or 5). There should be 371 records printed.

Task #6 (5 marks) - Newest 2 Games per Publisher

Write a BQL query that returns the two newest games from each publisher. Note that some publishers will only have one game.

Task #7 (5 marks) - Searching Descriptions

Write a BQL query that returns a list of games and their respective genres organized into groups for each publisher. The games' descriptions must match the following conditions: containing both the words "ipsum" and "et" but not containing either of the words "congue" or "sit". You must also find how many hits were counted for each genre.

Task #8 (5 marks) - Finish Him! Puzzle Style!

Write a BQL query to find the top 10 Puzzle or Dance games using a custom relevance model, which gives higher rating to games that are of the genre Puzzle (with boost value 50) or games that have the name Mortal Kombat (with boost value 100).

Task #9 (15 marks) - List all Game and Facet Information using your Game Center Website

Modify your existing game center website from Lab 1 to use SenseiDB to display a list of all of the games instead of your previous database. As well, you need to display the facet information for Publisher Name, Rating, Genre, and Maximum Number of Players.

Your page doesn't have to do anything fancy, it can just be a simple page that displays the list of all games and facet information in a readable format.

Refer to http://senseidb.com/clients.html for the client APIs to interact with sensei. Hint: the Rest/JSON Client API via HTTP POST is probably the easiest to implement.

You can view a live example at http://cs-suse-5.ok.ubc.ca/44907087/tomcat/gameCenter/senseiList.php.

The mark breakdown is as follows:

Submission

Submit a single text file with answers to the written questions and a single zip file all your source code using Connect or by email.


*Home