Complete Query Answering over Horn Ontologies Using a Triple Store - - PowerPoint PPT Presentation

complete query answering over horn ontologies using a
SMART_READER_LITE
LIVE PREVIEW

Complete Query Answering over Horn Ontologies Using a Triple Store - - PowerPoint PPT Presentation

Complete Query Answering over Horn Ontologies Using a Triple Store Yujiao Zhou joint work with Yavor Nenov, Bernardo Cuenca Grau and Ian Horrocks Department of Computer Science, University of Oxford Yujiao Zhou (Oxford) Complete Query


slide-1
SLIDE 1

Complete Query Answering over Horn Ontologies Using a Triple Store

Yujiao Zhou

joint work with Yavor Nenov, Bernardo Cuenca Grau and Ian Horrocks Department of Computer Science, University of Oxford

Yujiao Zhou (Oxford) Complete Query Answering ISWC 2013 1 / 16

slide-2
SLIDE 2

Conjunctive Query Answering

An ontology O consists of a set of schema-level axioms. A dataset D consists of a set of facts (ground atoms). A conjunctive query is of the form Q( x) = ∃ y ϕ( x, y).

  • a ∈ cert(Q, O, D) iff O ∪ D |

= Q( a).

Yujiao Zhou (Oxford) Complete Query Answering ISWC 2013 2 / 16

slide-3
SLIDE 3

Running example

Oex = { SubClassOf (Animal SomeValuesFrom(eats Thing)), SubClassOf (Herbivore AllValuesFrom(eats Plant)), DisjointClasses(Herbivore Carnivore), SubClassOf (Carnivore MinCardinality(2 hasParent)) } Dex = { ClassAssertion(Animal, lion), ClassAssertion(Animal, rabbit), ClassAssertion(Herbivore, rabbit), ClassAssertion(Herbivore, sheep), PropertyAssertion(eats, sheep, grass), ClassAssertion(Carnivore, wolf ) } Qex(x) = ∃y(eats(x, y) ∧ Plant(y)) cert(Qex, Oex, Dex) = { sheep, rabbit }

Yujiao Zhou (Oxford) Complete Query Answering ISWC 2013 3 / 16

slide-4
SLIDE 4

Running example

Oex = { SubClassOf (Animal SomeValuesFrom(eats Thing)), SubClassOf (Herbivore AllValuesFrom(eats Plant)), DisjointClasses(Herbivore Carnivore), SubClassOf (Carnivore MinCardinality(2 hasParent)) } Dex = { ClassAssertion(Animal, lion), ClassAssertion(Animal, rabbit), ClassAssertion(Herbivore, rabbit), ClassAssertion(Herbivore, sheep), PropertyAssertion(eats, sheep, grass), ClassAssertion(Carnivore, wolf ) } Qex(x) = ∃y(eats(x, y) ∧ Plant(y)) cert(Qex, Oex, Dex) = { sheep, rabbit } Oex = { SubClassOf (Animal SomeValuesFrom(eats Thing)), SubClassOf (Herbivore AllValuesFrom(eats Plant)), DisjointClasses(Herbivore Carnivore), SubClassOf (Carnivore MinCardinality(2 hasParent)) } Dex = { ClassAssertion(Animal, lion), ClassAssertion(Animal, rabbit), ClassAssertion(Herbivore, rabbit), ClassAssertion(Herbivore, sheep), PropertyAssertion(eats, sheep, grass), ClassAssertion(Carnivore, wolf ) } Qex(x) = ∃y(eats(x, y) ∧ Plant(y)) Oex ∪ Dex | = Qex(sheep) cert(Qex, Oex, Dex) = { sheep, rabbit }

Yujiao Zhou (Oxford) Complete Query Answering ISWC 2013 3 / 16

slide-5
SLIDE 5

Running example

