Tools & Frameworks for the Semantic Web Semantic Web - Fall 2005 Computer Engineering Department Sharif University of Technology.

Slides:



Advertisements
Similar presentations
Dr. Leo Obrst MITRE Information Semantics Information Discovery & Understanding Command & Control Center February 6, 2014February 6, 2014February 6, 2014.
Advertisements

1 ICS-FORTH EU-NSF Semantic Web Workshop 3-5 Oct Christophides Vassilis Database Technology for the Semantic Web Vassilis Christophides Dimitris Plexousakis.
Dr. Alexandra I. Cristea OWL Dr. Alexandra I. Cristea
CH-4 Ontologies, Querying and Data Integration. Introduction to RDF(S) RDF stands for Resource Description Framework. RDF is a standard for describing.
Jena a introduction Semantic Web Tools. Originally devised by HP Labs in Bristol, it was developed by Brian McBride of Hewlett-Packard and was derived.
Master Informatique 1 Semantic Technologies Part 4Jena Werner Nutt.
JENA –A SEMANTIC WEB TOOL by Ranjani Sankaran & krishna Priyanka Chebrolu.
Of 27 lecture 7: owl - introduction. of 27 ece 627, winter ‘132 OWL a glimpse OWL – Web Ontology Language describes classes, properties and relations.
RDF Databases By: Chris Halaschek. Outline Motivation / Requirements Storage Issues Sesame General Introduction Architecture Scalability RQL Introduction.
Semantic Web Tools Vagan Terziyan Department of Mathematical Information Technology, University of Jyvaskyla ;
Chapter 8: Web Ontology Language (OWL) Service-Oriented Computing: Semantics, Processes, Agents – Munindar P. Singh and Michael N. Huhns, Wiley, 2005.
RDF(S) Tools Adrian Pop, Programming Environments Laboratory Linköping University.
COMP 6703 eScience Project Semantic Web for Museums Student : Lei Junran Client/Technical Supervisor : Tom Worthington Academic Supervisor : Peter Strazdins.
Introduction to Databases Transparencies
Dr. Alexandra I. Cristea OWL.
1 An Introduction to RDF and the Jena RDF API. 2 Outline Introduction Statements Writing RDF Reading RDF Navigating a Graph Querying a Graph Operations.
Using Java in Linked Data Applications Fuming Shih Oct 12.
Triple Stores.
An OWL based schema for personal data protection policies Giles Hogben Joint Research Centre, European Commission.
Nancy Ide Vassar College USA Resource Definition Framework A Tutorial EUROLAN 2003 July 28 - August 8 Bucharest - Romania.
RDF (Resource Description Framework) Why?. XML XML is a metalanguage that allows users to define markup XML separates content and structure from formatting.
Database System Concepts and Architecture Lecture # 3 22 June 2012 National University of Computer and Emerging Sciences.
A Scalable Application Architecture for composing News Portals on the Internet Serpil TOK, Zeki BAYRAM. Eastern MediterraneanUniversity Famagusta Famagusta.
Information storage: Introduction of database 10/7/2004 Xiangming Mu.
Okech Odhiambo Faculty of Information Technology Strathmore University
1 Representing Data with XML September 27, 2005 Shawn Henry with slides from Neal Arthorne.
The Semantic Web Web Science Systems Development Spring 2015.
Database Support for Semantic Web Masoud Taghinezhad Omran Sharif University of Technology Computer Engineering Department Fall.
RDF and OWL Developing Semantic Web Services by H. Peter Alesso and Craig F. Smith CMPT 455/826 - Week 6, Day Sept-Dec 2009 – w6d21.
Building an Ontology of Semantic Web Techniques Utilizing RDF Schema and OWL 2.0 in Protégé 4.0 Presented by: Naveed Javed Nimat Umar Syed.
The Jena RDF Framework Konstantinos Tzonas. Contents What is Jena Capabilities of Jena Basic notions RDF concepts in Jena Persistence Ontology management.
Tools & Frameworks for the Semantic Web Semantic Web - Fall 2005 Computer Engineering Department Sharif University of Technology.
Semantic Web Andrejs Lesovskis. Semantic Web layers.
Ontology Query. What is an Ontology Ontologies resemble faceted taxonomies but use richer semantic relationships among terms and attributes, as well as.
Presentation : Konstantinos Kanaris.  What is Jena?  Usage of Jena  Main Concepts  Main Components  Storage Models  OWL API  RDF API  Reasoning.
Metadata. Generally speaking, metadata are data and information that describe and model data and information For example, a database schema is the metadata.
Modulo3 Protegè Tutorial UNIVERSITA’ DI CAMERINO Corso di laurea in Informatica (classe 23/S) Barbara Re Anno Accademico
Lesson Overview 3.1 Components of the DBMS 3.1 Components of the DBMS 3.2 Components of The Database Application 3.2 Components of The Database Application.
Efficient RDF Storage and Retrieval in Jena2 Written by: Kevin Wilkinson, Craig Sayers, Harumi Kuno, Dave Reynolds Presented by: Umer Fareed 파리드.
EEL 5937 Ontologies EEL 5937 Multi Agent Systems Lecture 5, Jan 23 th, 2003 Lotzi Bölöni.
RDF languages and storages part 1 - expressivness Maciej Janik Conrad Ibanez CSCI 8350, Fall 2004.
Sesame: A Generic Architecture for Storing and Querying RDF and RDF Schema Jeen Broekstra, Arjohn Kampman, and Frank van Harmelen 정홍석
Practical RDF Chapter 10. Querying RDF: RDF as Data Shelley Powers, O’Reilly SNU IDB Lab. Hyewon Lim.
Organization of the Lab Three meetings:  today: general introduction, first steps in Protégé OWL  November 19: second part of tutorial  December 3:
User Profiling using Semantic Web Group members: Ashwin Somaiah Asha Stephen Charlie Sudharshan Reddy.
Practical RDF Ch.10 Querying RDF: RDF as Data Taewhi Lee SNU OOPSLA Lab. Shelley Powers, O’Reilly August 27, 2004.
Description of Information Resources: RDF/RDFS (an Introduction)
Dr. Bhavani Thuraisingham September 24, 2008 Building Trustworthy Semantic Webs Lecture #9: RDF and RDF Security.
Triple Stores. What is a triple store? A specialized database for RDF triples Can ingest RDF in a variety of formats Supports a query language – SPARQL.
Representing Data with XML February 26, 2004 Neal Arthorne.
Practical RDF Chapter 12. Ontologies: RDF Business Models Shelley Powers, O’Reilly SNU IDB Lab. Taikyoung Kim.
Sesame: An Architecture for Storing and Querying RDF Data and Schema Inf. Yasser Ganji Saffar When they were out of sight Ali Baba.
CS621 : Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 12 RDF, OWL, Minimax.
1 Dr Alexiei Dingli Introduction to Web Science Modelling Knowledge.
Motivation Dynamically identify and understand information sources Provide interoperability between agents in a semantic manner Enable distributed extensible.
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall RDF & RDF Schema Machine Understandable Metadata for the.
WonderWeb. Ontology Infrastructure for the Semantic Web. IST Project Review Meeting, 11 th March, WP2: Tools Raphael Volz Universität.
RDF storages and indexes Maciej Janik September 1, 2005 Enterprise Integration – Semantic Web.
Semantic Interoperability in GIS N. L. Sarda Suman Somavarapu.
Sesame A generic architecture for storing and querying RDF and RDFs Written by Jeen Broekstra, Arjohn Kampman Summarized by Gihyun Gong.
ISC321 Database Systems I Chapter 2: Overview of Database Languages and Architectures Fall 2015 Dr. Abdullah Almutairi.
OWL (Ontology Web Language and Applications) Maw-Sheng Horng Department of Mathematics and Information Education National Taipei University of Education.
Editing OWL Ontologies with Protégé
Building Trustworthy Semantic Webs
Jena 6/8/2018.
ece 720 intelligent web: ontology and beyond
Triple Stores.
Lecture 1: Multi-tier Architecture Overview
The Jena RDF Framework Konstantinos Tzonas.
Presentation transcript:

