EXERCISES INF3580 SPRING 2010 WEEK 5

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 Semantics

Read

  • Semantic Web Programming: chapter 4.
  • Foundations of Semantic Web Technologies: chapter 3, 2.

Read more in W3C's RDFS semantics document.

1.1 Entailment

In these exercises we will learn about entailment and decide the logical consequences of RDFS statements.

Let entailments.n3 be the file listed below, where rdf and rdfs are the usual namespaces.

 1:  :Person a owl:Class .
 2:  :Man a owl:Class ;
 3:       rdfs:subClassOf :Person .
 4:  :Parent a owl:Class ;
 5:          rdfs:subClassOf :Person .
 6:  :Father a owl:Class ;
 7:          rdfs:subClassOf :Parent ;
 8:          rdfs:subClassOf :Man .
 9:  :Child a owl:Class ;
10:         rdfs:subClassOf :Person .
11:  :hasParent a rdf:Property ;
12:             rdfs:domain :Person ;
13:             rdfs:range  :Parent .
14:  :hasFather a rdf:Property ;
15:             rdfs:subPropertyOf :hasParent ;
16:             rdfs:range :Father .
17:  :isChildOf a rdf:Property ;
18:             rdfs:domain :Child ;
19:             rdfs:range  :Parent .
20:  :Ann a :Person ;
21:       :hasFather  :Carl .
22:  :Carl a :Man .

1.1.1 Exercise

Is entailments.n3 syntactically correct RDF(S)?

1.1.2 Exercise

Explain what it means for one set of statements to entail a (different) set of statements.

1.2 Manual entailment calculation

In the following exercises decide if entailment.n3 entails the statement(s) given and explain why/why not? If the answer is "yes, the statement(s) is entailed by entailments.n3", then use the simple entailment rules and the rdfs entailment rules found at RDFS entailment rules to prove your answer. If the answer is "no", then explain, informally or formally, why this is so.

1.2.1 Exercise

First, to get the an overview of the statements in entailments.n3, draw a diagram.

1.2.2 Tip exercise

:Father rdfs:subClassOf :Person .
1.2.2.1 Solution

True. :Father is (transitively) a subclass of :Person. Rule rdfs11.

In the proof below each line is marked with "P" if the statement is a premise, i.e., exists in entailments.n3, or with the rule and the input statements to this rule by which the line in question is concluded.

Proof:

  1. :Father rdfs:subClassOf :Parent — P
  2. :Parent rdfs:subClassOf :Person — P
  3. :Father rdfs:subClassOf :Person — 1, 2, rdfs11

Statements 1. and 2. are found in entailments.n3 and are premises to the application of the entailment rule rdfs11 on line 3, which yields the statement we're after.

1.2.3 Exercise

:Man rdfs:subClassOf :Person .

1.2.4 Exercise

:Carl a :Person .

1.2.5 Exercise

:Carl a :Parent .

1.2.6 Exercise

:Carl :hasChild :Ann .

1.2.7 Exercise

:Carl a :Man .

1.2.8 Exercise

:Carl a :Father .

1.2.9 Exercise

:Child rdf:type rdfs:Resource .

1.2.10 Exercise

:Ann a :Child .

1.2.11 Exercise

:Ann :isChildOf :Carl .

1.2.12 Exercise

:Ann :hasParent :Carl .

1.2.13 Exercise

:Ann :hasParent _:x .

1.2.14 Exercise

:Ann :hasParent [ rdf:type :Person ] .

1.2.15 Exercise

:hasFather rdfs:domain :Person .

1.2.16 Exercise

rdfs:range rdf:type rdfs:Resource .

1.2.17 Exercise

:hasFather rdfs:range :Father .

1.2.18 Exercise

:hasFather rdfs:domain [ rdfs:subClassOf :Person ] .

1.2.19 Exercise

:Father rdfs:subClassOf [ rdfs:subClassOf :Person ] .

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

Date: 2010-03-12 15:40:09 CET

HTML generated by org-mode 6.34trans in emacs 23