====== Introduction to ontologies ====== ^ Last verification: | 20180914 | ^ Tools required for this lab: | -- | ===== Before the lab ===== Reading: * **[[http://protege.stanford.edu/publications/ontology_development/ontology101-noy-mcguinness.html|Build your first ontology]]** * [[http://www.cs.uu.nl/docs/vakken/smw/lectures/Semantic%20Web%20Languages.pdf|Ontology, SW languages]] * [[http://www.slideshare.net/ocorcho/ekaw2014-keynote-ontology-engineering-for-and-by-the-masses-are-we-already-there-42068683|Ontology Engineering for and by the Masses: are we already there?]] * [[#if_you_want_to_know_more|If you want to know more...]] ===== Lab instructions ===== Developing an ontology is a complex task and it is hardly possible to learn everything what is important on a single lab session. This lab aims to get you familiar with the WebProtégé ontology editor and chosen ontology constructs. You are encouraged to continue developing and refining your ontology at home. During this lab you can prototype an ontology for: * The Bold and the Beautiful / The Game of Thrones (as you are already familiar with the topic :-) ) * or Multimedia Library (e.g. books, movies, music CDs, etc). ===== - Tool for prototyping: WebProtégé ===== WebProtégé is a lightweight online ontology editing tool. It supports a limited set of constructs of ontology languages such as RDFS and OWL. Full-fledged ontology editor is Protege Desktop. - Create an account at [[http://webprotege.stanford.edu/|WebProtégé]] website. - Create a new project called: ''AGH-SemWeb2019-Name'', where Name should be your name(s). - Load (open) your project. ===== - Developing an ontology ===== An ontology is an artifact that describes certain domain (part of a world). It consists of a set of concepts (//classes//), typically organised in a hierarchy, connected by various //properties// and having various //attributes//. - Open the [[http://protege.stanford.edu/publications/ontology_development/ontology101-noy-mcguinness.html|Build your first ontology]] tutorial. Skim sections 1 and 2. - Leave it open and read appropriate sections while doing consecutive steps... - Note: [[http://protegewiki.stanford.edu/wiki/WebProtegeUsersGuide|WebProtege Users Guide]] may be useful \\ **Note: each part should take approx. 10 minutes!** ==== - Determine the domain and scope ==== - Scope: Discuss in pairs and define the scope of your ontology. For example, your ontology may describe all GoT characters in a specified period of time (e.g. at the end of the first book) or all multimedia items that you own. - You can adjust the scope later during the process. - 8-) Write down the scope of the ontology in the report. - Competency questions: Think of and list the competency questions your ontology will help to answer. Exemplary competency questions may be: - What are the other movies in the genre I watch most often? - Who are the children of the one named "Kingslayer"? - Did Brooke marry a member of the Forrester family and when? \\ 8-) Write down the competency questions in the report. ==== - Consider reuse ==== - Search for existing ontologies related to the topic (max 10 minutes) (e.g. the simplest ontology that will be useful is FOAF for describing the names od Dublin Core for describing basic media metadata). Although you may not know the syntax of ontology languages, they should be intuitive (remember, they are basically descriptions of classes and relations among them). - 8-) Put in your report links to **two** ontologies that you find useful / related to the topic. List classes and properties you will use in your ontology (if any). ==== - Enumerate important terms ==== - 8-) Write down in the report important terms that you will use to build your ontology. They may be nouns, verbs and other parts of speech. They will help you to identify and define //classes//, //datatype properties// (typically, attributes of the classes) and //object properties// (relations between classes). ==== - Define classes and class hierarchy ==== - In WebProtege, choose the ''Classes'' tab and create a new class. E.g., it may by a ''Person'', or ''Movie'' or ''Kingdom'' etc.{{ :pl:dydaktyka:semweb:wp-class.png?400 |}} - Repeat it for other classes. Create approx. 10-20 classes. - Use //drag-and-drop// mechanism od WebProtege to move classes around in the classes "tree" -> create a hierarchy of terms. * //NOTE//: Multiple inheritance is acceptable. If the tool is not helpful, use ''rdfs:subClassOf'' as an additional property. * //NOTE 2//: If two "sibling" classes (having the same parent class) are disjoint, add ''owl:disjointWith'' properties to their descriptions (:!: //if it is possible with the current version of the tool//). Define at least one such relation. ==== - Define the properties of classes ==== - In ''Properties'' tab, create new properties as subclasses of ''owl:topObjectProperty'' and ''owl:topDataProperty''. {{ :pl:dydaktyka:semweb:wp-properties.png?400 |}} - object properties link classes to classes - data properties link classes to datatypes (e.g., strings, dates etc.) - Specify the domain and range of the properties. Do you see any limitations/problems? If so, write them in the report. 8-) ==== - Create instances ==== - In ''Individuals'' tab, create a few instances (//objects//) of defined classes (e.g., ''Jaime Lannister'' - an individual of a class ''Person'', ''House Lannister'' as an instance of a class ''Family'' etc.) - Assert relations among the instances (e.g., ''Jaime Lannister'' ''belongsTo'' ''House Lannister'') ==== - Tune your ontology ==== - More about creating classes: read [[http://protege.stanford.edu/publications/ontology_development/ontology101-noy-mcguinness.html#Section4|Section 4]] and Section 5 of the tutorial and correct mistakes in your ontology. - Conventions and vocabulary: read [[http://protege.stanford.edu/publications/ontology_development/ontology101-noy-mcguinness.html#Section6|Section 6]] and: - tune your naming conventions (use ''CamelCase'', starting with a capital letter for class names and a small letter for properties), - be consistent about suffixes in the classes' names. ===== - Wrapping up ===== - Can your ontology answer the competency questions you defined? If necessary, adjust the questions and/or the ontology. - Set your "Sharing settings" in WebProtege so that at least the teacher (login: ''kkutt'') can access it. - 8-) The report consists of a __pdf file and the ontology__ - put the identifier on your ontology in the report and make sure the ontology is accessible. - 8-) Write a short reflection about the process of developing an ontology. What was intuitive, what was not? What was difficult? How would you improve the process when building your next ontology? ===== Control questions ===== * what is Ontology? * what is an ontology? * what are the ontologies for? * what are the main components of an ontology? ===== If you want to know more ===== Lecture: * {{pl:dydaktyka:semweb:2014:eis2014semweb-ontologies.pdf|Semantic Web: Building Ontologies (2014)}}, * {{pl:dydaktyka:semweb:2014:eis2014semweb-ontology-logic.pdf|Semantic Web: Ontology Engineering and Reasoning (2014)}} Software: * [[http://protege.stanford.edu|Protégé]] ontology editor * [[http://owl.cs.manchester.ac.uk/publications/talks-and-tutorials/protg-owl-tutorial/|Protégé Tutorial]] * [[http://oops.linkeddata.es/|OOPS! (OntOlogy Pitfall Scanner!)]] * [[https://github.com/dgarijo/WIDOCO|WIzard for DOCumenting Ontologies (WIDOCO)]] Reading: * {{guarinofois98.pdf|N. Guarino: "Formal Ontology and Information Systems" (1998)}} * [[https://www.cambridgesemantics.com/blog/semantic-university/learn-owl-rdfs/rdfs-vs-owl/|RDFS vs OWL. Short comparison @Cambridge Semantics]] * [[http://ontologydesignpatterns.org/wiki/Main_Page|Ontology Design patterns]] OWL Tutorials: * [[http://www.cs.man.ac.uk/~horrocks/ISWC2003/Tutorial/|OWL Tutorial from 2003]] * [[http://mowl-power.cs.man.ac.uk/2009/07/sssw/|OWL Reasoning Examples and Hands-On Session (2009)]] * [[http://mowl-power.cs.man.ac.uk/2008/iswc-tones/|Reasoning for Ontology Engineering and Usage - ISWC 2008]] * [[http://owl.cs.manchester.ac.uk/publications/talks-and-tutorials/|Talks and Tutorials -- OWL @ Manchester]] * http://protege.stanford.edu/conference/2009/tutorials.html * [[http://www.linkeddatatools.com/introducing-rdfs-owl|Tutorial 4: Introducing RDFS & OWL]]