Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
First-order Predicate Logic (FOPL) as an Ontology Language Ontology Languages 1 Ontology Languages Based on First-order predicate Logic (FOPL) The following standardized languages are based on FOPL: • Common Logic • CycL • KIF They are typically much more expressive than description logics and reasoning is typically undecidable. There are many upper level ontologies (domain independent ontologies that fix concepts across domains) formulated in FOPL. An example is DOLCE (Descriptive Ontology for Linguistic and Cognitive Engineering). Ontology Languages 2 DOLCE DOLCE defines general concepts such as ‘participation’, ‘dependence’, ‘constitution’ in an extension of FOPL. For example, DOLCE contains axioms that fix the meaning of concepts related to ‘parthood’: Assume P(x, y) says that x is a part of y. Then • PP(x, y) = P(x, y) ∧ ¬P(y, x) defines proper parthood; • O(x, y) = ∃z(P(z, x) ∧ P(z, y)) defines overlap; • AT(x) = ¬∃yPP(y, x) defines atoms. Ontology Languages 3 Syntax of FOPL: signature A signature for FOPL consists of • a set V of variables denoted by x, x0 , x1 , . . . , y, y0 , y1 , . . . , z, z0 , z1 . . .; • a set P of predicate symbols each of which comes with a positive number as its arity. Predicates of arity one are called unary predicates and are often denoted by A, A0 , A1 . . . , B, B0 , B1 , . . . In description logic, they correspond to concept names, so we sometimes call them concept names. Predicates of arity two are called binary predicates and are often denoted by r, r0 , r1 , . . . , s, s0 , s1 , . . .. In description logic, they correspond to roles, so we sometimes call them roles. • a “special” binary relation symbols “=”. Ontology Languages 4 Syntax of FOPL: formulas Formulas of FOPL are defined by induction: • If P is a predicate of arity k and x1 , . . . , xk are terms, then P (x1 , . . . , xk ) is a formula; • in particular, if x1 , x2 are terms, then x1 = x2 is a formula; • If F is a formula, then ¬F is a formula; • If F and G are formulas, then F ∧ G and F ∨ G are formulas; • If F is a formula and x a variable, then ∀x.F and ∃x.F are formulas. We abbreviate • F1 → F2 = ¬F1 ∨ F2 ; • F1 ↔ F2 = (F1 → F2 ) ∧ (F2 → F1 ). Ontology Languages 5 Translation of concept inclusions into FOPL: idea • Father ≡ Person u Male u ∃hasChild.>. • Student ≡ Person u ∃is registered at.University. • Father v Person. • Father v ∃hasChild.>. are translated to • ∀x.(Father(x) ↔ (Person(x) ∧ Male(x) ∧ ∃y.hasChild(x, y))). • ∀x.(Student(x) ↔ (Person(x) ∧ ∃y.(is registered at(x, y) ∧ University(y)))). • ∀x.(Father(x) → Person(x)). • ∀x.(Father(x) → ∃y.hasChild(x, y)). Ontology Languages 6 Semantics of FOPL: interpretation An interpretation I = (∆I , ·I ) for FOPL consists of • a non-empty set ∆I (the domain); • an interpretation function that maps – every k-ary predicate symbol P to a k-ary relation over ∆I . In particular, ∗ every unary predicate symbol A is mapped to a subset AI of ∆I and ∗ every binary predicate symbol r is a mapped to a subset of ∆I × ∆I . This is almost the same definition as for description logics. The only difference is that we have predicate symbols of arity larger than 2. Ontology Languages 7 Example Consider • the concept names University, BritishUniversity, Student, • the role name student at. An interpretation IU is given by • ∆IU = {LU, MU, CMU, Tim, Tom, Rob, a, b, c}. • UniversityIU = {LU, MU, CMU, a, b}; • BritishUniversityIU = {LU, MU}; • StudentIU = {Tim, Tom, c}; • student atIU = {(Tim, LU), (Rob, CMU)}. Ontology Languages 8 Semantics of FOPL: Satisfaction A variable assignment α for an interpretation I is a function that maps every variable x ∈ V to an element α(x) ∈ ∆I . We define the satisfaction relation “I, α |= F ” between a formula F and an interpretation I w.r.t. an assignment α inductively as follows: • I, α |= P (x1 , . . . , xk ) if, and only if, (α(x1 ), . . . , α(xk )) ∈ P I ; • I, α |= x1 = x2 if, and only if, α(x1 ) = α(x2 ); • I, α |= ¬F if, and only if, not I, α |= F ; • I, α |= F ∧ G if, and only if, I, α |= F and I, α |= G; • I, α |= F ∨ G if, and only if, I, α |= F or I, α |= G; Ontology Languages 9 Satisfaction continued • I, α |= ∃x.F if, and only if, there exists a d ∈ ∆I such that I, α[x 7→ d] |= F • I, α |= ∀x.F if, and only if, for all d ∈ ∆I we have I, α[x 7→ d] |= F . where α[x 7→ d] stands for the assignment that coincides with α except that x is mapped to d. A variable x is called free in a formula F if x has an occurrence in F such that no occurrence of ∃x or ∀x is in front of it. To indicate that the free variables in a formula F are among x1 , . . . , xk , we sometimes write F (x1 , . . . , xk ) instead of F. To test whether I, α |= F (x1 , . . . , xk ) it is enough to know the α(x1 ), . . . , α(xk ). Thus, we write I |= F (a1 , . . . , ak ) if I, α |= F (x1 , . . . , xk ) holds for some assignment (equivalently, all assignments) α with α(x1 ) = a1 , . . . , α(xk ) = ak . Ontology Languages 10 Example IU • Let α(x) = LU. Then IU , α |= University(x). We sometimes denote this by IU |= University(LU). • Let α(x) = Tim. Then IU , α 6|= University(x). We sometimes denote this by IU 6|= University(Tim). • Let α(x) = Tim and α(y) = LU. Then IU , α |= student at(x, y). We sometimes denote this by IU |= student at(Tim, LU). • Let α be arbitrary. Then IU , α |= ∃x.University(x); since this does not depend on α, we denote this by IU |= ∃x.University(x). • We have IU |= ∃x.¬University(x). • We have IU |= ¬∀x.(Student(x) → ∃y.student at(x, y)). Ontology Languages 11 FOPL Ontologies and Reasoning A closed FOPL formula (also called a sentence) is a FOPL formula without free variables. An FOPL ontology T is a finite set of closed FOPL formulas. For example, the following translation MED] of the EL TBoxes MED is an FOPL ontology: ∀x.(Pericardium(x) → (Tissue(x) ∧ ∃y.(cont in(x, y) ∧ Heart(y)))) ∀x.(Pericarditis(x) → (Inflammation(x) ∧ ∃y.(has loc(x, y) ∧ Pericardium(y)))) ∀x.(Inflammation(x) → (Disease(x) ∧ ∃y.(acts on(x, y) ∧ Tissue(y)))) ∀x.(F (x) → (Heartdisease(x) ∧ NeedTreatment(x))) where F (x) = Disease(x) ∧ ∃y.(has loc(x, y) ∧ ∃z.(cont in(y, z) ∧ Heart(z))) Ontology Languages 12 FOPL Ontologies and Reasoning For an interpretation I, we say that I is a model of T (or, equivalently, that I satisfies T ) and write I |= T, if, and only if, I |= F for all F ∈ T . An FOPL sentence F follows from a FOPL ontology T , in symbols T |= F, if, and only if, for all interpretations I the following holds: If I |= T , then I |= F . For example, “Pericarditis needs treatment” follows from MED if, and only if, MED] |= ∀x(Percarditis(x) → NeedsTreatment(x)). As mentioned above already, for FOPL ontologies T and FOPL sentences F the problem “T |= F ” is undecidable! Ontology Languages 13 First-order Predicate Logic (FOPL) as a Query Language Ontology Languages 14 Data A ground sentence F is of the form P (c1 , . . . , cn ), where P is an n-ary predicate and c1 , . . . , cn are individual symbols. A database instance is a finite set D of ground sentences. The set Ind(D) denote the set of individual symbols in D. For example, the following set Duni is a database instance: • University(LU), University(MU), University(CMU); • BritishUniversity(LU) • Student(Tim), Student(Tom); • student at(Tim, LU), student at(Rob, CMU). Here we have Ind(Duni ) = {LU, MU, CMU, Tim, Tom, Rob} Ontology Languages 15 Querying Database Instances An n-ary query Q is a mapping that takes as input a database instance D and outputs a set Q(D) of n-tuples from Ind(D). If n = 0, then Q is called a Boolean query and outputs either ‘Yes’ or ‘No’ or ‘Don’t know’: Q(D) ∈ { Yes, No, Don’t know }. Consider the database instance Duni with the following queries: • Boolean Query: Is every British university a university? • Boolean Query: Does every university have a student? • Unary query: Output all students that are not students at any university. • Unary query: Output all universities that are not British universities. Ontology Languages 16 Assumptions The answers to the queries above depend on our assumptions about the way in which Duni represents the world. The main options are: • Closed World Assumption: if something is not stated explicitly in Duni it is false. We assume complete knowledge about the domain: if some ground sentence is true, it is included in Duni . • Open World Assumption: if something is not stated in Duni , then we do not know whether it is true or false. We assume incomplete knowledge about the domain: if some ground sentence is not in Duni , it can still be true. In relational databases we make the closed world assumption! Ontology Languages 17 In Schema.org Markup we make the Open World Assumption Consider the following Schema.org Markup: <div vocab="http://schema.org/" typeof="Movie"> <h1 property="name">Avatar</h1> <div property="director" typeof="Person"> Director: <span property="name">James Cameron</span> (born <time property="birthDate" datetime="1954-08-16">August 16, 1954</time>) </div> <span property="genre">Science fiction</span> </div> Corresponds to the database instance: Movie(m), name(o, Avatar), director(m, p) name(p, Cameron), birthDay(p, 1954), genre(m, ScienceFiction) Clearly, we cannot be sure that by collecting markup of webpages we collect all movies! Ontology Languages 18 FOPL Relational Database Querying We formulate queries as FOPL formulas. The query defined by F is n-ary if F has n free variables. A query is Boolean if it is defined by a closed formula (has no free variable). We realize the closed world assumption by regarding a database instance as an interpretation. The interpretation ID defined by a database instance D is given by setting: • ∆ID = Ind(D); • For any n-ary predicate P and any (a1 , . . . , an ) in Ind(D): (a1 , . . . , an ) ∈ P ID Ontology Languages if and only if P (a1 , . . . , an ) ∈ D 19 Example The interpretation J = IDuni defined by Duni is given as follows: • ∆J = {LU, MU, CMU, Tim, Tom, Rob}; • UniversityJ = {LU, MU, CMU}; • BritishUniversityJ = {LU}; • StudentJ = {Tim, Tom}; • student atJ = {(Tim, LU), (Rob, CMU)}. Ontology Languages 20 FOPL Relational Database Queries (Closed World Semantics) A tuple (a1 , . . . , an ) in Ind(D) is an answer to an FOPL query F (x1 , . . . , xn ) in database instance D if ID |= F (a1 , . . . , an ) We set answer(F (x1 , . . . , xn ), D) = {(a1 , . . . , an ) | ID |= F (a1 , . . . , an )} The answer to a Boolean FOPL query F in D is ‘Yes’ if ID |= F The answer to a Boolean FOPL query F in D is ‘No’ if ID 6|= F Note that the answer ‘Don’t know’ is never returned! Ontology Languages 21 Examples We query Duni under closed world semantics: • Output all universities. The corresponding query is F (x) = University(x). The set of answers is answer(F (x), Duni ) = {LU, MU, CMU} • Is every British university a university? The corresponding query is F = ∀x(BritishUniversity(x) → University(x)) The answer is ‘Yes’. Ontology Languages 22 Examples • Does every university have a student? The corresponding query is F = ∀x(University(x) → ∃ystudent at(y, x)) The answer is ‘No’. • Output all students that are not students at any university. The corresponding query is F (x) = Student(x) ∧ ¬∃ystudent at(x, y) The set of answers is answer(F (x), Duni ) = {Tom} • Output all universities that are not British universities. The corresponding query is F (x) = University(x) ∧ ¬BritishUniversity(x) The set of answers is answer(F (x), Duni ) = {MU, CMU}. Ontology Languages 23 Complexity of querying relational databases Consider, for simplicity, Boolean queries. There are two different ways of measuring the complexity of querying relational databases (RDBs): • Data complexity: This measures the time/space needed (in the worst case) to evaluate a fixed query F in an instance I of a RDB (i.e., to decide whether I |= F ). Thus, when measuring data complexity, the input variable is the size of the instance and the query is assumed to be fixed. • Combined Complexity: This measures the time/space needed (in the worst case) to evaluate a query F in an instance I of a RDB. Thus, when measuring combined complexity, both the size of the instance and the query are input variables. Data complexity is regarded as being more relevant as queries are typically rather small, but database instances are very large compared to the query. FOPL: Data complexity is in LogSpace. So it is in polytime and, therefore, tractable. Combined complexity is PSpace-complete, and, therefore, not tractable. Ontology Languages 24 FOPL Query Answering (Open World Semantics) Let D be a database instance. An interpretation I is a model of D if • Ind(D) ⊆ ∆I ; • If P (a1 , . . . , an ) ∈ D, then (a1 , . . . , an ) ∈ P I . The set of models of D is denoted by Mod(D). Let F (x1 , . . . , xn ) be an FOPL query. Then (a1 , . . . , an ) in Ind(D) is a certain answer to F (x1 , . . . , xn ) in D, in symbols D |= F (a1 , . . . , an ), if I |= F (a1 , . . . , an ) for all I ∈ Mod(D). The set of certain answers to F (x1 , . . . , xn ) in D is certanswer(F (x1 , . . . , xn ), D) = {(a1 , . . . , an ) | D |= F (a1 , . . . , an )} Ontology Languages 25 FOPL Query Answering (Open World Semantics) • ‘Yes’ is the certain answer to a Boolean query F if I |= F for all I ∈ Mod(D). • ‘No’ is the certain answer to a Boolean query F if I 6|= F for all I ∈ Mod(D) • If neither ‘Yes’ nor ‘No’ is a certain answer, then we say that the certain answer is ‘Don’t know’. Note that under closed world semantics the answer to a Boolean query is always either ‘Yes’ or ‘No’. Ontology Languages 26 Example We consider again the database instance Duni : • University(LU), University(MU), University(CMU); • BritishUniversity(LU) • Student(Tim), Student(Tom); • student at(Tim, LU), Ontology Languages student at(Rob, CMU). 27 Example Output all universities. The corresponding query is F (x) = University(x). The set of certain answers is certanswer(F (x), Duni ) = {LU, MU, CMU} This coincides with answer(F (x), Duni ). To see this, we have to show: • for all I ∈ Mod(Duni ): I |= F (LU), I |= F (MU), and I |= F (CMU). • there exists I ∈ Mod(Duni ) with I 6|= F (Tim); • there exists I ∈ Mod(Duni ) with I 6|= F (Tom). • there exists I ∈ Mod(Duni ) with I 6|= F (Rob). For Point 2 to 4 we just take IDuni ! Ontology Languages 28 Example Is every British university a university? The corresponding query is F = ∀x(BritishUniversity(x) → University(x)) The certain answer to F in Duni is ‘Don’t know’. To see this we have to construct two interpretations I ∈ Mod(Duni ) and J ∈ Mod(Duni ) such that • I |= F ; • J 6|= F . For Point 1 we can take IDuni . For Point 2, we expand IDuni by adding a new individual a to its domain ∆J and let a ∈ BritishUniversityJ and a 6∈ UniversityJ . Ontology Languages 29 Example Does every university have a student? The corresponding query is F = ∀x(University(x) → ∃ystudent at(y, x)) The certain answer to F in Duni is ‘Don’t know’. To see this we have to construct two interpretations I ∈ Mod(Duni ) and J ∈ Mod(Duni ) such that • I |= F ; • J 6|= F . For Point 2 we can take J = IDuni (since MU does not have a student in IDuni ). For Point 1, we expand IDuni to an interpretation I by adding a new individual a to its domain ∆I and let (a, MU) ∈ student atI . Ontology Languages 30 Example Output all students that are not students at any university. The corresponding query is F (x) = Student(x) ∧ ¬∃ystudent at(x, y) The set of certain answers is certanswer(F (x), Duni ) = ∅. To see this, observe that IDuni shows already that only Tom could be a certain answer. But Tom is not a certain answer since the interpretation I that expands IDuni by adding (Tom, MU) to student atI shows that there is a model of Duni in which Tom is a student at some university. Ontology Languages 31 Example Output all universities that are not British universities. The corresponding query is F (x) = University(x) ∧ ¬BritishUniversity(x) The set of answers is certanswer(F (x), Duni ) = ∅. To see this, expand IDuni by adding MU and CMU to BritishUniversityI . Then I is a model of Duni in which there is no university that is not a British university. Ontology Languages 32 The Relationship between Relational Databases and Ontologies • FOPL database querying (closed world assumption) means checking I |= F • FOPL and Description Logic ontology querying means checking T |= F • Typically, an FOPL or Description Logic ontology T has many different interpretations (many different I such that I |= T ). Data instances D have only one interpretation (under closed world assumption). • FOPL and Description Logic ontologies make the open world assumption. For example, often individuals are not mentioned at all. Ontology Languages 33