Web – technologies / weekly exercises Answers (1)

advertisement
Web – technologies / weekly exercises
Answers (1/1)
<person>
<name>
<first_name>Alan</first_name>
<last_name>Turing></last_name>
</name>
<profession>computer scientists</profession>
<profession>mathematician</profession>
<profession>cryptographer</profession>
</person>
Web – technologies / Weekly exercises
Number 1
1.
Give an XML-document (by not using attributes), which includes the
information that the first name of a person is Alan, his last name is Turing,
and his professions are computer scientist, mathematician and
cryptographer.
2.
Give the tree diagram of the document given in 1.
3.
Modify the document given in exercise 1 such that the “first” and “last”
are the attributes of the name element
Web – technologies / weekly exercises
Answers (1/2)
person
name
first_name
Alan
last-name
Turing
profession
computer
scientist
profession
mathematician
profession
cryptographer
Web – technologies / weekly exercises
Answers (1/3)
<person first_name=“Alan” last_name=“Turing”>
<profession>computer scientists</profession>
<profession>mathematician</profession>
<profession>cryptographer</profession>
</person>
Web – technologies / Weekly exercises
Number 2
1.
Give an XML-document (by not using attributes), which includes the
following information: the social security number (123456789A), the first
name of a person is Jack, and his last name is Taylor, his address is
composed of postcode (0500), city (Boston) and street (Hamilton
street), and his telephone numbers are 12345 and 6789.
2.
Give the tree diagram of the document given in exercise 1.
3.
Give a DTD (Document Type Definition) for the XML-document
specified in exercise 1.
4.
Give an XML Schema for the information specified in exercise 1.
Validate the schema using the validator located at :
http://www.stg.brown.edu/service/xmlvalid/
5.
Give an instance of a the XML Schema specified in exercise 4.
Web – technologies / weekly exercises
Answers (1/2)
<person>
<social_security_number>123456789A</social_security_number>
<name>
<first_name>Jack</first_name>
<last_name>Taylor</last_name>
</name>
<address>
<city>Boston</city>
<postcode>0500</postcode>
<street>Hamilton Street></street>
</address>
<telephone_number>12345</telephone_number>
<telephone_number>12345</telephone_number>
</person>
Web – technologies / weekly exercises
Answers (2/2)
Person
name
Social_
securitynumber
1234..9A
first_
name
last_
name
Jack
Taylor
address
city
Boston
postcode
0500
Telephone_
number
street
12345
Hamilton street
Telephone_
number
6789
Web – technologies / weekly exercises
Answers (3/2)
<!ELEMENT person
<!ELEMENT social_security_number
<!ELEMENT name
<!ELEMENT first_name
<!ELEMENT last_name
<!ELEMENT address
<!ELEMENT city
<!ELEMENT postcode
<!ELEMENT street
<!ELEMENT telephone_number
(social_security_number, name address, telephone_number*)>
(#PCDATA)>
(first_name, last_name)>
(#PCDATA)>
(#PCDATA)>
(city, postcode, street)>
(#PCDATA)>
(#PCDATA)>
(#PCDATA)>
(#PCDATA)>
Web – technologies / weekly exercises
Answers (4/2)
<xsd: element name = “person”>
<xsd: complexType>
<xsd: element name = “ name”>
<xsd: complexType>
<xsd: element name = “first_name” type = “xsd: string” />
<xsd: element name = “last_name” type = “xsd: string” />
</xsd: complexType>
</XSD:element>
<xsd: element name = “ address”>
<xsd: complexType>
<xsd: element name = “city” type = “xsd: string” />
<xsd: element name = “postcode” type = “xsd: integer” />
<xsd: element name = “street” type = “xsd: string” />
</xsd: complexType>
</XSD:element>
<xsd: element name = “telephone_number” type “xsd:string”
minoccurs=“1” maxOccurs=“unbounded” />
<xsd: attribute name = “social_security_number” type “xsd:string” />
</xsd: complexType>
</XSD:element>
Web – technologies / weekly exercises
Answers (5/2)
<person social_security_number = “123456789A”>
<name>
<first_name>Jack</first_name>
<last_name>Taylor</last_name>
</name>
<address>
<city>Boston</city>
<postcode>0500</postcode>
<street>Hamilton </Street>
</address>
<telephone_number>12345</telephone_number>
<telephone_number>12345</telephone_number>
</person>
Web – technologies / Weekly exercises
Number 3
1.
Give a conceptual schema (using ER-design) about teams, players, and their fans,
including
•
•
•
For each team, its name, its players, its team captain (one of its players), and the colors of its
uniform.
For each player, his/her name.
For each fan, his/her name, favorite teams, favorite players, and favorite color.
2.
Do exercise 1 using UML-design
3.
Capture the knowledge, using the graph of N3 notation, of the following English
statements:
–
–
–
–
–
–
4.
Jack Smith studies at Helsinki University
Helsinki University has a web site at http://www.helsinki.fi/university/
Jack is a friend of Elisa Ford
Elisa Ford studies at Lappeenranta University of Technology
Lappeenranta University of Technology has a website at http://www.lut.fi/en/
Elisa Ford has a website at http://www.lut.fi/elisa
Using UML give a schema for the statements given in exercise 3.
Answer 3.1
Web – technologies / Weekly exercises
Answers 3
name
name
plays
Player
Team
is-captain
uniformscolors
Color
color-name
favoriteteams
favoritecolor
favoriteplayers
Fan
name
Answer 3.2
Web – technologies / Weekly exercises
Answers 3
Player
name
plays-in
is_captain
Team
name
uniform_colors
Fan
name
favorite color
favorite_palyer
favorite_teams
Web – technologies / Weekly exercises
Answers 3
Answer 3.3
#studies_at
#Jack Smith
#Helsinki University
#has-website
http://www.helsinki.fi/university
#friend-of
#Elisa Ford
#studies-at
#Lappeenranta University
of Technology
#has-website
http://www.lut.fi/elisa
#has-website
http://www.lut.fi/en
Answer 3.4
Web – technologies / Weekly exercises
Answers 3
Person
name
has-website
friend-of
studies-at
University
name
has-website
Web – technologies / Weekly exercises
Number 4
1.
Modify the xml file of the slide page 198 and the style sheet presented at
pages 201 and 202 such that the final layout would look as follows
Project:
Trumantruck.com
Work Schedule
Date
2000025
2000225
2000311
Description
Taking Truck Body Apart
Sandblasting Dismantling Cab
Sanding, Priming Hood and Fender
Hours
2
3
4
Web – technologies / Weekly exercises
Answers Number 4
Answer 4.1
<?xml version=“1.0” encoding=“UTF-8”?>
<?xml-stylesheet href=“simple.xsl” type=“text/XSL”?>
<project name=Trumantruck.com”>
<description>Rebuilding a 1967 Chevy Pickup Truck</description>
<schedule>
<workday>
<date>20000205></date>
<description>Taking Truck Body Apart</description>
<hours>2</hours>
</workday>
<workday>
<date>20000225></date>
<description>Sandblasting, Dismantling Cab</description>
<hours>3</hours>
</workday>
<workday>
<date>200003111></date>
<description>Sanding, Priming Hood and Fender</description>
<hours>4</hours>
</workday>
</schedule>
</project>
Web – technologies / Weekly exercises
Answers Number 4
Answer 4.1 continues
<xsl:stylesheet xmln:xsl=http://www.w3.org/TR/WD-xsl>
<xsl:template match=“/”>
<html>
<TITLE> Schedule For
<xsl:value-of select=“/project/@name”/>
<xsl: value-of select=“/project/description”/>
</TITLE>
<CENTER>
<TABLE border=“1”>
<TR>
<TD><B>Date</B></TD>
<TD><B>Description</B></TD>
<TD><B>Hours</B></TD>
</TR>
<xsl:apply-templates/>
</TABLE>
</CENTRE>
</html>
</xsl:template>
Web – technologies / Weekly exercises
Answers Number 4
Answer 4.1 continues
<xsl: template match=“project”>
<H1> Project :
<xsl: value-of select=@name”/>
</H1>
<HR/>
<xsl : apply-template/>
<xsl : template match = “schedule”>
<H2> Work Schedule</H2>
<xsl:apply-templates/>
</xsl : template>
<xsl : template match = “workday”>
<TR>
<TD>
<xsl : value –of select =“date”/>
</TD>
<TD>
<xsl : value -of select=“description”/>
</TD>
<TD>
<xsl : value -of select=“hours”/>
</TD>
</TR>
</xsl : template>
</xsl : stylesheet>
Web – technologies / Weekly exercises
Number 5
1.
Give an a taxonomy, which can be used in classifying learning
objects of computer science.
2.
Give a thesarus that describes information entities such as
course, laboratory course, exercise, exam, class room, course
course book, laboratory, lecturer and laboratory room.
3.
Give a conceptual schema using ER-schema notation that
models the entities stated in exercise 2 and their relationships.
4.
State using first order predicate logic “everyone who has
enrolment of the Java course has a registration on that
course”.
RDF-exercises
RDF-Exercise 1.
Give an RDF_description that states the following:
Resource http: //www.hut.fi/~jack/homepage is a homepage and it is owned by
Jack Taylor.
Answer RDF-Excercise 1.
<?xml version =”1.0” encoding_”UTF-16”?>
<rdf : RDF
xmlns : rdf=”http://www.w3.org/1999/02/22-rdf-syntax-ns#”
xmlns : mydomain = http://www.mydomain.org/my-rdf-ns”>
<rdf : Description rdf : about = ” http: //www.hut.fi/~jack/homepage”>
<mydomain : homepage-owner> Jack Taylor </mydomain : homepage-owner>
</rdf : Description>
</rfd: RDF>
RDF-Exercise 2.
Give an RDF_description that states the following:
Resource http: //www.innouni.fi/innouni-ns/#T-999”> is a course named Javaprogramming and is lectured by Lisa Smith at room T2.
Answer RDF-Excercise 2.
<?xml version =”1.0” encoding_”UTF-16”?>
<rdf : RDF
xmlns : rdf=”http://www.w3.org/1999/02/22-rdf-syntax-ns#”
xmlns : mydomain = http://www.mydomain.org/my-rdf-ns”>
<rdf : Description rdf : about = ” http: //www.innouni.fi/innouni-ns/#T-999”>
<mydomain : course-name> Java-programming </mydomain : course-name>
<mydomain : course-lecturer> Lisa Smith </mydomain : course-lecturer>
<mydomain : lecture-room> T2 </mydomain : lecture-room>
</rdf : Description>
</rfd: RDF>
RDF-Exercise 3.
By using container elemn rdf :Bag, give an RDF_description that states the
following: Mary and John owns the car ABC-99
Answer RDF-Excercise 3.
<?xml version =”1.0” encoding_”UTF-16”?>
<rdf : RDF
xmlns : rdf=”http://www.w3.org/1999/02/22-rdf-syntax-ns#”
xmlns : mydomain = http://www.mydomain.org/my-rdf-ns”>
<rdf : Description rdf : about = ” #ABC-99”>
<mydomain : owns>
<rdf : Bag>
<rdf : _li rdf : resource= ”#Mary”/>
<rdf : _li rdf : resource= ”#John”/>
</mydomain : owns>
</rdf : Description>
</rfd: RDF>
RDF-Exercise 4.
By using the ”collection” value of the rdf : parseType attribute give an
RDF_description that states the following: Mary and John owns the car
ABC-99
Answer RDF-Excercise 4.
<?xml version =”1.0” encoding_”UTF-16”?>
<rdf : RDF
xmlns : rdf=”http://www.w3.org/1999/02/22-rdf-syntax-ns#”
xmlns : mydomain = http://www.mydomain.org/my-rdf-ns”>
<rdf : Description rdf : about = ” #ABC-99”>
<mydomain: owns rdf : parseType = ”Collection”>
<rdf : Description rdf: about = ”#Mary”/>
<rdf : Description rdf: about = ”#John”/>
</mydomain : owns>
</rdf : Description>
</rfd: RDF>
RDF Schema-exercises
RDFS-Exercise 1.
Give a graphical presentation and RDF Schema that describe the following:
Professors and assistants are subclasses of teachers. Each techer has a
name. Each course has a course_id. Professors lecture courses while
assistants suprervise courses.
domain
Course
range
Assistant
supervises
teacher_name
subClassOf
domain
course_id
range
domain
range
range
Teacher
lectures
Literal
domain
subClassOf
Professor
Literal
<rdf : RDF
xmlns : rdf=”http://www.w3.org/1999/02/22-rdf-syntax-ns#”
xmlns : rdfs=http://www.w3.org/2000/01/rdf-schema#”>
<rdfs:Class rdf:ID=”assistant”>
<rdfs:comment>The class of assistants.</rdfs:comment>
<rdfs:subClassOf rdf:resource=“teacher”/>
</rdfs:Class>
<rdfs:Class rdf:ID=”professor”>
<rdfs:comment>The class of professors.</rdfs:comment>
<rdfs:subClassOf rdf:resource=“teacher”/>
</rdfs:Class>
<rdfs:Class rdf:ID=”teacher”>
<rdfs:comment>The class of teachers</rdfs:comment>
</rdfs:Class>
<rdfs:Class rdf:ID=”course”>
<rdfs:comment>The class of courses</rdfs:comment>
</rdfs:Class>
<rdfs:Property rdf:ID=”lectures”>
<rdfs:comment>
It relates professors to courses
</rdfs:comment>
<rdfs:domain rdf:resource=“#professor”/>
<rdfs:range rdf:resource=“#course”/>
</rdfs:Property>
<rdfs:Property rdf:ID=”supervises”>
<rdfs:comment>
It relates assistants to courses
</rdfs:comment>
<rdfs:domain rdf:resource=“#assistant”/>
<rdfs:range rdf:resource=“#course”/>
</rdfs:Property>
<rdfs:Property rdf:ID=”lecturer_name”>
<rdfs:comment>
It is a property of teachers and takes literals as values.
</rdfs:comment>
<rdfs:domain rdf:resource=“#teacher”/>
<rdfs:range rdf:resource=“&rdf;Literal”/>
</rdfs:Propert>
<rdfs:Property rdf:ID=”course_id”>
<rdfs:comment>
It is a property of courses and takes literals as values.
</rdfs:comment>
<rdfs:domain rdf:resource=“#course”/>
<rdfs:range rdf:resource=“&rdf;Literal”/>
</rdfs:Propert>
</rdf:RDF>
Execise 2. RQL-Exercise .
By using RQL and the RDF Schema of the previous exercise give the following
queries:
a)
b)
c)
Retrieve all the instances of the class Teacher
Retrieve aal the inatances of the class Teacher that are iether profwssors
or assistanra.
Retrieve the names of the assistants.
Answers:
a)
teacher
b)
^teacher
c)
select X, Y
from assistant{X} . teacher_name {Y}
Execise 3.
Discuss the difference vbetween the following statements, and draw graphs to
illustrate the difference: X supports the proposal; Y supports the propodsal;
Z supports the proposal. The group of X, Y, and Z supports the proposal.
Draw graphs to illustrate the difference.
supports
X
supports
Y
supports
Z
the proposal
the proposal
the proposal
X
belongs
belongs
Y
the group
belongs
Z
supports
the proposal
Exercise 4. Compare rdfs:subClassOf with type extension in XML Schema
Exercise 5. Try to map the relational database model on RDF.
Exercise 6. Compare entity-relationship modelling to RDF.
Exercise 7.Model part of a library in RDF Schema: books, authors, publishers,
years, copies, dates, and so on. Then write some statements in RDF, and
query them using RQL.
literal
Author
range
range
year
writtenBy
domain
ISBN
domain
domain
Book
range
domain
range
literal
literal
publishedBy
publishretName
range
presents
Publisher
Copy
domain
copyNumber
range
literal
domain
<rdf:RDF
xmlns:rdf=“http.w3.org/1999/02/22-rdf-syntax-ns#”
xmlns:rdfs=“http.w3.org/2000/01/rdf-schema#”>
<rdfs:Class rdf:ID=”book”>
<rdfs:comment>The class of books</rdfs:comment>
</rdfs:Class>
<rdfs:Class rdf:ID=”publisher”>
<rdfs:comment>The class of publishers</rdfs:comment>
</rdfs:Class>
<rdfs:Property rdf:ID=”publishedBy”>
<rdfs:comment>
It relates books to publishers
</rdfs:comment>
<rdfs:domain rdf:resource=“#book”/>
<rdfs:range rdf:resource=“#publisher”/>
</rdfs:Property>
<rdfs:Property rdf:ID=”ISBN”>
<rdfs:comment>
It is a property of books and takes literals as values.
</rdfs:comment>
<rdfs:domain rdf:resource=“#book”/>
<rdfs:range rdf:resource=“&rdf;Literal”/>
</rdfs:Propert>
</rdf:RDF>
RDF-satatements
<mydomain: book rdf:ID=”12345”
mydomain: ISBN = ”abc567”>
<mydomain: publishedBy rdf:resource=”#Prenticee_Hall”/>
<mydomain: writternBy rdf:resourcre= ”#Jack_Smith”/>
</mydomain:book>
The same RDF-description by not using abbreviated syntax
<rdf: Description rdf: ID=”12345”>
<rdf : type rdf : resource=”&mydomain ; book”/>
<mydomain : ISBN> abc567 </mydomain : ISBN>
<mydomain: publishedBy rdf:resource=”#Prenticee_Hall”/>
<mydomain: writternBy rdf:resourcre= ”#Jack_Smith”/>
</rdf : Description>
•
Queries:
a)
Retrieve all the instances of the book class?
Anwer: book
b)
Retrieve all books and their ISBN:s:
Answer: select X, Y
from book {X} . ISBN {y}
c)
Retrieve all the ISBN:s of the books published by Prentice-Hall
Answer: select N
from book {X} . publishedBy {Y}, {C} ISBN {N}
where Y= ”Prentice-Hall” and X=C
Exercise 8. Write an ontology about geography: cities, countries,
capitals, borders, states, and so on.
domain
countryName
range
domain
country
range
range
border
range
literal
belongs
isPartOf
domain
domain
city
locates
isSubClassOff
capital
state
<rdf:RDF
xmlns:rdf=“http.w3.org/1999/02/22-rdf-syntax-ns#”
xmlns:rdfs=“http.w3.org/2000/01/rdf-schema#”>
<rdfs:Class rdf:ID=”country”>
<rdfs:comment>The class of countries</rdfs:comment>
</rdfs:Class>
<rdfs:Class rdf:ID=”city”>
<rdfs:comment>The class of cities</rdfs:comment>
</rdfs:Class>
<rdfs:Class rdf:ID=”state”>
<rdfs:comment>The class of states</rdfs:comment>
</rdfs:Class>
<rdfs:Property rdf:ID=”belongs”>
<rdfs:comment>
It relates cities to countries
</rdfs:comment>
<rdfs:domain rdf:resource=“#city”/>
<rdfs:range rdf:resource=“#country”/>
</rdfs:Property>
<rdfs:Property rdf:ID=”locates”>
<rdfs:comment>
It relates cities to states
</rdfs:comment>
<rdfs:domain rdf:resource=“#city”/>
<rdfs:range rdf:resource=“#state”/>
</rdfs:Property>
<rdfs:Property rdf:ID=”isPartOf”>
<rdfs:comment>
It relates states to countries
</rdfs:comment>
<rdfs:domain rdf:resource=“#state”/>
<rdfs:range rdf:resource=“#country”/>
</rdfs:Property>
<rdfs:Class rdf:ID=”capital”>
<rdfs:comment>
The class of capitals
</rdfs:comment>
<rdfs:subClassOf rdf:resource=“city”/>
</rdfs:Class>
<rdfs:Property rdf:ID=”border”>
<rdfs:comment>
It relates bordersto countries
</rdfs:comment>
<rdfs:domain rdf:resource=“#country”/>
<rdfs:range rdf:resource=“#country”/>
</rdfs:Property>
<rdfs:Property rdf:ID=”countryName”>
<rdfs:comment>
It is a property of countries and takes literals as values.
</rdfs:comment>
<rdfs:domain rdf:resource=“#country”/>
<rdfs:range rdf:resource=“&rdf;Literal”/>
</rdfs:Propert>
</rdf:RDF>
Exercise 9. Consider the classes of males and females. Name a relationship
between them that should be included in an ontology.
Answer: relationship husbendOf; inverse wifeOf
Exercise 10. Consider the classes of persons, males and females. Name a
relationship between all the three that should be included in an ontology.
Which part of this relationship can be expressed in RDF Schema.
Answer. Husband, Wife, Mother, Father
Exercise 11. Suppose we declare Bob and Peter to be the father of Mary.
Obviously there is a semantic error here. How should the semantic model
make this error impossible?
Answer: by a cardinality restriction.
Exercise 12. What relationship exist between ”is child of” and ”is parent of” ?
Answer: inverse relationship
Exercise 13. Consider the property eats with domain animal and range animal
or plant. Suppose we define a new class vegetarian. Name a desirable
restriction on eats for this class. Do you think that this restriction can be
expressed in RDF Schema by using rdfs : range ?
Answer: Specifying a subclass by restrictiong the range of a property is outside
the expression power of RDF Schema. In particular, rdfs : range defines the
range, e.g., eats, for all classes.
OWL-exercises
OWL-Exercise 1. Give an OWL-ontology that describes the following:
There are courses and laboratory courses. Homeworks are part of courses.
Courses are organized by teachers. Teachers are either professors or
assistants. Professors teach courses while assistants only teach laboratory
courses.
organize
teacher
course
teach
subClassOf
subClassOf
isPartOf
subClassOf
professor
assistant
laboratory-course
homework
teach
<rdf:RDF
xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-nsl#
xmlns:rdfs=http://www.w3.org/2000/01/rdf-schema#
xmlns:owl=http://www.w3.org/2002/07/owl#
<owl:Ontology rdf:about=“”/>
<owl:Class rdf:ID=“course”>
<rdfs:comment>Courses form a class.</rdfs:comment>
</owl:Class>
<owl:Class rdf:ID=“laboratoryCourse”>
<rdfs:comment>Laboratory course is a type of course.</rdfs:comment>
<rdfs:subClassOf rdf:resource=“#course”/>
</owl:Class>
<owl:Class rdf:ID=“homework”>
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resoyrce=“#is_part_of”/>
<owl:allValuesFrom rdf:resource=“#course”/>
</owl:Restriction>
</rdfs:subClassOf>
</owl:Class>
<owl:Class rdf:ID=“teacher”>
<rdfs:comment>Teachers form a class.</rdfs:comment>
</owl:Class>
<owl:Class rdf:ID=“assistant”>
<rdfs:comment>Assistants are exactly those teachers that teach laboratory
courses.</rdfs:comment>
<owl:intersectionOf rdf:parseType=“Collection”>
<owl:Class rdf:about=“#teacher”/>
<owl:Restriction>
<owl:onProperty rdf:resoyrce=“#teach”/>
<owl:allValuesFrom rdf:resorce=“#laboratoryCourse”/>
</owl:Restriction>
</owl:intersectionOf >
</owl:Class>
<owl:Class rdf:ID=“professor”>
<rdfs:comment>Professors are exactly those teachers that teach laboratory
courses.</rdfs:comment>
<owl:intersectionOf rdf:parseType=“Collection”>
<owl:Class rdf:about=“#teacher”/>
<owl:Restriction>
<owl:onProperty rdf:resoyrce=“#teach”/>
<owl:someValuesFrom rdf:resorce=“#course”/>
</owl:Restriction>
</owl:intersectionOf >
</owl:Class>
<owl:TransitiveProperty rdf:ID=“is_part_of”/>
<owl:ObjectProperty rdf:ID=“teachs”>
<rdfs:domain rdf:resource=“#teacher”/>
</owl:ObjectProperty>
</rdf:RDF>
OWL-Exercise 2. Give an OWL-ontology that describes the following:
a) Medicinal products are either over the counter drugs or prescription
based drugs. Each medicinal product includes an active substance. In
addition each medicinal product is substitutable by zero or more medicinal
products.
b) Panadol is an instance of over the counter drug, Tramadol is an instance
of prescription based drug, and Loperamide is an instance of active
substance.
Is-substitutable
medicinal
product
is_subClass_of
over the
counter drug
is_subClass_of
instance_of
Panadol
prescription
based drug
Instance_of
Tramadol
includes
active
substance
Instance_of
Loperamide
Answer a)
<rdf:RDF
xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-nsl#
xmlns:rdfs=http://www.w3.org/2000/01/rdf-schema#
xmlns:owl=http://www.w3.org/2002/07/owl#
<owl:Ontology rdf:about=“”/>
<owl:Class rdf:ID=“medicinalProduct”>
<rdfs:comment>Medicinal products form a class.</rdfs:comment>
</owl:Class>
<owl:Class rdf:ID=“overTheCounterDrug”>
<rdfs:subClassOf rdf:resource=“#medicinalProduct”/>
<owl : disjointWith rdf : resource= ”#prescriptionBasedDrug”/>
</owl:Class>
<owl:Class rdf:ID=“prescriptionBasedDrug”>
<rdfs:subClassOf rdf:resource=“#medicinalProduct”/>
<owl : disjointWith rdf : resource= ”#overTheCounterDrug”/>
</owl:Class>
<owl:Class rdf:ID=“activeSubstance”>
<owl : disjointWith rdf : resource= ”#medicinalProduct”/>
</owl:Class>
<owl:ObjectProperty rdf:ID=“includes”>
<rdfs:domain rdf:resource=“#medicinalProduct”/>
<rdfs:range rdf:resource=“#activeSubstance”/>
</owl:ObjectProperty>
<owl:TransitiveProperty rdf:ID=“substitutes”>
<rdfs:domain rdf:resource=“#medicinalProduct”/>
<rdfs:range rdf:resource=“#medicinalProduct”/>
</owl:ObjectProperty>
</rdf:RDF
Answer b)
<rdf Description rdf : ID=”Panadol”/>
<rdf : type rdf : resource= ”#overTheCounterDrug”/>
</rdf : Description>
<rdf Description rdf : ID=”Tramadoldol”/>
<rdf : type rdf : resource= ”#prescriptionBasedDrug”/>
</rdf : Description>
<rdf Description rdf : ID=”Lopermide”/>
<rdf : type rdf : resource= ”# activeSubstance”/>
</rdf : Description>
Download