query answering with description logic ontologies Meghyn Bienvenu ( - - PowerPoint PPT Presentation

query answering with description logic ontologies
SMART_READER_LITE
LIVE PREVIEW

query answering with description logic ontologies Meghyn Bienvenu ( - - PowerPoint PPT Presentation

query answering with description logic ontologies Meghyn Bienvenu ( CNRS & Universit de Montpellier ) Magdalena Ortiz ( Vienna University of Technology ) ontology-mediated query answering (omqa) 2/29 ??? data ontology user query


slide-1
SLIDE 1

query answering with description logic

  • ntologies

Meghyn Bienvenu (CNRS & Université de Montpellier) Magdalena Ortiz (Vienna University of Technology)

slide-2
SLIDE 2
  • ntology-mediated query answering (omqa)

data incomplete database (ground facts)

  • ntology

(logical theory)

???

user query

2/29

slide-3
SLIDE 3
  • ntology-mediated query answering (omqa)

data

???

patient data

“Melanie has listeriosis” “Paul has Lyme disease”

medical knowledge

“Listeriosis & Lyme disease are bacterial infections”

user query

“Find all patients with bacterial infections”

2/29

slide-4
SLIDE 4
  • ntology-mediated query answering (omqa)

data

???

patient data

“Melanie has listeriosis” “Paul has Lyme disease”

medical knowledge

“Listeriosis & Lyme disease are bacterial infections”

user query

“Find all patients with bacterial infections”

expected answers: Melanie, Paul

2/29

slide-5
SLIDE 5
  • ntology-mediated query answering (omqa)

data

???

employee data

“Marie is a professor” “Mark teaches CS200”

  • rg. knowledge

“Professors are teaching staff” “Someone who teaches is part of the teaching staff”

user query

“Find all teaching staff”

2/29

slide-6
SLIDE 6
  • ntology-mediated query answering (omqa)

data

???

employee data

“Marie is a professor” “Mark teaches CS200”

  • rg. knowledge

“Professors are teaching staff” “Someone who teaches is part of the teaching staff”

user query

“Find all teaching staff”

expected answers: Marie, Mark

2/29

slide-7
SLIDE 7

what are ontologies good for?

To standardize the terminology of an application domain ∙ by adopting a common vocabulary, easy to share information ∙ meaning of terms is constrained, so less misunderstandings To present an intuitive and unified view of data sources ∙ ontology can be used to enrich the data vocabulary, making it easier for users to formulate their queries ∙ especially useful when integrating multiple data sources To support automated reasoning ∙ uncover implicit connections between terms, errors in modelling ∙ exploit knowledge in the ontology during query answering, to get back a more complete set of answers to queries

3/29

slide-8
SLIDE 8

what are ontologies good for?

To standardize the terminology of an application domain ∙ by adopting a common vocabulary, easy to share information ∙ meaning of terms is constrained, so less misunderstandings To present an intuitive and unified view of data sources ∙ ontology can be used to enrich the data vocabulary, making it easier for users to formulate their queries ∙ especially useful when integrating multiple data sources To support automated reasoning ∙ uncover implicit connections between terms, errors in modelling ∙ exploit knowledge in the ontology during query answering, to get back a more complete set of answers to queries

3/29

slide-9
SLIDE 9

what are ontologies good for?

To standardize the terminology of an application domain ∙ by adopting a common vocabulary, easy to share information ∙ meaning of terms is constrained, so less misunderstandings To present an intuitive and unified view of data sources ∙ ontology can be used to enrich the data vocabulary, making it easier for users to formulate their queries ∙ especially useful when integrating multiple data sources To support automated reasoning ∙ uncover implicit connections between terms, errors in modelling ∙ exploit knowledge in the ontology during query answering, to get back a more complete set of answers to queries

3/29

slide-10
SLIDE 10

applications of omqa: medicine

General medical ontologies: SNOMED CT (∼ 400,000 terms!), GALEN Specialized ontologies: FMA (anatomy), NCI (cancer), ...

Querying & exchanging medical records (find patients for medical trials) ∙ myocardial infarction vs. MI vs. heart attack vs. 410.0 Supports tools for annotating and visualizing patient data (scans, x-rays)

4/29

slide-11
SLIDE 11

applications of omqa: life sciences

Hundreds of ontologies at BioPortal (http://bioportal.bioontology.org/):

Gene Ontology (GO), Cell Ontology, Pathway Ontology, Plant Anatomy, ...

Help scientists share, query, & visualize experimental data

5/29

slide-12
SLIDE 12

applications of omqa: entreprise information systems

Companies and organizations have lots of data ∙ need easy and flexible access to support decision-making

Example industrial projects: ∙ Public debt data: Sapienza Univ. & Italian Department of Treasury ∙ Energy sector: Optique EU project (several univ, StatOil, & Siemens)

6/29

slide-13
SLIDE 13
  • ur focus: horn description logics

Ontologies formulated using description logics (DLs): ∙ family of decidable fragments of first-order logic ∙ basis for OWL web ontology language (W3C) ∙ range from fairly simple to highly expressive ∙ complexity of query answering well understood In this tutorial, focus on Horn description logics: ∙ DL-LiteR, , , Horn- , ... ∙ good computational properties, well suited for OMQA ∙ still expressive enough for interesting applications ∙ basis for OWL 2 QL and OWL 2 EL profiles Consider various types of queries

7/29

slide-14
SLIDE 14
  • ur focus: horn description logics

Ontologies formulated using description logics (DLs): ∙ family of decidable fragments of first-order logic ∙ basis for OWL web ontology language (W3C) ∙ range from fairly simple to highly expressive ∙ complexity of query answering well understood In this tutorial, focus on Horn description logics: ∙ DL-LiteR, EL, ELHI, Horn-SHIQ, ... ∙ good computational properties, well suited for OMQA ∙ still expressive enough for interesting applications ∙ basis for OWL 2 QL and OWL 2 EL profiles Consider various types of queries

7/29

slide-15
SLIDE 15

plan for tutorial ∙ Horn Description Logics ∙ Basics of OMQA ∙ Instance Queries ∙ Conjunctive Queries ∙ Navigational Queries ∙ Queries with Negation and Recursion ∙ Research Trends in OMQA ∙ Practical OMQA Systems: Ontop

8/29

slide-16
SLIDE 16

horn description logics

slide-17
SLIDE 17

dl basics

Building blocks of DLs: ∙ concept names (unary predicates, classes)

IceCream, Pizza, Meat, SpicyDish, Dish, Menu, Restaurant, ...

∙ role names (binary predicates, properties)

hasIngred, hasCourse, hasDessert, serves, ...

∙ individual names (constants)

menu32, pastadish17, d3, rest156, r12, ...

(specific menus, dishes, restaurants ...)

NC / NR / NI: set of all concept / role / individual names

10/29

slide-18
SLIDE 18

dl knowledge bases

Knowledge base (KB) = ABox (data) + TBox (ontology) ABox contains facts about specific individuals

(Ind(A): individuals appearing in ABox A)

∙ finite set of concept assertions A(a) and role assertions r(a, b) ∙ IceCream(d2): dish d2 is of type IceCream ∙ hasDessert(m, d2): menu m is connected via hasDessert to dish d2 TBox contains general knowledge about the domain of interest ∙ finite set of axioms (details on syntax to follow) ∙ IceCream is a subclass of Dessert ∙ hasCourse connects Menus to Dishes ∙ every Menu is connected to at least one dish via hasCourse

11/29

slide-19
SLIDE 19

dl knowledge bases

Knowledge base (KB) = ABox (data) + TBox (ontology) ABox contains facts about specific individuals

(Ind(A): individuals appearing in ABox A)

∙ finite set of concept assertions A(a) and role assertions r(a, b) ∙ IceCream(d2): dish d2 is of type IceCream ∙ hasDessert(m, d2): menu m is connected via hasDessert to dish d2 TBox contains general knowledge about the domain of interest ∙ finite set of axioms (details on syntax to follow) ∙ IceCream is a subclass of Dessert ∙ hasCourse connects Menus to Dishes ∙ every Menu is connected to at least one dish via hasCourse

11/29

slide-20
SLIDE 20

concept and role constructors

Can build complex concepts and roles using constructors: ∙ conjunction (⊓), disjunction (⊔), negation (¬)

Dessert ⊓ ¬IceCream Pizza ⊔ PastaDish

∙ restricted forms of existential and universal quantification ( , )

hasCourse contains Meat Dish contains Meat

( acts as a “wildcard”, denotes set of all things)

∙ inverse ( ) and composition ( ) of roles

hasCourse contains contains

(use NR for set of role names and inverse roles) (use inv r to toggle : inv r r , inv r r )

Note: set of available constructors depends on the particular DL!

12/29

slide-21
SLIDE 21

concept and role constructors

Can build complex concepts and roles using constructors: ∙ conjunction (⊓), disjunction (⊔), negation (¬)

Dessert ⊓ ¬IceCream Pizza ⊔ PastaDish

∙ restricted forms of existential and universal quantification (∃, ∀)

∃hasCourse.⊤ ∃contains.Meat Dish ⊓ ∀contains.¬Meat

( ⊤ acts as a “wildcard”, denotes set of all things)

∙ inverse ( ) and composition ( ) of roles

hasCourse contains contains

(use NR for set of role names and inverse roles) (use inv r to toggle : inv r r , inv r r )

Note: set of available constructors depends on the particular DL!

12/29

slide-22
SLIDE 22

concept and role constructors

Can build complex concepts and roles using constructors: ∙ conjunction (⊓), disjunction (⊔), negation (¬)

Dessert ⊓ ¬IceCream Pizza ⊔ PastaDish

∙ restricted forms of existential and universal quantification (∃, ∀)

∃hasCourse.⊤ ∃contains.Meat Dish ⊓ ∀contains.¬Meat

( ⊤ acts as a “wildcard”, denotes set of all things)

∙ inverse (−) and composition (·) of roles

hasCourse− contains · contains

(use N±

R for set of role names and inverse roles)

(use inv(r) to toggle −: inv(r) = r−, inv(r−) = r )

Note: set of available constructors depends on the particular DL!

12/29

slide-23
SLIDE 23

concept and role constructors

Can build complex concepts and roles using constructors: ∙ conjunction (⊓), disjunction (⊔), negation (¬)

Dessert ⊓ ¬IceCream Pizza ⊔ PastaDish

∙ restricted forms of existential and universal quantification (∃, ∀)

∃hasCourse.⊤ ∃contains.Meat Dish ⊓ ∀contains.¬Meat

( ⊤ acts as a “wildcard”, denotes set of all things)

∙ inverse (−) and composition (·) of roles

hasCourse− contains · contains

(use N±

R for set of role names and inverse roles)

(use inv(r) to toggle −: inv(r) = r−, inv(r−) = r )

Note: set of available constructors depends on the particular DL!

12/29

slide-24
SLIDE 24

tbox axioms

Concept inclusions C ⊑ D (C, D possibly complex concepts)

IceCream ⊑ Dessert Menu ⊑ ∃hasCourse.⊤ Spicy ⊓ Dish ⊑ SpicyDish

Role inclusions R ⊑ S (R, S possibly complex roles)

hasIngred ⊑ contains ingredOf− ⊑ hasIngred hasDessert ⊑ hasCourse

Note: type and syntax of axioms depends on the particular DL!

13/29

slide-25
SLIDE 25

dl semantics

Interpretation I (“possible world”) ∙ domain of objects ∆I (possibly infinite set) ∙ interpretation function ·I that maps

∙ concept name A ⇝ set of objects AI ⊆ ∆I ∙ role name r ⇝ set of pairs of objects rI ⊆ ∆I × ∆I ∙ individual name a ⇝ object aI ∈ ∆I

14/29

slide-26
SLIDE 26

example: interpretation

∆I

italFeastI chCakeI

DishI DessertI AppetizerI MenuI

hasCourse h a s C

  • u

r s e h a s C

  • u

r s e hasCourse

4 concept names: Dish, Dessert, Appetizer, Menu 1 role name: hasCourse 2 individual names: italFeast, chCake

15/29

slide-27
SLIDE 27

dl semantics

Interpretation I (“possible world”) ∙ domain of objects ∆I (possibly infinite set) ∙ interpretation function ·I that maps

∙ concept name A ⇝ set of objects AI ⊆ ∆I ∙ role name r ⇝ set of pairs of objects rI ⊆ ∆I × ∆I ∙ individual name a ⇝ object aI ∈ ∆I

Interpretation function ·I extends to complex concepts and roles:

⊤ ∆I ⊥ ∅ ¬C ∆I \ CI C1 ⊓ C2 C1

I ∩ C2 I

∃R.C {d1 | there exists (d1, d2) ∈ RI with d2 ∈ CI} ∀R.C {d1 | d2 ∈ CI for all (d1, d2) ∈ RI} r− {(d2, d1) | (d1, d2) ∈ rI}

16/29

slide-28
SLIDE 28

back to the example

∆I

italFeastI chCakeI

DishI DessertI AppetizerI MenuI

hasCourse h a s C

  • u

r s e h a s C

  • u

r s e hasCourse

Dish ⊓ Menu Dessert ⊓ Appetizer ∃hasCourse.⊤ ∃hasCourse−.Dessert

17/29

slide-29
SLIDE 29

semantics of dl kbs

Satisfaction in an interpretation ∙ I satisfies C ⊑ D ⇔ CI ⊆ DI ∙ I satisfies R ⊑ S ⇔ RI ⊆ SI ∙ satisfies A a a A ∙ satisfies r a b a b r Model of a KB = interpretation that satisfies all statements in is satisfiable = has at least one model entails (written ) = every model

  • f

satisfies

18/29

slide-30
SLIDE 30

semantics of dl kbs

Satisfaction in an interpretation ∙ I satisfies C ⊑ D ⇔ CI ⊆ DI ∙ I satisfies R ⊑ S ⇔ RI ⊆ SI ∙ I satisfies A(a) ⇔ aI ∈ AI ∙ I satisfies r(a, b) ⇔ (aI, bI) ∈ rI Model of a KB = interpretation that satisfies all statements in is satisfiable = has at least one model entails (written ) = every model

  • f

satisfies

18/29

slide-31
SLIDE 31

semantics of dl kbs

Satisfaction in an interpretation ∙ I satisfies C ⊑ D ⇔ CI ⊆ DI ∙ I satisfies R ⊑ S ⇔ RI ⊆ SI ∙ I satisfies A(a) ⇔ aI ∈ AI ∙ I satisfies r(a, b) ⇔ (aI, bI) ∈ rI Model of a KB K = interpretation that satisfies all statements in K K is satisfiable = K has at least one model K entails α (written K | = α) = every model I of K satisfies α

18/29

slide-32
SLIDE 32

back to the example

∆I

italFeastI chCakeI

DishI DessertI AppetizerI MenuI

hasCourse h a s C

  • u

r s e h a s C

  • u

r s e hasCourse

Which of the following assertions / axioms is satisfied in I? Dessert ⊑ Dish Dish ⊓ Menu ⊑ ⊥ Menu ⊑ ∃hasCourse.⊤ ∃hasCourse−.⊤ ⊑ Dish Menu(italFeast) hasCourse(italFeast, chCake)

19/29

slide-33
SLIDE 33

some important horn dls

Idea: Horn DLs cannot express disjunction (explicitly or implicitly) ∙ better computational properties than non-Horn DLs (more on this later) DL-LiteR ∙ concept inclusions B1 B2

B1 B2 either A NC or R (R NR )

∙ role inclusions R1 R2 R1 R2 NR ∙ allows only , , and r C as constructors ∙ only concept inclusions in TBox ∙ additionally allows for and inverse roles (r ) ∙ can also have role inclusions Horn- ∙ limited use of , r C, and number restrictions ( nR C, nR C) ∙ also have transitivity axioms (e.g. assert contains is transitive)

20/29

slide-34
SLIDE 34

some important horn dls

Idea: Horn DLs cannot express disjunction (explicitly or implicitly) ∙ better computational properties than non-Horn DLs (more on this later) DL-LiteR ∙ concept inclusions B1 ⊑ (¬)B2

B1, B2 either A ∈ NC or ∃R (R ∈ N±

R )

∙ role inclusions R1 ⊑ (¬)R2 R1, R2 ∈ N±

R

∙ allows only , , and r C as constructors ∙ only concept inclusions in TBox ∙ additionally allows for and inverse roles (r ) ∙ can also have role inclusions Horn- ∙ limited use of , r C, and number restrictions ( nR C, nR C) ∙ also have transitivity axioms (e.g. assert contains is transitive)

20/29

slide-35
SLIDE 35

some important horn dls

Idea: Horn DLs cannot express disjunction (explicitly or implicitly) ∙ better computational properties than non-Horn DLs (more on this later) DL-LiteR ∙ concept inclusions B1 ⊑ (¬)B2

B1, B2 either A ∈ NC or ∃R (R ∈ N±

R )

∙ role inclusions R1 ⊑ (¬)R2 R1, R2 ∈ N±

R

EL ∙ allows only ⊤, ⊓, and ∃r.C as constructors ∙ only concept inclusions in TBox ∙ additionally allows for and inverse roles (r ) ∙ can also have role inclusions Horn- ∙ limited use of , r C, and number restrictions ( nR C, nR C) ∙ also have transitivity axioms (e.g. assert contains is transitive)

20/29

slide-36
SLIDE 36

some important horn dls

Idea: Horn DLs cannot express disjunction (explicitly or implicitly) ∙ better computational properties than non-Horn DLs (more on this later) DL-LiteR ∙ concept inclusions B1 ⊑ (¬)B2

B1, B2 either A ∈ NC or ∃R (R ∈ N±

R )

∙ role inclusions R1 ⊑ (¬)R2 R1, R2 ∈ N±

R

EL ∙ allows only ⊤, ⊓, and ∃r.C as constructors ∙ only concept inclusions in TBox ELHI⊥ ∙ additionally allows for ⊥ and inverse roles (r−) ∙ can also have role inclusions Horn- ∙ limited use of , r C, and number restrictions ( nR C, nR C) ∙ also have transitivity axioms (e.g. assert contains is transitive)

20/29

slide-37
SLIDE 37

some important horn dls

Idea: Horn DLs cannot express disjunction (explicitly or implicitly) ∙ better computational properties than non-Horn DLs (more on this later) DL-LiteR ∙ concept inclusions B1 ⊑ (¬)B2

B1, B2 either A ∈ NC or ∃R (R ∈ N±

R )

∙ role inclusions R1 ⊑ (¬)R2 R1, R2 ∈ N±

R

EL ∙ allows only ⊤, ⊓, and ∃r.C as constructors ∙ only concept inclusions in TBox ELHI⊥ ∙ additionally allows for ⊥ and inverse roles (r−) ∙ can also have role inclusions Horn-SHIQ ∙ limited use of ¬, ∀r.C, and number restrictions (≥ nR.C, ≤ nR.C) ∙ also have transitivity axioms (e.g. assert contains is transitive)

20/29

slide-38
SLIDE 38

basics of omqa

slide-39
SLIDE 39

aboxes vs. databases

ABoxes and databases (DBs) and are syntactically similar: ∙ ABox = finite set of assertions (unary and binary facts) ∙ Database = finite set of facts of arbitrary arity ABoxes interpreted under open world assumption: ∙ every assertion in the ABox is assumed to hold (true) ∙ assertions not present in the ABox may hold or not (unknown) Each ABox gives rise to many interpretations (its models) ∙ models can be infinite, can have infinitely many models Databases interpreted under closed world assumption: ∙ every fact in the DB is assumed to hold (true) ∙ every fact not in the DB is assumed not to hold (false) In other words, each DB corresponds to single finite interpretation ∙ domain of the interpretation = set of constants in DB

22/29

slide-40
SLIDE 40

aboxes vs. databases

ABoxes and databases (DBs) and are syntactically similar: ∙ ABox = finite set of assertions (unary and binary facts) ∙ Database = finite set of facts of arbitrary arity ABoxes interpreted under open world assumption: ∙ every assertion in the ABox is assumed to hold (true) ∙ assertions not present in the ABox may hold or not (unknown) Each ABox gives rise to many interpretations (its models) ∙ models can be infinite, can have infinitely many models Databases interpreted under closed world assumption: ∙ every fact in the DB is assumed to hold (true) ∙ every fact not in the DB is assumed not to hold (false) In other words, each DB corresponds to single finite interpretation ∙ domain of the interpretation = set of constants in DB

22/29

slide-41
SLIDE 41

aboxes vs. databases

ABoxes and databases (DBs) and are syntactically similar: ∙ ABox = finite set of assertions (unary and binary facts) ∙ Database = finite set of facts of arbitrary arity ABoxes interpreted under open world assumption: ∙ every assertion in the ABox is assumed to hold (true) ∙ assertions not present in the ABox may hold or not (unknown) Each ABox gives rise to many interpretations (its models) ∙ models can be infinite, can have infinitely many models Databases interpreted under closed world assumption: ∙ every fact in the DB is assumed to hold (true) ∙ every fact not in the DB is assumed not to hold (false) In other words, each DB corresponds to single finite interpretation ∙ domain of the interpretation = set of constants in DB

22/29

slide-42
SLIDE 42

querying databases

Database query q of arity n maps

(Boolean query = arity 0)

Database D ⇝ ans(q, D) = set of n-tuples of constants from D Interpretation ans q set of n-tuples of elements from First-order (FO) query = first-order formula ∙ arity of FO query = number of free variables ∙ answers = substitutions for free vars that make formula hold ∙ example: Dish x y contains x y Spicy y Datalog queries = finite set of Datalog rules + ‘goal’ relation ∙ arity of Datalog query = arity of goal relation ∙ answers = exhaustively apply rules to DB / interpretation, collect tuples in goal relation ∙ example: rules contains x z contains x y contains y z and SpicyDish x Dish x contains x y Spicy y

23/29

slide-43
SLIDE 43

querying databases

Database query q of arity n maps

(Boolean query = arity 0)

Database D ⇝ ans(q, D) = set of n-tuples of constants from D Interpretation I ⇝ ans(q, I) = set of n-tuples of elements from I First-order (FO) query = first-order formula ∙ arity of FO query = number of free variables ∙ answers = substitutions for free vars that make formula hold ∙ example: Dish x y contains x y Spicy y Datalog queries = finite set of Datalog rules + ‘goal’ relation ∙ arity of Datalog query = arity of goal relation ∙ answers = exhaustively apply rules to DB / interpretation, collect tuples in goal relation ∙ example: rules contains x z contains x y contains y z and SpicyDish x Dish x contains x y Spicy y

23/29

slide-44
SLIDE 44

querying databases

Database query q of arity n maps

(Boolean query = arity 0)

Database D ⇝ ans(q, D) = set of n-tuples of constants from D Interpretation I ⇝ ans(q, I) = set of n-tuples of elements from I First-order (FO) query = first-order formula ∙ arity of FO query = number of free variables ∙ answers = substitutions for free vars that make formula hold ∙ example: Dish(x) ∧ ∀y.(contains(x, y) → ¬Spicy(y)) Datalog queries = finite set of Datalog rules + ‘goal’ relation ∙ arity of Datalog query = arity of goal relation ∙ answers = exhaustively apply rules to DB / interpretation, collect tuples in goal relation ∙ example: rules contains x z contains x y contains y z and SpicyDish x Dish x contains x y Spicy y

23/29

slide-45
SLIDE 45

querying databases

Database query q of arity n maps

(Boolean query = arity 0)

Database D ⇝ ans(q, D) = set of n-tuples of constants from D Interpretation I ⇝ ans(q, I) = set of n-tuples of elements from I First-order (FO) query = first-order formula ∙ arity of FO query = number of free variables ∙ answers = substitutions for free vars that make formula hold ∙ example: Dish(x) ∧ ∀y.(contains(x, y) → ¬Spicy(y)) Datalog queries = finite set of Datalog rules + ‘goal’ relation ∙ arity of Datalog query = arity of goal relation ∙ answers = exhaustively apply rules to DB / interpretation, collect tuples in goal relation ∙ example: rules contains(x, z) ← contains(x, y), contains(y, z) and SpicyDish(x) ← Dish(x), contains(x, y), Spicy(y)

23/29

slide-46
SLIDE 46

querying dl knowledge bases

Problem: each KB gives rise to multiple interpretations (its models), but DB query semantics defines answers w.r.t. a single interpretation Solution: adopt certain answer semantics ∙ require tuple to be an answer w.r.t. all models of KB Formally: Call a tuple a1 an of individuals from a certain answer to n-ary query q over DL KB iff a1 an ans q for every model

  • f

Question: what happens if is unsatisfiable? Ontology-mediated query answering (OMQA) = computing certain answers to queries

24/29

slide-47
SLIDE 47

querying dl knowledge bases

Problem: each KB gives rise to multiple interpretations (its models), but DB query semantics defines answers w.r.t. a single interpretation Solution: adopt certain answer semantics ∙ require tuple to be an answer w.r.t. all models of KB Formally: Call a tuple a1 an of individuals from a certain answer to n-ary query q over DL KB iff a1 an ans q for every model

  • f

Question: what happens if is unsatisfiable? Ontology-mediated query answering (OMQA) = computing certain answers to queries

24/29

slide-48
SLIDE 48

querying dl knowledge bases

Problem: each KB gives rise to multiple interpretations (its models), but DB query semantics defines answers w.r.t. a single interpretation Solution: adopt certain answer semantics ∙ require tuple to be an answer w.r.t. all models of KB Formally: Call a tuple (a1, . . . , an) of individuals from A a certain answer to n-ary query q over DL KB K = (T , A) iff (aI

1 , . . . , aI n) ∈ ans(q, I) for every model I of K

Question: what happens if is unsatisfiable? Ontology-mediated query answering (OMQA) = computing certain answers to queries

24/29

slide-49
SLIDE 49

querying dl knowledge bases

Problem: each KB gives rise to multiple interpretations (its models), but DB query semantics defines answers w.r.t. a single interpretation Solution: adopt certain answer semantics ∙ require tuple to be an answer w.r.t. all models of KB Formally: Call a tuple (a1, . . . , an) of individuals from A a certain answer to n-ary query q over DL KB K = (T , A) iff (aI

1 , . . . , aI n) ∈ ans(q, I) for every model I of K

Question: what happens if K is unsatisfiable? Ontology-mediated query answering (OMQA) = computing certain answers to queries

24/29

slide-50
SLIDE 50

querying dl knowledge bases

Problem: each KB gives rise to multiple interpretations (its models), but DB query semantics defines answers w.r.t. a single interpretation Solution: adopt certain answer semantics ∙ require tuple to be an answer w.r.t. all models of KB Formally: Call a tuple (a1, . . . , an) of individuals from A a certain answer to n-ary query q over DL KB K = (T , A) iff (aI

1 , . . . , aI n) ∈ ans(q, I) for every model I of K

Question: what happens if K is unsatisfiable? Ontology-mediated query answering (OMQA) = computing certain answers to queries

24/29

slide-51
SLIDE 51

example: certain answers

Consider the query q(x) = Dessert(x) and the DL-LiteR KB K = (T , A): T = {Cake ⊑ Dessert IceCream ⊑ Dessert hasDessert ⊑ hasCourse ∃hasCourse ⊑ Menu ∃hasDessert− ⊑ Dessert } A = {Cake(d1) IceCream(d2) Dessert(d3) hasDessert(m, d4)} Certain answers to q w.r.t. : ∙ d1 cert q

Cake d1 , Cake Dessert

∙ d2 cert q

IceCream d2 , IceCream Dessert

∙ d3 cert q

Dessert d3

∙ d4 cert q

hasDessert m d4 , hasDessert Dessert

The fifth individual m is not a certain answer: can construct model

  • f

in which m Dessert

25/29

slide-52
SLIDE 52

example: certain answers

Consider the query q(x) = Dessert(x) and the DL-LiteR KB K = (T , A): T = {Cake ⊑ Dessert IceCream ⊑ Dessert hasDessert ⊑ hasCourse ∃hasCourse ⊑ Menu ∃hasDessert− ⊑ Dessert } A = {Cake(d1) IceCream(d2) Dessert(d3) hasDessert(m, d4)} Certain answers to q w.r.t. K: ∙ d1 cert q

Cake d1 , Cake Dessert

∙ d2 cert q

IceCream d2 , IceCream Dessert

∙ d3 cert q

Dessert d3

∙ d4 cert q

hasDessert m d4 , hasDessert Dessert

The fifth individual m is not a certain answer: can construct model

  • f

in which m Dessert

25/29

slide-53
SLIDE 53

example: certain answers

Consider the query q(x) = Dessert(x) and the DL-LiteR KB K = (T , A): T = {Cake ⊑ Dessert IceCream ⊑ Dessert hasDessert ⊑ hasCourse ∃hasCourse ⊑ Menu ∃hasDessert− ⊑ Dessert } A = {Cake(d1) IceCream(d2) Dessert(d3) hasDessert(m, d4)} Certain answers to q w.r.t. K: ∙ d1 ∈ cert(q, K)

Cake(d1) ∈ A, Cake ⊑ Dessert ∈ T

∙ d2 ∈ cert(q, K)

IceCream(d2) ∈ A, IceCream ⊑ Dessert ∈ T

∙ d3 ∈ cert(q, K)

Dessert(d3) ∈ A

∙ d4 ∈ cert(q, K)

hasDessert(m, d4)∈A, hasDessert− ⊑ Dessert ∈ T

The fifth individual m is not a certain answer: can construct model

  • f

in which m Dessert

25/29

slide-54
SLIDE 54

example: certain answers

Consider the query q(x) = Dessert(x) and the DL-LiteR KB K = (T , A): T = {Cake ⊑ Dessert IceCream ⊑ Dessert hasDessert ⊑ hasCourse ∃hasCourse ⊑ Menu ∃hasDessert− ⊑ Dessert } A = {Cake(d1) IceCream(d2) Dessert(d3) hasDessert(m, d4)} Certain answers to q w.r.t. K: ∙ d1 ∈ cert(q, K)

Cake(d1) ∈ A, Cake ⊑ Dessert ∈ T

∙ d2 ∈ cert(q, K)

IceCream(d2) ∈ A, IceCream ⊑ Dessert ∈ T

∙ d3 ∈ cert(q, K)

Dessert(d3) ∈ A

∙ d4 ∈ cert(q, K)

hasDessert(m, d4)∈A, hasDessert− ⊑ Dessert ∈ T

The fifth individual m is not a certain answer: can construct model J of K in which mJ ̸∈ DessertJ

25/29

slide-55
SLIDE 55

key techniques for omqa: query rewriting

Query rewriting: Reduces problem of finding certain answers to standard DB query evaluation

(⇝ exploit existing DB systems)

+

query rewriting

+

query evaluation TBox T query ABox

q

database query q0 query answers A

Call q x a rewriting of q x and iff for every ABox and tuple a q a a ans q x ( = treat as DB) Types of rewritings: FO-rewritings (SQL), Datalog rewritings, ...

26/29

slide-56
SLIDE 56

key techniques for omqa: query rewriting

Query rewriting: Reduces problem of finding certain answers to standard DB query evaluation

(⇝ exploit existing DB systems)

+

query rewriting

+

query evaluation TBox T query ABox

q

database query q0 query answers A

Call q′(⃗ x) a rewriting of q(⃗ x) and T iff for every ABox A and tuple ⃗ a T , A | = q(⃗ a) ⇔ ⃗ a ∈ ans(q′(⃗ x), IA) (IA = treat A as DB) Types of rewritings: FO-rewritings (SQL), Datalog rewritings, ...

26/29

slide-57
SLIDE 57

key techniques for omqa: query rewriting

Query rewriting: Reduces problem of finding certain answers to standard DB query evaluation

(⇝ exploit existing DB systems)

+

query rewriting

+

query evaluation TBox T query ABox

q

database query q0 query answers A

Call q′(⃗ x) a rewriting of q(⃗ x) and T iff for every ABox A and tuple ⃗ a T , A | = q(⃗ a) ⇔ ⃗ a ∈ ans(q′(⃗ x), IA) (IA = treat A as DB) Types of rewritings: FO-rewritings (SQL), Datalog rewritings, ...

26/29

slide-58
SLIDE 58

key techniques for omqa: saturation

Saturation: Render explicit (some of) the implicit information contained in the KB, making it available for query evaluation Simple use of saturation:

(works e.g. for RDFS ontologies)

∙ use saturation to ‘complete’ the ABox by adding those assertions that are logically entailed from the KB ∙ then evaluate the query over the saturated ABox More complex uses: ∙ enrich the ABox in other ways (e.g. add new ABox individuals to witness the existential restrictions R C) ∙ combine saturation with query rewriting

27/29

slide-59
SLIDE 59

key techniques for omqa: saturation

Saturation: Render explicit (some of) the implicit information contained in the KB, making it available for query evaluation Simple use of saturation:

(works e.g. for RDFS ontologies)

∙ use saturation to ‘complete’ the ABox by adding those assertions that are logically entailed from the KB ∙ then evaluate the query over the saturated ABox More complex uses: ∙ enrich the ABox in other ways (e.g. add new ABox individuals to witness the existential restrictions R C) ∙ combine saturation with query rewriting

27/29

slide-60
SLIDE 60

key techniques for omqa: saturation

Saturation: Render explicit (some of) the implicit information contained in the KB, making it available for query evaluation Simple use of saturation:

(works e.g. for RDFS ontologies)

∙ use saturation to ‘complete’ the ABox by adding those assertions that are logically entailed from the KB ∙ then evaluate the query over the saturated ABox More complex uses: ∙ enrich the ABox in other ways (e.g. add new ABox individuals to witness the existential restrictions ∃R.C) ∙ combine saturation with query rewriting

27/29

slide-61
SLIDE 61

complexity of omqa

View OMQA as a decision problem (yes-or-no question): Problem: Q answering in L (Q a query language, L a DL) Input: An n-ary query q ∈ Q, an ABox A, a L-TBox T , and a tuple ⃗ a ∈ Ind(A)n Question: Does ⃗ a belong to cert(q, (T , A))? Combined complexity: in terms of size of whole input Data complexity: in terms of size of

  • nly

∙ view rest of input as fixed (of constant size) ∙ motivation: ABox typically much larger than rest of input Note: use to denote size of (similarly for , q , etc.)

28/29

slide-62
SLIDE 62

complexity of omqa

View OMQA as a decision problem (yes-or-no question): Problem: Q answering in L (Q a query language, L a DL) Input: An n-ary query q ∈ Q, an ABox A, a L-TBox T , and a tuple ⃗ a ∈ Ind(A)n Question: Does ⃗ a belong to cert(q, (T , A))? Combined complexity: in terms of size of whole input Data complexity: in terms of size of A only ∙ view rest of input as fixed (of constant size) ∙ motivation: ABox typically much larger than rest of input Note: use |A| to denote size of A (similarly for |T |, |q|, etc.)

28/29

slide-63
SLIDE 63

complexity classes

We will mention the following standard classes: P problems solvable in deterministic polynomial time NP problems solvable in non-det. polynomial time coNP problems whose complement is solvable in non-deterministic polynomial time LogSpace problems solvable in deterministic logarithmic space NLogSpace problems solvable in non-det. logarithmic space PSpace problems solvable in polynomial space

(note: =NPSpace)

Exp problems solvable in deterministic exponential time Another less known but important class: AC0 problems solvable by uniform family of polynomial-size constant-depth circuits Relationships between classes: AC0 LogSpace NLogSpace P NP PSpace Exp

29/29

slide-64
SLIDE 64

complexity classes

We will mention the following standard classes: P problems solvable in deterministic polynomial time NP problems solvable in non-det. polynomial time coNP problems whose complement is solvable in non-deterministic polynomial time LogSpace problems solvable in deterministic logarithmic space NLogSpace problems solvable in non-det. logarithmic space PSpace problems solvable in polynomial space

(note: =NPSpace)

Exp problems solvable in deterministic exponential time Another less known but important class: AC0 problems solvable by uniform family of polynomial-size constant-depth circuits Relationships between classes: AC0 ⊊ LogSpace ⊆ NLogSpace ⊆ P ⊆ NP ⊆ PSpace ⊆ Exp

29/29