Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
36 views42 pages

Advanced OWL

explain this like explaining to 15yrs old girl remember that i'm having examination in next 1 hour so please make sure to cover all the key point in the document

Uploaded by

aksshu1902
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views42 pages

Advanced OWL

explain this like explaining to 15yrs old girl remember that i'm having examination in next 1 hour so please make sure to cover all the key point in the document

Uploaded by

aksshu1902
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

Advanced OWL

Logics
• Logics allow describing axioms of some things (called primitives)
• Each type of logic is characterised by the nature of “primitives” they
apply to
• Primitives are categorized
• Ontological commitments: things that can exist
• Facts, objects, relations, time
• Epistemological commitments: state of knowledge
• True/false, plausibility, belief…
Types of logic
Logic language Ontological commitment Epistemological Examples
commitment
Propositional logic Facts True/false/unknown ”it rains”
First order logic Facts, objects, relations True/false/unknown “Smith works at Heriot Watt university”
Modal logic Possibility and necessity True/false/unknown “it is possible to have groups of 3”
Deontic logic Obligation, permission, forbidden True/false/unknown “It is forbidden to plagiarise”
Temporal logic Facts, objects, relations, time True/false/unknown “I am always hungry”
Probability theory Facts Certainty, [0,1] “It is probable that weather is hot”
Fuzzy logic Partial truth Truth value, [0,1] “I feel cold”
Components of a logic
Syntax
• Rules that specify what a well-formed sentence (or formula) looks like
• Tells us how to build a knowledge base
• All legal expressions are sentences (otherwise knows as well-formed
formulas)

Semantics
• Rules that specify what a sentence (or formula) really means in the world
• Tells us what the knowledge base means
Propositional Logic
• The simplest type of logic
• A proposition is a statement that is either true or false
• There is no objects, relations, and functions.
Propositional Logic vs. First Order Logic
”If Jane is younger than Lisa then Lisa is older than Jane.”

• Using Propositional logic:


p: Jane is younger than Lisa
q: Lisa is older than Jane
p => q

• Using First order logic:


Younger: to be younger than (predicate with two variables)
Older: to be older than
Younger(Jane, Lisa) => Older(Lisa, Jane)
First order logic features
• Atomic negation: not C(x)
• Role negation: not R(x,y)
• Intersection of concepts: 𝐴 ∩ 𝐵 (set of individuals of A who are also
individuals of B)
• Union of concepts: 𝐴 ∪ 𝐵 (set of individuals of A and individuals of B)
• Existential restrictions: exists at least one individual that participates
in a property (owl:some)
• Universal restriction: only (all) individuals that participate in a
property (owl:only)
First order logic syntax
Description logics
• Family of formal knowledge representation languages
• Used in AI to describe and reason about concepts
• A description language is made of fragments of first order logic (not
full first order logic)
• They favour trade-off between expressiveness (complex structures,
constraints) and decidability (ability for reasoning: computing of logic for
deduction)
• (full) first order logic
• Expressiveness against decidability
Terms

FOL (first order logic) DL (description logic) OWL

constant individual individual


unary predicate concept class
binary predicate role property
Different description languages
Basic DL languages Extensions
language name allows name
F Functional prop uniqueness
E Existential qualification There exists at least one
AL Attributive • Atomic negation individual
language • intersection
• restrictions U Concept union
• limited existential qualification H Role hierarchy Rdfs:subPropertyOf
FL Frame based • Concept intersection C Role negation Not p(x,y)
• restrictions R Limited role inclusion Reflexivity, disjointness
• limited existential quantification
• role restriction O Nominals owl:one of, owl:hasValue
EL Existential • concept intersection I Inverse property P(x,y) => Q(y,x)
language • existential restrictions
N Cardinality owl:cardinality, counting
Q Cardinality restriction (in owl2)
S is used as abbreviation for ALC, some use it for ALCH
(D) Use of datatype prop Data values or data types
Other DL languages and their use
• EL
• Fragment of OWL intended for Conceptual modelling
• Example SNOMED CT ontology (3x105 classes)
• RL
• Rule-base OWL, intended for inferencing
• In practice SWRL is used (not part of OWL)
• QL
• Query-language, intended for ontology based data access (OBDA)
• Queries roles and individuals (Abox)
• SPARQL more general, queries also Tbox (concepts and their individuals)
OWL flavours
OWL Full
Maximum expressiveness with syntactic
freedom of RDF with no computational guarantees
OWL DL
Highly expressive while retaining
computational completeness

