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)father(X,Z)natural_paternal_uncle(Y,Z).
sister(X,Y)parent(Z,X)parent(Z,Y)
       female(X)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

hotel(Hotel_Id,Name,City,Province_or_state,Country,Address)
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

Q262802P19Q244025.”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(X1,X2,X3,,Xn) can be re-expressed as n1 binary relations, namely

P1(X1,X2),P2(X2,X3),P3(X3,X4),,Pn1(Xn1,Xn).

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)

    your skin

  • (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)

    the task of cleaning your office

  • (j)

    the diagnosis of flu in a person

  • (k)

    France.

Based on this experience, suggest and justify a modification of the top-level ontology. Think about categories that are not exclusive or other distinctions that seem to be fundamental.