Web - PowerPoint PPT Presentation

About This Presentation
Title:

Web

Description:

1. Give an XML-document (by not using attributes), which includes the ... 2. Give a thesarus that describes information entities such as course, ... – PowerPoint PPT presentation

Number of Views:544
Avg rating:3.0/5.0
Slides: 60
Provided by: jpuu4
Category:
Tags: thesarus | web

less

Transcript and Presenter's Notes

Title: Web


1
Web technologies / weekly exercisesAnswers
(1/1)
ltpersongt ltnamegt ltfirst_namegtAlanlt/first_namegt
ltlast_namegtTuringgtlt/last_namegt lt/namegt ltprof
essiongtcomputer scientistslt/professiongt ltprofessi
ongtmathematicianlt/professiongt ltprofessiongtcryptog
rapherlt/professiongt lt/persongt
2
Web technologies / Weekly exercisesNumber 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.
  • Give the tree diagram of the document given in 1.
  • Modify the document given in exercise 1 such that
    the first and last are the attributes of the
    name element

3
Web technologies / weekly exercisesAnswers
(1/2)
person
name
profession
profession
profession
computer scientist
first_name
last-name
mathematician
cryptographer
Alan
Turing
4
Web technologies / weekly exercisesAnswers
(1/3)
ltperson first_nameAlan last_nameTuringgt
ltprofessiongtcomputer scientistslt/professiongt ltp
rofessiongtmathematicianlt/professiongt ltprofessiongt
cryptographerlt/professiongt lt/persongt
5
Web technologies / Weekly exercisesNumber 2
  • 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.
  • 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.
  • 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.

6
Web technologies / weekly exercisesAnswers
(1/2)
ltpersongt ltsocial_security_numbergt123456789Alt/so
cial_security_numbergt ltnamegt ltfirst_namegtJac
klt/first_namegt ltlast_namegtTaylorlt/last_namegt lt
/namegt ltaddressgt ltcitygtBostonlt/citygt ltpostc
odegt0500lt/postcodegt ltstreetgtHamilton
Streetgtlt/streetgt lt/addressgt lttelephone_numbergt12
345lt/telephone_numbergt lttelephone_numbergt12345lt/t
elephone_numbergt lt/persongt
7
Web technologies / weekly exercisesAnswers
(2/2)
Person
name
Social_ security- number
Telephone_ number
Telephone_ number
address
postcode
street
first_ name
last_ name
city
6789
12345
1234..9A
Boston 0500 Hamilton street
Jack Taylor
8
Web technologies / weekly exercisesAnswers
(3/2)
lt!ELEMENT person (social_security_number, name
address, telephone_number)gt lt!ELEMENT
social_security_number (PCDATA)gt lt!ELEMENT
name (first_name, last_name)gt lt!ELEMENT
first_name (PCDATA)gt lt!ELEMENT
last_name (PCDATA)gt lt!ELEMENT address (city,
postcode, street)gt lt!ELEMENT city (PCDATA)gt lt!E
LEMENT postcode (PCDATA)gt lt!ELEMENT
street (PCDATA)gt lt!ELEMENT telephone_number (
PCDATA)gt
9
Web technologies / weekly exercisesAnswers
(4/2)
  • ltxsd element name persongt
  • ltxsd complexTypegt
  • ltxsd element name namegt
  • ltxsd complexTypegt
  • ltxsd element name first_name type xsd
    string /gt
  • ltxsd element name last_name type xsd
    string /gt
  • lt/xsd complexTypegt
  • lt/XSDelementgt
  • ltxsd element name addressgt
  • ltxsd complexTypegt
  • ltxsd element name city type xsd
    string /gt
  • ltxsd element name postcode type xsd
    integer /gt
  • ltxsd element name street type xsd
    string /gt
  • lt/xsd complexTypegt
  • lt/XSDelementgt
  • ltxsd element name telephone_number type
    xsdstring
  • minoccurs1 maxOccursunbounded /gt
  • ltxsd attribute name social_security_numb
    er type xsdstring /gt
  • lt/xsd complexTypegt