OWL Lite
Classification
hierarchy and simple
constraints
OWL flavours
• OWL full -> SROIQ(D)
• Very high expressiveness, prohibitive reasoning
• OWL 2 -> SHOIQ
• High expressiveness, very complex reasoning
• OWL-DL -> SHOIN
• Lower expressiveness, decidable
• OWL-lite -> SHIF
• Low expressiveness, high reasoning
• Protégé supports SHOIN
Example of first order logic
Sentences First order logic representation
• Ander is Basque • ∀𝑥, 𝐵𝑎𝑠𝑞𝑢𝑒 𝑥 ⟹ 𝑃𝑒𝑟𝑠𝑜𝑛(𝑥)
• 𝐵𝑎𝑠𝑞𝑢𝑒(𝐴𝑛𝑑𝑒𝑟)
• Alona is Gerard’s daughter
• ℎ𝑎𝑠𝐷𝑎𝑢𝑔ℎ𝑡𝑒𝑟(𝐴𝑛𝑑𝑒𝑟, 𝐴𝑙𝑜𝑛𝑎)
• Basques like soccer • ∀𝑥, 𝑦 ℎ𝑎𝑠𝐷𝑎𝑢𝑔ℎ𝑡𝑒𝑟 𝑥, 𝑦 ⟹ 𝑐ℎ𝑖𝑙𝑑𝑂𝑓(𝑥, 𝑦)
• Children of soccer fans are • ∀𝑥, 𝐵𝑎𝑠𝑞𝑢𝑒(𝑥) ⟹ 𝑙𝑖𝑘𝑒𝑠(𝑥, 𝑆𝑜𝑐𝑐𝑒𝑟)
pelota fans • ∀𝑥, 𝑦, 𝑐ℎ𝑖𝑙𝑑𝑂𝑓 𝑥, 𝑦 𝐴𝑁𝐷 𝑙𝑖𝑘𝑒𝑠(𝑥, 𝑆𝑜𝑐𝑐𝑒𝑟) ⟹ 𝑙𝑖𝑘𝑒𝑠(𝑦, 𝑆𝑜𝑐𝑐𝑒𝑟)

• Soccer fans like summer • ∀𝑥, 𝑙𝑖𝑘𝑒𝑠(𝑥, 𝑆𝑜𝑐𝑐𝑒𝑟) ⟹ 𝑙𝑖𝑘𝑒𝑠(𝑥, 𝑆𝑢𝑚𝑚𝑒𝑟)


