Test

advertisement
384.124 Semantic Web Techniques
Test
24 Nov 2008, 13:15 - 14:45
Family Name
Given Name
Student ID
Signature
1) Construct a small ontology with a class Public Transport that has four indirect
subclasses, Bus, Streetcar, Metro, and Train. Consider Bus and Streetcar properties
“borne Street”; Streetcar, Metro, and Train properties “borne Rail”; a Metro property
“level Subsurface”; for all four classes, “carry Person”. Draw the diagram with two
intermediate classes abstracting shared property values, give them (meaningful) names,
and add their subclass links. Enter all property values at the highest possible levels. Write
all property values that can be derived for subclasses, here:
Mention any case(s) of multiple inheritance, here:
Introduce Metro instances m1 and m2, Train instance t, and Person instance p. Represent
the facts that m1 and m2 carry p, and t carries p. Hint: Plan to best use the space below.
Draw a line between the classes and instances.
2) This is an RDF diagram about three fictitious institutions:
-------------------/
\
------->| http://www.e-star.ca |<-------------/
\
/ --\
/
-------------------\
\
hosts /
/ |
|
|
\
\ hosts
/
/
|
| field|
\
\
/
/
| founded|
|
\
\
/
/ name|
|
|
\
\
/
campus /
v
v
v
\ campus
\
|
/
-----------------\
|
|
/
|e-Star| |2002| |e-Learning|
\
|
|
|
-----------------|
|
|
v
v
|
--------------------------------------------/
\
/
\
| http://www.uni-80.ca |
| http://www.uni-newlearn.ca |
\
/
\
/
-------------------- \
/ -------------------------|
\
------/
|
name |
founded -->|1980|
|1999|<--- founded
| name
v
------v
--------------------------------------------------|University of the Eighties|
|University of New Learning|
---------------------------------------------------
Complete its following RDF serialisation as an XML element by filling in each "___"
(URLs and texts may be arbitrarily shortened, as long as they remain unique):
<rdf:RDF>
<rdf:Description about="http://www.e-star.ca">
<name>________</name>
_____________________
_____________________
<campus rdf:resource="______________________"/>
_______________________________________________
</rdf:Description>
<rdf:Description about=" www.uni-80.ca">
_______________________________________
_______________________________________
_______________________________________________
</rdf:Description>
_______________________________________________
_______________________________________
_______________________________________
_______________________________________________
__________________
</rdf:RDF>
3) Consider the following RuleML program (<Implies …> reflects “:-” in Prolog):
<Implies>
<head>
<Atom>
<Rel>r</Rel>
<Atom>
<Rel>p</Rel>
<Ind>1</Ind>
</Atom>
<Var>x</Var>
<Var>y</Var>
</Atom>
</head>
<body>
<Atom>
<Rel>q</Rel>
<Ind>2</Ind>
</Atom>
<And>
<Atom>
<Rel>q</Rel>
<Var>y</Var>
</Atom>
<Atom>
<Rel>r</Rel>
<Var>x</Var>
</Atom>
</And>
</body>
</Implies>
Complete the corresponding Prolog program by just filling in the four versions of "___":
p(X,Y) :- _____, _____.
______.
______.
What would be the fact(s) implied by the program (write in here using Prolog syntax)?
4) Consider the following Datalog program in Prolog syntax:
deal(X) :- sale(X).
deal(X) :- used(X), quality(X).
sale(X) :- rest(X).
rest(a).
used(b).
a) Give its grounding (consistently replacing variables by constants in each rule):
____________________________
____________________________
_________________________________________________
_________________________________________________
______________________________________
______________________________________
___________
___________
b) Construct its Least Herbrand Model by fixpoint iteration (starting with the set of facts,
applying the rules bottom-up to add new facts, etc., until the set no longer changes):
Download