# 16.7 Exercises

###### Exercise 16.1.

There are many possible kinship relationships you could imagine, like mother, father, great-aunt, second-cousin-twice-removed, and natural-paternal-uncle. Some of these can be defined in terms of the others, for example:

 $brother(X,Y)\leftarrow\mbox{}father(X,Z)\wedge\mbox{}natural\_paternal\_uncle(% Y,Z).$ $sister(X,Y)\leftarrow\mbox{}parent(Z,X)\wedge\mbox{}parent(Z,Y)\wedge\mbox{}$ $female(X)\wedge\mbox{}different(X,Y).$

Give two quite different representations for kinship relationships based on different relations being primitive.

Consider representing the primitive kinship relationship using relation

 $children(Mother,Father,List\_of\_children).$

What advantages or disadvantages may this representation have compared to the two you designed above?

###### Exercise 16.2.

A travel site has a database that represents information about hotels and feedback from users that uses the relations

 $\displaystyle hotel(Hotel\_Id,Name,City,Province\_or\_state,Country,Address)$ $\displaystyle reported\_clean(Hotel\_Id,RoomNumber,Cleanliness,day(Year,Month,% Day)).$

Show how the following facts can be represented using triple notation, using vocabularies that make sense:

```hotel(h345, "The Beach Hotel", victoria, bc,
canada, "300 Beach St").
reported_clean(h345, 127, clean, day(2023,01,25)).
```

Is it reasonable to represent the hotel name and address as strings? Explain.

###### Exercise 16.3.

Christine Sinclair (Q262802) was born in Burnaby (Q244025), British Columbia. Give the triples in Wikidata that relate her place of birth to the name of the province she was born in. The result should be a sequence of triples starting with one with Q262802 as the subject, and ending with “British Columbia”(en), where the object of each tuple is the subject of the next tuple. Give both the Wikidata tuples as well as the English translation. The information can be found starting from https://www.wikidata.org/wiki/Q262802. The first triple is

 $Q262802~{}~{}P19~{}~{}Q244025.~{}~{}~{}\mbox{"Christine Sinclair's place of % birth was Burnaby"}.$

The next tuple then has Q244025 as the subject.

###### Exercise 16.4.

Give 10 tuples that are related to the first goal scored in the 2010 FIFA World Cup Final (Q208401 in Wikidata), scored by Andrés Iniesta (Q43729) at 116 minutes. Either draw the relationships as in Figure 16.1 or write the triples using the Wikidata names, as well as a translation into English. The triples should be connected (as they are in Figure 16.1). The information can be found at https://www.wikidata.org/wiki/Q208401.

###### Exercise 16.5.

Sam has proposed that any $n$-ary relation $P({X_{1}},{X_{2}},{X_{3}},\dots,{X_{n}})$ can be re-expressed as $n-1$ binary relations, namely

 ${{P_{1}}({X_{1}},{X_{2}}),{P_{2}}({X_{2}},{X_{3}}),{P_{3}}({X_{3}},{X_{4}}),% \dots,P_{n-1}(X_{n-1},{X_{n}}).}$

Explain to Sam why this may not be such a good idea. What problems would arise if Sam tried to do this? Use an example to demonstrate where the problem arises.

###### Exercise 16.6.

Write an ontology for the objects that often appear on your desk that may be useful for a robot that is meant to tidy your desk. Think of the categories that (a) the robot can perceive and (b) should be distinguished for the task.

###### Exercise 16.7.

Suppose a “beach resort” is a resort near a beach that the resort guests can use. The beach has to be near the sea or a lake, where swimming is permitted. A resort must have places to sleep and places to eat. Write a definition of beach resort in OWL.

###### Exercise 16.8.

A luxury hotel has multiple rooms to rent, each of which is comfortable and has a view. The hotel must also have more than one restaurant. There must be menu items for vegetarians and for meat eaters to eat in the restaurants.

• (a)

Define a luxury hotel in OWL, based on this description. Make reasonable assumptions where the specification is ambiguous.

• (b)

Suggest three other properties you would expect of a luxury hotel. For each, give the natural language definition and the OWL specification.

###### Exercise 16.9.

For the following, explain how each is categorized by the top-level ontology of Section 16.3.2:

• (a)

• (b)

the period at the end of the first sentence of this chapter

• (c)

the excitement a child has before a vacation

• (d)

the trip home from a vacation

• (e)

a computer program

• (f)

summer holidays

• (g)

the ring of a telephone

• (h)

the dust on your desk

• (i)