Example in OWL
@prefix : <http://hw.ac.uk/basques#> . :Soccer rdfs:subClassOf :Sport.
@prefix owl: <http://www.w3.org/2002/07/owl#> . :daughterOf rdf:type owl:ObjectProperty ;
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . rdfs:domain :Woman .
@prefix xml: <http://www.w3.org/XML/1998/namespace> . :like rdf:type owl:ObjectProperty ;
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . rdfs:domain :Person ;
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . rdfs:range owl:Thing .
@base <http://hw.ac.uk/basques#> . :Ander rdf:type owl:NamedIndividual ,
:Basque .
<http://hw.ac.uk/basques#> rdf:type owl:Ontology .
:Alona rdf:type owl:NamedIndividual ,
:Person rdf:type owl:Class.
:Person ;
:Sport rdf:type owl:Class.
:daughterOf :Ander .
:Season rdf:type owl:Class.
:summer rdf:type owl:NamedIndividual , Use SWRL
:Basqune rdfs:subClassOf :Person.
:Season ;
:Woman rdfs:subClassOf :Person.
The second rule (S2) in rdf format
:x rdf:type <http://www.w3.org/2003/11/swrl#Variable> . rdf:rest [ rdf:type <http://www.w3.org/2003/11/swrl#AtomList> ;
rdf:first [ rdf:type
:y rdf:type <http://www.w3.org/2003/11/swrl#Variable> . <http://www.w3.org/2003/11/swrl#IndividualPropertyAtom> ;
<http://www.w3.org/2003/11/swrl#propertyPredicate> :likeSport ;
:s rdf:type <http://www.w3.org/2003/11/swrl#Variable> .
<http://www.w3.org/2003/11/swrl#argument1> :y ;
[ <http://swrl.stanford.edu/ontologies/3.3/swrla.owl#isRuleEnabled> <http://www.w3.org/2003/11/swrl#argument2> :s
"true"^^xsd:boolean ;
] ; rdf:rest rdf:nil
rdfs:comment "enherited hobby"^^xsd:string ;
]] ;
rdfs:label "S2"^^xsd:string ;
<http://www.w3.org/2003/11/swrl#head>
rdf:type <http://www.w3.org/2003/11/swrl#Imp> ;
[ rdf:type <http://www.w3.org/2003/11/swrl#AtomList> ;
<http://www.w3.org/2003/11/swrl#body>
rdf:first [ rdf:type
[ rdf:type <http://www.w3.org/2003/11/swrl#AtomList> ; <http://www.w3.org/2003/11/swrl#IndividualPropertyAtom> ;
rdf:first [ rdf:type <http://www.w3.org/2003/11/swrl#propertyPredicate> :likeSport ;
<http://www.w3.org/2003/11/swrl#IndividualPropertyAtom> ;
<http://www.w3.org/2003/11/swrl#argument1> :x ;
<http://www.w3.org/2003/11/swrl#propertyPredicate> :childOf ;
<http://www.w3.org/2003/11/swrl#argument2> :s
<http://www.w3.org/2003/11/swrl#argument1> :x ;
] ; rdf:rest rdf:nil
<http://www.w3.org/2003/11/swrl#argument2> :y
]].
];
OWL advanced features (restrictions ad
characteristics)
• Class restrictions • Property characteristics
• Class intersection (owl:and)
• Class union (owl:or) • Inverse property (owl:inverseOf)
• Class complement (owl:not) • Symmetric (owl:SymmetricProperty,
• Subclass of complex class
• Enumerated class (list of individuals)
owl:AssymetricProperty)
• Individual restrictions • Disjoint (owl:propertyDisjointWith)
• Same individuals (owl:sameAs) • Reflexive (owl:ReflexiveProperty,
• Different individuals (owl:differetFrom) owl:IrreflexiveProperty)
• Object Property restrictions • Functional (owl:FunctionalProperty,
• Existential restriction (owl:some) owl:InverseFunctionalProperty)
• Universal restriction (owl:only)
• Equivalence (owl:some and owl only) • Transitive (owl:TransitiveProperty)
• Range value restriction (owl:value) • Chain (owl:propertyChainAxiom)
• Cardinality restrictions
• Minimum range (owl:min) • Data property restrictions
• Maximum range (owl:max) • Value, Some, intervals, comparison
• Exact range (owl:exactly)
operators
OWL: Intersection of classes
𝑊𝑜𝑚𝑎𝑛 𝑥 𝒂𝒏𝒅 𝑃𝑎𝑟𝑒𝑛𝑡(𝑥) ⟺ 𝑴𝒐𝒕𝒉𝒆𝒓(𝒙)
• We can define a class as the
intersection of two classes.
• Individuals of such class will be those
belonging to both intersected classes
• Example Mother is Woman and Parent

• Inference
• Any individual mother will also be Parent
OWL: Union of classes
𝐹𝑎𝑡ℎ𝑒𝑟 𝑥 𝒐𝒓 𝑀𝑜𝑡ℎ𝑒𝑟(𝑥) ⟺ 𝑷𝒂𝒓𝒆𝒏𝒕(𝒙)

• A union class is the class of


individuals that belong to at
least one of union classes
• Example Parent is Mother or
Father
OWL: Complement classes
𝑃𝑒𝑟𝑠𝑜𝑛 𝑥 𝑎𝑛𝑑 𝑛𝑜𝑡 𝑃𝑎𝑟𝑒𝑛𝑡(𝑥) ⟹ 𝑪𝒉𝒊𝒍𝒅𝒍𝒆𝒔𝒔𝑷𝒆𝒓𝒔𝒐𝒏(𝒙)

• A complement class is the class


of individuals that belong to one
class and not to another
• Example, person who have no
children are defined as the
complement of
• Person and not Parent
OWL: Subclass of complex class
𝑃𝑎𝑟𝑒𝑛𝑡 𝑥 𝑎𝑛𝑑 𝑀𝑎𝑛(𝑥) ⟹ 𝑮𝒓𝒂𝒏𝒅𝑭𝒂𝒕𝒉𝒆𝒓(𝒙)
• A class can be defined as the subclass of a
intersection (of two classes)
• Individuals of such class will be the individuals of
the first class that are also individuals of the second
• Example
• A GrandFather is the subclass of man and parent

• This expresses necessary and not sufficient


condition
• Someone who is parent and man is not necessarily
GrandFather
OWL: Enumerated class
• We can define a class as being
the enumeration of a list of
individuals
• Example
• Bill, John and Mary are members
of the class PartyGuests
OWL: Distinct individuals (owl:differentFrom)
• OWL does not distinguish
individuals by their names
• Example, Alex and John might be
considered the same
• To avoid this, we assert that they
are different
• Alex different from John and from
Bill
OWL: Same individuals (owl:sameAs)
• With OWL we can assert that two
individuals are the same
• Example if Alex and Alexander are
the same

• Owl:sameAs combines all