10
Web technologies / weekly exercisesAnswers
(5/2)
  • ltperson social_security_number 123456789Agt
  • ltnamegt
  • ltfirst_namegtJacklt/first_namegt
  • ltlast_namegtTaylorlt/last_namegt
  • lt/namegt
  • ltaddressgt
  • ltcitygtBostonlt/citygt
  • ltpostcodegt0500lt/postcodegt
  • ltstreetgtHamilton lt/Streetgt
  • lt/addressgt
  • lttelephone_numbergt12345lt/telephone_numbergt
  • lttelephone_numbergt12345lt/telephone_numbergt
  • lt/persongt

11
Web technologies / Weekly exercisesNumber 3
  • 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.
  • Do exercise 1 using UML-design
  • Capture the knowledge, using the graph of N3
    notation, of the following English statements
  • 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/elis
    a
  • 4. Using UML give a schema for the statements
    given in exercise 3.

12
Web technologies / Weekly exercisesAnswers 3
Answer 3.1
name
name
plays
Player
Team
is-captain
uniforms- colors
favorite- players
favorite- teams
Color
favorite- color
Fan
color-name
name
13
Web technologies / Weekly exercisesAnswers 3
Answer 3.2
Player name plays-in is_captain
Team name uniform_colors
Fan name favorite color favorite_palyer favorite_t
eams
14
Web technologies / Weekly exercisesAnswers 3
Answer 3.3
studies_at
Jack Smith
has-website
Helsinki University
http//www.helsinki.fi/university
friend-of
studies-at
has-website
Elisa Ford
Lappeenranta University of Technology
http//www.lut.fi/en
has-website
http//www.lut.fi/elisa
15
Web technologies / Weekly exercisesAnswers 3
Answer 3.4
Person name has-website friend-of studies-at
University name has-website
16
Web technologies / Weekly exercisesNumber 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
Hours
Date Description 2000025 Taking Truck Body
Apart 2000225 Sandblasting Dismantling
Cab 2000311 Sanding, Priming Hood and Fender
2 3 4
17
Web technologies / Weekly exercisesAnswers
Number 4
  • Answer 4.1

lt?xml version1.0 encodingUTF-8?gt lt?xml-style
sheet hrefsimple.xsl typetext/XSL?gt ltproject
nameTrumantruck.comgt ltdescriptiongtRebuilding
a 1967 Chevy Pickup Trucklt/descriptiongt ltschedule
gt ltworkdaygt ltdategt20000205gtlt/dategt ltdescri
ptiongtTaking Truck Body Apartlt/descriptiongt ltho
ursgt2lt/hoursgt lt/workdaygt ltworkdaygt ltdategt2
0000225gtlt/dategt ltdescriptiongtSandblasting,
Dismantling Cablt/descriptiongt lthoursgt3lt/hoursgt
lt/workdaygt ltworkdaygt ltdategt200003111gtlt/dat
egt ltdescriptiongtSanding, Priming Hood and
Fenderlt/descriptiongt lthoursgt4lt/hoursgt lt/workd
aygt lt/schedulegt lt/projectgt
18
Web technologies / Weekly exercisesAnswers
Number 4
Answer 4.1 continues
ltxslstylesheet xmlnxslhttp//www.w3.org/TR/WD-x
slgt ltxsltemplate match/gt
lthtmlgt ltTITLEgt Schedule For ltxslvalue-of
select/project/_at_name/gt ltxsl value-of
select/project/description/gt lt/TITLEgt ltCENTERgt
ltTABLE border1gt ltTRgt
ltTDgtltBgtDatelt/Bgtlt/TDgt ltTDgtltBgtDescriptionlt
/Bgtlt/TDgt ltTDgtltBgtHourslt/Bgtlt/TDgt lt/TRgt
ltxslapply-templates/gt lt/TABLEgt lt/CENTREgt
lt/htmlgt lt/xsltemplategt
19
Web technologies / Weekly exercisesAnswers
Number 4
  • Answer 4.1 continues

ltxsl template matchprojectgt ltH1gt
Project ltxsl value-of
select_at_name/gt lt/H1gt ltHR/gt
ltxsl apply-template/gt ltxsl template
match schedulegt ltH2gt Work
Schedulelt/H2gt ltxslapply-templates/gt lt/
xsl templategt ltxsl template match
workdaygt ltTRgt ltTDgt
ltxsl value of select date/gt
lt/TDgt ltTDgt ltxsl value -of
selectdescription/gt lt/TDgt
ltTDgt ltxsl value -of
selecthours/gt lt/TDgt
lt/TRgt lt/xsl templategt lt/xsl stylesheetgt
20
Web technologies / Weekly exercisesNumber 5
  • 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.