Oex = { SubClassOf (Animal SomeValuesFrom(eats Thing)), SubClassOf (Herbivore AllValuesFrom(eats Plant)), DisjointClasses(Herbivore Carnivore), SubClassOf (Carnivore MinCardinality(2 hasParent)) } Dex = { ClassAssertion(Animal, lion), ClassAssertion(Animal, rabbit), ClassAssertion(Herbivore, rabbit), ClassAssertion(Herbivore, sheep), PropertyAssertion(eats, sheep, grass), ClassAssertion(Carnivore, wolf ) } Qex(x) = ∃y(eats(x, y) ∧ Plant(y)) cert(Qex, Oex, Dex) = { sheep, rabbit } Oex = { SubClassOf (Animal SomeValuesFrom(eats Thing)), SubClassOf (Herbivore AllValuesFrom(eats Plant)), DisjointClasses(Herbivore Carnivore), SubClassOf (Carnivore MinCardinality(2 hasParent)) } Dex = { ClassAssertion(Animal, lion), ClassAssertion(Animal, rabbit), ClassAssertion(Herbivore, rabbit), ClassAssertion(Herbivore, sheep), PropertyAssertion(eats, sheep, grass), ClassAssertion(Carnivore, wolf ) } Qex(x) = ∃y(eats(x, y) ∧ Plant(y)) Oex ∪ Dex | = Qex(rabbit) cert(Qex, Oex, Dex) = { sheep, rabbit }

Yujiao Zhou (Oxford) Complete Query Answering ISWC 2013 3 / 16

slide-6
SLIDE 6

Background

OWL 2

High computational complexity Limited scalability of OWL 2 reasoner

Lightweight profiles, e.g. OWL 2 RL

Polynomial data complexity

Scalable triple stores: OWLim, Oracle’s RDF Semantic Graph, RDFox . . .

Restrictions on expressivity

Disjunctive and existential axioms

Yujiao Zhou (Oxford) Complete Query Answering ISWC 2013 4 / 16

slide-7
SLIDE 7

Approach Overview

OWL 2 RL reasoner - most workload

1 Compute lower and upper bounds for query answers;1 2

∗Extract relavant part to resolve answers in the gap;

OWL 2 reasoner - as little work as possible

3 Check the answers in the gap with the relevant fragment. 1Yujiao Zhou et al. “Making the Most of your Triple Store: Query Answering

in OWL 2 Using an RL Reasoner”. In: WWW. 2013.

Yujiao Zhou (Oxford) Complete Query Answering ISWC 2013 5 / 16

slide-8
SLIDE 8

Lower and upper bounds of query answers

Lower Bounds

OL: RL fragment of O OL ⊆ O Property: cert(Q, OL, D) ⊆ cert(Q, O, D) Example

Oex

L = { SubClassOf (Herbivore AllValuesFrom(eats Plant))

DisjointClasses(Herbivore Carnivore) } Dex = { ClassAssertion(Animal, lion), ClassAssertion(Animal, rabbit), ClassAssertion(Herbivore, rabbit), ClassAssertion(Herbivore, sheep), PropertyAssertion(eats, sheep, grass), ClassAssertion(Carnivore, wolf ) } Qex(x) = ∃y(eats(x, y) ∧ Plant(y)) cert(Qex, Oex

L , Dex) = { sheep } Yujiao Zhou (Oxford) Complete Query Answering ISWC 2013 6 / 16

slide-9
SLIDE 9

Lower and upper bounds of query answers

Upper Bounds

Over-approximate O to an RL ontology OU, s.t. OU | = O Property cert(Q, O, D) ⊆ cert(Q, OU, D) Disjunctive axioms: disjunctions → conjunctions.

SubClassOf (Mammal UnionOf (Herbivore Carnivore)) SubClassOf (Mammal IntersectionOf (Herbivore Carnivore))

Existential axioms: skolemisation by fresh individuals.

SubClassOf (Animal SomeValuesFrom(eats Thing)) SubClassOf (Animal HasValue(eats c))

Yujiao Zhou (Oxford) Complete Query Answering ISWC 2013 7 / 16

slide-10
SLIDE 10

Lower and upper bounds of query answers

Upper Bounds

Over-approximate O to an RL ontology OU, s.t. OU | = O Property cert(Q, O, D) ⊆ cert(Q, OU, D) Disjunctive axioms: disjunctions → conjunctions.

SubClassOf (Mammal UnionOf (Herbivore Carnivore)) SubClassOf (Mammal IntersectionOf (Herbivore Carnivore))