Tools & Frameworks for the Semantic Web Semantic Web - Fall 2005 Computer Engineering Department Sharif University of Technology

Outline  Jena A Semantic Web framework  Sesame An architecture for storing and querying RDF data.  Protégé An environment for creating and editing ontologies and knowledge bases.

Jena

Introduction  Jena is a Java framework for building Semantic Web applications.  Jena is open source software developed in HP Labs.  The Jena framework includes: A RDF API  Reading and writing RDF in RDF/XML, N3 and N- Triples An OWL API In-memory and persistent storage RDQL support

Jena Versions  Two versions: Jena 1  Expressive support for RDF  Limited reasoning facilities (RDQL) Jena 2  Ontology API included  Support for OWL included

RDF Model  Resource: Anything that can be described with an RDF expression.  Property: Trait, attribute or relation used to describe a resource.  Literal: Simple data type (String, Integer, etc).  Statement: Resource, united with the property and its associated value.  An RDF Model is a set of statements.

RDF API of Jena  Allows creating and manipulating RDF Models from Java applications.  Provides Java classes to represent: Models. Resources. Properties. Literals. Statements.

Example: vcards

Create an RDF Model String personURI = " String givenName = "John"; String familyName = "Smith"; String fullName = givenName + " " + familyName; // create an empty model Model model = ModelFactory.createDefaultModel(); Resource johnSmith = model.createResource(personURI); johnSmith.addProperty(VCARD.FN, fullName); johnSmith.addProperty(VCARD.N, model.createResource().addProperty(VCARD.Given, givenName).addProperty(VCARD.Family, familyName));

