0% found this document useful (0 votes)
38 views78 pages

Module 2

The document provides an overview of semantic web technologies including description logics, RDF, and OWL. It discusses description logics for representing knowledge through concepts, roles, and axioms. It then covers RDF and RDF Schema for representing metadata through subject-predicate-object triples that can be visualized as a graph. Finally, it introduces OWL as a language for defining ontologies on the semantic web.

Uploaded by

Viji Rajendran
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
0% found this document useful (0 votes)
38 views78 pages

Module 2

The document provides an overview of semantic web technologies including description logics, RDF, and OWL. It discusses description logics for representing knowledge through concepts, roles, and axioms. It then covers RDF and RDF Schema for representing metadata through subject-predicate-object triples that can be visualized as a graph. Finally, it introduces OWL as a language for defining ontologies on the semantic web.

Uploaded by

Viji Rajendran
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 78

Semantic web

Module 2
Knowledge Representation in Description Logic
Introduction - An Informal Example
The Family of Attributive Languages
Inference Problems.
RDF and RDF Schema
Introduction
XML Essentials
RDF- RDF Schema
A Summary of the RDF/RDF Schema Vocabulary.
OWL
Introduction
Requirements for Web Ontology Description Languages
Header Information
Versioning
Annotation Properties
Properties
Classes
Individuals
Data types
A Summary of the OWL Vocabulary.
Description Logics: Introduction
• Description Logics are a subset of first-order logic:
– Only unary predicates (called concepts) and binary
predicates (called roles, properties).
• Knowledge bases are composed of:
– T-box: defining the concepts and the roles
– A-box: including ground facts about individuals
• Complex concepts are defined by concept descriptions:
– The expressive power of the language is determined by the
set of constructors in the grammar of concept descriptions
– Complex roles can also be defined via constructors
DL Syntax - Introduction
– Concept (class) names
e.g., Cat, Animal, Doctor
• Equivalent to FOL unary predicates
– Role (property) names
e.g., sits-on, hasParent, loves
• Equivalent to FOL binary predicates
– Constants (Individual) names
e.g., Felix, John, Mary, Boston, Italy
• Equivalent to FOL constants
DL Syntax - Introduction
DL should include constructors to define :
• Complex concepts
• Complex roles
• Axioms
• Assertions
Reasoning techniques should cover :
• Concept subsumption
• Concept instantiation
DL system
Example - concepts
Concepts denote unary descriptions
Example - roles

Roles denote binary descriptions


Example - Axioms
Example - Axioms
DL Family
DL Family
DL Family
T-Boxes
• Can include statements of the form:
A :- C
AÍ C (it should really be a square inclusion)

• A is a base concept and C can be a concept


description.
An example Grammar for Concept Descriptions.

C,D are complex concepts. A is a base concept.

Many other constructors possible: union,


existential quantification, equality on role paths,…
Example Terminology

a1: Italians are people


a2: Comedies are movies
a3: Comedies are disjoint from documentaries
a4: Movies have at most one director
a5: Award movies are those that have at least one award
a6: Italian hits are award movies whose director is Italian
Semantics of Description Logics
• Semantics are based on interpretations.
• Given a knowledge base Δ, the models of Δ
are the interpretations that are consistent Δ’s
T-box and A-box.
• Any fact that is true in all models of Δ are said
to be entailed by Δ.
Interpretations: Formally
• An interpretation I contains a non-empty
domain of objects, OI .
• I assigns an object aI in to every constant a in
the A-box.
– We make the unique names assumption: a≠b
implies that aI≠bI
• I assigns CI , a subset of OI, to every concept C
• I assigns a binary relation RI, a subset of OI x OI
to every role R.
Extensions of Complex Expressions

The extensions of concept and role descriptions


are given by the following equations. (#S
denotes the cardinality of the set S).
Conditions on Models
• An interpretation of Δ is a model if the
following conditions hold:
A Í C for every inclusion A Í C
I I

A I =C I for every statement A :=C