Existential axioms: skolemisation by fresh individuals.

SubClassOf (Animal SomeValuesFrom(eats Thing)) SubClassOf (Animal HasValue(eats c)) Oex = { SubClassOf (Animal SomeValuesFrom(eats Thing)), SubClassOf (Herbivore AllValuesFrom(eats Plant)), DisjointClasses(Herbivore Carnivore), SubClassOf (Carnivore MinCardinality(2 hasParent)) } Dex = { ClassAssertion(Animal, lion), ClassAssertion(Animal, rabbit), ClassAssertion(Herbivore, rabbit), ClassAssertion(Herbivore, sheep), PropertyAssertion(eats, sheep, grass), ClassAssertion(Carnivore, wolf ) } Qex(x) = ∃y(eats(x, y) ∧ Plant(y))

Yujiao Zhou (Oxford) Complete Query Answering ISWC 2013 7 / 16

slide-11
SLIDE 11

Lower and upper bounds of query answers

Upper Bounds

Over-approximate O to an RL ontology OU, s.t. OU | = O Property cert(Q, O, D) ⊆ cert(Q, OU, D) Disjunctive axioms: disjunctions → conjunctions.

SubClassOf (Mammal UnionOf (Herbivore Carnivore)) SubClassOf (Mammal IntersectionOf (Herbivore Carnivore))

Existential axioms: skolemisation by fresh individuals.

SubClassOf (Animal SomeValuesFrom(eats Thing)) SubClassOf (Animal HasValue(eats c)) Oex

U = { SubClassOf (Animal HasValue(eats c)),

SubClassOf (Herbivore AllValuesFrom(eats Plant)), DisjointClasses(Herbivore Carnivore), SubClassOf (Carnivore HasValue(hasParent c1)), SubClassOf (Carnivore HasValue(hasParent c2)), DifferentFrom(c1 c2) } Dex = { ClassAssertion(Animal, lion), ClassAssertion(Animal, rabbit), ClassAssertion(Herbivore, rabbit), ClassAssertion(Herbivore, sheep), PropertyAssertion(eats, sheep, grass), ClassAssertion(Carnivore, wolf ) } Qex(x) = ∃y(eats(x, y) ∧ Plant(y)) cert(Qex, Σex

U , Dex) = { sheep, rabbit, lion } Yujiao Zhou (Oxford) Complete Query Answering ISWC 2013 7 / 16

slide-12
SLIDE 12

Lower and upper bounds of query answers

Lower & Upper Bounds

  

  • a ∈ cert(Q, O, D)
  • a ∈ cert(Q, OL, D)

sheep

  • a ∈ cert(Q, O, D)
  • a ∈ cert(Q, OU, D)

wolf

Yujiao Zhou (Oxford) Complete Query Answering ISWC 2013 8 / 16

slide-13
SLIDE 13

Lower and upper bounds of query answers

Lower & Upper Bounds

  

  • a ∈ cert(Q, O, D)
  • a ∈ cert(Q, OL, D)

sheep

  • a ∈ cert(Q, O, D)
  • a ∈ cert(Q, OU, D)

wolf ???

  • a ∈ cert(Q, OU, D) \ cert(Q, OL, D)

rabbit, lion

Yujiao Zhou (Oxford) Complete Query Answering ISWC 2013 8 / 16

slide-14
SLIDE 14

Lower and upper bounds of query answers

Lower & Upper Bounds

  

  • a ∈ cert(Q, O, D)
  • a ∈ cert(Q, OL, D)

sheep

  • a ∈ cert(Q, O, D)
  • a ∈ cert(Q, OU, D)

wolf ???

  • a ∈ cert(Q, OU, D) \ cert(Q, OL, D)

rabbit, lion Computed by the same OWL 2 RL reasoner efficiently.

Yujiao Zhou (Oxford) Complete Query Answering ISWC 2013 8 / 16

slide-15
SLIDE 15

Computing ontology and dataset fragments

Main Intuition

Two questions: how Qex(rabbit), Qex(lion) are obtained from Oex

U ∪ Dex;

if they can be derived from Oex ∪ Dex in an analogical way.

