Download presentation
Presentation is loading. Please wait.
1
Web Ontology Language: OWL
Part 2
2
What is OWL? W3C Recommendation, February 2004. Web Ontology Language
web standard Web Ontology Language for processing information on the web designed to be interpreted by computers, not for being read by people OWL is written in XML OWL became a W3C (World Wide Web Consortium) Recommendation in February 2004. A W3C Recommendation is understood by the industry and the web community as a web standard. A W3C Recommendation is a stable specification developed by a W3C Working Group and reviewed by the W3C Membership. Q. What does the acronym "OWL" stand for? A. Actually, OWL is not a real acronym. The language started out as the "Web Ontology Language" but the Working Group disliked the acronym "WOL." They decided to call it OWL. The Working Group became more comfortable with this decision when one of the members pointed out the following justification for this decision from the noted ontologist A.A. Milne who, in his influential book "Winnie the Pooh" stated of the wise character OWL: "He could spell his own name WOL, and he could spell Tuesday so that you knew it wasn't Wednesday...“ See for more:
3
Example in Protégé
4
What are ontologies? Ontologies are content theories about the sorts of objects, properties of objects, and relations between objects that are possible in a specified domain of knowledge.
5
OWL is Written in XML By using XML, OWL information can easily be exchanged between different types of computers using different types of operating system and application languages. Oh yes, there is a namespace: xmlns:owl =" Install Protégé from: A Protégé tutorial is at: By using XML, OWL information can easily be exchanged between different types of computers using different types of operating system and application languages.
6
(more on) OWL A Web Language: Based on RDF(S)
An Ontology Language: Based on logic
7
I am looking for a comfortable destination with beach access
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
8
Tourism Semantic Web Open World:
New hotels are being added New activities are offered Providers publish their services dynamically Standard format / grounding is needed → Tourism Ontology
9
Tourism Semantic Web Web Services Tourism Ontology Destination
OWL Metadata (Individuals) OWL Metadata (Individuals) Tourism Ontology Destination Activity Accomodation OWL Metadata (Individuals) OWL Metadata (Individuals) Web Services
10
OWL XML/RDF Syntax: Header
<rdf:RDF xmlns:owl =" xmlns:rdf =" syntax-ns#" xmlns:rdfs=" schema#" xmlns:xsd =" XLMSchema#"> An OWL ontology may start with a collection of assertions for housekeeping purposes using owl:Ontology element
11
OWL Individuals (e.g., “FourSeasons”) Properties
ObjectProperties (references) DatatypeProperties (simple values) Classes (e.g., “Hotel”) The visualisation here is from the Protégé software. Protégé is a freeware ontology editor from Stanford: ‘Individuals’ is another word for instances of a class (or schema). Validators are: For RDF: For OWL:
12
Classes Sets of individuals with common characteristics
Individuals are instances of at least one class Beach City Sydney BondiBeach Cairns CurrawongBeach
13
Examples of Classes in OWL
<owl:Class rdf:ID="Winery"/> <owl:Class rdf:ID="Region"/> <owl:Class rdf:ID="ConsumableThing"/> It is important to remember that definitions may be incremental and distributed. In particular, we can have more to say about Winery later. See: * classes which are subsets that contain all objects of that type. <?xml version='1.0' encoding='ISO '?> <rdf:RDF xmlns:owl =" xmlns:rdf =" xmlns:rdfs =" xmlns:xsd =" xmlns ="" > <owl:Ontology rdf:about=""> <owl:versionInfo>$Id$</owl:versionInfo> <rdfs:comment> </rdfs:comment> </owl:Ontology> <owl:Class rdf:ID="Animal"> <rdfs:label>Animal</rdfs:label> Not vegetable or mineral. <owl:Class rdf:ID="Male"> <rdfs:label>Male</rdfs:label> <rdfs:subClassOf rdf:resource="#Animal"/> </owl:Class> <owl:Class rdf:ID="Female"> <rdfs:label>Female</rdfs:label> <rdfs:subClassOf rdf:resource="Animal"/> <owl:disjointWith rdf:resource="Male"/> </rdf:RDF> * This is the definition of an Animal class, with a label of Animal and two subclasses: Male and Female.
14
Classes Classes are defined using owl:Class
owl:Class is a subclass of rdfs:Class Disjointness is defined using owl:disjointWith <owl:Class rdf:about="#associateProfessor"> <owl:disjointWith rdf:resource="#professor"/> <owl:disjointWith rdf:resource="#assistantProfessor"/> </owl:Class>
15
Class Inheritance Classes usually constitute a taxonomic hierarchy (a subclass-superclass hierarchy) A class hierarchy is usually an IS-A hierarchy: an instance of a subclass is an instance of a superclass If you think of a class as a set of elements, a subclass is a subset
16
Class Inheritance - Example
Apple is a subclass of Fruit Every apple is a fruit Student is a subclass of Person Every student is a person Rectangle is a subclass of Shape Every Rectangle is a Shape
17
Superclass Relationships
Classes can be organized in a hierarchy Direct instances of subclass are also (indirect) instances of superclasses Cairns Sydney Canberra Coonabarabran
18
Example Subclasses <owl:Class rdf:ID="PotableLiquid">
<rdfs:subClassOf rdf:resource="#ConsumableThing" /> … </owl:Class> <owl:Class rdf:ID=“Person"> <rdfs:subClassOf rdf:resource="&Person"/> <rdfs:label xml:lang="en">student</rdfs:label> <rdfs:label xml:lang=“Ar">طالب</rdfs:label> ...
19
Class Relationships Classes can overlap arbitrarily RetireeDestination
City Cairo BondiBeach Alexandria
20
Class Disjointness All classes could potentially overlap
In many cases we want to make sure they don’t share instances disjointWith UrbanArea RuralArea Woomera Sydney Sydney CapeYork City Destination
21
Example disjoint <owl:Class rdf:about="#Man"> <owl:disjointWith rdf:resource="#Woman"/> </owl:Class>
22
Individuals (Instances)
Represent objects in the domain Specific things Two names could represent the same “real-world” individual Sydney SydneysOlympicBeach BondiBeach
23
Example of Individuals
<Region rdf:ID="CentralCoastRegion" /> equivalent to: <owl:Thing rdf:ID="CentralCoastRegion" /> <owl:Thing rdf:about="#CentralCoastRegion"> <rdf:type rdf:resource="#Region"/> </owl:Thing> In addition to classes, we want to be able to describe their members. We normally think of these as individuals in our universe of things. An individual is minimally introduced by declaring it to be a member of a class. The two definitions above are equivalent. Please note: writing rdf:resource = “#Something” means that ‘Something’ has been defined before, e.g., as a class. Otherwise, we need to write complete URIs. Here, Region is a pre-existing class in both examples. * individual objects in a class: <Person rdf:ID="Adam"> <rdfs:label>Adam</rdfs:label> <rdfs:comment>Adam is a person.</rdfs:comment> <age><xsd:integer rdf:value="13"/></age> <shoesize><xsd:decimal rdf:value="9.5"/></shoesize> </Person> * Adam is a Person. Please note: On the slide, we use rdf:ID to refer to the existance of the CentralCoastRegion resource, and then we use rdf:about to describe it. Sometimes, the rdf:ID definition is in a different document, that gets included in the one using the rdf:about definition. Read on for more explanations and examples on this. The most basic concepts in a domain should correspond to classes that are the roots of various taxonomic trees. Every individual in the OWL world is a member of the class owl:Thing. Thus each user-defined class is implicitly a subclass of owl:Thing. Domain specific root classes are defined by simply declaring a named class. OWL also defines the empty class, owl:Nothing. For example, we can create three root classes: Winery, Region, and ConsumableThing. <owl:Class rdf:ID="Winery"/> <owl:Class rdf:ID="Region"/> <owl:Class rdf:ID="ConsumableThing"/> Note that now we have only said that there exist classes that have been given these names, indicated by the 'rdf:ID=' syntax. Formally, we know almost nothing about these classes other than their existence, despite the use of familiar English terms as labels. And while the classes exist, they may have no members. For all we know at the moment, these classes might as well have been called Thing1, Thing2, and Thing3. It is important to remember that definitions may be incremental and distributed. In particular, we will have more to say about Winery later. The syntax rdf:ID="Region" is used to introduce a name, as part of its definition. This is the rdf:ID attribute ([RDF], ) that is like the familiar ID attribute defined by XML. Within this document, the Region class can now be referred to using #Region, e.g. rdf:resource="#Region". Other ontologies may reference this name using its complete form, " Another form of reference uses the syntax rdf:about="#Region" to extend the definition of a resource. This use of the rdf:about="&ont;#x" syntax is a critical element in the creation of a distributed ontology. It permits the extension of the imported definition of x without modifying the original document and supports the incremental construction of a larger ontology. It is now possible to refer to the classes we defined in other OWL constructs using their given identifier.
24
Properties In OWL there are two kinds of properties
Object properties, which relate objects to other objects E.g. is-TaughtBy, supervises Data type properties, which relate objects to datatype values E.g. phone, title, age, etc.
25
Properties OWL (DL and Lite) distinguishes between data type ptoperties and object properties (RDFS does not) An ObjectProperty relates one Resource to another Resource: ObjectProperty Resource Resource A DatatypeProperty relates a Resource to a Literal or an XML Schema data type: DatatypeProperty Resource Value
26
ObjectProperties Link two individuals together
Relationships (0..n, n..m) BondiBeach hasPart Sydney hasAccomodation FourSeasons
27
Datatype Properties OWL makes use of XML Schema data types, using the layered architecture of the SW <owl:DatatypeProperty rdf:ID="age"> <rdfs:range rdf:resource= " #nonNegativeInteger"/> </owl:DatatypeProperty>
28
Domains Individuals can only take values of properties that have matching domain “Only Destinations can have Accommodations” Domain can contain multiple classes Domain can be undefined: Property can be used everywhere More examples: Propery, Domain & Range <owl:ObjectProperty rdf:ID="madeFromGrape"> <rdfs:domain rdf:resource="#Wine"/> <rdfs:range rdf:resource="#WineGrape"/> </owl:ObjectProperty> <owl:ObjectProperty rdf:ID="course"> <rdfs:domain rdf:resource="#Meal" /> <rdfs:range rdf:resource="#MealCourse" /> In OWL, a sequence of elements without an explicit operator represents an implicit conjunction. The property madeFromGrape has a domain of Wine and a range of WineGrape. That is, it relates instances of the class Wine to instances of the class WineGrape. Multiple domains mean that the domain of the property is the intersection of the identified classes (and similarly for range). Similarly, the property course ties a Meal to a MealCourse. Note that the use of range and domain information in OWL is different from type information in a programming language. Among other things, types are used to check consistency in a programming language. In OWL, a range may be used to infer a type. For example, given: <owl:Thing rdf:ID="LindemansBin65Chardonnay"> <madeFromGrape rdf:resource="#ChardonnayGrape" /> </owl:Thing> we can infer that LindemansBin65Chardonnay is a wine because the domain of madeFromGrape is Wine.
29
Object Properties User-defined data types
<owl:ObjectProperty rdf:ID="isTaughtBy"> <owl:domain rdf:resource="#course"/> <owl:range rdf:resource= "#academicStaffMember"/> <rdfs:subPropertyOf rdf:resource="#involves"/> </owl:ObjectProperty>
30
Complex Classes Property Restrictions
Defining a Class by restricting its possible instances via their property values OWL distinguishes between the following two: Value constraint (Mother ≡ Woman ⊓ hasChild.Person) Cardinality constraint (MotherWithManyChildren ≡ Mother ⊓ ≥3hasChild) Property restrictions are local remember RDFS allows only global properties owl:allValuesFrom <owl:Class rdf:ID="Wine"> <rdfs:subClassOf rdf:resource="&food;PotableLiquid" /> ... <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#hasMaker" /> <owl:allValuesFrom rdf:resource="#Winery" /> </owl:Restriction> </rdfs:subClassOf> </owl:Class> owl:someValuesFrom <owl:someValuesFrom rdf:resource="#Winery" /> owl:hasValue <owl:Class rdf:ID="Burgundy"> <owl:onProperty rdf:resource="#hasSugar" /> <owl:hasValue rdf:resource="#Dry" />
31
Property Restrictions
In OWL we can declare that the class C satisfies certain conditions All instances of C satisfy the conditions This is equivalent to saying that C is subclass of a class C', where C' collects all objects that satisfy the conditions C' can remain anonymous
32
Property Restrictions (2)
A (restriction) class is achieved through an owl:Restriction element This element contains an owl:onProperty element and one or more restriction declarations One type defines cardinality restrictions (at least one, at most 3,…)
33
Complex Classes - Property Restrictions someValuesFrom
A Mother is a Woman that has a child (some Person) Mother ⊑ Woman ⊓ hasChild.Person <owl:Class rdf:ID=“Mother"> <rdfs:subClassOf rdf:resource="#Woman" /> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#hasChild" /> <owl:someValuesFrom rdf:resource="#Person" /> </owl:Restriction> </rdfs:subClassOf> </owl:Class> owl:allValuesFrom <owl:Class rdf:ID="Wine"> <rdfs:subClassOf rdf:resource="&food;PotableLiquid" /> ... <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#hasMaker" /> <owl:allValuesFrom rdf:resource="#Winery" /> </owl:Restriction> </rdfs:subClassOf> </owl:Class> owl:someValuesFrom <owl:someValuesFrom rdf:resource="#Winery" /> owl:hasValue <owl:Class rdf:ID="Burgundy"> <owl:onProperty rdf:resource="#hasSugar" /> <owl:hasValue rdf:resource="#Dry" />
34
Complex Classes - Property Restrictions allValuesFrom
To express the set of parents that only have female children (daughters) you would write: ParentsWithOnlyDaughters ⊑ Person ⊓ hasChild.Woman <owl:Class rdf:ID=“ParentsWithOnlyDaughters"> <rdfs:subClassOf rdf:resource="#Person" /> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#hasChild" /> <owl:allValuesFrom rdf:resource="#Woman" /> </owl:Restriction> </rdfs:subClassOf> ... </owl:Class> owl:allValuesFrom <owl:Class rdf:ID="Wine"> <rdfs:subClassOf rdf:resource="&food;PotableLiquid" /> ... <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#hasMaker" /> <owl:allValuesFrom rdf:resource="#Winery" /> </owl:Restriction> </rdfs:subClassOf> </owl:Class> owl:someValuesFrom <owl:someValuesFrom rdf:resource="#Winery" /> owl:hasValue <owl:Class rdf:ID="Burgundy"> <owl:onProperty rdf:resource="#hasSugar" /> <owl:hasValue rdf:resource="#Dry" />
35
Complex Classes - Property Restrictions hasValue
hasValue allows to define classes based on the existence of particular property values, their must be at least one matching property value The set of all childs of the woman MARY would be expressed like following: MarysChildren ⊑ Person П hasParent.{MARY} <owl:Class rdf:ID=“MarysChildren"> <rdfs:subClassOf rdf:resource="#Person" /> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#hasParent" /> <owl:hasValue rdf:resource="#MARRY" /> </owl:Restriction> </rdfs:subClassOf> ... </owl:Class> owl:allValuesFrom <owl:Class rdf:ID="Wine"> <rdfs:subClassOf rdf:resource="&food;PotableLiquid" /> ... <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#hasMaker" /> <owl:allValuesFrom rdf:resource="#Winery" /> </owl:Restriction> </rdfs:subClassOf> </owl:Class> owl:someValuesFrom <owl:someValuesFrom rdf:resource="#Winery" /> owl:hasValue <owl:Class rdf:ID=“GoodPaper"> <owl:onProperty rdf:resource="#hasAuthor" /> <owl:hasValue rdf:resource="#DieterFensel" /> …
36
Complex Classes Union of Classes
Instances of the Union of two Classes are either the instance of one or both classes Person ≡ Man ⊔ Woman <owl:Class rdf:ID=“Person"> <owl:unionOf rdf:parseType="Collection"> <owl:Class rdf:about="#Woman" /> <owl:Class rdf:about="#Man" /> </owl:unionOf> </owl:Class>
37
Complex Classes Intersection of Classes
Instances of the Intersection of two Classes are simultaneously instances of both class Man ≡ Person ⊓ Male <owl:Class rdf:ID=“Man"> <owl:intersectionOf rdf:parseType="Collection"> <owl:Class rdf:about="#Person" /> <owl:Class rdf:about="#Male" /> </owl:intersectionOf> </owl:Class>
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.