a I Î C I for every statement C(a)
(a , b ) Î R for every statement R(a, b)
I I I
Inference in Description Logics
• This is where all the action is: coming up with efficient
algorithms for inference and understanding the complexity of
the problems.
• Subsumption (only for the T-box):
– A concept C is said to be subsumed by concept D w.r.t. a T-
box T, if in every model, I, of T,
– Examples: I I
C Í D
MovieÙ (³ 2 award) is subsumed by AwardMovies
MovieÙ(" director.Person) is subsumed by ItalianHits
Inference Service: Concept Satisfiability
Inference Service: Concept Subsumption
Description Logics: Concept Examples
Inference Problems in TBOX
• Having a ALC theory K = (T , A). For T BOX T and
concepts C, D, we want to decide whether

• All these tasks can be reduced to unsatisability


checking of a single concept ...
Inference Problems for ABOX
for ABOX A, axiom , concept C, role R and individuals a,a0
we want to decide whether

• All these tasks, as well as concept unsatisability checking,


can be reduced to consistency checking.
DL Architecture

Knowledge Base

Inference System
Tbox (schema)

Interface
Man ´ Human u Male
Happy-Father ´ Man u 9 has-child
Female u …

Abox (data)
John : Happy-Father
hJohn, Maryi : has-child
John: 6 1 has-child
XML Essentials
• An XML element is made up of a start tag, an end tag, and data in
between.
• Example:
<director> Matthew Dunn </director>
• Example of another element with the same value:
<actor> Matthew Dunn </actor>
• XML tags are case-sensitive: <CITY> <City> <city>
• XML can abbreviate empty elements, for example:
<married> </married> can be abbreviated to <married/>
• An attribute is a name-value pair separated by an equal sign (=).
• Example: <City ZIP=“94608”> Emeryville </City>
• Attributes are used to attach additional, secondary information to
an element.
• A basic XML document is an XML element that can, but might not,
include nested XML elements.
• Example:
<books>
<book isbn=“123”>
<title> Second Chance </title>
<author> Matthew Dunn </author>
</book>
</books>
• Authoring guidelines:
– All elements must have an end tag.
– All elements must be cleanly nested (overlapping elements are not allowed).
– All attribute values must be enclosed in quotation marks.
– Each document must have a unique first element, the root node.
RDF, RDFS
RDF and RDFS
• RDF stands for Resource Description Framework
• It is a W3C recommendation (http://www.w3.org/RDF)
• RDF is graphical formalism ( + XML syntax + semantics)
– for representing metadata
– for describing the semantics of information in a machine-
accessible way
• RDFS extends RDF with “schema vocabulary”, e.g.:
– Class, Property
– type, subClassOf, subPropertyOf
– range, domain
RDF Statements
• RDF Statements
– A specific resource together with a named
property plus the value of that property for that
resource
• subject, the predicate, and the object
– the object of a statement can be another resource
or it can be a literal
Representation - Triple
• Ora Lassila is the creator of the resource
http://www.w3.org/Home/Lassila

Subject Predicate Object


(Resource) (Property) (Literal)
http://www.w3.org/ Creator "Ora Lassila"
Home/Lassila
Representation - Graph
Representation – Graph with
structured value (1)
• The individual whose name is Ora Lassila, email
<lassila@w3.org>, is the creator of
http://www.w3.org/home/lassila.
The RDF Data Model
• Statements are <subject, predicate, object> triples:
hasColleague
Ian Uli
• Can be represented using XML serialisation, e.g.:
<Ian,hasColleague,Uli>
• Statements describe properties of resources
• A resource is a URI representing a (class of) object(s):
– a document, a picture, a paragraph on the Web;
– http://www.cs.man.ac.uk/index.html
– a book in the library, a real person (?)
– isbn://5031-4444-3333
– …
• Properties themselves are also resources (URIs)
URIs
• URI = Uniform Resource Identifier
• "The generic set of all names/addresses that are short strings
that refer to resources“
• URIs may or may not be dereferencable
– URLs (Uniform Resource Locators) are a particular type of URI, used
for resources that can be accessed on the WWW (e.g., web pages)
• In RDF, URIs typically look like “normal” URLs, often with
fragment identifiers to point at specific parts of a document:
– http://www.somedomain.com/some/path/to/file#fragmentID
Linking Statements
• The subject of one statement can be the object of another
• Such collections of statements form a directed, labeled graph

hasColleague
Ian Uli
hasHomePage
hasColleague

Carole http://www.cs.mam.ac.uk/~sattler

• Note that the object of a triple can also be a “literal” (a string)


• Note also that RDF triples don’t by themselves give meaning
RDF Syntax
• RDF has an XML syntax that has a specific meaning:
• Every Description element describes a resource
• Every attribute or nested element inside a Description is a
property of that Resource with an associated object resource
• Resources are referred to using URIs

<Description about="some.uri/person/ian_horrocks">
<hasColleague resource="some.uri/person/uli_sattler"/>
</Description>
<Description about="some.uri/person/uli_sattler">
<hasHomePage>http://www.cs.mam.ac.uk/~sattler</hasHomePage>
</Description>
<Description about="some.uri/person/carole_goble">
<hasColleague resource="some.uri/person/uli_sattler"/>
</Description>
RDF Syntax: Triples and Graphs

« Ian Horrocks » « University of Manchester »

ex:name ex:name

_:xxx _:yyy
ex:member-of

rdf:type rdf:type

ex:Person ex:Organisation
RDF Schema (RDFS)
• RDF gives a formalism for meta data annotation, and a way to write it
down in XML, but it does not give any special meaning to vocabulary
such as subClassOf or type
– Interpretation is an arbitrary binary relation
– I.e., <Person,subClassOf,Animal> has no special meaning

• RDF Schema defines “schema vocabulary” that supports definition of


ontologies
– gives “extra meaning” to particular RDF predicates and resources (such as
subClasOf)
– this “extra meaning”, or semantics, specifies how a term should be
interpreted
RDF Schema Model (General)
• Property-centric
– Each property specifies what classes of subjects and objects it relates
– New properties can be added to a class without modifying the class
• Basic Conception
– resource, class, subClassOf, type
– property, subPropertyOf
– domain, range, constraintResource, constraintProperty
• Definitions can include constraints which express validation conditions
– domain constraints link properties with classes
– range constraints limit property values
• BUT expressive inadequacy and poorly defined semantics
Property-centric and
Domain and Range 1
• The RDF Schema class and property system is similar
to the type systems of object-oriented programming
languages such as Java. However, RDF differs from
many such systems in that instead of defining a class
in terms of the properties its instances may have, an
RDF schema will define properties in terms of the
classes of resource to which they apply. This is the
role of the rdfs:domain and rdfs:range mechanisms
described in this specification.
Property-centric and
Domain and Range 2
• For example, we could define the eg:author property to have a domain of
eg:Document and a range of eg:Person, whereas a classical OO system
might typically define a class eg:Book with an attribute called eg:author of
type eg:Person. Using the RDF approach, it is easy for others to
subsequently define additional properties with a domain of Document or
a range of eg:Person. This can be done without the need to redefine the
original description of these classes.
• One benefit of the RDF property-centric approach is that it is very easy for
anyone to say anything they want about existing resources, which is one
of the architectural principles of the Web.
RDF Core Classes and
Properties 1
• Rdfs:Resource
– All things described by RDF are called resources, and are members of
the class rdfs:Resource.
• rdfs:Literal
– The class rdfs:Literal represents the self-denoting nodes called the
'literals' in the RDF graph structure. Property values such as textual
strings are examples of RDF literals.
• rdfs:Class
– This corresponds to the generic concept of a type or category of
resource.
– * RDF class membership is used to represent types or categories of
resource. Two classes may happen to have the same members, while
remaining distinct resources.
RDF Core Classes and Properties 1’
• rdfs:label
– The rdfs:label property is used to provide a humanreadable
version of a resource's name.
• rdfs:comment
– The rdfs:comment property is used to provide a
humanreadable description of a resource.
– A textual comment helps clarify the meaning of RDF classes
and properties. Such inline documentation complements the
use of both formal techniques (Ontology and rule languages)
and informal (prose documentation, examples, test cases). A
variety of documentation forms can be combined to indicate
the intended meaning of the classes and properties
described in an RDF Schema. Multilingual is supported at
xml:lang.
Example
• <rdfs:Class rdf:ID="Animal">
• <rdfs:label>Animal</rdfs:label>
• <rdfs:comment>
• This class of animals is illustrative of a
number of ontological idioms.
• </rdfs:comment>
• </rdfs:Class>
RDF Core Classes and Properties 2
• rdf:Property
– rdf:Property represents those resources that are RDF
properties.
• rdf:type
– The rdf:type property indicates that a resource is a member
of a class.
– * When a resource has an rdf:type property whose value is
some specific class, we say that the resource is an instance of
the specified class.
– The value of an rdf:type property will always be a resource
that is an instance of rdfs:Class. The resource known as
rdfs:Class is itself a resource of rdf:type rdfs:Class.
Example
• <rdf:Property rdf:ID="hasParent">
• <rdfs:domain rdf:resource="#Animal"/>
• <rdfs:range rdf:resource="#Animal"/>
• </rdf:Property>
RDF Core Classes and Properties 3
• rdfs:subClassOf
– The rdfs:subClassOf property represents a specialization relationship
between classes of resource.
– The rdfs:subClassOf property is transitive.
• rdfs:subPropertyOf
– The property rdfs:subPropertyOf is an instance of rdf:Property that is
used to specify that one property is a specialization of another.
– Sub-property hierarchies can be used to express hierarchies of range and
domain constraints.
– * The term 'super-property' is sometimes used to indicate the
relationship between some property and another more general property
that it is a rdfs:subPropertyOf.
Example
• <rdfs:Class rdf:ID="Male">
• <rdfs:subClassOf rdf:resource="#Animal"/>
• </rdfs:Class>

• <rdf:Property rdf:ID="hasFather">
• <rdfs:subPropertyOf rdf:resource="#hasParent"/>
• <rdfs:range rdf:resource="#Male"/>
• </rdf:Property>
RDF Core Classes and Properties 4
• rdfs:range
– An instance of rdfs:Property, used to indicate class(es) that the values of a
property will be members of.
– The value of an rdfs:range property is always a Class.
– The rdfs:range property can itself be used to express this: the rdfs:range
of rdfs:range is the class rdfs:Class. This indicates that any resource that is
the value of a range property will be a class.
– The rdfs:range property is only applied to properties. This can also be
represented in RDF using the rdfs:domain property. The rdfs:domain of
rdfs:range is the class rdf:Property. This indicates that the range property
applies to resources that are themselves properties.
RDF Core Classes and Properties 4’
• rdfs:domain
– An instance of rdf:Property that is used to indicate the
class(es) that will have as members any resource that has
the indicated property.
– The rdfs:domain of rdfs:domain is the class rdf:Property.
This indicates that the domain property is used on
resources that are properties.
– The rdfs:range of rdfs:domain is the class rdfs:Class. This
indicates that any resource that is the value of adomain
property will be a class.
RDF Container Classes and Properties 1

• rdfs:Container
– The rdfs:Container class is a super-class of the RDF Container classes, ie.
rdf:Bag, rdf:Seq, rdf:Alt.
• rdf:Bag
– The rdf:Bag class represents RDF's 'Bag' container construct, and is a
subclass of rdfs:Container.
• rdf:Seq
– The rdf:Seq class represents RDF's 'Sequence' container construct, and is
a subclass of rdfs:Container.
• rdf:Alt
– The rdf:Seq class represents RDF's 'Alt' container construct, and is a
subclass of rdfs:Container.
RDF Container Classes and Properties 2

• rdfs:ContainerMembershipProperty
– The rdfs:ContainerMembershipProperty class has as
members the property rdfs:member and the properties _1,
_2, _3 ... that can be used to indicate membership of Bag,
Seq and Alt containers.
– rdfs:ContainerMembershipProperty is a subclass of
rdf:Property. Each container membership property is a
rdfs:subPropertyOf the rdfs:member property.
• rdfs:member
– The rdfs:member property is a super-property of the
container membership properties.
– (That is, each numbered container membership property has
a rdfs:subPropertyOf relationship to the property
rdfs:member).
RDF Container Classes and Properties 3

• rdf:List
– The rdf:List class represents the class of RDF Lists. It is used
with the 'first', 'rest' and 'nil' constructs, and has special case
support in the RDF/XML syntax.
• rdf:first
– The rdf:first property represents a relationship between an
rdf:List and its first item.
• rdf:rest
– The rdf:rest property represents a relationship between an
rdf:List item and the rest of the list, or its end (ie. rdf:nil).
• rdf:nil
– The rdf:nil resource represents an empty rdf:List.
RDF Utility Classes and Properties 1
• rdfs:seeAlso
– The property rdfs:seeAlso is used to indicate a resource that might
provide additional RDF information about the subject resource.
• rdfs:isDefinedBy
– The property rdfs:isDefinedBy is a subproperty of rdfs:seeAlso, and
indicates the resource defining the subject resource.
• rdf:value
– The rdf:value property identifies the principal value (usually a string)
of a property when the property value is a structured resource.
RDF Utility Classes and Properties 2
• rdf:Statement
– The rdf:Statement class represents statements about the properties of
resources.
– rdf:Statement is the domain of the properties rdf:predicate, rdf:subject
and rdf:object.
– Different individual rdf:Statement instances may happen to have the
same values for their predicate, subject and object properties.
• rdf:subject
– The subject of an RDF statement.
– The rdf:subject property indicates a resource that is the subject of some
RDF statement.
– The rdfs:domain of rdf:subject is rdf:Statement and the rdfs:range is
rdfs:Resource. This property can be used to specify the resource
described by an RDF
RDF Utility Classes and Properties 3
• rdf:predicate
– The predicate of an RDF statement.
– The rdfs:domain of rdf:predicate is rdf:Statement and the rdfs:range is
rdfs:Resource. This property can be used to specify the predicate used
in an RDF statement.
• rdf:object
– The object of an RDF statement.
– The rdfs:domain of rdf:object is rdf:Statement. No range is defined for
this property since values of rdfs:object can include both Literals and
Resources.
– This property can be used to specify the object of anRDF statement.
Example - RDF Schema Model
RDFS
• RDFS vocabulary adds constraints on models,
e.g.:
– 8x,y,z type(x,y) and subClassOf(y,z) ) type(x,z)
ex:Person ex:Animal
rdfs:subClassOf
rdf:type
ex:John ex:Person

rdf:type
ex:Animal
Problems with RDFS
• RDFS too weak to describe resources in sufficient detail
– No localised range and domain constraints
• Can’t say that the range of hasChild is person when applied to persons and elephant
when applied to elephants
– No existence/cardinality constraints
• Can’t say that all instances of person have a mother that is also a person, or that
persons have exactly 2 parents
– No transitive, inverse or symmetrical properties
• Can’t say that isPartOf is a transitive property, that hasPart is the inverse of isPartOf
or that touches is symmetrical
–…
• Difficult to provide reasoning support
– No “native” reasoners for non-standard semantics
– May be possible to reason via FO axiomatisation
RDF Schema is now being superseded by
OWL
RDF Vocabulary

Classes:
rdf:Property, rdf:Statement, rdf:XMLLiteral
rdf:Seq, rdf:Bag, rdf:Alt, rdf:List
Properties:
rdf:type, rdf:subject, rdf:predicate,
rdf:object,
rdf:first, rdf:rest, rdf:_n
rdf:value
Resources:
rdf:nil RDFS Vocabulary

RDFS Properties
rdfs:domain
RDFS Vocabulary rdfs:range
rdfs:subPropertyOf
RDFS Classes rdfs:subClassOf
rdfs:Resource rdfs:member
rdfs:Class rdfs:seeAlso
rdfs:Literal rdfs:isDefinedBy
rdfs:Datatype rdfs:comment
rdfs:Container rdfs:label
rdfs:ContainerMembershipProperty
OWL
• Defined Concepts
– owl:Class, a subclass of rdfs:class
– owl:Restriction, the class of all restrictions

• Predicates relating Classes


– owl:disjointWith, owl:intersectionOf,
owl:complementOf – for the boolean operators
– owl:equivalentClass, owl:disjointWith
OWL Class Constructors

• Lots of redundancy, e.g., use negations to


transform and to or and exists to forall
OWL Axioms

• Axioms (mostly) reducible to inclusion (v)


– C ´ D iff both C v D and D v C
Database:
• Closed world assumption (CWA) Ontology:
– Missing information treated
• Open world assumption
as false (OWA)
• Unique name assumption (UNA) – Missing information treated
– Each individual has a single, as unknown
unique name • No UNA
• Schema behaves as constraints – Individuals may have more
on structure of data than one name
– Define legal database states • Ontology axioms behave like
implications (inference rules)
- Entail implicit information
OWL Syntax: Abstract Syntax
• One of the clearer human-readable syntaxes

Class(SpicyPizza complete
annotation(rdfs:label "PizzaTemperada"@pt)
annotation(rdfs:comment "Any pizza that has a
spicy topping is a SpicyPizza"@en)
Pizza restriction(hasTopping
someValuesFrom(SpicyTopping))
)
OWL Syntax: N3
• Recommended for human-readable fragments

default:SpicyPizza
a owl:Class ;
rdfs:comment "Any pizza that has a spicy topping is a SpicyPizza"@en ;
rdfs:label "PizzaTemperada"@pt ;
owl:equivalentClass
[ a owl:Class ;
owl:intersectionOf (default:Pizza [ a owl:Restriction ;
owl:onProperty default:hasTopping ;
owl:someValuesFrom default:SpicyTopping
])
].
OWL Syntax: RDF/XML
• Recommended for serialisation

<owl:Class rdf:ID="SpicyPizza">
<rdfs:label xml:lang="pt">PizzaTemperada</rdfs:label>
<rdfs:comment xml:lang="en">Any pizza that has a spicy topping is a SpicyPizza</rdfs:comment>
<owl:equivalentClass>
<owl:Class>
<owl:intersectionOf rdf:parseType="Collection">
<owl:Class rdf:about="#Pizza"/>
<owl:Restriction>
<owl:onProperty>
<owl:ObjectProperty rdf:about="#hasTopping"/>
</owl:onProperty>
<owl:someValuesFrom rdf:resource="#SpicyTopping"/>
</owl:Restriction>
</owl:intersectionOf>
</owl:Class>
</owl:equivalentClass>
</owl:Class>
Abstract Syntax: Declaring classes in
OWL
• Naming a new class “plant”:
Class(pp:plant partial)

• Naming some “special plants”:


Class(pp:grass partial pp:plant)
Class(pp:tree partial pp:plant)

• Alternative Declaration:
Class(pp:grass partial)
Class(pp:tree partial)
SubClassOf(pp:grass pp:plant)
SubClassOf(pp:tree pp:plant)
Abstract Syntax: Declaring Properties in
OWL
• A simple property:
ObjectProperty(pp:eaten_by)

• Properties may be inverse to each other:


ObjectProperty(pp:eats inverseOf(pp:eaten_by))

• Domain and Ranges:


ObjectProperty(pp:has_pet
domain(pp:person) range(pp:animal))
Abstract Syntax: Declaring Properties in
OWL
• Datatype Properties:
DataProperty(pp:service_number range(xsd:integer))

• Property Hierarchy:
SubPropertyOf(pp:has_pet pp:likes)

• Algebraic properties:
ObjectProperty(pp:married_to Symmetric)
ObjectProperty(pp:ancestor_of Transitive)
ObjectProperty(pp:passport_nr Functional)
Abstract Syntax: Individuals in OWL
• Individual(pp:Tom type(owl:Person))

• Individual(pp:Dewey type(pp:duck))

• Individual(pp:Rex type(pp:dog)
value(pp:is_pet_of pp:Mick))

• Individual(pp:Mick type(pp:male)
value(pp:reads pp:Daily-Mirror)
value(pp:drives pp:Golf-GTI)
value(pp:name „Mick"ˆxsd:string))

You might also like