Yujiao Zhou (Oxford) Complete Query Answering ISWC 2013 9 / 16

slide-16
SLIDE 16

Computing ontology and dataset fragments

Main Intuition

Two questions: how Qex(rabbit), Qex(lion) are obtained from Oex

U ∪ Dex;

if they can be derived from Oex ∪ Dex in an analogical way.

A proof of Qex(rabbit) in Oex

U ∪ D

ClassAssertion(Animal rabbit) SubClassOf (Animal HasValue(eats c)) eats(rabbit, c) ClassAssertion(Herbivore rabbit) SubClassOf (Herbivore AllValuesFrom(eats Plant)) Plant(c) {corresponding axioms in O ∪ D} | = Qex(rabbit) ClassAssertion(Animal rabbit) SubClassOf (Animal SomeValuesFrom(eats Thing)) ClassAssertion(Herbivore rabbit) SubClassOf (Herbivore AllValuesFrom(eats Plant))

Yujiao Zhou (Oxford) Complete Query Answering ISWC 2013 9 / 16

slide-17
SLIDE 17

Computing ontology and dataset fragments

Main Intuition

Two questions: how Qex(rabbit), Qex(lion) are obtained from Oex

U ∪ Dex;

if they can be derived from Oex ∪ Dex in an analogical way.

A proof of Qex(lion) in Oex

U ∪ D

ClassAssertion(Animal rabbit) SubClassOf (Animal HasValue(eats c)) eats(rabbit, c) ClassAssertion(Herbivore rabbit) SubClassOf (Herbivore AllValuesFrom(eats Plant)) Plant(c) ClassAssertion(Animal lion) SubClassOf (Animal HasValue(eats c)) eats(lion, c) {corresponding axioms in O ∪ D} | = Qex(lion) ClassAssertion(Animal rabbit) SubClassOf (Animal SomeValuesFrom(eats Thing)) ClassAssertion(Herbivore rabbit) SubClassOf (Herbivore AllValuesFrom(eats Plant)) ClassAssertion(Animal lion)

Yujiao Zhou (Oxford) Complete Query Answering ISWC 2013 9 / 16

slide-18
SLIDE 18

Computing ontology and dataset fragments

Main Intuition

Given a tuple a in the gap, find ALL the proofs of Q( a) in OU ∪ D; “trace back” the proofs into fragments Of ⊆ O and Df ⊆ D.

  • a ∈ cert(Q, O, D) iff

a ∈ cert(Q, Of , Df ) for each a in the gap

Yujiao Zhou (Oxford) Complete Query Answering ISWC 2013 10 / 16

slide-19
SLIDE 19

Computing ontology and dataset fragments

Main Intuition

Given a tuple a in the gap, find ALL the proofs of Q( a) in OU ∪ D; “trace back” the proofs into fragments Of ⊆ O and Df ⊆ D.

  • a ∈ cert(Q, O, D) iff

a ∈ cert(Q, Of , Df ) for each a in the gap

G ex = { rabbit, lion } Oex = { SubClassOf (Animal SomeValuesFrom(eats Thing)), SubClassOf (Herbivore AllValuesFrom(eats Plant)), DisjointClasses(Herbivore Carnivore), SubClassOf (Carnivore MinCardinality(2 hasParent)) } Dex = { ClassAssertion(Animal lion), ClassAssertion(Animal rabbit), ClassAssertion(Herbivore rabbit), ClassAssertion(Herbivore sheep), PropertyAssertion(eats sheep grass), ClassAssertion(Carnivore wolf ) } Qex(x) = ∃y(eats(x, y) ∧ Plant(y)) Of ∪ Df | = Qex(rabbit) but Of ∪ Df | = Qex(lion)

Yujiao Zhou (Oxford) Complete Query Answering ISWC 2013 10 / 16

slide-20
SLIDE 20

Calling OWL 2 Reasoner

OWL 2 Reasoner

To verify if the extracted fragments validate Q( a) for each a in the gap: cert(Q, O, D) = cert(Q, OL, D) ∪ { a in the gap | Of ∪ Df | = Q( a)}. Example