properties of two instances
• The two become indistinguishable
• This might not be the behaviour
sought for your application
• In such a case use skos:exactMatch or
skos:closeMatch
Property restrictions- existential quantification
𝐶 𝑥 ⟹ ∃ 𝑦, 𝑝(𝑥, 𝑦)
• A class can be defined by expressing a restriction
on the range of a property
• Example: A parent is defined an equivalent to the
class range of “hasChild” using the operator
some (named existential quantification)

• This is expressed as: every parent has at least one


child who is a person
Property restrictions- Universal quantification
𝐶 𝑥 ⟹ ∀ 𝑦, 𝑝(𝑥, 𝑦)
• A class can also be defined by
expressing that all individuals
participate in a property
• Example:
• A person is happy only if their children are
happy

• This is expressed as: children of happy


person must all be happy.
Property restrictions- closure
• We can express that the range must be one and
only one by combining some and only
• This is called Closure
• Example:
• A person is happy when they have one and
only one happy child
Property restrictions- Restriction on individual
• We can define a class by setting a
restriction on the value of the range
of the range of a property
• It would be the class of all individuals
participating in the property where the
range equal to the given value
• Example:
• JonhChildren is the class of all
individuals whose parent is John
OWL: Cardinality restriction max
• We can express an upper limit of
values in a range using owl:max
• Example
• John has at most 4 children who
are parents
• The number of parents is not
limited but those who are
parents is limited to 4
OWL: Cardinality restriction min
• We can also express a lower limit of
the number of values in a range using
min
• Example
• John has at least 2 children who are
parents
• The number of parents is again not
limited but those who are parents is
at least 2
OWL: Cardinality restriction exactly
• We can also set exactly the
number of values in a range
using exactly
• Example
• John has exactly 3 children who
are parents

Using exactly, min and max in an ontology


increases its complexity
OWL: Cardinality restriction owl:exactly
• We can set the exact number of
values in a range with
owl:exactly without specifying a
constraint class
• Example
• Define for a “fully married man”
that the number of wives is 4
OWL: property characteristics owl:inverseOf
• If p is a property with domain d
and range r then
• Property q with domain r and
range q is inverse of p
• Example
• hasHusband is the inverse
property of hasWife
OWL: property characteristics, symmetry
• If p is a property with domain d
and range r then
• P is said symmetric if is true when
range and domain are swapped
• Example
• hasSpouse is symmetric

• hasChild is asymmetric
OWL: property characteristics, disjoint
• If p is a property with domain d and
range r then
• And q is a property with range d and r
• p and q are disjoint if they cannot apply
simultaneously to the same individuals
• Example
• hasChild and hasSpouse are disjoint
OWL: property characteristics, reflexive
• A property is reflexive if it has the domain and
the range can be the same
• The property applies to the same person
• Irreflexive is when the rage and domain cannot
be the same
• Example
• hasRelative holds for the same person, example
Mary relative Mary

• hasChild is irreflexive
OWL: property characteristics, functional
• Functional means one individual from the
domain can only related to one individual from
the range
• Inverse functional is the opposite
• Example
• hasHusband is functional

• hasWife is inverseFunctional is irreflexive


OWL: property characteristics, transitive
• A property p(d,r) with domain d and range r is
transitive if
• p(x,y) and p(y, z) implies p(x,z)
• Example
• hasBrother is transitive
OWL: property characteristics, chain
• We can define a property as a chain of other
properties
• Example, hasGrandFather can be defined as
the chain of hasParent and hasFather
OWL advanced features (restrictions ad
characteristics)
• Class restrictions • Property characteristics
• Class intersection (owl:and)
• Class union (owl:or) • Inverse property (owl:inverseOf)
• Class complement (owl:not) • Symmetric (owl:SymmetricProperty,
• Subclass of complex class
• Enumerated class (list of individuals)
owl:AssymetricProperty)
• Individual restrictions • Disjoint (owl:propertyDisjointWith)
• Same individuals (owl:sameAs) • Reflexive (owl:ReflexiveProperty,
• Different individuals (owl:differetFrom) owl:IrreflexiveProperty)
• Object Property restrictions • Functional (owl:FunctionalProperty,
• Existential restriction (owl:some) owl:InverseFunctionalProperty)
• Universal restriction (owl:only)
• Equivalence (owl:some and owl only) • Transitive (owl:TransitiveProperty)
• Range value restriction (owl:value) • Chain (owl:propertyChainAxiom)
• Cardinality restrictions
• Minimum range (owl:min) • Data property restrictions
• Maximum range (owl:max) • Value, Some, intervals, comparison
• Exact range (owl:exactly)
operators
Data properties and restrictions

You might also like