130 likes | 277 Views
Semanntic Web Exercises. XML-exercises (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.
E N D
XML-exercises (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
XML-exercises (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.
Conceptual modelling exercises • 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/elisa 4. Using UML give a schema for the statements given in exercise 3.
XSLT-exercise 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
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. By using first order predicate logic state the following “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. RDF-Exercise 2. Give an RDF_description that states the following: Resource http: //www.innouni.fi/innouni-ns/#T-999”> is a course named Java-programming and is lectured by Lisa Smith at room T2. 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.
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
RDFS-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. 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.
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. 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.
Exercise 8. Write an ontology about geography: cities, countries, capitals, borders, states, and so on. Exercise 9. Consider the classes of males and females. Name a relationship between them that should be included in an ontology. 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. 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? Exercise 12. What relationship exist between ”is child of” and ”is parent of” ?
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 ?
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. 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.