Writing and Reading the Model  To serialize the model in XML: model.write(System.out);  To load a model in the memory: Model model = ModelFactory.createDefaultModel(); model.read(“file:c:/example.owl”);

Navigating the Model  Getting information via the URI of the resource: // retrieve the resource John Smith String johnSmithURI = " Resource jSmith = model.getResource(johnSmithURI); // retrieve the value of the property N Resource name = (Resource) jSmith.getProperty(VCARD.N).getObject(); // retrieve the value of the property FN String fullName = (String) jSmith.getProperty(VCARD.FN).getObject();

Referring to a Model  Searching information in a model: // retrieve all the resources of the type vcard // (assuming that all such resources have a property FN) ResIterator it = model.listSubjectsWithProperty(VCARD.FN); while (it.hasNext()) { Resource r = it.nextResource(); System.out.println(r); }  More advanced querying: Use of construction listStatements(Selector s). Use of RDQL.

Operations on Models  A model is a set of statements.  Support of the following operations: Union. Intersection. Difference. // reading the RDF models model1.read(new InputStreamReader(in1), ""); model2.read(new InputStreamReader(in2), ""); // unifying RDF models Model model = model1.union(model2);

Ontology API of Jena  Supports RDF Schema, DAML, DAML+OIL and OWL.  Language independent.

Example: Camera Ontology

Creation of an Ontology Model  Use of method createOntologyModel().  Possible to specify: Used language. Associated reasoning. String fileName = "c:/ejemplo.owl"; String baseURI = "file:///" + fileName; OntModel model = ModelFactory.createOntologyModel(ProfileRegistry.OWL_DL_LANG); model.read(new FileReader(schemaFileName), baseURI);

Classes  Classes are basic construction blocks.  Represented as OntClass. Example: Obtain subclasses of class Camera. OntClass camera = model.getOntClass(camNS + "Camera"); for (Iterator i = camera.listSubClasses(); i.hasNext();) { OntClass c = (OntClass) i.next(); System.out.println(c.getLocalName()); }

