Hide menu

Semantic Technologies in Practice - Exercise solutions

  1. See example at slide after 12:17
  2. See slides at 15:23 + 18:27
  3. See slide at 41:22. OWA means that everything that is not known to be false, may actually be true, we don't know. Hence, a reasoner may infer anything that is not known to be true. In a RDB setting we usually have the opposite, anything that is not mentioned is assumed to be false/not exist.
  4. UNA means that if two things have different names they also refer to two distinct objects. In OWL/RDF the same thing can be represented by two individuals that actually refer to the same individual in the real world. For instance, assume that we have a relation called marriedTo, and a restriction on the class Person saying that a person can be married to only one other person. If I add the two facts "Ann marriedTo Pete" and "Ann marriedTo Peter", and we have no additional information about Pete and Peter, a reasoner will simply infer that Pete and Peter are in fact the same (owl:sameAs).
  5. We will be able to infer that Peter is an Elephant. Domain and range is used to draw conclusions about the type of the individuals, not primarily to detect errors (as you might in an RDB), although if you make the classes Person and Elephant disjoint you can detect the inconsistency that Peter cannot be both Person and Elephant.
  6. See slide 5 of this presentation. (There is a possible small mistake in the answer given, can you spot it?)
  7. a) In a closed world, anything we don't know is false, hence, this statement renders a contradiction. b) In an open world what we don't know could also be true, we just don't know. We also don't have a UNA, hence, to find a model that satisfies the other statements we need to assume that Bob and Sam are actually the same individuals.
  8. Types of elements:
    • rdfs:comment is an annotation property. Annotation properties are used for commenting your models in different ways. rdfs:comment is a general annotation property, but you can also define your own more specific annotations.
    • cat is an owl:Class
    • Tibbs is an indivdual
    • has_father is an owl:ObjectProperty
  9. No there aren't any datatype properties. Datatype properties are used to create RDF-triples with a literal as the object. The range of datatype properties can be a xsd-datatype. In topBraid datatype properties are shown in green in properties view, and in Protégé you find them under the "Data Properties" heading.
  10. The default namespace of the ontology is "http://owl.man.ac.uk/2005/07/sssw/people#" (in Protégé you find this under "Prefixes" while in TopBraid you find if in the "overview"-tab when double-clicking on the ontology), while the base URI (location) of the file is set to "http://owl.man.ac.uk/2005/07/sssw/people.owl". It is a good practice to let these be the same, so that the namespace also indicates the file. This ontology uses a so-called #-namespace, where the #-sign is used to separate the namespace from the element name. You can also use the /-sign instead of a # when defining a default namespace.
  11. The ontology has 60 classes. In Protégé you find this in the Ontology metrics-view (you can find it among the ontology views under Window->Views) and in TopBraid in the Statistics-tab when double clicking on the ontology.
  12. No, the ontology doesn't import any other ontology. owl:Imports lets you include all the statements of another ontology into the current one. In Protégé you can see, and add, imports under Active Ontology, and the Ontology Imports view. In TopBraid Imports-tab at the bottom of the window, where you can drag and drop files from the navigator in order to import them.
  13. An animal lover is a person who has at least 3 pets.
  14. has_parent because it is a "superproperty" of has_father
  15. Yes, Fido is a pet, because Joe has_pet Fido, and the inverse of has_pet is is_pet_of, and the definition of pet is that it is anything that is_pet_of something.
  16. A mad_cow is a cow that eats something that is both brain and part_of some sheep (i.e. sheep's brain). However, a cow is a subclass of vegetarian, and a vegetarian is defined to be an animal who eats only things that are not animals and not parts of any animal. Sheep is an animal, hence, a sheep's brain is a part of an animal, this is contradiction, hence, an unsatisfiable class.
Submit the answer to question 17 to me by e-mail.
  1. ?reader=Mick, ?pet=Rex Since has_pet and is_pet_of are each other's inverses, you could just specify either one of the triple patterns if a reasoner is used first.
  2. SELECT ?instance
    WHERE {
    ?instance rdf:type :duck .

The final exercise should be handed in according to the instructions given for the exercise (submitted by e-mail before September 12th).

Page responsible: Eva Blomqvist
Last updated: 2012-09-07