Logics for Data and Knowledge Representation Web Ontology
Logics for Data and Knowledge Representation Web Ontology Language (OWL) -- Exercises Feroz Farazi
Exercise 1 q Suppose that a family consists of a father (John), a mother (Maria), two sisters (Sara and Jenifer) and two brothers (David and Robert). In an OWL representation we find that the two brothers and the two sisters are codified as follows: : David : Sara : John : has. Father : spouse. Of : John : Maria Later on another property : has. Child is codified. (i) What will be the output of the following SPARQL Query when a reasoner is activated? : John : has. Child ? y
Exercise 1 (ii) Expand the OWL representation in a way that supports returning non-empty result of the following query and this expansion is independent of the entity-entity triples. : John : has. Child ? y (iii) Add also the following axioms to the dataset. : Jenifer : has. Father : Robert : has. Father : John What result the following query will return? : John : has. Child ? y (iv) How can we infer the spouse relation in the reverse direction?
Solution (i) The result of the query is empty. (ii) We can make the property : has. Father as an inverse property of : has. Child as follows: : has. Father owl: inverse. Of : has. Child Query Result: : David : Sara (iii) Query Result: : David : Sara : Jenifer : Robert (iv) We can make the relation : spouse. Of its own inverse as follows: : spouse. Of owl: inverse. Of : spouse. Of
Exercise 2 q Within a family, relations such as : spouse. Of : married. To : sibling. Of are applicable in both directions (from subject to object, and vice versa) whereas the following do not hold always. : brother. Of : sister. Of i) Which property holds in the relations that are applicable in both directions? ii) How can we represent these relations in OWL? iii) In which basic category this property belongs?
Solution i) Symmetric property holds in these relations ii) They can be represented as follows: : spouse. Of : married. To : sibling. Of rdf: type owl: Symmetric. Property iii) The symmetric property is an object property. Moreover, the domain and range of the symmetric property are the same.
Exercise 3 q Consider that in the family of John and Maria, also John’s father (James) and mother (Jerry) live. Relations such as : has. Ancestor and : has. Descendent can be applied between different levels. For example: : John : has. Ancestor : James : Sara : has. Ancestor : John : James : has. Descendent : John : has. Descendent : Sara i) Which property holds in the relations that are applicable in different levels of the hierarchy? ii) How can we represent these relations in OWL? iii) In which basic category this property belongs? iv) Show the results of the following queries: a) : James : has. Descendent ? y b) : John : has. Ancestor ? y
Solution i) Transitive property holds in these relations ii) They can be represented as follows: : has. Ancestor rdf: type : has. Descendent rdf: type owl: Transitive. Property iii) The transitive property is an object property. iv) a) Query Result : John : Sara b) Query Result: : James
Exercise 4 1. In RDFS we can represent that two classes : Test and : Experiment are equivalent. : Test rdfs: sub. Class. Of : Experiment rdfs: sub. Class. Of : Test Convert this representation in OWL. 2. In RDFS we can represent that two properties : has. Child and : has. Kid are equivalent. : has. Child rdfs: sub. Property. Of : has. Kid rdfs: sub. Property. Of : has. Child Convert this representation in OWL. 3. Is there any way to represent the fact that two entities (or individuals) : Italia and : Il_Bel_Paese are same.
Solution 1. OWL representation: : Test owl: equivalent. Class : Experiment 2. OWL representation: : has. Child owl: equivalent. Property 3. It can be represented in OWL as follows: : Italia owl: same. As : Il_Bel_Paese : has. Kid
Exercise 5 1. a) Which OWL property allows to have exactly one value for a particular individual? b) In a family tree, relations such as the following ones can be defined as functional. : has. Father : has. Mother Represent them in OWL and demonstrate their use with necessary entity-entity axioms. 2. a) Which OWL property allows to have exactly one subject for a particular object? c) Demonstrate the use of this property in developing applications such as entity matching.
Solution 1. a) OWL Functional property has this feature. b) OWL representations of the properties : has. Father and : has. Mother are as follows: : has. Father rdf: type owl: Functional. Property : has. Mother rdf: type owl: Functional. Property Two entity-entity axioms are provided below: : John : has. Father : James : John : has. Father : Handler The objects : James and : Handler are the values of the same subject and property. We already have defined that : has. Father property is functional. Therefore, it can be concluded that : James and : Handler refer to the same person.
Solution 2. a) OWL Inverse Functional property has this feature. b) Given that the property : SSN (social security number) is an Inverse Functional property and it is encoded as follows: : SSN rdf: type owl: Inverse. Functional. Property Two entity-entity axioms are provided below: mo: James : SSN N 123812834 ps: Handler : SSN N 123812834 The subjects : James and : Handler are attached to the same social security number, which cannot be shared by two different persons. Therefore, we can conclude that mo: James and ps: Handler are the same entity.
Exercise 6 Which OWL constructs support the encoding of the following statements? i) If x and y are brothers and y is son of z then x is son of z. ii) If y is brother of z and z is father of x, then y is uncle of x. iii) If disease x is located in body part y which is part of body part z, then x is located in z. Represent all the above statements in OWL. Also write explicitly which version of OWL supports the encoding of such statements.
Solution Sub. Property. Of and Object. Property. Chain support the encoding of such statements. i) Sub. Property. Of( Object. Property. Chain( : brother. Of : son. Of) ii) Sub. Property. Of( Object. Property. Chain( : brother. Of : father. Of) : uncle. Of) iii) Sub. Property. Of( Object. Property. Chain( : located. In : part of) : located. In)
Exercise 7 (Laboratory) 1. Create the family tree ontology in Protégé (can be downloaded here: http: //protege. stanford. edu/download/registered. html#p 4. 3). 2. Encode inverse relation between entities. 3. Implement symmetric properties. 4. Implement functional properties. 5. Implement inverse functional properties. 6. Develop Pizza ontology according to the manual provided in the following link: http: //130. 88. 198. 11/tutorials/protegeowltutorial/resources/Pr otege. OWLTutorial. P 4_v 1_3. pdf
- Slides: 16