Properties  Represented via OntProperty. OntModel m = ModelFactory.createOntologyModel(); OntClass Camera = m.createClass(camNS + "Camera"); OntClass Body = m.createClass(camNS + "Body"); ObjectProperty part = m.createObjectProperty(camNS + "part"); ObjectProperty body = m.createObjectProperty(camNS + "body"); body.addSuperProperty(part); body.addDomain(Camera); body.addRange(Body);

Complex Classes  It is possible to define classes by means of operations for union, intersection, difference.  Example:

// create instance throughTheLens OntClass Window = m.createClass(camNS + "Window"); Individual throughTheLens = m.createIndividual(camNS + "ThroughTheLens", Window); // create property viewfinder ObjectProperty viewfinder = m.createObjectProperty(camNS + "viewfinder"); // create restriction hasValue HasValueRestriction viewThroughLens = m.createHasValueRestriction(null, viewfinder, throughTheLens); // create class Camera OntClass Camera = m.createClass(camNS + "Camera"); // create intersection for defining class SLR IntersectionClass SLR = m.createIntersectionClass(camNS + "SLR", m.createList(new RDFNode[] {viewThroughLens, Camera}));

Schema vs Instance Data  Schema Possible to define:  Classes  Properties (DataTypeProperty, ObjectProperty)  Restrictions  Types of Data  Cardinality  Instance Data Defining instances (individuals) of the Schema elements.

Kodak

