590 likes | 827 Views
Ontologies in the Semantic Web: Logics, Languages and more…. Pavel Klinov. What I am here for:. To say few words about semantics and ontologies Why they are important To present my biased view on ontologies To give you an introduction into logical foundations of formal ontologies KR & R
E N D
Ontologies in the Semantic Web: Logics, Languages and more… Pavel Klinov
What I am here for: • To say few words about semantics and ontologies • Why they are important • To present my biased view on ontologies • To give you an introduction into logical foundations of formal ontologies • KR & R • To give a brief overview of the “state-of-the-art” ontological languages • W3C standards, trends, challenges and more (RDF(S), OWL)
Ontologies: Why Are They Important? • Imagine two communicating agents • Agent A tells: Red(X) • Ambiguity • This apple is red • Person is a Red • What the intended meaning is? • More generally: intended interpretation of a term is usually a small subset of all interpretations → need to specify it
Where’s Semantics on Web? • Semantic = Meaning. What things have meaning? • Text, e.g., Web content • Terms or expressions in agent dialogue • Representation language • Key question: How can semantics be captured? • Informally or Formally • Implicitly or Explicitly M. Uschold, “Where is the semantics in the Semantic Web”
Shared Human Consensus Implicit vs Explicit Semantics • Implicit • Explicit Pump: “a device for moving a gas or liquid from one place or container to another” M. Uschold, “Where is the semantics in the Semantic Web”
Informal vs Formal Semantics • Informal, e.g., NL descriptions • Formal, i.e., expressed in a formal language • The rest of the talk is about formal and explicit semantics Pump: “a device for moving a gas or liquid from one place or container to another” (pump has (superclasses (device,…)) M. Uschold, “Where is the semantics in the Semantic Web”
Ontologies as Systems of Constraints (1) • A little more formal approach: • Given an agent A using a language L with vocabulary V • There exists M(L) – set of all models of L • But set of intended models of L according to A is CA(L) - subset of M(L) M(L) CA(L) conceptualization N. Guarino, “Semantic Matching”
Ontologies as Systems of Constraints (2) • Now add a second agent - B • In order to “understand” A, B must either share the same conceptualization or A and B must adopt a common conceptualization • The key role of ontologies: they help establish a common conceptualization through placing semantic constraints on models of a language M(L) CA(L) conceptualization CB(L) N. Guarino, “Semantic Matching”
Logical Foundations of Formal Ontologies Pavel Klinov
Why Logic? • Logic provides framework for defining: • What are models • What are semantic constraints • How constraints can be formulated • What are the consequences of placing those constraints • Few logics have been investigated as ontology languages • First-Order Logic • Description Logic
Logics for ontologies • FOL • + Expressive • + Well understood • - Undecidable • - Doesn’t (naturally) support structured concepts • Example: “Every human has two parents who are humans”
Logics for ontologies • Description Logic (DL) • + Expressive • + Well understood • + Decidable (though worst case intractable) • + Supports structured knowledge • - Less expressive than FOL • Example: “Every human has two parents who are humans”
Syntax of the simplest DL - ALC • Each concept defines a term in a vocabulary • Concepts are defined using axioms: C = A∩B • DL allows creating structured concepts from elementary (atomic) concepts • Ontology = collection of axioms (DL knowledge base) I. Horrocks, U. Sattler, “DL: Basics, Applications and More”
Semantics of ALC • DL has a declarative model-theoretic semantics • Interpretation = <Universe, Interp. Func.> • Interpretation satisfies: • Axiom A = B iff AI = BI • Axiom A B iff AI BI • Ontology iff it satisfies all axioms • Important! DL semantics allows to state what is true without stating how to determine that I. Horrocks, U. Sattler, “DL: Basics, Applications and More”
Back to models and constraints • Models of a language M(L) = all possible interpretations of given DL concepts • Semantic constraints = DL axioms • Intended models (conceptualization) = interpretations that satisfy given DL ontology (set of axioms) • Examples: • Lion Mammal is satisfied by LionI={1,2}, MammalI={1,2,3} • Red Human is not satisfied by RedI={red_colour}, HumanI={John,Abbey,Mike} • A=¬A is never satisfied
Knowledge Representation in DL • Terminological Knowledge (TBox) • Concept definitions or inclusion axioms • Man Human • Man = Human ∩ Male • Assertional Knowledge (ABox) • Concept and role membership axioms • John:Human • parentOf(Jim,John)
Reasoning in the Semantic Web • Reasoning can be used to support ontology design and improve the quality of the resulting ontology • Reasoning can support ontology integration • Reasoning can be used by agents to determine set of facts consistent w.r.t. ontology
Ontology Design • Ontologies can be created step-by-step by computing “is-a” relationships between concepts GrandFather is Father whose child is Parent Person Man Woman is-a Father Parent Mother GrandFather GrandMother child
Person Person Man Woman is-a is-a Adolescent Father Parent Mother GrandFather GrandMother Boy Girl has-child Ontology Integration • Reasoning might be used to compute integrated hierarchy and detect inconsistencies
Facts consistent w.r.t. ontology • Reasoning can be used to classify objects and infer their properties • Classification • Tom is a parent of Jim and John is a son of Jim. Therefore, Tom is a grandfather • Inferring properties • Tom is a grandfather, so he must be at least 45 years of age
Reasoning in DL • Basic TBox inference problems: • Concept Satisfiability: Concept C is satisfiable w.r.t. TBox iff there exists an interpretation I of TBox s.t. CI is non-empty • Concept subsumption: C is subsumed by D w.r.t. TBox iff every interpretation I of TBox satisfies C D • Concept disjointness: C is disjoint with D w.r.t. TBox iff for every interpretation I of TBox CI is disjoint with DI • Examples: • Is Man ∩ Man satisfiable w.r.t. an empty TBox? No • Is Man ∩ Woman satisfiable w.r.t. an empty TBox? Yes • Man Person w.r.t. empty TBox? No • Man Person w.r.t. T={PersonMan U Woman}? Yes!
Inference problems are interrelated • C is subsumed by D iff (C ∩ D) is unsatisfiable • C and D are equivalent iff C is subsumed by D and vice versa • C and D are disjoint iff their intersection is unsatisfiable • All that is needed is a SAT solver for DL! DI DI CI
Satisfiability w.r.t. TBox • SAT w.r.t. generic TBoxes is difficult • At every logical step, reasoner must examine TBox to check that no axiom is violated • Sometimes the problem may be reduced to reasoning w.r.t. empty TBox • This may be done for simple terminologies using unfolding
Preconditions for Unfolding • Simple TBoxes • Every concept appear every once in the left handside of every axiom • No cycles • All left handsides are atomic
Unfolding • Replace every non-basic concept in right handside by its definition • Example:
Tableau Reasoning for DLs • Goal: determine if concept is satisfiable • Try to construct model (tableau) for concept. If failed – concept is unsatisfiable • Tableau construction is accomplished by applying rules at every step of the reasoning process • Termination conditions: • No rule can be applied - complete tableau • Clash occurs, e.g, a:C and a:¬C – incomplete tableau • The procedure is provably sound, complete and guaranteed to terminate
Tableau Expansion Rules • Intersection rule: Tableau contains a:(C ∩ D), then add a:C and a:D • Union rule: Tableau contains a:(C U D), then create two tableaux (one with a:C and another with a:D) • Universal restriction rule: Tableau contains a:(R.C) and (a,b):R, then add b:C • Existential restriction rule: Tableau contains a:(R.C), then add (a,b):R and b:C
Reasoning Example: • Is (child.Male ∩ child.Female) satisfiable? • K={a:(child.Male ∩child.Female)}. Apply ∩-rule • K=K{a:(child.Male), a:(child.Female)}. Apply -rule • K=K{(a,b):child, b:Male}. Apply -rule • K=K{(a,c):child, c:Female} • At this point no rule can be applied, no clash occurred, so the concept is satisfiable (a is Parent of both – Male b and Female c)
Another Reasoning Example: • Is (child.Man ∩ child.Woman) satisfiable? • Unfolding: (child.Male ∩ child. Male) • K={a:(child.Male ∩ child. Male)}. Apply ∩-rule • K=K{a:(child.Male), a:( child. Male)}. Apply -rule • K=K{(a,b):child, b:Male}. Apply -rule • K=K{b:Male} • At this point, there is clash: b:Male and b: Male, so the concept is unsatisfiable
ABox Reasoning • Membership • Does object belong to concept? • Retrieval • Get all objects for given concept • Classification • Get most specific concept for given object • Tableau procedure works the same way: • a:C holds is a:C is unsatisfiable
DL Summary • DL is a logical reconstruction of earlier formalisms (Sem. Nets, Frames) • DL are translatable to other formalisms (FOL, Modal Logics) • Decision procedures exist and are known for most of DLs • DL research = balancing between expressiveness and decidability
Ontology Languages for the Semantic Web Pavel Klinov
RDF • RDF stands for Resource Description Framework • It is a W3C candidate 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 • RDF document is a collection of triples (RDF graph) I. Horrocks, “Ontology Languages for the Semantic Web”
RDF Semantics • RDF has “non-standard” semantics – mix of model-theoretic semantics, semantic conditions and axiomatic triples • <rdf:subject, rdf:type, rdf:property> - axiomatic triple • Semantics given by RDF Model Theory (MT) (http://www.w3.org/TR/rdf-mt/) • In RDF MT, an interpretation I of a vocabulary V consists of: • IR, a non-empty set of resources (universe) • IS, a mapping from V into IR (interpretation function) • IP, a distinguished subset of IR (the properties) • A vocabulary element v 2 V is a property iff IS(v) 2 IP • IEXT, a mapping from IP into the powerset of IRxIR • I.e., property elements mapped to subsets of IRxIR • IL, a mapping from typed literals into IR I. Horrocks, “Ontology Languages for the Semantic Web”
RDF Semantics: Example • Satisfies: • <a,b,c> • <c,a,a> • … • Doesn’t satisfy: • <a,c,b> c not a property • <a,b,b> (a,b) not in IEXT(1) • … RDF W3C Standard - http://www.w3.org/TR/rdf-mt/
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 • 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 subClassOf) • this “extra meaning”, or semantics, specifies how a term should be interpreted • RDFS is an RDF document http://www.w3.org/TR/rdf-schema/rdfs-namespace/ I. Horrocks, “Ontology Languages for the Semantic Web”
RDFS Examples • RDF Schema terms: • Class • Property • type • subClassOf • range • domain • These terms are the RDF Schema building blocks (constructors) used to create vocabularies: • <Person,type,Class> • <hasColleague,type,Property> • <Professor,subClassOf,Person> • <Carole,type,Professor> • <hasColleague,range,Person> • <hasColleague,domain,Person> I. Horrocks, “Ontology Languages for the Semantic Web”
RDFS Semantics • RDFS simply adds semantic conditions and axiomatic triples that give meaning to schema vocabulary • Class interpretation ICEXT simply induced by rdf:type, i.e.: • x is in ICEXT(y) if and only if <x,y> is in IEXT(IS(rdf:type)) • Other semantic conditions include: • If <x,y> is in IEXT(IS(rdfs:domain)) and <u,v> is in IEXT(x) then u is in ICEXT(y) • If <x,y> is in IEXT(IS(rdfs:subClassOf)) then x and y are in IC and ICEXT(x) is a subset of ICEXT(y) • IEXT(IS(rdfs:subClassOf)) is transitive and reflexive on IC • Axiomatic triples include: • rdf:type rdfs:domain rdfs:Resource • rdfs:domain rdfs:domain rdf:Property I. Horrocks, “Ontology Languages for the Semantic Web”
RDF(S): flexible and liberal • No distinction between classes and instances (individuals) • <Species,type,Class> • <Lion,type,Species> • <Leo,type,Lion> • Properties can themselves have properties • <hasDaughter,subPropertyOf,hasChild> • <hasDaughter,type,familyProperty> • No distinction between language constructors and ontology vocabulary, so constructors can be applied to themselves/each other • <type,range,Class> • <Property,type,Class> • <type,subPropertyOf,subClassOf> I. Horrocks, “Ontology Languages for the Semantic Web”
Problems with RDFS • RDFS is too weak to describe resources in sufficient detail • No localized 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 axiomatization (http://www.w3.org/TR/lbase/) I. Horrocks, “Ontology Languages for the Semantic Web”
Requirement for Web Ontology Language • Desirable features identified for Web Ontology Language: • Extends existing Web standards • Such as XML, RDF, RDFS • Easy to understand and use • Should be based on familiar KR idioms • Formally specified • Of “adequate” expressive power • Possible to provide automated reasoning support
OWL • Ideally, OWL would extend RDF Schema • Consistent with the layered architecture of the Semantic Web • But simply extending RDF Schema would work against obtaining expressive power and efficient reasoning • Combining RDF Schema with logic leads to uncontrollable computational properties G. Antoniou, F. van Harmelen, “Semantic Web Primer”
Three species of OWL • W3C’sWeb Ontology Working Group defined OWL as three different sublanguages: • OWL Full • OWL DL • OWL Lite • Each sublanguage designed to fulfill different aspects of requirements
OWL Full • It uses all the OWL languages primitives • owl:unionOf • owl:equivalentClass • owl:max(min)Cardinality • … • It allows the combination of these primitives in arbitrary ways with RDF and RDF Schema • OWL Full is fully upward-compatible with RDF, both syntactically and semantically • OWL Full is so powerful that it is undecidable • No complete reasoning support • Example: cardinality restrictions on complex roles, e.g., >2ancestorOf.Person G. Antoniou, F. van Harmelen, “Semantic Web Primer”
OWL DL • OWL DL is a sublanguage of OWL Full that restricts application of the constructors from OWL and RDF • Application of OWL’s constructors’ to each other is disallowed • Example: EquivalentProperties(owl:sameAs,owl:differentFrom) • It corresponds to a well studied DL SHOIN(D) • OWL DL permits efficient reasoning support • No full compatibility with RDF: • Not every RDF document is a legal OWL DL document. • Every legal OWL DL document is a legal RDF document. G. Antoniou, F. van Harmelen, “Semantic Web Primer”
OWL Lite • An even further restriction limits OWL DL to a subset of the language constructors • E.g., OWL Lite excludes enumerated classes, disjointness statements, and arbitrary cardinality. • The advantage of this is a language that is easier to • Understand, for users • Implement, for tool builders • Reason, for tools • The disadvantage is restricted expressivity G. Antoniou, F. van Harmelen, “Semantic Web Primer”
Upward Compatibility between OWL Species • Every legal OWL Lite ontology is a legal OWL DL ontology • Every legal OWL DL ontology is a legal OWL Full ontology • Every valid OWL Lite conclusion is a valid OWL DL conclusion • Every valid OWL DL conclusion is a valid OWL Full conclusion G. Antoniou, F. van Harmelen, “Semantic Web Primer”
OWL Syntactic Varieties • OWL builds on RDF and uses RDF’s XML-based syntax • Other syntactic forms for OWL have also been defined: • An alternative, more readable XML-based syntax (OWL/XML) • An abstract syntax, that is much more compact and readable than the XML languages (Lisp-like) • A graphic syntax based on the conventions of UML G. Antoniou, F. van Harmelen, “Semantic Web Primer”
Few OWL fragments… Pavel Klinov
owl:Ontology • <owl:Ontology rdf:about=""> • <rdfs:comment>Some OWL ontology </rdfs:comment> • <owl:priorVersion • rdf:resource="http://www.uc.edu/uni-ns-0.1"/> • <owl:imports • rdf:resource=" http://www.uc.edu/uni-ns-1.0 "/> • <rdfs:label>University Ontology</rdfs:label> • </owl:Ontology> owl:imports is a transitive property G. Antoniou, F. van Harmelen, “Semantic Web Primer”