EXERCISES INF3580 SPRING 2010 EASTER

A bird.

A bird.

This document contains exercises made for INF3580. Please send any comments, errors, bug or improvement reports to this exercise set to martige@ifi.uio.no. Feedback is most welcome! Alphabetically thanks to Audun Stolpe, Espen H. Lian, Martin Giese and Rune Dahl for feedback.

The main curriculum for INF3580 spring 2010 is Semantic Web Programming by John Hebeler et al., Wiley Publishing, 2009. They have a website with additional articles and all source code used in the book at http://semwebprogramming.org/. Auxiliary curriculum is the book Foundations of Semantic Web Technologies by Hitzler, Krützsch, Rudolph, CRC Press 2009.

Keep all the work you do for these exercises in a safe place. Setting up a version control system like cvs, svn or git for the work you do is smart. You can create a svn repository on IfI's svn server, see their help section for more information. There is also a walk-through from old INF3120 on how to set up a svn repository and connect it to Eclipse, but news is that you'll need the plug-in subclipse to make it work. Please contact me if you have any smart tips to share.

1 Easter eggs

1.1 Logical puzzles

1.1.1 Exercise

Encode the Zebra Puzzle in an ontology, so that the answer is computed by the reasoner, i.e., describe the explicit and implicit facts that are given in the text, e.g., "a house can only have one colour".

1.1.1.1 Tip

The perhaps most difficult to do in this exercise is to express all the implicit information in the puzzle, e.g., that there are five houses on a row, where some houses are next to each other and some are not, that there are exactly five persons and that each person has exactly one favorite drink, and that the five drinks mentioned are the only ones considered. Remember that OWL ontologies and reasoning abides by the open world assumption and also not the unique name assumption.

1.2 Sudoku

Use SPARQL to solve a game of Sudoku.

1.2.1 Exercise

This is the same exercise as 7.6 page 302 in Foundations of Semantic Web Technologies.

Consider a small game of sudoku 4x4, which has the following setup

3
4
2
3

In (this game of) Sudoku the aim is to place the numbers 1–4 in the cells so that no number is duplicated for any row, any column or any of the four 2x2 squares that make up each corner of the game.

Create an RDF document and a SPARQL query that solves this game.

1.2.1.1 Tip

Use FILTER to state that all values on a row are distinct. Repeat this process so that it reflects the rules of the game.

Author: Martin G. Skj?veland <martige@ifi.uio.no>

Date: 2010-03-08 16:15:38 CET

HTML generated by org-mode 6.34trans in emacs 23