21
RDF-exercises
22
  • 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.
  • lt?xml version 1.0 encoding_UTF-16?gt
  • ltrdf RDF
  • xmlns rdfhttp//www.w3.org/1999/02/22-rdf-syn
    tax-ns
  • xmlns mydomain http//www.mydomain.org/my-rdf
    -nsgt
  • ltrdf Description rdf about http
    //www.hut.fi/jack/homepagegt
  • ltmydomain homepage-ownergt Jack Taylor
    lt/mydomain homepage-ownergt
  • lt/rdf Descriptiongt
  • lt/rfd RDFgt

23
  • RDF-Exercise 2.
  • Give an RDF_description that states the
    following
  • Resource http //www.innouni.fi/innouni-ns/T-999
    gt is a course named Java-programming and is
    lectured by Lisa Smith at room T2.
  • Answer RDF-Excercise 2.
  • lt?xml version 1.0 encoding_UTF-16?gt
  • ltrdf RDF
  • xmlns rdfhttp//www.w3.org/1999/02/22-rdf-syn
    tax-ns
  • xmlns mydomain http//www.mydomain.org/my-rdf
    -nsgt
  • ltrdf Description rdf about http
    //www.innouni.fi/innouni-ns/T-999gt
  • ltmydomain course-namegt Java-programming
    lt/mydomain course-namegt
  • ltmydomain course-lecturergt Lisa Smith
    lt/mydomain course-lecturergt
  • ltmydomain lecture-roomgt T2 lt/mydomain
    lecture-roomgt
  • lt/rdf Descriptiongt
  • lt/rfd RDFgt

24
  • 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.
  • lt?xml version 1.0 encoding_UTF-16?gt
  • ltrdf RDF
  • xmlns rdfhttp//www.w3.org/1999/02/22-rdf-syn
    tax-ns
  • xmlns mydomain http//www.mydomain.org/my-rdf
    -nsgt
  • ltrdf Description rdf about ABC-99gt
  • ltmydomain ownsgt
  • ltrdf Baggt
  • ltrdf _li rdf resource Mary/gt
  • ltrdf _li rdf resource John/gt
  • lt/mydomain ownsgt
  • lt/rdf Descriptiongt
  • lt/rfd RDFgt

25
  • 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.
  • lt?xml version 1.0 encoding_UTF-16?gt
  • ltrdf RDF
  • xmlns rdfhttp//www.w3.org/1999/02/22-rdf-syn
    tax-ns
  • xmlns mydomain http//www.mydomain.org/my-rdf
    -nsgt
  • ltrdf Description rdf about ABC-99gt
  • ltmydomain owns rdf parseType Collectiongt
  • ltrdf Description rdf about Mary/gt
  • ltrdf Description rdf about John/gt
  • lt/mydomain ownsgt
  • lt/rdf Descriptiongt
  • lt/rfd RDFgt

26
RDF Schema-exercises
27
  • 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.

Assistant
domain
range
supervises
Course
teacher_name
subClassOf
domain
range
range
domain
Teacher
lectures
Literal
course_id
subClassOf
domain
range
Professor
Literal
28
  • ltrdf RDF
  • xmlns rdfhttp//www.w3.org/1999/02/22-rdf-syn
    tax-ns
  • xmlns rdfshttp//www.w3.org/2000/01/rdf-schema
    gt
  • ltrdfsClass rdfIDassistantgt
  • ltrdfscommentgtThe class of
    assistants.lt/rdfscommentgt
  • ltrdfssubClassOf rdfresourceteacher/gt
  • lt/rdfsClassgt
  • ltrdfsClass rdfIDprofessorgt
  • ltrdfscommentgtThe class of
    professors.lt/rdfscommentgt
  • ltrdfssubClassOf rdfresourceteacher/gt
  • lt/rdfsClassgt
  • ltrdfsClass rdfIDteachergt
  • ltrdfscommentgtThe class of
    teacherslt/rdfscommentgt
  • lt/rdfsClassgt
  • ltrdfsClass rdfIDcoursegt