Of ∪ Df | = Qex(rabbit) but Of ∪ Df | = Qex(lion) cert(Qex, Oex, Dex) = cert(Qex, Oex

L , Dex) ∪ {rabbit} = {sheep, rabbit} Yujiao Zhou (Oxford) Complete Query Answering ISWC 2013 11 / 16

slide-21
SLIDE 21

Evaluation

Datasets

Lehigh University Benchmark (LUBM) Generated queries Fly Anatomy (FLY) A realistic and complex ontology describing the anatomy of flies.

Yujiao Zhou (Oxford) Complete Query Answering ISWC 2013 12 / 16

slide-22
SLIDE 22

Evaluation

Results

  • n LUBM40 with |O| = 93 and |D| = 4, 000, 000

Query |G| |Of | |Df | time(s) M1 39 6 29,041 60.7 M2 1 6 29,004 42.1 M3 16 6 29,054 47.6 M4 30 6 29,032 60.2 M5 4 6 29,010 64.3 M6 29 10 87,209 3,339.4 M7 15 6 29,033 60.7 M8 14 6 29,038 52.2 M9 10 12 86,785 886.7 S 39 12 29,041 2,126.5

Yujiao Zhou (Oxford) Complete Query Answering ISWC 2013 13 / 16

slide-23
SLIDE 23

Evaluation

Scalability

  • n LUBM1 – LUBM40

500 1000 1500 2000 2500 3000 3500 4000 10 20 30 40 20 40 60 80 100 120 Total time (s) Memory usage (G) The number of universities M1_time M1_mem M6_time M6_mem M9_time M9_mem S_time S_mem

Results of the other queries are very similar to that of M1.

Yujiao Zhou (Oxford) Complete Query Answering ISWC 2013 14 / 16

slide-24
SLIDE 24

Evaluation

Results

  • n FLY with |O| = 144, 407 and |D| = 6, 308

Query |G| |Of | |Df | time(s) HermiT(s) Q1 803 224 4,515 155.2 3,465.9 Q2 342 224 4,054 114.0 3,179.0 Q3 28 217 3,712 92.3 5,863.3 Q4 25 233 3,762 99.2 2,944.3 Q5 518 222 3,712 124.6 3,243.7

Yujiao Zhou (Oxford) Complete Query Answering ISWC 2013 15 / 16

slide-25
SLIDE 25

Evaluation

Conclusion

Q, O, D G Of , Df

  • a ∈ cert(Q, O, D) iff

a ∈ cert(Q, Of , Df ) for each a ∈ G Future Work To extend the work to OWL 2 ontologies To improve the scalability by datalog encoding Other optimisations, e.g. summarisation, improvement of lower & upper bounds.

Yujiao Zhou (Oxford) Complete Query Answering ISWC 2013 16 / 16

slide-26
SLIDE 26

Backward Chaining Algorithm

Tabling technique

Objective: to ensure the termination of finding out all proofs;

Tree 1 Tree 2

P(c) e(r, y)∧P(y)

. . .

Answer y=c ... Leaf1 ... Solution Nodes Answer table Goal e(r,x)∧P(x) P(c) Tree 1 Tree 2 Tree ... ... Goal table D1 P(c)∧A(r) y=c Leaf1 Root ... ... P(c) A(r)

. . .

rule sub-answer Yujiao Zhou (Oxford) Complete Query Answering ISWC 2013 1 / 4

slide-27
SLIDE 27

Backward Chaining Algorithm

Pruning with lower and upper bounds

Before backward chaining on a node labeled with a goal P, we check P both in the lower and upper bounds. Upper bounds: cert(P, OU, D) = ∅; Lower bounds: P is ground and cert(P, OL, D) = ∅.

Yujiao Zhou (Oxford) Complete Query Answering ISWC 2013 2 / 4

slide-28
SLIDE 28

Results

  • n LUBM40 with |O| = 93 and |D| = 4, 000, 000

Yujiao Zhou (Oxford) Complete Query Answering ISWC 2013 3 / 4

slide-29
SLIDE 29

Results

  • n FLY with |O| = 144, 407 and |D| = 6, 308

Yujiao Zhou (Oxford) Complete Query Answering ISWC 2013 4 / 4