From OWL to Description Logics U. Straccia (ISTI - CNR) DLs & SW 2007 67 / 170
What Are Description Logics? (http://dl.kr.org/) A family of logic-based knowledge representation formalisms Descendants of semantic networks and KL-ONE Describe domain in terms of concepts (classes), roles (properties, relationships) and individuals Distinguished by: Formal semantics (typically model theoretic) Decidable fragments of FOL Closely related to Propositional Modal & Dynamic Logics Closely related to Guarded Fragment of FOL, L2 and C2 Provision of inference services Decision procedures for key problems (e.g., satisfiability, subsumption) Implemented systems (highly optimised) U. Straccia (ISTI - CNR) DLs & SW 2007 68 / 170
Short History of Description Logics Phase 1: Mostly system development (early eighties) Incomplete systems (Back, Classic, Loom, Kandor,...) Based on structural algorithms Phase 2: first tableaux algorithms and complexity results (mid-eighties - mid-nineties) Development of tableaux algorithms and complexity results Tableaux-based systems (Kris, Crack) Investigation of optimization techniques Phase 3: Optimized systems for very expressive DLs (mid-nineties -... ) Tableaux algorithms for very expressive DLs Highly optimised tableau systems (FaCT, DLP, Racer) Relationship to modal logic and decidable fragments of FOL U. Straccia (ISTI - CNR) DLs & SW 2007 69 / 170
Latest developments Phase 4: Mature implementations Mainstream applications and Tools Databases consistency of conceptual schema (EER, UML) using e.g. DLR (n-ary DL) schema integration Query subsumptiion (w.r.t. a conceptual schema) Ontologies and the Semantic Web (and Grid) Ontology engineering (design, maintenance, integration) Reasoing with ontology-based markup (metadata) Service description and discovery Commercial implemenations Cerebra, Racer U. Straccia (ISTI - CNR) DLs & SW 2007 70 / 170
Description Logics Basics Concept/Class: names are equivalent to unary predicates In general, concepts equiv to formulae with one free variable Role or attribute: names are equivalent to binary predicates In general, roles equiv to formulae with two free variables Taxonomy: Concept and role hierarchies can be expressed Individual: names are equivalent to constants Operators: restricted so that: Language is decidable and, if possible, of low complexity No need for explicit use of variables Restricted form of and Features such as counting can be succinctly expressed U. Straccia (ISTI - CNR) DLs & SW 2007 71 / 170
The DL Family A given DL is defined by set of concept and role forming operators Smallest propositionally closed DL is ALC (Attributive Language with Complement) Concepts constructed using,,, and Syntax Example C, D (top concept) (bottom concept) A (atomic concept) Human C D (concept conjunction) Human Male C D (concept disjunction) Nice Rich C (concept negation) Meat R.C (existential quantification) haschild.blond R.C (universal quantification) haschild.human U. Straccia (ISTI - CNR) DLs & SW 2007 72 / 170
General inclusion axioms: are of the form C D concept D subsumes concept C" HappyFather Man haschild.female Concept definitions: are of the form A = C (equivalent to A C, C A) Primitive concept definitions: are of the form A C Sometimes, a we have primitive and concept definitions only, where no atom can be defined more than once and no recursion is allowed in that case the concept definitions can be unfolded Assertions: are of the form a:c and (a, b):r individual a is an instance of concept C individual a is related to b by means of R John:Happy_Father (John, Mary):has_child (In)Equality Axioms: are of the form a = b and a b U. Straccia (ISTI - CNR) DLs & SW 2007 73 / 170
DL Semantics Semantics is given in terms of an interpretation I = ( I, I), where I is the domain (a non-empty set) I is an interpretation function that maps: Concept (class) name A into a subset A I of I Role (property) name R into a subset R I of I I Individual name a into an element of I Interpretation function I is extended to concept expressions: I = I I = (C 1 C 2 ) I = C I I 1 C 2 (C 1 C 2 ) I = C I I 1 C 2 ( C) I = I \ C I ( R.C) I = {x I y. x, y R I y C I } ( R.C) I = {x I y. x, y R I y C I } U. Straccia (ISTI - CNR) DLs & SW 2007 74 / 170
Example: assume I = ( I, I) such that I = {a, b, c, d, e, f, 1, 2, 4, 5, 8} Person I = {a, b, c, d} Blonde I = {b, d} haschild I = { a, b, a, c, c, d, b, c } What is the interpretation of Person haschild.blond? (Person haschild.blond) I = Person I {x y. x, y haschild I y Blond I } = {a, b, c, d} {x y. x, y { a, b, a, c, c, d, b, c } y {b, d}} = {a, b, c, d} {a, c} = {a, c} Finally, we say that I is a model of C D, written I = C D, iff C I D I I is a model of a:c, written I = a:c, iff a I C I I is a model of (a, b):r, written I = (a, b):r, iff a I, b I R I I is a model of a = b, written I = a = b, iff a I = b I I is a model of a b, written I = a b, iff ai b I U. Straccia (ISTI - CNR) DLs & SW 2007 75 / 170
Excerpt of pizza ontology... (according to University of Manchester) PizzaFruttiDiMare = Pizza hastopping.mixedseafoodtopping hastopping.garlictopping hastopping.tomatotopping hastopping.(mixedseafoodtopping GarlicTopping TomatoTopping) hasbase.pizzabase PizzaBase = DeepPanBase ThinAndCrispyBase MixedSeafoodTopping FishTopping FishTopping PizzaTopping hasspiceness.mild disjoint(fishtopping, MeatTopping, HerbSpiceTopping) functional(hasspiciness) Topping hasspiciness.(hot Medium Mild) U. Straccia (ISTI - CNR) DLs & SW 2007 76 / 170
Note: Simplification of acyclic ontologies Acyclic TBoxes can be unfolded or expanded Replace each A C with A = C A, where A is a new atom Given A = C, replace each occurrence of A with C Example: parent = person haschild.person woman = person femal mother = parent femal Original TBox parent = person haschild.person woman = person femal mother = person haschild.person femal Unfolded TBox U. Straccia (ISTI - CNR) DLs & SW 2007 77 / 170
DLs and First-Order-Logic Satisfiability preserving ALC mapping to FOL: introduce a unary predicate A for an atomic concept A a binary predicate R for a role R Translate as follows t(, x) true t(, x) false t(a, x) A(x) t(c 1 C 2, x) t(c 1, x) t(c 2, x) t(c 1 C 2, x) t(c 1, x) t(c 2, x) t( C, x) t(c, x) t( R.C, x) y.r(x, y) t(c, y) t( R.C, x) y.r(x, y) t(c, y) t(c D) x.t(c, x) t(d, x) t(a:c) t(c, a) t((a, b):r) R(a, b) Example: t(happyfather Man haschild.female) = x.happyfather(x) (Man(x) ( y.haschild(x, y) Female(y))) t(a:man haschild.female) = Man(a) ( y.haschild(a, y) Female(y)) U. Straccia (ISTI - CNR) DLs & SW 2007 78 / 170
Note on DL naming For instance, AL: C, D A C D A R. R.C C: Concept negation, C. Thus, ALC = AL + C S: Used for ALC with transitive roles R + U: Concept disjunction, C 1 C 2, e.g. Male Female E: Existential quantification, R.C, e.g. haspart.wheel H: Role inclusion axioms, R 1 R 2, e.g. iscomponentof ispartof N : Number restrictions, ( n R) and ( n R), e.g. ( 3 has_child) (has at least 3 children) Q: Qualified number restrictions, ( n R.C) and ( n R.C), e.g. ( 2 haschild.adult) (has at most 2 adult children) O: Nominals (singleton class), {a}, e.g. haschild.{mary}. Note: a:c equiv to {a} C and (a, b):r equiv to {a} R.{b} I: Inverse role, R, e.g. ispartof = haspart F: Functional role, f, e.g. fun(hasage) R +: transitive role, e.g. trans(ispartof ) SHIF = S + H + I + F = ALCR +HIF OWL-Lite (EXPTIME) SHOIN = S + H + O + I + N = ALCR +HOIN OWL-DL (NEXPTIME) U. Straccia (ISTI - CNR) DLs & SW 2007 79 / 170
Semantics of additional constructs: H: Role inclusion axioms, I = R 1 R 2 iff R 1 I R 2 I N : Number restrictions, ( n R) I = {x I : {y x, y R I } n}, ( n R) I = {x I : {y x, y R I } n} Q: Qualified number restrictions, ( n R.C) I = {x {y x, y R I y C I } n}, ( n R.C) I = {x I : {y x, y R I y C I } n} O: Nominals (singleton class), {a} I = {a I } I: Inverse role, (R ) I = { x, y y, x R I } F: Functional role, I = fun(f ) iff z y z if x, y f I and x, z f I the y = z R +: transitive role, (R +) I = { x, y z such that x, z R I z, y R I } U. Straccia (ISTI - CNR) DLs & SW 2007 80 / 170
Lisp-like Syntax of DLs formulae In many systems the syntax is Lisp-like *top* *bottom* C (not C) C D (and C D) C D (or C D) R.C (some R C) R.C (all R C) ( n R) (at-least n R) ( n R) (at-most n R) ( n R.C) (at-least n R C) ( n R.C) (at-most n R C) {a} (one-of a) R (inv R) C D (implies C D) A = C (define-concept A C) R P (implies-role R P) fun(f ) (functional f) trans(r) (transitive R) a:c (instance a C) (a, b):r (related a b R) Example: (define-concept Man (and Human Male)) (define-concept Happy_Father (and Man (some has_child Female))) (instance john Happy_Father) (related john mary has_child) U. Straccia (ISTI - CNR) DLs & SW 2007 81 / 170
Concrete domains Concrete domains: reals, integers, strings,... (tim, 14):hasAge (sf, SoftComputing ):hasacronym (source1, ComputerScience ):isabout (service2, InformationRetrievalTool ):Matches Minor = Person hasage. 18 Semantics: a clean separation between object classes and concrete domains D = D, Φ D D is an interpretation domain ΦD is the set of concrete domain predicates d with a predefined arity n and fixed interpretation d D n D Concrete properties: R I I D Notation: (D). E.g., ALC(D) is ALC + concrete domains U. Straccia (ISTI - CNR) DLs & SW 2007 82 / 170
Example: assume I = ( I, I) such that I = {a, b, c, d, e, f, 1, 2, 4, 5, 8} Person I = {a, b, c, d} Consider the following concrete domain with of some unary predicates (n = 1) over reals D = R, Φ D = {= m, m, m, > m, < m m R} the fixed interpretation of the predicates is (= m) D = {m} ( m) D = {k k m} ( m) D = {k k m} (> m) D = {k k > m} (< m) D = {k k < m} Concrete properties: hasage I I R hasage I = { a, 9, c, 20, b, 12 } What is the interpretation of Person hasage. 18? (Person hasage. 18 ) I = Person I {x y R such that x, y hasage I y ( 18 ) I = {a, b, c, d} {x y. x, y { a, 9, c, 20, b, 12 } y 18} = {a, b, c, d} {a, b} = {a, b} U. Straccia (ISTI - CNR) DLs & SW 2007 83 / 170
DL Knowledge Base A DL Knowledge Base is a pair K = T, A, where T is a TBox containing general inclusion axioms of the form C D, concept definitions of the form A = C primitive concept definitions of the form A C role inclusions of the form R P role equivalence of the form R = P A is a ABox containing assertions of the form a:c containing assertions of the form (a, b):r containing (in) equality Axioms of the form a = b and a b An interpretation I is a model of K, written I = K iff I = T and I = A, where I = T (I is a model of T ) iff I is a model of each element in T I = A (I is a model of A) iff I is a model of each element in A U. Straccia (ISTI - CNR) DLs & SW 2007 84 / 170
OWL DL as Description Logic Concept/Class constructors: Abstract Syntax DL Syntax Example Descriptions (C) A (URI reference) A Conference owl:thing owl:nothing intersectionof(c 1 C 2...) C 1 C 2 Reference Journal unionof(c 1 C 2...) C 1 C 2 Organization Institution complementof(c) C MasterThesis oneof(o 1...) {o 1,...} {"WISE","ISWC",...} restriction(r somevaluesfrom(c)) R.C parts.incollection restriction(r allvaluesfrom(c)) R.C date.date restriction(r hasvalue(o)) R.{o} date.{2005} restriction(r mincardinality(n)) ( n R) ( 1 location) restriction(r maxcardinality(n)) ( n R) ( 1 publisher) restriction(u somevaluesfrom(d)) U.D issue.integer restriction(u allvaluesfrom(d)) U.D name.string restriction(u hasvalue(v)) U. = v } series.= LNCS restriction(u mincardinality(n)) ( n U) ( 1 title) restriction(u maxcardinality(n)) ( n U) ( 1 author) Note: R is an abstract role, while U is a concrete property of arity two. U. Straccia (ISTI - CNR) DLs & SW 2007 85 / 170
Axioms: Axioms Abstract Syntax DL Syntax Example Class(A partial C 1... C n) A C 1... C n Human Animal Biped Class(A complete C 1... C n) A = C 1... C n Man = Human Male EnumeratedClass(A o 1... o n) A = {o 1 }... {o n} RGB = {r} {g} {b} SubClassOf(C 1 C 2 ) C 1 C 2 EquivalentClasses(C 1... C n) C 1 =... = C n DisjointClasses(C 1... C n) C i C j =, i j Male Female ObjectProperty(R super (R 1 )... super (R n) R R i HasDaughter haschild domain(c 1 )... domain(c n) ( 1 R) C i ( 1 haschild) Human range(c 1 )... range(c n) R.C i haschild.human [inverseof(p)] R = P haschild = hasparent [symmetric] R = R similar = similar [functional] ( 1 R) ( 1 hasmother) [Inversefunctional] ( 1 R ) [Transitive]) Tr(R) Tr(ancestor) SubPropertyOf(R 1 R 2 ) R 1 R 2 EquivalentProperties(R 1... R n) R 1 =... = R n cost = price AnnotationProperty(S) U. Straccia (ISTI - CNR) DLs & SW 2007 86 / 170
Abstract Syntax DL Syntax Example DatatypeProperty(U super (U 1 )... super (U n) U U i domain(c 1 )... domain(c n) ( 1 U) C i ( 1 hasage) Human range(d 1 )... range(d n) U.D i hasage.posinteger [functional]) ( 1 U) ( 1 hasage) SubPropertyOf(U 1 U 2 ) U 1 U 2 hasname hasfirstname EquivalentProperties(U 1... U n) U 1 =... = U n Individuals Individual(o type (C 1 )... type (C n)) o:c i tim:human value(r 1 o 1 )... value(r no n) (o, o i ):R i (tim, mary):haschild value(u 1 v 1 )... value(u nv n) (o, v 1 ):U i (tim, 14):hasAge SameIndividual(o 1... o n) o 1 =... = o n president_bush = G.W.Bush DifferentIndividuals(o 1... o n) o i o j, i j john peter Symbols Object Property R (URI reference) R haschild Datatype Property U (URI reference) U hasage Individual o (URI reference) U tim Data Value v (RDF literal) U International Conference on Semantic Web U. Straccia (ISTI - CNR) DLs & SW 2007 87 / 170
XML representation of OWL statements Example: Person haschild.(doctor haschild.doctor) intersectionof( Person restriction(haschild allvaluesfrom(unionof(doctor restriction(haschild somevaluesfrom(doctor))))) U. Straccia (ISTI - CNR) DLs & SW 2007 88 / 170
OWL Lite as Description Logic Prohibits union and complements Restricts intersection to implicit intersections in the frame-like class axioms Limits all embedded descriptions to concept names Does not allow individuals to show up in description or class axioms Limits role filler cardinalities to 0 or 1 U. Straccia (ISTI - CNR) DLs & SW 2007 89 / 170
Concept/Class constructors: Abstract Syntax DL Syntax Example Descriptions (C) A (URI reference) A Conference owl:thing owl:nothing restriction(r somevaluesfrom(c)) R.C parts.incollection restriction(r allvaluesfrom(c)) R.C date.date restriction(r mincardinality(n)) ( n R), n {0, 1} ( 1 location) restriction(r maxcardinality(n)) ( n R), n {0, 1} ( 1 publisher) restriction(u somevaluesfrom(d)) U.D issue.integer restriction(u allvaluesfrom(d)) U.D name.string restriction(u mincardinality(n)) ( n U), n {0, 1} ( 1 title) restriction(u maxcardinality(n)) ( n U), n {0, 1} ( 1 author) Note: R is an abstract role, while U is a concrete property of arity two. U. Straccia (ISTI - CNR) DLs & SW 2007 90 / 170
Axioms: Axioms Abstract Syntax DL Syntax Example Class(A partial C 1... C n) A C 1... C n Human Animal Biped Class(A complete C 1... C n) A = C 1... C n Man = Human Male EquivalentClasses(C 1... C n) C 1 =... = C n ObjectProperty(R super (R 1 )... super (R n) R R i HasDaughter haschild domain(c 1 )... domain(c n) ( 1 R) C i ( 1 haschild) Human range(c 1 )... range(c n) R.C i haschild.human [inverseof(p)] R = P haschild = hasparent [symmetric] R = R similar = similar [functional] ( 1 R) ( 1 hasmother) [Inversefunctional] ( 1 R ) [Transitive]) Tr(R) Tr(ancestor) SubPropertyOf(R 1 R 2 ) R 1 R 2 EquivalentProperties(R 1... R n) R 1 =... = R n cost = price AnnotationProperty(S) U. Straccia (ISTI - CNR) DLs & SW 2007 91 / 170
Abstract Syntax DL Syntax Example DatatypeProperty(U super (U 1 )... super (U n) U U i domain(c 1 )... domain(c n) ( 1 U) C i ( 1 hasage) Human range(d 1 )... range(d n) U.D i hasage.posinteger [functional]) ( 1 U) ( 1 hasage) SubPropertyOf(U 1 U 2 ) U 1 U 2 hasname hasfirstname EquivalentProperties(U 1... U n) U 1 =... = U n Individuals Individual(o type (C 1 )... type (C n)) o:c i tim:human value(r 1 o 1 )... value(r no n) (o, o i ):R i (tim, mary):haschild value(u 1 v 1 )... value(u nv n) (o, v 1 ):U i (tim, 14):hasAge SameIndividual(o 1... o n) o 1 =... = o n president_bush = G.W.Bush DifferentIndividuals(o 1... o n) o i o j, i j john peter Symbols Object Property R (URI reference) R haschild Datatype Property U (URI reference) U hasage Individual o (URI reference) U tim Data Value v (RDF literal) U International Conference on Semantic Web U. Straccia (ISTI - CNR) DLs & SW 2007 92 / 170
Use Case: Semantic Shopping Agent Suppose we would like to buy a sporty car, 1 which costs at most about 20000 euro 2 who s color is metallic blue 3 in case there are leather seats then we want also air conditioning 4... In todays Web, we have manually 1 to search for car selling web sites, e.g. using Google, 2 to select the most promising sites, 3 to browse through them and query them to see about the cars each site sells and match them with our requirements 4 select the offers in each web site, which match our requirements 5 eventually to merge all the best offers from each site together and select the best ones U. Straccia (ISTI - CNR) DLs & SW 2007 93 / 170
Suppose that among the web sites we found http://www.autos.com U. Straccia (ISTI - CNR) DLs & SW 2007 94 / 170
Suppose I select the sporty car link... U. Straccia (ISTI - CNR) DLs & SW 2007 95 / 170
The list is not in the right order: let s order it by invoice price... U. Straccia (ISTI - CNR) DLs & SW 2007 96 / 170
Now, let s see the properties of the Mazda MX-5 Miata... U. Straccia (ISTI - CNR) DLs & SW 2007 97 / 170
Limitations As we can see, the whole process is rather tedious and time consuming I ve to visit many sites Browsing in each site is very time consuming Finding the right information in a site, which has to match the requirements is not simple The way of browsing and querying may differ from site to site U. Straccia (ISTI - CNR) DLs & SW 2007 98 / 170
Better Solution: Use a Software Agent Why not use a software agent doing automatically all these steps? 1 to search for car selling web sites 2 to select the most promising sites, 3 to browse through them and query them to see about the cars each site sells and match them with the requirements 4 select the offers in each web site, which match our requirements 5 eventually to merge all the best offers from each site together and select the best ones and present them to the user U. Straccia (ISTI - CNR) DLs & SW 2007 99 / 170
Today s problems for a Software Agent The major problem to automatize the process is that Web information resources are not meant for automatic information processing Web pages are in HTML. Extracting information by wrapping is difficult Query language not standardized. Querying automatically is difficult U. Straccia (ISTI - CNR) DLs & SW 2007 100 / 170
Possible Solution: Semantic Shopping Agent The content of a shopping site is encoded as a Knowledge base: It contains an ontology describing all the classes and properties of the vehicles it sells It contains all the instances of the classes U. Straccia (ISTI - CNR) DLs & SW 2007 101 / 170
Possible Solution: Semantic Shopping Agent The content of a shopping site is encoded as a Knowledge base: It contains an ontology describing all the classes and properties of the vehicles it sells It contains all the instances of the classes U. Straccia (ISTI - CNR) DLs & SW 2007 102 / 170
Possible Solution: Semantic Shopping Agent The content of a shopping site is encoded as a Knowledge base: It contains an ontology describing all the classes and properties of the vehicles it sells It contains all the instances of the classes U. Straccia (ISTI - CNR) DLs & SW 2007 103 / 170
Possible Solution: Semantic Shopping Agent The content of a shopping site is encoded as a Knowledge base: It contains an ontology describing all the classes and properties of the vehicles it sells It contains all the instances of the classes We can query the sites by asking Find sporty cars, whose price is 20000, and... In Description Logic, we are looking for all instances of the class MyQuery = SportyCars ( hasprice. 20000 ) ( hascolor. = blue ) ( ( hasseats.leatherseats) ( hasairconditioning.airconditioning))... KB = MyQuery(MazdaMX 5Miata) U. Straccia (ISTI - CNR) DLs & SW 2007 104 / 170