29
  • ltrdfsProperty rdfIDlecturesgt
  • ltrdfscommentgt
  • It relates professors to courses
  • lt/rdfscommentgt
  • ltrdfsdomain rdfresourceprofessor/gt
  • ltrdfsrange rdfresourcecourse/gt
  • lt/rdfsPropertygt
  • ltrdfsProperty rdfIDsupervisesgt
  • ltrdfscommentgt
  • It relates assistants to courses
  • lt/rdfscommentgt
  • ltrdfsdomain rdfresourceassistant/gt
  • ltrdfsrange rdfresourcecourse/gt
  • lt/rdfsPropertygt

30
  • ltrdfsProperty rdfIDlecturer_namegt
  • ltrdfscommentgt
  • It is a property of teachers and takes
    literals as values.
  • lt/rdfscommentgt
  • ltrdfsdomain rdfresourceteacher/gt
  • ltrdfsrange rdfresourcerdfLiteral/gt
  • lt/rdfsPropertgt
  • ltrdfsProperty rdfIDcourse_idgt
  • ltrdfscommentgt
  • It is a property of courses and takes
    literals as values.
  • lt/rdfscommentgt
  • ltrdfsdomain rdfresourcecourse/gt
  • ltrdfsrange rdfresourcerdfLiteral/gt
  • lt/rdfsPropertgt
  • lt/rdfRDFgt

31
  • Execise 2. RQL-Exercise .
  • By using RQL and the RDF Schema of the previous
    exercise give the following queries
  • 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
  • teacher
  • teacher
  • select X, Y
  • from assistantX . teacher_name Y

32
  • 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
the proposal
X
supports
the proposal
Y
supports
the proposal
Z
33
X
belongs
belongs
supports
Y
the proposal
the group
belongs
Z
34
  • Exercise 4. Compare rdfssubClassOf with type
    extension in XML Schema

35
  • Exercise 5. Try to map the relational database
    model on RDF.

36
  • Exercise 6. Compare entity-relationship modelling
    to RDF.

37
  • 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
year
range
writtenBy
domain
domain
literal
domain
Book
ISBN
range
domain
range
publishedBy
publishretName
literal
range
presents
domain
Publisher
Copy
domain
copyNumber
range
literal
38
  • ltrdfRDF
  • xmlnsrdfhttp.w3.org/1999/02/22-rdf-syntax-ns
  • xmlnsrdfshttp.w3.org/2000/01/rdf-schemagt
  • ltrdfsClass rdfIDbookgt
  • ltrdfscommentgtThe class of
    bookslt/rdfscommentgt
  • lt/rdfsClassgt
  • ltrdfsClass rdfIDpublishergt
  • ltrdfscommentgtThe class of
    publisherslt/rdfscommentgt
  • lt/rdfsClassgt
  • ltrdfsProperty rdfIDpublishedBygt
  • ltrdfscommentgt
  • It relates books to publishers
  • lt/rdfscommentgt
  • ltrdfsdomain rdfresourcebook/gt
  • ltrdfsrange rdfresourcepublisher/gt
  • lt/rdfsPropertygt

39
  • ltrdfsProperty rdfIDISBNgt
  • ltrdfscommentgt
  • It is a property of books and takes
    literals as values.
  • lt/rdfscommentgt
  • ltrdfsdomain rdfresourcebook/gt
  • ltrdfsrange rdfresourcerdfLiteral/gt
  • lt/rdfsPropertgt
  • lt/rdfRDFgt

40
RDF-satatements
  • ltmydomain book rdfID12345
  • mydomain ISBN abc567gt
  • ltmydomain publishedBy rdfresourcePrenticee_H
    all/gt
  • ltmydomain writternBy rdfresourcre
    Jack_Smith/gt
  • lt/mydomainbookgt
  • The same RDF-description by not using abbreviated
    syntax
  • ltrdf Description rdf ID12345gt
  • ltrdf type rdf resourcemydomain book/gt
  • ltmydomain ISBNgt abc567 lt/mydomain ISBNgt
  • ltmydomain publishedBy rdfresourcePrenticee_H
    all/gt
  • ltmydomain writternBy rdfresourcre
    Jack_Smith/gt
  • lt/rdf Descriptiongt