Managing Instance Data URI = OntClass c = model.getOntClass(URI +#Camera") OntProperty p = model.getOntProperty(URI +#name") Individual ind = model.getIndividual(URI +#camera1") if (ind.hasProperty(p)) Statement st = ind.getProperty(p); Object l = (Object)st.getObject();

Managing Instance Data  Other operations: model.listIndividuals()  Returns all instances of the model individual.hasProperty(Property p,Object o)  Returns True if there is an individual having property p with value o ontClass.listInstances();  Returns all instances of the class

Jena Inference Support  Inference  Deduce additional information The task of inferencing is carried out by reasoners Jena comprises a set of basic reasoners  OWL Reasoner  DAML Reasoner  RDF Rule Reasoner  Generic Rule Reasoner There is a way to include new reasoners  For example: (?A rdfs:subClassOf ?B) (?B rdfs:subClassOf ?C)  (?A rdfs:subClassOf ?C)

Jena Inference Support  To reason, an Inference Model should be created  Example: Reasoner reasoner = ReasonerRegistry.getOWLReasoner(); reasoner = reasoner.bindSchema(schema); InfModel modelInf = ModelFactory.createInfModel(reasoner,data);

Ontology Validation in Jena Model schema = ModelLoader.loadModel("file:c:/Schema.owl"); Model data = ModelLoader.loadModel("file:c:/example.owl"); Reasoner reasoner = ReasonerRegistry.getOWLReasoner(); reasoner = reasoner.bindSchema(schema); InfModel modelInf = ModelFactory.createInfModel(reasoner, data); ValidityReport vrp1 = modelInf.validate(); if (vrp1.isValid()){ System.out.println(“Valid OWL"); }else { System.out.println(“Not valid OWL"); for (Iterator i = vrp1.getReports(); i.hasNext();){ System.out.println(" - " + i.next()); }

KODAK Error (range check): Incorrectly typed literal due to range (prop, value) Culprit = Implicated node: Implicated node: 'KODAK‘

1 KODAK OLIMPUS Error (too many values): Too many values on max-N property (prop, class) Culprit = Implicated node: Implicated node:

RDQL  q1 contains a query: SELECT ?x WHERE (?x "John Smith")  For executing q1 with a model m1.rdf: java jena.rdfquery --data m1.rdf --query q1  The outcome is: x =============================

Using RDQL from Java Code  It is possible to run RDQL queries from the Java application.  The following classes are to be used for this: Query QueryExecution QueryEngine QueryResults ResultBinding

RDQL Example SELECT ?x, ?fname WHERE (?x ?fname) Query query = new Query("SELECT...") ; query.setSource(model); QueryExecution qe = new QueryEngine(query) ; QueryResults results = qe.exec(); for (Iterator iter = results; iter.hasNext();) { ResultBinding res = (ResultBinding) iter.next(); Resource x = (Resource) res.get("x"); Literal fname = (Literal) res.get("fname"); System.out.println("x: " + x + " fname: " + fname); }

Persistent Models  Jena permits to create persistent models: such as with relational databases.  Jena 2 supports: MySQL Oracle PostgreSQL  To create a persistent model: ModelFactory.createModelRDBMaker(conn).createModel()

Example // Create a connection to DB DBConnection c = new DBConnection(DB_URL, DB_USER, DB_PASS, DB_TYPE); // Create a ModelMaker for persistent models ModelMaker maker = ModelFactory.createModelRDBMaker(c); // Create a new model Model model = maker.createModel("modelo_1"); // Start transaction model.begin(); // Read a model from an XML archive model.read(in, null); // Commit a transaction model.commit();

Sesame When they were out of sight Ali Baba came down, and, going up to the rock, said, "Open, Sesame.“ --Tales of 1001 Nights

Querying Levels  RDF documents can be considered at three different levels of abstraction: 1. At the syntactic level they are XML documents. 2. At the structure level they consist of a set of triples. 3. At the semantic level they constitute one or more graphs with partially predefined semantics.  Querying at what level is the best?

Querying at the Syntactic Level  In this level we just have an XML document.  So we can Query RDF using an XML query language. (e.g. XQuery)  But RDF is not just an XML dialect. XML:  Has a tree structure data model.  Only nodes are labeled. RDF:  Has a graph structure data model.  Both edges (properties) and nodes (subjects/objects) are labeled.  Different ways of encoding the same information in XML are possible.

Querying at the Structure Level  In this level RDF document represents a set of triples:  (type, Book, Class)  (subClassOf, FamousWriter, Writer)  (hasWritten, twain/mark, ISBN )  (type, twain/mark, FamousWriter) Advantage: Independent of the specific XML syntax.  A successful query: SELECT ?x FROM … WHERE (type ?x FamousWriter)  An unsuccessful query: SELECT ?x FROM … WHERE (type ?x Writer)

Querying at the Semantic Level  We need a query language that is sensitive to the RDF Schema primitives: e.g. Class, subClassOf, Property, …  RQL RDF Query Language The first proposal for a declarative query language for RDF and RDF Schema. Output of queries is again legal RDF schema code, which can be used as input of another query. A sample query:  SELECT Y FROM FamousWriter {X}. hasWritten {Y}

Sesame – Introduction & History  Sesame: An Architecture for Storing and Querying RDF Data and Schema Information.  The European On-To-Knowledge project kicked off in Feb. 2000: This project aims at developing ontology-driven knowledge management tools. In this project Sesame fulfills the role of storage and retrieval middleware for ontologies and metadata expressed in RDF and RDF Schema.

On-To-Knowledge Project  Sesame is positioned as a central tool in this project.  OntoExtract: extracts ontological conceptual structures from natural-language documents.  OntoEdit: An ontology editor.  RDF Ferret: A user front-end, that provides search and query. RDF Ferret OntoExtract SesameOntoEdit

What is Sesame?  Sesame is an open source Java framework for storing, querying and reasoning with RDF and RDF Schema.  It can be used as: Standalone Server: A database for RDF and RDF Schema. Java Library: For applications that need to work with RDF internally.

Sesame’s Architecture Repository Repository Abstraction Layer (RAL) Admin ModuleExport ModuleQuery Module HTTP Protocol HandlerSOAP Protocol Handler Sesame SOAP HTTP

The Repository  DBMSs Currently, Sesame is able to use  PostgreSQL  MySQL  Oracle (9i or newer)  SQL Server  Existing RDF stores  RDF flat files  RDF network services Using multiple sesame server to retrieve results for queries. This opens up the possibility of a highly distributed architecture for RDF(S) storing and querying.

Repository Abstraction Layer (RAL)  RAL offers stable, high-level interface for talking to repositories.  It is defined by an API that offers these functionalities: Add data Retrieve data Delete data  Data is returned in streams. (Scalability) Only small amount of data is kept in memory. Suitable for use in highly constrained environments such as portable devices.  Caching data (Performance) E.g. caching RDF schema data which is needed very frequently.

Stacking Abstraction Layers

Admin Module  Allows incrementally inserting or deleting RDF data in/from repository.  Retrieves its information form an RDF(S) source  Parses it using an RDF parser  Checks each (S, P, O) statement it gets from the parser for consistency with the information already present in the repository and infers implied information if necessary for instance: If P equals type, it infers that O must be a class. If P equals subClassOf, it infers that S and O must be classes. If P equals subPropertyOf, then it infers that both S and O must be properties. If P equals domain or range, then it infers that S must be a property and O must be a class.

Query Module  Evaluates RQL queries posed by the user  It is independent of the underlying repository. So it can not use optimizations and query evaluations offered by specific DBMSs.  RQL queries are translated into a set of calls to the RAL. e.g. when a query contains a join operation over two subqueries, each of the subqueries is evaluated, and the join operation is then executed by the query engine on the results.

RDF Export Module  This module allows for the extraction of the complete schema and/or data from a model in RDF format.  It supplies the basis for using Sesame with other RDF tools.

Important Features of Sesame  Powerful query language  Portability It is written completely in Java.  Repository independence  Extensibility Other functional modules can be created and be plugged in it.  Flexible communication by using protocol handlers The architecture separates the communication details from the actual functionality through the use of protocol handlers.

SeRQL (Sesame RDF Query Language)  It combined the best features of other query languages: RQL, RDQL, N-Triples, N3  Some of the built-in predicates: {X} serql:directSubClassOf {Y} {X} serql:directSubPropertyOf {Y} {X} serql:directType {Y}

Using PostgreSQL as Repository  PostgreSQL is an open-source object-relational DBMS.  It supports subtable relations between its tables.  Subtable relations are also transitive.  These relations can be used to model the subsumption reasoning of RDF schema.

Example RDF Schema & Data Writer FamousWriter …/ISBN …/twain/mark BookhasWritten Schema type hasWritten type subClassOf rangedomain Data

Storing Schema (in an RDBMS) uri Resource Writer FamousWriter Book uri hasWritten sourcetarget Writer FamousWriter Book Resource Writer Resource sourcetarget hasWrittenWriter sourcetarget hasWrittenBook sourcetarget ClassSubClassOfSubPropertyOf PropertyDomainRange

uri …/ISBN uri …/twain/mark sourcetarget …/twain/mark…/ISBN FamousWriter Writer Book Resource hasWritten Storing Data (PostgreSQL) In order to decrease the database size another table, called resources, is added to database which maps resource descriptions to unique IDs.

 There are many ambiguities in RDFS: RDF Schema is defined in natural language. No formal description of its semantic is given. E.g. about subClassOf it only says that it is a property with class as its domain and range.  RDF Schema is self-describing: The definition of its terms is itself done in RDF schema.  As a result it consists some inconsistencies.  Circular dependencies in terms definitions: Class is both a subclass of and an instance of Resource. Resource is an instance of Class. RDF Schema Ambiguities

Scalability Issues  An experiment using Sesame: Uploading and querying a collection of nouns from Wordnet (  Consisting of about 400,000 RDF statements. Using a desktop computer (Sun UltraSPARC 5 workstation, 256MB RAM) Uploading the Wordnet nouns took 94 minutes. Querying was quite slow.  Because data is distributed over multiple tables, and retrieving data needs doing many joins on tables.

Protégé

Protégé - Introduction  Protégé is an extensible, platform- independent environment for creating and editing ontologies and knowledge bases.  Current version is but the tutorial in the next slides is based on version 2.1.1

Tutorial Scenario  Semantic Web for Tourism/Traveling  Goal: Find matching holiday destinations for a customer I am looking for a comfortable destination with beach access Tourism Web

Tourism Semantic Web OWL Metadata (Individuals) OWL Metadata (Individuals) OWL Metadata (Individuals) OWL Metadata (Individuals) Tourism Ontology Web Services Destination AccomodationActivity

OWL (in Protégé)  Individuals (e.g., “FourSeasons”)  Properties ObjectProperties (references) DatatypeProperties (simple values)  Classes (e.g., “Hotel”)

Individuals  Represent objects in the domain  Specific things  Two names could represent the same “real-world” individual SydneysOlympicBeach BondiBeach Sydney

ObjectProperties  Link two individuals together  Relationships (0..n, n..m) Sydney BondiBeach hasPart FourSeasons hasAccomodation

Inverse Properties  Represent bidirectional relationships  Adding a value to one property also adds a value to the inverse property Sydney BondiBeach hasPart isPartOf

Transitive Properties  If A is related to B and B is related to C then A is also related to C  Often used for part-of relationships Sydney BondiBeach hasPart NewSouthWales hasPart hasPart (derived)

DatatypeProperties  Link individuals to primitive values (integers, floats, strings, booleans etc)  Often: AnnotationProperties without formal “meaning” Sydney hasSize = 4,500,000 isCapital = true rdfs:comment = “Don’t miss the opera house”

Classes  Sets of individuals with common characteristics  Individuals are instances of at least one class City Sydney Beach Cairns BondiBeach CurrawongBeach

Range and Domain  Property characteristics Domain: “left side of relation” (Destination) Range: “right side” (Accomodation) Sydney BestWestern FourSeasons hasAccomodation Destination Accomodation hasAccomodation

Domains  Individuals can only take values of properties that have matching domain “Only Destinations can have Accomodations”  Domain can contain multiple classes  Domain can be undefined: Property can be used everywhere

Superclass Relationships  Classes can be organized in a hierarchy  Direct instances of subclass are also (indirect) instances of superclasses Cairns Sydney Canberra Coonabarabran

Class Relationships  Classes can overlap arbitrarily City Sydney Cairns BondiBeach RetireeDestination

Class Disjointness  All classes could potentially overlap  In many cases we want to make sure they don’t share instances Sydney UrbanAreaRuralArea Sydney Woomera CapeYork disjointWith City Destination

Creating a new OWL project

Creating simple classes

Creating class hierarchy and set disjoints

Creating Contact class with datatype properties

Editing details of datatype properties

Createing an object property hasContact

Creating an object property with inverse

Creating the remaining classes and properties

Class Descriptions  Classes can be described by their logical characteristics  Descriptions are “anonymous classes” Things with three star accomodationThings with sightseeing opportunities RetireeDestination Sydney SanJose BlueMountains

Class Descriptions  Define the “meaning” of classes  Anonymous class expressions are used “All national parks have campgrounds.” “A backpackers destination is a destination that has budget accomodation and offers sports or adventure activities.”  Expressions mostly restrict property values (OWL Restrictions)

Class Descriptions: Why?  Based on OWL’s Description Logic support  Formalize intentions and modeling decisions (comparable to test cases)  Make sure that individuals fulfill conditions  Tool-supported reasoning

Reasoning with Classes  Tool support for three types of reasoning exists: Consistency checking: Can a class have any instances? Classification: Is A a subclass of B? Instance classification: Which classes does an individual belong to?  For Protégé we recommend RACER.

Restrictions (Overview)  Define a condition for property values allValuesFrom someValuesFrom hasValue minCardinality maxCardinality cardinality  An anonymous class consisting of all individuals that fulfill the condition

Cardinality Restrictions  Meaning: The property must have at least/at most/exactly x values  is the shortcut for and  Example: A FamilyDestination is a Destination that has at least one Accomodation and at least 2 Activities

allValuesFrom Restrictions  Meaning: All values of the property must be of a certain type  Warning: Also individuals with no values fulfill this condition (trivial satisfaction)  Example: Hiking is a Sport that is only possible in NationalParks

someValuesFrom Restrictions  Meaning: At least one value of the property must be of a certain type  Others may exist as well  Example: A NationalPark is a RuralArea that has at least one Campground and offers at least one Hiking opportunity

hasValue Restrictions  Meaning: At least one of the values of the property is a certain value  Similar to someValuesFrom but with Individuals and primitive values.  Example: A PartOfSydney is a Destination where one of the values of the isPartOf property is Sydney

Enumerated Classes  Consist of exactly the listed individuals OneStarRating TwoStarRating ThreeStarRating BudgetAccomodation

Logical Class Definitions  Define classes out of other classes unionOf (or) intersectionOf (and) complementOf (not)  Allow arbitrary nesting of class descriptions (A and (B or C) and not D)

unionOf  The class of individuals that belong to class A or class B (or both)  Example: Adventure or Sports activities AdventureSports

intersectionOf  The class of individuals that belong to both class A and class B  Example: A BudgetHotelDestination is a destination with accomodation that is a budget accomodation and a hotel BudgetAccomodation Hotel

Implicit intersectionOf  When a class is defined by more than one class description, then it consists of the intersection of the descriptions  Example: A luxury hotel is a hotel that is also an accomodation with 3 stars AccomodationWith3Stars Hotel LuxuryHotel

complementOf  The class of all individuals that do not belong to a certain class  Example: A quiet destination is a destination that is not a family destination Destination FamilyDestination QuietDestination (grayed)

Class Conditions  Necessary Conditions: (Primitive / partial classes) “If we know that something is a X, then it must fulfill the conditions...”  Necessary & Sufficient Conditions: (Defined / complete classes) “If something fulfills the conditions..., then it is an X.”

Class Conditions (2) QuietDestination NationalPark (not everything that fulfills these conditions is a NationalPark) (everything that fulfills these conditions is a QuietDestination)

Classification NationalPark BackpackersDestination  A RuralArea is a Destination  A Campground is BudgetAccomodation  Hiking is a Sport  Therefore: Every NationalPark is a Backpackers-Destiantion

Classification (2)  Input: Asserted class definitions  Output: Inferred subclass relationships

Creating an enumerated class out of individuals

Creating a hasValue restriction

Creating a defined class

Classifying Campground

Adding restrictions to City and Capital

Creating defined class BackpackersDestination

Creating defined class FamilyDestination

Creating defined class QuietDestination

Creating defined class RetireeDestination

Classification

Consistency Checking

Visualization with OWLViz

OWL Wizards

Ontology Import  Adds all classes, properties and individuals from an external OWL ontology into your project  Allows to create individuals, subclasses, or to further restrict imported classes  Can be used to instantiate an ontology for the Semantic Web

Tourism Semantic Web (2) OWL Metadata (Individuals) Tourism Ontology Web Services Destination AccomodationActivity

Ontology Import with Protégé  On the Metadata tab: Add namespace, define prefix Check “Imported” and reload your project

Individuals

Generated OWL File \ <rdf:RDF xmlns=" xmlns:rdf=" xmlns:rdfs=" xmlns:owl=" xmlns:dc=" xmlns:travel=" xml:base=" Sydney Queen Victoria St 1240 Manic super bunjee now offers nerve wrecking jumps from 300 feet right out of a helicopter. Satisfaction guaranteed.

Lots of other tools  RDFStore RDF framework for Perl  Raptor RDF parser library  Kowari, Gateway triple based database systems  RAP RDF framework for PHP  Validators For RDF  W3C RDF For OWL  WonderWeb  Pellet

References  Sesame User Guide for Sesame  Broekstra J., Sesame: A Generic Architecture for Storing and Querying RDF and RDF Schema, ISWC’  Protégé

References  Jena Official site of Jena 2  Jena 2 Ontology API  An Introduction to RDF and the Jena RDF API  A Programmer's Introduction to RDQL  Jena 2 Database Interface  Jena 2 Inference support   Other tools

The End