41
  • Queries
  • a) Retrieve all the instances of the book class?
  • Anwer book
  • b) Retrieve all books and their ISBNs
  • Answer select X, Y
  • from book X . ISBN y
  • Retrieve all the ISBNs of the books published by
    Prentice-Hall
  • Answer select N
  • from book X . publishedBy Y, C ISBN N
  • where Y Prentice-Hall and XC

42
  • Exercise 8. Write an ontology about geography
    cities, countries, capitals, borders, states, and
    so on.

domain
domain
countryName
country
border
range
range
range
range
literal
belongs
isPartOf
domain
domain
state
city
locates
isSubClassOff
capital
43
  • ltrdfRDF
  • xmlnsrdfhttp.w3.org/1999/02/22-rdf-syntax-ns
  • xmlnsrdfshttp.w3.org/2000/01/rdf-schemagt
  • ltrdfsClass rdfIDcountrygt
  • ltrdfscommentgtThe class of
    countrieslt/rdfscommentgt
  • lt/rdfsClassgt
  • ltrdfsClass rdfIDcitygt
  • ltrdfscommentgtThe class of
    citieslt/rdfscommentgt
  • lt/rdfsClassgt
  • ltrdfsClass rdfIDstategt
  • ltrdfscommentgtThe class of
    stateslt/rdfscommentgt
  • lt/rdfsClassgt
  • ltrdfsProperty rdfIDbelongsgt
  • ltrdfscommentgt
  • It relates cities to countries

44
  • ltrdfsProperty rdfIDlocatesgt
  • ltrdfscommentgt
  • It relates cities to states
  • lt/rdfscommentgt
  • ltrdfsdomain rdfresourcecity/gt
  • ltrdfsrange rdfresourcestate/gt
  • lt/rdfsPropertygt
  • ltrdfsProperty rdfIDisPartOfgt
  • ltrdfscommentgt
  • It relates states to countries
  • lt/rdfscommentgt
  • ltrdfsdomain rdfresourcestate/gt
  • ltrdfsrange rdfresourcecountry/gt
  • lt/rdfsPropertygt
  • ltrdfsClass rdfIDcapitalgt
  • ltrdfscommentgt
  • The class of capitals

45
  • ltrdfsProperty rdfIDbordergt
  • ltrdfscommentgt
  • It relates bordersto countries
  • lt/rdfscommentgt
  • ltrdfsdomain rdfresourcecountry/gt
  • ltrdfsrange rdfresourcecountry/gt
  • lt/rdfsPropertygt
  • ltrdfsProperty rdfIDcountryNamegt
  • ltrdfscommentgt
  • It is a property of countries and takes
    literals as values.
  • lt/rdfscommentgt
  • ltrdfsdomain rdfresourcecountry/gt
  • ltrdfsrange rdfresourcerdfLiteral/gt
  • lt/rdfsPropertgt
  • lt/rdfRDFgt

46
  • 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

47
  • 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

48
  • 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.

49
  • Exercise 12. What relationship exist between is
    child of and is parent of ?
  • Answer inverse relationship

50
  • 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.

51
OWL-exercises
52
  • 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
professor
subClassOf
assistant
laboratory-course
homework
teach
53
  • ltrdfRDF
  • xmlnsrdfhttp//www.w3.org/1999/02/22-rdf-synta
    x-nsl
  • xmlnsrdfshttp//www.w3.org/2000/01/rdf-schema
  • xmlnsowlhttp//www.w3.org/2002/07/owl
  • ltowlOntology rdfabout/gt
  • ltowlClass rdfIDcoursegt
  • ltrdfscommentgtCourses form a class.lt/rdfscommen
    tgt
  • lt/owlClassgt
  • ltowlClass rdfIDlaboratoryCoursegt
  • ltrdfscommentgtLaboratory course is a type of
    course.lt/rdfscommentgt
  • ltrdfssubClassOf rdfresourcecourse/gt
  • lt/owlClassgt
  • ltowlClass rdfIDhomeworkgt
  • ltrdfssubClassOfgt
  • ltowlRestrictiongt
  • ltowlonProperty rdfresoyrceis_part_of/
    gt
  • ltowlallValuesFrom rdfresourcecourse/gt
  • lt/owlRestrictiongt
  • lt/rdfssubClassOfgt

54
  • ltowlClass rdfIDteachergt
  • ltrdfscommentgtTeachers form a
    class.lt/rdfscommentgt
  • lt/owlClassgt
  • ltowlClass rdfIDassistantgt
  • ltrdfscommentgtAssistants are exactly those
    teachers that teach laboratory courses.lt/rdfscomm
    entgt
  • ltowlintersectionOf rdfparseTypeCollectiongt
  • ltowlClass rdfaboutteacher/gt
  • ltowlRestrictiongt
  • ltowlonProperty rdfresoyrceteach/gt
  • ltowlallValuesFrom rdfresorcelaboratory
    Course/gt
  • lt/owlRestrictiongt
  • lt/owlintersectionOf gt
  • lt/owlClassgt

55
  • ltowlClass rdfIDprofessorgt
  • ltrdfscommentgtProfessors are exactly those
    teachers that teach laboratory courses.lt/rdfscomm
    entgt
  • ltowlintersectionOf rdfparseTypeCollectiongt
  • ltowlClass rdfaboutteacher/gt
  • ltowlRestrictiongt
  • ltowlonProperty rdfresoyrceteach/gt
  • ltowlsomeValuesFrom rdfresorcecourse/gt
  • lt/owlRestrictiongt
  • lt/owlintersectionOf gt
  • lt/owlClassgt
  • ltowlTransitiveProperty rdfIDis_part_of/gt
  • ltowlObjectProperty rdfIDteachsgt
  • ltrdfsdomain rdfresourceteacher/gt
  • lt/owlObjectPropertygt
  • lt/rdfRDFgt

56
  • 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.

57
Answer a)
  • ltrdfRDF
  • xmlnsrdfhttp//www.w3.org/1999/02/22-rdf-synta
    x-nsl
  • xmlnsrdfshttp//www.w3.org/2000/01/rdf-schema
  • xmlnsowlhttp//www.w3.org/2002/07/owl
  • ltowlOntology rdfabout/gt
  • ltowlClass rdfIDmedicinalProductgt
  • ltrdfscommentgtMedicinal products form a
    class.lt/rdfscommentgt
  • lt/owlClassgt
  • ltowlClass rdfIDoverTheCounterDruggt
  • ltrdfssubClassOf rdfresourcemedicinalProduct
    /gt
  • ltowl disjointWith rdf resource
    prescriptionBasedDrug/gt
  • lt/owlClassgt
  • ltowlClass rdfIDprescriptionBasedDruggt
  • ltrdfssubClassOf rdfresourcemedicinalProduct
    /gt
  • ltowl disjointWith rdf resource
    overTheCounterDrug/gt
  • lt/owlClassgt
  • ltowlClass rdfIDactiveSubstancegt
  • ltowl disjointWith rdf resource
    medicinalProduct/gt
  • lt/owlClassgt

58
  • ltowlObjectProperty rdfIDincludesgt
  • ltrdfsdomain rdfresourcemedicinalProduct/gt
  • ltrdfsrange rdfresourceactiveSubstance/gt
  • lt/owlObjectPropertygt
  • ltowlTransitiveProperty rdfIDsubstitutesgt
  • ltrdfsdomain rdfresourcemedicinalProduct/gt
  • ltrdfsrange rdfresourcemedicinalProduct/gt
  • lt/owlObjectPropertygt
  • lt/rdfRDF

59
Answer b)
  • ltrdf Description rdf IDPanadol/gt
  • ltrdf type rdf resource overTheCounterDrug
    /gt
  • lt/rdf Descriptiongt
  • ltrdf Description rdf IDTramadoldol/gt
  • ltrdf type rdf resource prescriptionBasedDr
    ug/gt
  • lt/rdf Descriptiongt
  • ltrdf Description rdf IDLopermide/gt
  • ltrdf type rdf resource
    activeSubstance/gt
  • lt/rdf Descriptiongt
Write a Comment
User Comments (0)
About PowerShow.com