uniform evaluation of nonmonotonic dl-programs - epcl-study… · uniform evaluation of...

77

Upload: phungcong

Post on 13-May-2018

225 views

Category:

Documents


7 download

TRANSCRIPT

Uniform Evaluation of Nonmonotonic DL-Programs

Thomas Eiter

joint work with T. Krennwallner, P. Schneider, G. Xiao

Institut für Informationsysteme, TU Wien

[email protected]

EPCL Training Camp, Dresden, December 21, 2012

Austrian Science Fund (FWF) grant P20840, P20841

ICT Ontorule (FP7 231875)

1/64

Uniform DL-Program Evaluation 1. Introduction

Background: Semantic Web (W3C)

RDF (Resource Description Framework) is the data modelRDFS (Schema) enriches RDF by simple taxonomies and hierarchiesMore expressive: OWL (Web Ontology Language) (2004; 2009)• strongly builds on Description Logics

Rule languages: Rule Interchange Format (RIF) (2010)

T. Eiter/TU Wien EPCL 21.12.2012 2/64

Uniform DL-Program Evaluation 1. Introduction

Combining Rules and Ontologies

Major Issue: combining rules and ontologies (logic framework)

Logic Programming and ontology formalisms like RDF/s, OWL resp.Description Logics have related yet di�erent underlying settings

At the heart, the di�erence is between LP and Classical logic

This makes combination non-trivial

Main Di�erences:

• Closed vs. Open World Assumption (CWA vs. OWA)

• Negation as failure, strong negation vs. classical negation

• Unique names assumption (UNA), treatment of equality

supplier branch address

Barrilla Roma Piazza Espagna 1DeCecco Milano Via Cadorno 2Barilla Roma Via Salaria 10

T. Eiter/TU Wien EPCL 21.12.2012 3/64

Uniform DL-Program Evaluation 1. Introduction

Some Approaches

Hybrid knowledge base: KB = (L,P )• L is an ontology

Father ≡Man u ∃hasChild.Human

• P is the rules part (program)

rich(X)← famous(X),not scientist(X)

Proposals:

• Description Logic Programs [Grosof et al., 2003]• DL-safe rules [Motik et al., 2005]• r-hybrid KBs [Rosati, 2005]• MKNF KBs [Motik and Rosati, 2007]• Description Logic Rules [Krötzsch et al., 2008a]• ELP [Krötzsch et al., 2008b]• DL+log [Rosati, 2006]• SWRL [Horrocks et al., 2004]• dl-programs [E_et al., 2008b]

T. Eiter/TU Wien EPCL 21.12.2012 4/64

Uniform DL-Program Evaluation 1. Introduction

dl-Programs

An extension of answer set programs with queries to DL knowledge

bases (KBs) (through dl-atoms) [E_et al., 2008b]

dl-atoms allow to query a DL knowledge base di�erently

bidirectional �ow of information, with clean technical separation ofDL engine and ASP solver (�loose coupling�)

DL EngineASP Solver ?

Use dl-programs as �glue� for combining inferences on a DL KB.

System Prototypes

• NLP-DL http://www.kr.tuwien.ac.at/research/systems/semweblp/

• #F-Logic programs (Ontoprise, extension to F-logic programs)

T. Eiter/TU Wien EPCL 21.12.2012 5/64

Uniform DL-Program Evaluation 1. Introduction

Loose Coupling - Features

Advantage:

• Clean semantics, can use legacy systems• Fairly easy to incorporate further knowledge formats(e.g. RDF)

• Privacy, information hiding

Rules

Ontology

dl-atom 1

dl-atom 2

RuleReasoner

OntologyReasoner

Hybrid Reasoner

Drawback: impedance mismatch, performance

• Evaluation of dl-program needs multiple calls of aDL-reasoner

• Calls are expensive

optimizations (caching, pruning ...)

• In some case, exponentially many calls might beunavoidable

• Even polynomially many calls might be too costly

T. Eiter/TU Wien EPCL 21.12.2012 6/64

Uniform DL-Program Evaluation 1. Introduction

Uniform Evaluation

Convert the evaluation problem into one for a singlereasoning engine

L-formulasLogic LReasoner

This means to transform a dl-program into an (equivalent) knowledgebase in one formalism L for evaluation (uniform evaluation)

Note: uniform evaluation is di�erent from tight integration of KBs ina single unifying logic

T. Eiter/TU Wien EPCL 21.12.2012 7/64

Uniform DL-Program Evaluation 1. Introduction

Issues

This idea of a �uniform evaluation� approach raises several issues:

1) Cost of a transformation

Reduction of conjunctive queries over DL-Lite ontologies to• �rst-order (FO) Logic [Calvanese et al., 2007]• non-recursive Datalog [Gottlob and Schwentick, 2011]

Reduction of SHIQ to disj. datalog [Hustadt et al., 2007].

2) Existence of a transformation (possibly under constraints)

Embedding of a formalism into anotherProperties (e.g. modularity [Janhunen, 1999])Embedding of dl-programs e.g. into AEL [de Bruijn et al., 2008],Equilibrium Logic [Fink and Pearce, 2010], MKNF [Motik andRosati, 2010], Default Logic [Wang et al., 2011]

3) Complexity of the target formalism (data complexity)

4) Feasibility of transformations for practical concerns

T. Eiter/TU Wien EPCL 21.12.2012 8/64

Uniform DL-Program Evaluation 1. Introduction

Roadmap

Uniform evaluation of various fragments of dl-programs has beenconsidered at the KBS group of TU Wien;

Review some of this work with a focus on items 1 and 4 from above,and reports some experimental data.

1. Introduction X

2. Nonmonotonic dl-Programs

3. FO-Rewritability

4. Datalog-Rewritability

5. Conclusion

T. Eiter/TU Wien EPCL 21.12.2012 9/64

Uniform DL-Program Evaluation 2. Nonmonotonic DL-Programs 2.1 Description Logic Ontologies

Ontologies

Knowledge about concepts, individuals, their properties and relationships

W3C standard (04/2004): Web Ontology Language (OWL)

Three increasingly expressive sublanguages

• OWL Lite: Concept hierarchies,simple constraint features. ( SHIF(D))

• OWL DL : Basically, DAML+OIL. ( SHOIN (D))

• OWL Full: Allow e.g. to treat classes as individuals.

OWL2 (2009): tractable pro�les OWL2 EL, OWL2 QL, OWL2 RL

OWL syntax is based on RDF

T. Eiter/TU Wien EPCL 21.12.2012 10/64

Uniform DL-Program Evaluation 2. Nonmonotonic DL-Programs 2.1 Description Logic Ontologies

Description Logics (DLs)

Description Logics o�er more expressivity than RDF/S!

The vocabulary of basic DLs comprises:

• Concepts (e.g., Wine, WhiteWine)• Roles (e.g., hasMaker, madeFromGrape)• Individuals (e.g., SelaksIceWine, TaylorPort)

Statements relate individuals and their properties using

• logical connectives (u, t, ¬, v, etc), and• quanti�ers (∃, ∀, ≤k, ≥k, etc)

A DL knowledge L = (T ,A) base usually comprises

• a TBox T (terminology, conceptualization), and• an ABox A (assertions, extensional knowledge)

DLs are tailored for decidable reasoning (key task: satis�ability)

T. Eiter/TU Wien EPCL 21.12.2012 11/64

Uniform DL-Program Evaluation 2. Nonmonotonic DL-Programs 2.1 Description Logic Ontologies

Example: The Wine Ontology

Available at http://www.w3.org/TR/owl-guide/wine.rdf

owl:Thing

Wine Region

Red

Wine

White

Wine

locatedIn

WineDescriptor

WineTaste

WineFlavor

hasFlavor

T. Eiter/TU Wien EPCL 21.12.2012 12/64

Uniform DL-Program Evaluation 2. Nonmonotonic DL-Programs 2.1 Description Logic Ontologies

Example: The Wine Ontology /2

Some axioms from the TBox

Wine v PotableLiquid u =1hasMaker u ∀hasMaker .Winery ;

∃hasColor−.Wine v {”White”, ”Rose”, ”Red”};WhiteWine ≡ Wine u ∀hasColor .{”White”}.

• A wine is a potable liquid, having exactly one maker, who is amember of the class �Winery�.

• Wines have colors �White�, �Rose�, or �Red �.

• A WhiteWine is a wine with exclusive color �White�.

The ABox contains, e.g.,

WhiteWine(”StGenevieveTexasWhite”),hasMaker(”TaylorPort”, ”Taylor”)

T. Eiter/TU Wien EPCL 21.12.2012 13/64

Uniform DL-Program Evaluation 2. Nonmonotonic DL-Programs 2.1 Description Logic Ontologies

Formal OWL / DL Semantics

The semantics of core DLs is given by a mapping to �rst-order logicIn many DLs, basic reasoning tasks can be reduced to core DLs

In essence, DLs are FO logic in disguise

OWL property axioms as RDF Triples DL syntax FOL short representation

〈P rdfs:domain C〉 > v ∀P−.C ∀x, y.P (x, y) ⊃ C(x)〈P rdfs:range C〉 > v ∀P.C ∀x, y.P (x, y) ⊃ C(y)

〈P owl:inverseOf P0〉 P ≡ P−0 ∀x, y.P (x, y) ≡ P0(y, x)

〈P rdf:type owl:SymmetricProperty 〉 P ≡ P− ∀x, y.P (x, y) ≡ P (y, x)〈P rdf:type owl:FunctionalProperty 〉 > v6 1P ∀x, y1, y2.P (x, y1)∧P (x, y2)⊃ y1=y2〈P rdf:type owl:TransitiveProperty 〉 P+ v P ∀x, y, z.P (x, y) ∧ P (y, z) ⊃ P (x, z)

OWL complex class descriptions DL syntax FOL short representation

owl:Thing > x = x

owl:Nothing ⊥ ¬x = x

owl:intersectionOf (C1 . . . Cn) C1u. . .uCn∧

Ci(x)

owl:unionOf (C1 . . . Cn) C1t. . .tCn∨

Ci(x)

owl:complementOf (C) ¬C ¬C(x)

owl:oneOf (o1 . . . on) {o1 . . . on}∨

x = oiowl:restriction (P owl:someValuesFrom (C)) ∃P.C ∃y.P (x, y) ∧ C(y)

owl:restriction (P owl:allValuesFrom (C)) ∀P.C ∀y.P (x, y) ⊃ C(y)

owl:restriction (P owl:value (o)) ∃P.{o} P (x, o)

owl:restriction (P owl:minCardinality (n)) >nP ∃ni=1yi.∧n

j=1 P (x, yj)∧∧

i6=j yi 6=yj

T. Eiter/TU Wien EPCL 21.12.2012 14/64

Uniform DL-Program Evaluation 2. Nonmonotonic DL-Programs 2.2 DL atoms

dl-atoms

Basic Idea:

Query the DL KB L using the query interface of the DL engine

Query Q may be concept/role instance C(X)/R(X,Y );subsumption test C v D; etc (recent extension: conjunctive queries)

Important: Possible to modify the extensional part (ABox) of L, byadding positive (]) or negative (−∪) assertions, before querying

Q evaluates to true i� the modi�ed L proves Q.

T. Eiter/TU Wien EPCL 21.12.2012 15/64

Uniform DL-Program Evaluation 2. Nonmonotonic DL-Programs 2.2 DL atoms

dl-atoms: Examples

Wine ontology

owl:Thing

Wine Region

Red

Wine

White

Wine

locatedIn

WineDescriptor

WineTaste

WineFlavorhasFlavor

DL[Wine](“ChiantiClassico”)

DL[Wine](X)

DL[DryWine ] dry ;Wine](W )

add all assertions DryWine(c) to L, such that dry(c) holds.

T. Eiter/TU Wien EPCL 21.12.2012 16/64

Uniform DL-Program Evaluation 2. Nonmonotonic DL-Programs 2.2 DL atoms

dl-Atoms: Syntax

A dl-atom has the form

DL[S1op1p1, . . . , Smopm pm;Q](t) , m ≥ 0,

where

each Si is either a concept or a role

opi ∈ {], −∪},pi is a unary resp. binary predicate (input predicate),

Q(t) is a DL query (t contains variables and/or constants).

Intuitively:opi = ] increases Si by pi.opi = −∪ increases ¬Si by pi.

Shorthand: λ = S1op1p1, . . . , Smopmpm

T. Eiter/TU Wien EPCL 21.12.2012 17/64

Uniform DL-Program Evaluation 2. Nonmonotonic DL-Programs 2.3 DL Queries

dl-Queries

A DL query Q(t) is one of

(a) a concept inclusion axiom C v D, or its negation¬(C v D),

(b) C(t) or ¬C(t), for a concept C and term t, or

(c) R(t1, t2) or ¬R(t1, t2), for a role R and terms t1, t2.

Remarks:

Further �update operators� can be considered (−∩)

Further queries are conceivable (e.g., union of conjunctive queries[E_et al., 2008a])

The queries above are standard queries.

T. Eiter/TU Wien EPCL 21.12.2012 18/64

Uniform DL-Program Evaluation 2. Nonmonotonic DL-Programs 2.4 DL Programs

dl-Programs

dl-programs are hybrid KBs with dl-atoms in rules

De�nition (DL-Program)

A dl-program is a pair KB = (L,P ) where

L is a DL knowledge base

P consists of dl-rules

a← b1, . . . , bk,not bk+1, . . . ,not bm,

m > 0, where• a is an atom,• b1, . . . , bm, m ≥ 0, are atoms or dl-atoms (no function symbols).

T. Eiter/TU Wien EPCL 21.12.2012 19/64

Uniform DL-Program Evaluation 2. Nonmonotonic DL-Programs 2.5 Answer Sets

Semantics

HBΦP : Set of all ground (classical) atoms with predicate symbol

in P and constants C from �nite relational alphabet Φ.

Constants C: those in P and (all) individuals in the ABox of L.

Herbrand interpretation: subset I ⊆ HBΦP

De�nition (Satisfaction)

• I satis�es a classical ground atom a (I |=L a), i� a ∈ I;

• I satis�es a ground dl-atom α = DL[λ;Q](c) (I |=L α) i�

L ∪A1(I) ∪ · · · ∪Am(I) |= Q(c), where

Ai(I) = {Si(e) | pi(e) ∈ I}, for opi = ];Ai(I) = {¬Si(e) | pi(e) ∈ I}, for opi = −∪.

I is a model of KB = (L,P ) if it satis�es each rule in grnd(P ) as usual

T. Eiter/TU Wien EPCL 21.12.2012 20/64

Uniform DL-Program Evaluation 2. Nonmonotonic DL-Programs 2.5 Answer Sets

Examples

Suppose L |= Wine(“TaylorPort”), and I containswineBottle(“TaylorPort”)

Then I |=L DL[“Wine”](“TaylorPort”) and

I |=L wineBottle(“TaylorPort”) ← DL[“Wine”](“TaylorPort”)

Suppose I = {white(“siw”), not_dry(“siw”)}.ThenI |=L DL[“WhiteWine” ] white, “DryWine”−∪not_dry ; “Wine”](“siw”)

T. Eiter/TU Wien EPCL 21.12.2012 21/64

Uniform DL-Program Evaluation 2. Nonmonotonic DL-Programs 2.5 Answer Sets

Answer Sets

Use a reduct KBI akin to the Gelfond-Lifschitz reduct P I

In building KBI , treat dl-atoms like ordinary atoms:

De�nition (Reduct KBI of KB = (L,P ))

KBI contains all rules obtained from grnd(P ) by removing

(i) all rule instances

a← b1, . . . , bk,not bk+1, . . . ,not bm

such that I |=L bj for some bj , k < j ≤ m, and

(ii) all literals not bj from the remaining rules.

De�nition (Answer set)

I is a (strong) answer set of KB i� I is the least model of KBI .

T. Eiter/TU Wien EPCL 21.12.2012 22/64

Uniform DL-Program Evaluation 2. Nonmonotonic DL-Programs 2.5 Answer Sets

Example: Reviewer selection [E_et al., 2008b] (adapted)

paper(p1); kw(p1, ”Semantic_Web”); (1)

paper(p2); kw(p2, ”Bioinformatics”); kw(p2,ASP); (2)

kw(P,K2)← kw(P,K1), DL[hasMember ](S,K1),DL[hasMember ](S,K2);

(3)

paperArea(P,A)← DL[keywords ] kw ; inArea](P,A); (4)

cand_rev(X,P )← paperArea(P,A), DL[CandidateReviewer ](X),DL[expert ](X,A);

(5)

assign(X,P )← cand_rev(X,P ),not unassign(X,P ); (6)

unassign(Y, P )← cand_rev(Y, P ), assign(X,P ), X 6= Y ; (7)

has_rev(P )← assign(X,P ); (8)

error(P )← paper(P ),not has_rev(P ). (9)

Determine paper area with enhanced keyword info (key word clusters) (3), (4)

Use ontology to determine candidate reviewers (5)

(6)�(9) is a plain ASP selection program (choose one cand_rev per paper)

T. Eiter/TU Wien EPCL 21.12.2012 23/64

Uniform DL-Program Evaluation 2. Nonmonotonic DL-Programs 2.5 Answer Sets

Reviewer selection (ctd.)

Answer sets of KB depend on the instances of hasMember , keywords,inArea, expert CandidateReviewer

Suppose in L expert(jim,”A1”), expert(tim,”A1”), expert(sue,”A2”)

ReviewerCandidate(jim), ReviewerCandidate(tim),

ReviewerCandidate(sue,”LP”), hasMember(c1, ”ASP”),

hasMember(c1, ”LP”) are true (named clusters)

Further, that inArea(p1,”A1”) is true and inArea(p2,”A2”) is true afterasserting keywords(p2,”LP”).

M =(1), (2), kw(p2, ”LP”), paperArea(p1, ”A1”), paperArea(p2, ”A2”),cand_rev(p1, jim), cand_rev(p1, tim), cand_rev(p2, sue),assign(jim, p1), unassign(tim, p1), assign(sue, p2),has_rev(p1), has_rev(p2)

is an answer set of KB.

T. Eiter/TU Wien EPCL 21.12.2012 24/64

Uniform DL-Program Evaluation 2. Nonmonotonic DL-Programs 2.5 Answer Sets

Example: Reviewer selection (ctd.) /2

M = { (1), (2), kw(p2, ”LP”), paperArea(p1, ”A1”), paperArea(p2, ”A2”),

cand_rev(p1, jim), cand_rev(p1, tim), cand_rev(p2, sue),

assign(jim, p1), unassign(tim, p1), assign(sue, p2),

has_rev(p1), has_rev(p2) }

Part 0: Facts

Part 1: kw , paperArea, (LP , ASP in same cluster)

Part 2 cand_rev

Part 3: choice for assign; has_rev ; reduct sPM (relevant part)

Note: second answer set is M = {. . . unassign(jim, p1),assign(tim, p1). . . }

T. Eiter/TU Wien EPCL 21.12.2012 25/64

Uniform DL-Program Evaluation 2. Nonmonotonic DL-Programs 2.5 Answer Sets

Computational Complexity

Deciding strong answer set existence for dl-programs (completeness results)

KB = (L,P ) no dl-atoms L in SHIF(D) L in SHOIN (D)

positive ExpTime ExpTime NExpTime

strati�ed ExpTime ExpTime PNExpTime

general NExpTime NExpTime NPNExpTime

Note:

Satis�ability in SHIF(D) /SHOIN (D) is ExpTime-/NExpTime-complete.

Key observation: The number of ground dl-atoms is polynomial

NPNExpTime = PNExpTime is less powerful than Answer Sets for disjunctiveprograms (≡ NExpTimeNP)

Same complexity as for no dl-atoms, if L is from a polyonmial DL class(e.g., OWL 2 Pro�les RL, EL, QL)

T. Eiter/TU Wien EPCL 21.12.2012 26/64

Uniform DL-Program Evaluation 2. Nonmonotonic DL-Programs 2.6 Applications

Applications

dl-programs facilitate some advanced reasoning tasks

Default Reasoning

Poole-style and Reiter-style Default Logic over DL knowledge bases (forrestricted fragments, to the e�ect of Terminological Default Logic [Baaderand Hollunder, 1995]).

Front-end [Dao-Tran et al., 2009]

Closed World Reasoning

Emulate CWA and Extended CWA (ECWA) on top of a DL KB.

Minimal Model Reasoning

Single out �minimal� models of a DL KB

T. Eiter/TU Wien EPCL 21.12.2012 27/64

Uniform DL-Program Evaluation 2. Nonmonotonic DL-Programs 2.7 Well-Founded Semantics

Well-founded semantics

Lift well-founded semantics for ordinary to dl-programs [E_et al., 2011]

Let for KB and I be γKB (I) = LM(KB I) the least model of thereduct KB I .

γKB is anti-monotone, thus γ2KB is is monotone and has a least

�xpoint lfp(γ2KB).

Well-founded atoms of KB = (L, P )

• WFS (KB) = lfp(γ2KB) is the set of well-founded atoms of KB ;

• For every ground atom a,

KB |=wf a denotes that a ∈WFS(KB),KB |=wf ¬a denotes that a /∈ γKB(WFS(KB)).

Well-founded and answer set semantics relate similarly as for ordinaryprograms

T. Eiter/TU Wien EPCL 21.12.2012 28/64

Uniform DL-Program Evaluation 3. FO-Rewritability

FO-Rewritability

Basic Idea:• Transform a dl-program KB = (L,P ) into an SQL expression S(KB)over the vocabulary of L

• Desired property: S(KB) is independent of the concrete ABox of Lmanagement systems (DBMS)

• To evaluate S(KB), we can use e�cient relational database

The family of DL-Lite DLs satis�es the (analog) property (calledFO-reducibility) for conjunctive queries

For dl-programs, we need restrictions on the rules and the ontology

De�nition

A dl-program KB = (L,P ), L = (T ,A), is FO-rewritable, if KB |= p(~c)for atom p(~c), is expressible by a FO formula φ(~x) over the relational

schema induced by the vocabulary of L, such that KB |= p(~c) i�A |= φ(~c), where φ only depends on p, P and T , but not on A.

T. Eiter/TU Wien EPCL 21.12.2012 29/64

Uniform DL-Program Evaluation 3. FO-Rewritability 3.1 Acyclic dl-programs

Acyclic dl-programs

To ensure FO-rewritability, ban intrinsic recursion from KB = (L,P )

This is ensured by acyclicity:

P is acyclic, if some mapping K : Preds(P )→ {0, . . . , n} existssuch that for every rule

a← b1, . . . , bk,not bk+1, . . . ,not bm,

in P , and every p, q ∈ Preds(P ) where p occurs in a and q occurs insome bi, it holds K(p) > K(q).

Example

KB = (L,P ) where L = {C v D} and

P =

{p(a); p(b); q(c);s(X)← DL[C ] p;D](X), not DL[C ] q, C−∪p;D](X)

}.

Note: every acyclic KB has WFS (KB) as its unique answer set.

T. Eiter/TU Wien EPCL 21.12.2012 30/64

Uniform DL-Program Evaluation 3. FO-Rewritability 3.2 FO-Rewritable dl-atoms

FO-Rewritable dl-atoms

For FO-rewritability of KB = (L,P ), L = (T ,A) each dl-queryQ(x) in P must be FO-rewritable, i.e., some FO-formula φQ(x) onL's vocabulary exists, such that L |= Q(c) i� A |= φQ(c), for each c

φQ(x) must depend only on T , but not on A

Example (cont'd)

dl-query Q = D(X) over L = {C v D} is translated to

φQ(x) = C(x) ∨D(x)

For dl-atom DL[λ,Q](x), also updates Si opi pi must be respected

Example (cont'd)

The dl-atom DL[C ] p;D](X) is translated into

δ1(x) = (C(x) ∨ p(x)) ∨D(x).

T. Eiter/TU Wien EPCL 21.12.2012 31/64

Uniform DL-Program Evaluation 3. FO-Rewritability 3.2 FO-Rewritable dl-atoms

FO-rewritable dl-atoms (cont'd)

if opi = −∪ occurs in P , avoid translating Si−∪pi to Si(x) ∨ ¬pi(x)

Assume L is over a DL that is

(i) CWA-satis�able (i.e., for every DL KB L′, the DL KBCWA(L′) = L′ ∪ {¬α | α ∈ AΣ, L

′ 6|= α}is satis�able, where AΣ is the set of all all membershipassertions in the underlying vocabulary Σ, , and

(ii) allows for FO-rewritable concept and role memberships.

Example (cont'd)

The dl-atom DL[C ] q;C−∪p;D](X) is translated into

δ2(x) = (C(x) ∨ q(x)) ∨D(x) ∨ ∃y((C(y) ∨ q(y)) ∧ p(y))

T. Eiter/TU Wien EPCL 21.12.2012 32/64

Uniform DL-Program Evaluation 3. FO-Rewritability 3.3 FO-Rewritability Result

FO-Rewritability Result

Theorem ([E_et al., 2011])

Let KB = (L,P ) be acyclic, and p(~c) an atom, such that

(1) every dl-query in P is FO-rewritable, and

(2) if −∪ occurs in P , then L is de�ned over a DL that

(2a) is CWA-satis�able, and

(2b) allows for FO-rewritable concept and role memberships.

Then, KB |=wf p(~c) is FO-rewritable.

Constructive proof:

(a) every dl-atom δ is expressible as FO formula over the ABox of L;(b) every predicate of rank 0 is easily FO-expressible over the facts of P ;(c) every other predicate pI is expressible by rule merging

(cf. Clark Completion)

T. Eiter/TU Wien EPCL 21.12.2012 33/64

Uniform DL-Program Evaluation 3. FO-Rewritability 3.3 FO-Rewritability Result

Example (cont'd)

The rule for predicate s is translated into

φs(x) = (δ1(x) ∧ ¬δ2(x))

Then KB |=wf s(o) i� F |= φs(o), for any constant o.

Remark:

The DL-Lite family is CWA-satis�able

There, dl-queries C(X), R(X,Y ) are immediately FO-rewritable

Other dl-queries can be reduced to such queries (introducing freshindviuals).

T. Eiter/TU Wien EPCL 21.12.2012 34/64

Uniform DL-Program Evaluation 3. FO-Rewritability 3.4 Implementation

Implementation

MOR (MergeRuleOntology) [Schneider, 2010]: experimental prototype

Evaluates conjunctive queries CQ over an acyclic dl-programKB = (L,P ) using an RDBMS (PostgreSQL 8.4)

Main modules:

• Datalog-to-SQL rewriter:puts the facts of P and the ABox of L in the DB and rewrites therules of P into cascading VIEWS (not materialized)

• DL-Lite plugin:transforms dl-atoms, using the perfect rewriting of a query and aTBox T from the algorithm PerfectRef [Calvanese et al., 2007]

• Owlgres (adapted):construct the perfect rewriting (no execution)

Realize hypothetical updates Si ] pi in dl-atoms by views

Other plugins than DL-lite are possible (access other DLs, even otherformalisms)

T. Eiter/TU Wien EPCL 21.12.2012 35/64

Uniform DL-Program Evaluation 3. FO-Rewritability 3.5 Experiments

Experiments

Benchmarks (n . . . number of facts / assertions)

Randomly generated sets of facts (Rn)• Allowing a high selectivity among the join attributes.

A simpli�ed version of DBpedia (Dn)• di�erent sets of books, periodicals, publications, incl. a single role.

Lehigh University Benchmark (LUBM) [Guo et al., 2005] (Un)• is not in DL-LiteR : changed ≈10% TBox axioms (e.g., drop roletransitivity, weaken B ≡ C1 u C2 to B v C1 and B v C2).

• used the LUBM instance generator (U100k has ≈12k individuals).

Queries

Name Description Data Reference

FO1 Tree of binary joins (with negation) Random [Schneider, 2010, Ex. 5.2.1]

FO2Select a range of the KB upon extension withbooks from an external source

DBpedia [Schneider, 2010, Ex 5.3.3]

FO3Seek students taking courses of faculty advi-sors who are not full professors

LUBM [Schneider, 2010, Ex 5.4.2]

T. Eiter/TU Wien EPCL 21.12.2012 36/64

Uniform DL-Program Evaluation 3. FO-Rewritability 3.5 Experiments

Experiments (cont'd)

Systems

MOR

DLV [Leone et al., 2006] 2010-10-14

dlvhex[DL]: dlvhex [E_et al., 2006] + RacerPro DL-plugin:

• usage of AllegroGraph library: RacerPro 1.9.2 can handle only limitedinstance size

DLVDB[Terracina et al., 2008]

Platform & Measurement

openSUSE 11.1 (x86_64) server, Intel Xeon CPU E5450 3.00GHz,15.7 GB RAM.

PostgreSQL 8.4 database item average of �ve runs (timeout of 6h,memout of 14.7 GB)

T. Eiter/TU Wien EPCL 21.12.2012 37/64

Uniform DL-Program Evaluation 3. FO-Rewritability 3.5 Experiments

Results

runtime in secs; ��� = out of memory

FO1 FO2 FO3

Inst MOR DLVDB DLV

R10k <1 <1 1R100k 1 1 105R250k 3 4 977R500k 5 9 2,795R1M 11 19 11,446

Inst MOR DLVDB dlvhex[DL]

D10k 1 <1 7D100k 4 6 �D250k 9 25 �D500k 18 50 �D1M 42 145 �

Inst MOR dlvhex[DL]

U10k 1 36U100k 4 117U250k 11 �U500k 20 �U1M 44 �

Linear runtime behavior of MOR for all benchmarks

For FO1, MOR and DLVDB scale similarly (DLVDBmaterializesviews)

The rule rewriting of DLVDB seems to be e�ective

Temporary update of DL KB in FO2 (60 individuals) did not hitmuch on MOR's performance

More details:http://www.kr.tuwien.ac.at/research/systems/drew/experiments.html

T. Eiter/TU Wien EPCL 21.12.2012 38/64

Uniform DL-Program Evaluation 3. FO-Rewritability 3.6 Limited Recursion

Limited Recursion

SQL:1999 standard: limited form of linear recursion in queries

p(X,Y ) ← a(X,Y ). p(X,Y ) ← a(X,Z), p(Z, Y ).

in SQL:

WITH RECURSIVE p AS

(SELECT ∗ FROM a UNION SELECT a.1 p.2 FROM a, p WHERE a.2 = p.1)

SELECT ∗ FROM p

Allow dl-programs that (1) have strati�ed negation (no predicatedepends negatively on itself) and (2) no cycles through dl-atoms

Remark: Hierarchic input to dl-atoms still possible

Benchmark:

LUBM ontology and a linear recursive dl-programCalculate the transitive closure of the sparse, tree-like structure ofthe subOrganization role (i.e., hierarchy of the LUBM university) byrules, feed it to the ontology

T. Eiter/TU Wien EPCL 21.12.2012 39/64

Uniform DL-Program Evaluation 3. FO-Rewritability 3.6 Limited Recursion

Experiment

Results (runtime in secs; same platform)

Instance MOR dlvhex[DL]

10k 1 35100k 1 108250k 2 �500k 4 �1M 11 �

For Un, quadratic trend for MOR, dlvhex[DL] runs out of memory

Observation: recursive queries are not well supported by RDBMS

• Postgres iterates joins without cycle• on cyclic data, queries may not terminate(⇒ bound iterations by LIMIT parameter)

T. Eiter/TU Wien EPCL 21.12.2012 40/64

Uniform DL-Program Evaluation 4. Datalog-Rewritability

Datalog-Rewritability

FO-rewritability excludes recursion

Query answering is not FO-rewritable in more expressive DLs

• e.g., in EL, SHIQ

But, it may be expressible in Datalog

Recall:

Theorem (Vardi, Immerman)

Datalog+ (Datalog with input negation) captures P on ordereddatabases (i.e., in presence of a successor relation).

T. Eiter/TU Wien EPCL 21.12.2012 41/64

Uniform DL-Program Evaluation 4. Datalog-Rewritability 4.1 Datalog-Rewritable DLs

Datalog-Rewritable DLs

De�nition

A DL DL is Datalog-rewritable if there exists a transformation ΦDL fromDL KBs to Datalog programs such that, for any DL KB L,

(i) L |= Q(o) i� ΦDL(L) |= Q(o) for any concept or role name Q fromL, and individuals o from L;

(ii) ΦDL is modular, i.e., for L = 〈T ,A〉 where T is a TBox and A anABox, ΦDL(L) = ΦDL(T ) ∪ A;

Polynomial Rewritability:

A Datalog-rewritable DL DL is polynomial rewritable, if ΦDL(L) iscomputable in polynomial time.

T. Eiter/TU Wien EPCL 21.12.2012 42/64

Uniform DL-Program Evaluation 4. Datalog-Rewritability 4.1 Datalog-Rewritable DLs

Example Datalog-Rewritable DLs

LDL+ [Heymans et al., 2010]: a lightweight ontology language• Extends in essence OWL 2 RL with singleton nominals, roleconjunctions, and transitive closure.

• A transformation ΦLDL+ of LDL+ into Datalog is straightforward;

Horn-SHIQ [Ortiz et al., 2010] and relatives [Gottlob andSchwentick, 2011]

SROEL(u,×) [Krötzsch, 2011]:a superset of OWL 2 EL [Motik et al., 2008]

• disregarding datatypes• adding concept production (C ×D v T , R v C ×D)

T. Eiter/TU Wien EPCL 21.12.2012 43/64

Uniform DL-Program Evaluation 4. Datalog-Rewritability 4.2 dl-program Transformation

dl-program Transformation

Let ΛP = {λ | DL[λ;Q] occurs in P} be the set of all input lists ofdl-atoms appearing in P .

Ψ(KB) := ΦDL(LΛP) ∪ P ord ∪ ρ(ΛP ) ∪ TP

where

LΛP=⋃λ∈ΛP

Lλ, where Lλ is L with all concept and role namessubscripted with λ(intuitively, create individual copies)

ρ(ΛP ) consists of rules Siλ(Xi)← pi(Xi), for all λ ∈ ΛP whereλ = S1 ] p1, . . . , Sm ] pm and 1 ≤ i ≤ m(intuitively, add the extension of pi to Si)

P ord is P with each DL[λ;Q](t) replaced by a new atom Qλ(t)

TP = {>(a), top2(a, b) | a, b from HUP }T. Eiter/TU Wien EPCL 21.12.2012 44/64

Uniform DL-Program Evaluation 4. Datalog-Rewritability 4.2 dl-program Transformation

Transformation (cont'd)

Example

KB = (L,P )

L = {C v D}

P =

{p(a); p(b); q(c);s(X)← DL[C ] p;D](X),not DL[C ] q;D](X)

}.

Then

ΛP = {λ1 =C ] p, λ2 =C ] q},

Φ(LΛP) = {Dλ1(X)←Cλ1(X); Dλ2(X)←Cλ2(X)},

ρ(ΛP ) = {Cλ1(X)← p(X); Cλ2(X)← q(X)}.

P ord = { p(a); p(b); q(c); s(X)←Dλ1(X),not Dλ2(X) }.

TP = {>(o) | o ∈ {a, b, c}} ∪ {>2(o1, o2) | {o1, o2} ⊂ {a, b, c}}.

T. Eiter/TU Wien EPCL 21.12.2012 45/64

Uniform DL-Program Evaluation 4. Datalog-Rewritability 4.2 dl-program Transformation

Correctness

Theorem

Let KB = (L,P ) be a dl-program over a Datalog-rewritable DL. Then

(1) for every a ∈ HBP , KB |=wf a i� Ψ(KB) |=wf a;

(2) the answer sets of KB correspond 1-1 to the answer sets of Ψ(KB),such that

(i) every answer set of KB is expendable to an answer set of Ψ(KB);and

(ii) for every answer set J of Ψ(KB), its restriction I = J |HBPto

HBP is an answer set of KB .

T. Eiter/TU Wien EPCL 21.12.2012 46/64

Uniform DL-Program Evaluation 4. Datalog-Rewritability 4.3 SROEL(u,×)

Datalog-rewritability of SROEL(u,×)isa(X,X)← nom(X) (10)self(X,V )← nom(X), triple(X,V,X) (11)

isa(X,Z)← top(Z), isa(X,Z′) (12)

isa(X, Y )← bot(Z), isa(U,Z), isa(X,Z′), cls(Y ) (13)

isa(X,Z)← subClass(Y, Z), isa(X, Y ) (14)isa(X,Z)← subConj(Y1, Y2, Z), isa(X, Y1), isa(X, Y2) (15)

isa(X,Z)← subEx(V, Y, Z), triple(X,V,X′), isa(X

′, Y ) (16)

isa(X,Z)← subEx(V, Y, Z), self(X,V ), isa(X, Y ) (17)

triple(X,V,X′)← supEx(Y, V, Z,X

′), isa(X, Y ) (18)

isa(X′, Z)← supEx(Y, V, Z,X

′), isa(X, Y ) (19)

isa(X,Z)← subSelf(V, Z), self(X,V ) (20)self(X,V )← supSelf(Y, V ), isa(X, Y ) (21)

triple(X,W,X′)← subRole(V,W ), triple(X,V,X

′) (22)

self(X,W )← subRole(V,W ), self(X,V ) (23)

triple(X,W,X′′

)← subRChain(U, V,W ), triple(X,U,X′), triple(X

′, V,X

′′) (24)

triple(X,W,X′)← subRChain(U, V,W ), self(X,U), triple(X,V,X

′) (25)

triple(X,W,X′)← subRChain(U, V,W ), triple(X,U,X

′), self(X

′, V ) (26)

triple(X,W,X)← subRChain(U, V,W ), self(X,U), self(X,V ) (27)

triple(X,W,X′)← subRConj(V1, V2,W ), triple(X,V1, X

′), triple(X,V2, X

′) (28)

self(X,W )← subRConj(V1, V2,W ), self(X,V1), self(X,V2) (29)isa(Y, Z)← isa(X, Y ), nom(Y ), isa(X,Z) (30)isa(X,Z)← isa(X, Y ), nom(Y ), isa(Y, Z) (31)

triple(Z,U, Y )← isa(X, Y ), nom(Y ), triple(Z,U,X). (32)

Proof system Pinst for SROEL(u,×) in Datalog [Krötzsch, 2011]

Reify concept / role names for uniformity isa(X,Y )

C(a) ; isa(a,C), R(a, b) ; triple(a,R, b), a ∈ NI ; nom(a)

reify axioms, e.g., A v C ; subClass(A,C), A uB v C ; subConj(A,B,C)

T. Eiter/TU Wien EPCL 21.12.2012 47/64

Uniform DL-Program Evaluation 4. Datalog-Rewritability 4.3 SROEL(u,×)

Datalog-rewritability of SROEL(u,×)

Use a rei�ed encoding of L:

Iinst(L) = {Iinst(α) | α ∈ L} ∪ {Iinst(s) | s ∈ NI ∪NC ∪NR}

Example

L1 = {A(a), A v ∃R.B, B v C, ∃R.C v D}is translated to

Iinst(L) =

{isa(a,A), supEx (A,R,B, eAv∃R.B), subClass(B,C),subEx (R,C,D), nom(a), cls(A), cls(B), cls(C), cls(D), rol(R)

}.

T. Eiter/TU Wien EPCL 21.12.2012 48/64

Uniform DL-Program Evaluation 4. Datalog-Rewritability 4.3 SROEL(u,×)

Answering DL-Queries

Pinst ∪ Iinst(L) can be readily used to answer queries L |= C(a)

For negative instance queries, use simple reduction:

L |= ¬C(a) ⇔ L ∪ {C(a)} is unsatis�able⇔ L ∪ {C(a)} |= ⊥(o) for any individual o.

For instance retrieval of ¬C(X), use an `indexed variant' of Pinst foreach case (L ∪ {C(a)}):• isa(X,Y ) ; isa_n(X,Y,′ C ′, a)

• similarly triple(X,Y, Z) ; triple_n(X,Y, Z,′ C ′, a)

• modify Pinst to P¬inst,

• use rules special P¬ to test L |= ¬C(a) via deriving isnota(a,C)from isa_n(·,⊥,′ C ′, a)

T. Eiter/TU Wien EPCL 21.12.2012 49/64

Uniform DL-Program Evaluation 4. Datalog-Rewritability 4.3 SROEL(u,×)

Answering DL-Queries /2

Use datalog transformations

ΦEL(L) = Pinst ∪ Iinst(L)

Φ¬EL(L) = P¬inst ∪ Iinst(L) ∪ P¬

Theorem

For every EL ontology L,

(i) L |= C(a) i� ΦEL(L) |= isa(a,C);

(ii) L |= ¬C(a) i� Φ¬EL(L) |= isnota(a,C).

T. Eiter/TU Wien EPCL 21.12.2012 50/64

Uniform DL-Program Evaluation 4. Datalog-Rewritability 4.4 Implementation and Experiments

Implementation

DReW prototype: uniform evaluation in Datalog¬

http://www.kr.tuwien.ac.at/research/systems/drew/

Written in Java (∼ 14k lines)

Datalog Reasoner: DLV or clingo

Ontology Parser: owl-api

DL Reasoner: conjunctive query for Datalog-rewritable ontologies(DL-safeness)

DL-program Reasoner:

• compute well-founded model for dl-programs over Datalog-rewritableontologies

• can be used for LDL+ and EL ontologies

DReW v0.3 features:

support of: OWL 2 RL, OWL 2 EL; answer set semantics

T. Eiter/TU Wien EPCL 21.12.2012 51/64

Uniform DL-Program Evaluation 4. Datalog-Rewritability 4.5 Experiment 1

Experiment 1: Instance Retrieval with Large EL TBoxes

Benchmark

El-Galen1 with 23,141 concepts and 950 roles in the TBox

A EL variant of Galen2 a prominent, large biomedical ontology

Created ontology instances G1-G4 with �xed TBox and increasingABoxes with 10∗i assertions, each using ≈ 10 concepts and roles.

Four instance retrieval queries over Gi

q1(X) = Substance(X) q3(X) = MaleAdult(X)q2(X) = Animal(X) q4(X) = Human(X)

Platform

Ubuntu Linux 11.10 system on an AMD Opteron Magny-Cours 6176SE 2.3GHz system with 24 cores and 128GB RAM

1http://condor-reasoner.googlecode.com/files/EL-GALEN.owl2http://www.opengalen.org/

T. Eiter/TU Wien EPCL 21.12.2012 52/64

Uniform DL-Program Evaluation 4. Datalog-Rewritability 4.5 Experiment 1

Results (Runtime in secs)

Ontology DReW Hermit

Query [DLV] [clingo]

G1 q1 2.0 1.3 8.1

q2 2.0 1.3 8.2

q3 2.0 1.3 8.0

q4 2.0 1.4 8.1

G2 q1 2.0 1.3 8.9

q2 2.0 1.4 8.9

q3 2.1 1.4 8.7

q4 2.0 1.3 9.0

Ontology DReW Hermit

Query [DLV] [clingo]

G3 q1 2.0 1.3 9.5

q2 2.1 1.4 9.5

q3 2.0 1.4 9.7

q4 2.1 1.4 9.5

G4 q1 2.1 1.4 10.3

q2 2.1 1.4 10.2

q3 2.1 1.4 10.2

q4 2.1 1.4 10.2

DReW with clingo 3.0.3 [Gebser et al., 2011] and DLV2010-10-14 [Leone et al., 2006].

HermiT1.3.5 [Motik et al., 2009] and Pellet 2.3.0 [Sirin et al., 2007].

DReW is superior to HermiT and Pellet

Pellet always timed out (1 hour) even with small ABoxes

Note: CB [Kazakov, 2009] and ELK [Kazakov et al., 2011] do fast classi�cation, but

can't be used for instance retrieval out of the box.T. Eiter/TU Wien EPCL 21.12.2012 53/64

Uniform DL-Program Evaluation 4. Datalog-Rewritability 4.6 Experiment 2

Experiment 2: Default Reasoning with EL-Policies

T =

Staff v User , Blacklisted v Staff , Deny u Grant v ⊥,UserRequest ≡ ∃hasAction.Action u ∃hasSubject .User u ∃hasTarget .Project ,StaffRequest ≡ ∃hasAction.Action u ∃hasSubject .Staff u ∃hasTarget .Project ,BlacklistedStaffRequest ≡ StaffRequest u ∃hasSubject .Blacklisted

A = {StaffRequest(joe), Blacklisted(jim), . . . }

D =

UserRequest(X) : Deny(X)/Deny(X),StaffRequest(X) : ¬BlacklistedStaffRequest(X)/Grant(X),BlacklistedStaffRequest(X) : >/Deny(X)

Access control policy, as in [Bonatti et al., 2011], couched interminological default logic [Baader and Hollunder, 1995]

Knowledge base ∆ = (L,D) with ontology L = (T ,A) and

Default rules D:

• users normally are denied access to �les• sta� is normally granted access to �les• blacklisted sta� are denied any access

T. Eiter/TU Wien EPCL 21.12.2012 54/64

Uniform DL-Program Evaluation 4. Datalog-Rewritability 4.6 Experiment 2

Benchmark & Results

KB DReWTyping [DLV] [clingo]

∆1 5 1.1 0.850 2.4 1.3100 6.0 3.0

∆5 5 6.6 4.450 8.3 5.0100 12.2 7.4

∆10 5 13.9 9.450 15.7 10.1100 20.5 13.3

∆25 5 35.8 26.050 40.0 26.4100 43.7 32.7

Ontology instances Li, i ∈ {1, 5, 10, 25}, that have a �xed TBox andincreasing Aboxes with i∗1000 instances of user requests.

ask whether a set of k particular individuals, designated by conceptsQk, k ∈ {5, 50, 100}, are granted access.

DReW scales sublinearly, on top of both DLV and clingo.

T. Eiter/TU Wien EPCL 21.12.2012 55/64

Uniform DL-Program Evaluation 5. Discussion & Conclusion 5.1 Discussion

Discussion

FO-Rewritability

Relaxed notion of FO-rewritability

• Combined approach [Kontchakov et al., 2010]: permit modi�cationsof the ABox (dependent on the TBox but independent of the query)

• For dl-atoms, precise contents of updated ABox unknown

• Still possible: auxiliary relations (e.g., a linear ordering of theindividuals, or arithmetic operations).

Recursive SQL: room for improvement (cf. [Terracina et al., 2008])

T. Eiter/TU Wien EPCL 21.12.2012 56/64

Uniform DL-Program Evaluation 5. Discussion & Conclusion 5.1 Discussion

Discussion (cont'd)

Datalog¬-Rewritability

Relaxed notions of Datalog-rewritability (allow for auxiliary relations).

Datalog¬-rewritability of dl-atoms:

• Program ΦDL(L) could have multiple answer sets (or none).

• Plugging in ΦDL(Lλ) for some dl-atom DL[λ,Q](~t) may lead tounwanted e�ects (e.g., additional answer sets).

⇒ use syntactic restrictions (e.g., acyclicity, dl-atoms are not involvedin cycles)

T. Eiter/TU Wien EPCL 21.12.2012 57/64

Uniform DL-Program Evaluation 5. Discussion & Conclusion 5.2 Conclusion

Conclusion

The uniform evaluation approach is a �exible framework

Further usage: Employ Modular Logic Programming to evaluatedatalog-rewritable dl-programs (TD-MLP)

The experimental results for simple prototypes (MOR, DReW,TD-MLP) are encouraging

More details:http://www.kr.tuwien.ac.at/research/systems/drew/experiments.html

T. Eiter/TU Wien EPCL 21.12.2012 58/64

Uniform DL-Program Evaluation 5. Discussion & Conclusion 5.2 Conclusion

Conclusion (cont'd)

Issues:

Other formalisms with (emerging) reasoning engines may beconsidered

• FO(·) Logic [Denecker and Ternovska, 2008]

• F-logic [Kifer et al., 1995]

• Datalog ± [Calì et al., 2010] (subsumes DL-Lite)

• ...

Improved prototypes / systems

Alternative encodings / reductions

Optimization methods and techniques

T. Eiter/TU Wien EPCL 21.12.2012 59/64

References I

Franz Baader and Bernhard Hollunder.

Embedding defaults into terminological knowledge representationformalisms.

J. Autom. Reasoning, 14(1):149�180, 1995.

Piero A. Bonatti, Marco Faella, and Luigi Sauro.

Adding default attributes to EL++.

In Wolfram Burgard and Dan Roth, editors, AAAI. AAAI Press, 2011.

Andrea Calì, Georg Gottlob, Thomas Lukasiewicz, Bruno Marnette, andAndreas Pieris.

Datalog+/-: A family of logical knowledge representation and querylanguages for new applications.

In LICS, pages 228�242. IEEE Computer Society, 2010.

References II

D. Calvanese, G. de Giacomo, D. Lembo, M. Lenzerini, and RiccardoRosati.

Tractable reasoning and e�cient query answering in description logics: TheDL-Lite family.

JAR, 39(3):385�429, 2007.

Minh Dao-Tran, Thomas Eiter, and Thomas Krennwallner.

Realizing default logic over description logic knowledge bases.

In C. Sossai and G. Chemello, editors, Proc. 10th European Conference onSymbolic and Quantitative Approaches to Reasoning with Uncertainty,(ECSQARU 2009), volume 5590 of Lecture Notes in Computer Science,pages 602�613. Springer, 2009.

References III

Jos de Bruijn, Thomas Eiter, and Hans Tompits.

Embedding approaches to combining rules and ontologies intoautoepistemic logic.

In Proceedings 11th International Conference on Principles of KnowledgeRepresentation and Reasoning (KR 2008), September 16-19, 2008, Sidney,Australia, pages 485�495, 2008.

Marc Denecker and Eugenia Ternovska.

A logic of non-monotone inductive de�nitions.

ACM Transactions on Computational Logic, 9, Issue 2, 2008.

Article 14, 52 pp.

T. Eiter, G. Ianni, R. Schindlauer, and H. Tompits.

E�ective integration of declarative rules with external evaluations forsemantic-web reasoning.

In ESWC, volume 4011 of LNCS, pages 273�287. Springer, 2006.

References IV

Thomas Eiter, Giovambattista Ianni, Thomas Krennwallner, and RomanSchindlauer.

Exploiting conjunctive queries in description logic programs.

Annals of Mathematics and Arti�cial Intelligence, 53(1-4):115�152, 2008.

doi:10.1007/s10472-009-9111-3.

Thomas Eiter, Giovambattista Ianni, Thomas Lukasiewicz, RomanSchindlauer, and Hans Tompits.

Combining Answer Set Programming with Description Logics for theSemantic Web.

Arti�cial Intelligence, 172(12-13):1495�1539, 2008.

doi:10.1016/j.artint.2008.04.002. Preliminary version available as Tech.Rep.INFSYS RR-1843-07-04, Institute of Information Systems, TU Vienna,January 2007.

References V

T. Eiter, G. Ianni, T. Lukasiewicz, and R. Schindlauer.

Well-founded semantics for description logic programs in the SemanticWeb.

ACM Trans. Comput. Log., 12(2):11, 2011.

Michael Fink and David Pearce.

A logical semantics for description logic programs.

In Tomi Janhunen and Ilkka Niemelä, editors, JELIA, volume 6341 ofLecture Notes in Computer Science, pages 156�168. Springer, 2010.

Martin Gebser, Benjamin Kaufmann, Roland Kaminski, Max Ostrowski,Torsten Schaub, and Marius Schneider.

Potassco: The Potsdam Answer Set Solving Collection.

AI Commun., 24(2):107�124, 2011.

References VI

Georg Gottlob and Thomas Schwentick.

Rewriting ontological queries into small nonrecursive datalog programs.

In Riccardo Rosati, Sebastian Rudolph, and Michael Zakharyaschev, editors,Description Logics, volume 745 of CEUR Workshop Proceedings.CEUR-WS.org, 2011.

B. N. Grosof, I. Horrocks, R. Volz, and S. Decker.

Description logic programs: Combining logic programs with descriptionlogic.

In Proc. WWW 2003, pages 48�57. ACM, 2003.

Yuanbo Guo, Zhengxiang Pan, and Je� He�in.

Lubm: A benchmark for owl knowledge base systems.

Web Semantics, 3(2-3):158 � 182, 2005.

References VII

S. Heymans, T. Eiter, and G. Xiao.

Tractable reasoning with DL-programs over datalog-rewritable descriptionlogics.

In Proc. 19th European Conference on Arti�cial Intelligence (ECAI). IOSPress, 2010.

Accepted for Publication.

I. Horrocks, P.F. Patel-Schneider, H. Boley, S. Tabet, B. Grosof, andM. Dean.

SWRL: A semantic web rule language combining OWL and RuleML.

W3C Member Submission, World Wide Web Consortium, 2004.

Ullrich Hustadt, Boris Motik, and Ulrike Sattler.

Reasoning in description logics by a reduction to disjunctive datalog.

J. Autom. Reasoning, 39(3):351�384, 2007.

References VIII

Tomi Janhunen.

On the intertranslatability of non-monotonic logics.

Ann. Math. Artif. Intell., 27(1-4):79�128, 1999.

Yevgeny Kazakov, Markus Krötzsch, and Frantisek Simancik.

Concurrent classi�cation of el ontologies.

In International Semantic Web Conference (1), volume 7031 of LectureNotes in Computer Science, pages 305�320. Springer, 2011.

Y. Kazakov.

Consequence-driven reasoning for Horn SHIQ ontologies.

In Craig Boutilier, editor, IJCAI, pages 2040�2045, 2009.

Michael Kifer, Georg Lausen, and James Wu.

Logical foundations of object-oriented and frame-based languages.

J. ACM, 42(4):741�843, 1995.

References IX

Roman Kontchakov, Carsten Lutz, David Toman, Frank Wolter, andMichael Zakharyaschev.

The combined approach to query answering in dl-lite.

In KR, 2010.

M. Krötzsch, S. Rudolph, and P. Hitzler.

Description logic rules.

In Proc. ECAI, pages 80�84. IOS Press, 2008.

M. Krötzsch, S. Rudolph, and P. Hitzler.

ELP: Tractable rules for OWL 2.

In Proc. ISWC 2008, pages 649�664, 2008.

References X

Markus Krötzsch.

E�cient rule-based inferencing for OWL EL.

In Toby Walsh, editor, IJCAI 2011, Proceedings of the 22nd InternationalJoint Conference on Arti�cial Intelligence, Barcelona, Catalonia, Spain, July16-22, 2011, pages 2668�2673. IJCAI/AAAI, 2011.

N. Leone, G. Pfeifer, W. Faber, T. Eiter, G. Gottlob, S. Perri, andF. Scarcello.

The DLV System for Knowledge Representation and Reasoning.

ACM Transactions on Computational Logic (TOCL), 7(3), July 2006.

B. Motik and R. Rosati.

A faithful integration of description logics with logic programming.

In Proc. IJCAI, pages 477�482, 2007.

References XI

B. Motik and R. Rosati.

Reconciling Description Logics and Rules.

Journal of the ACM, 57(5):1�62, 2010.

B. Motik, U. Sattler, and R. Studer.

Query answering for OWL-DL with rules.

Journal of Web Semantics, 3(1):41�60, July 2005.

Boris Motik, Bernardo Cuenca Grau, Ian Horrocks, Zhe Wu, AchilleFokoue, and Carsten Lutz.

Owl 2 web ontology language: Owl 2 web ontology language: Pro�les.

W3C Working Draft, World Wide Web Consortium,http://www.w3.org/TR/2008/WD-owl2-pro�les-20081008/, 2008.

References XII

Boris Motik, Rob Shearer, and Ian Horrocks.

Hypertableau Reasoning for Description Logics.

Journal of Arti�cial Intelligence Research, 36:165�228, 2009.

Magdalena Ortiz, Sebastian Rudolph, and Mantas Simkus.

Worst-case optimal reasoning for the horn-dl fragments of owl 1 and 2.

In Fangzhen Lin, Ulrike Sattler, and Miroslaw Truszczynski, editors, KR.AAAI Press, 2010.

R. Rosati.

On the decidability and complexity of integrating ontologies and rules.

Journal of Web Semantics, 3(1):41�60, 2005.

R. Rosati.

DL+log: Tight integration of description logics and disjunctive datalog.

In Proc. KR, pages 68�78, 2006.

References XIII

P. Schneider.

Evaluation of description logic programs using an RDBMS.

Master's thesis, Vienna University of Technology, December 2010.

E. Sirin, B. Parsia, B. Cuenca Grau, A. Kalyanpur, and Y. Katz.

Pellet: A practical OWL-DL reasoner.

J. Web Sem., 5(2):51�53, 2007.

Giorgio Terracina, Nicola Leone, Vincenzino Lio, and Claudio Panetta.

Experimenting with recursive queries in database and logic programmingsystems.

TPLP, 8(2):129�165, 2008.

Yisong Wang, Jia-Huai You, Li-Yan Yuan, Yi-Dong Shen, and ThomasEiter.

Embedding description logic programs into default logic.

CoRR, abs/1111.1486, 2011.

Uniform DL-Program Evaluation 7. Appendix: Modular Datalog¬

Appendix: Modular Datalog¬

Declaration:int fun(int, int);

De�nition:int fun(int x, int y) {

.

.

.

return · · · ;}

Use:int z = fun(1,2);

Imperative Programming (C-style)

Declaration:fun :: Int -> Int -> Int

De�nition:fun x y = · · ·Use:let z = fun 1 2 in · · ·

Functional Programming (Haskell-style)

Declaration:

m = (fun[p, q], R)

• fun is a module name

• p, q are predicate names

• R is a set of rules

De�nition:R = {even(X)← · · · ; . . . }Use:z(X)← fun[r, s].even(X)

Modular Nonmonotonic Logic Programming (MLP)

T. Eiter/TU Wien EPCL 21.12.2012 60/64

Uniform DL-Program Evaluation 7. Appendix: Modular Datalog¬ 7.1 MLP Reduction

Using MLPs

Idea:

For uniform evaluation, use (datalog) modules to emulate DL-atoms

Express DL-atom DL[λ;Q](X), λ = S1 ] p1, . . . , Sm ] pm, by a callatom Pλ[p1, . . . , pm].Q(X)

Module m = (Pλ[q1, . . . , qm], R) has R encoding I |= DL[λ;Q](X)

Example

KB = (L,P ), where L = {C v D} and

• P =

{p(a); p(b); q(c);s(X)← DL[C ] p;D](X),not DL[C ] q;D](X)

}.

MLP P = (m1,mDL), where

• m1 = (P1[], R1) where R1 =

{p(a), p(b), q(c),s(X)← PDL[p].D(X),not PDL[q].D(X)

},

• mDL = (PDL[C], RDL) where RDL = TP ∪ {D(X)← C(X)}.

T. Eiter/TU Wien EPCL 21.12.2012 61/64

Uniform DL-Program Evaluation 7. Appendix: Modular Datalog¬ 7.2 Experiments

Experiments

Main Question

Tradeo� between structured programming (modules) and code repetition

Use the TD-MLP solver (handles a fragment of MLPs)

• Note: MLP is very expressive (2− NExpTime-complete)

Benchmarks

Experiments on dl-programs KB = (Ui, Pj), where• Ui is an EL version of the LUBM ontology, with i universities

skip 2 TBox axioms with inverse rolesskip 2857 (33154) ABox axioms with datatype violations in U1 (U15)U has 86 TBox axioms using 43 concepts and 25 roles;U1 (U15) has 5738 (67691) ABox axioms, 1555 (17174) individuals

Pj (acyclic) is a variant of the LUBM query Qi3

• P0�P4: 2�5 dl-atoms, no input list• P5�P9: 2�9 dl-atoms, each with distinct input list

3http://swat.cse.lehigh.edu/projects/lubm/query.htm

T. Eiter/TU Wien EPCL 21.12.2012 62/64

Uniform DL-Program Evaluation 7. Appendix: Modular Datalog¬ 7.2 Experiments

Results (Runtime in secs; Hardware as for Datalog¬)Ontology U1

Program DReW TD-MLP[clingo] [DLV] [clingo] [DLV]

P0 0.31 0.45 1.98 2.88P1 0.32 0.44 1.69 2.47P2 0.32 0.44 2.63 3.82P3 0.31 0.43 1.66 2.42P4 0.32 0.45 2.45 3.63P5 0.61 0.86 1.66 2.46P6 1.79 2.76 5.65 8.41P7 2.70 4.30 4.87 7.84P8 2.76 4.26 9.70 14.12P9 2.73 4.31 8.04 11.60

Ontology U15

Program DReW TD-MLP[clingo] [DLV] [clingo] [DLV]

P0 6.49 10.27 30.43 42.53P1 4.00 6.27 21.22 30.12P2 3.95 6.08 32.65 45.24P3 3.98 6.13 20.94 30.33P4 4.15 6.43 28.19 39.93P5 7.97 12.66 21.54 30.87P6 23.52 40.56 72.86 103.76P7 36.33 64.05 115.03 162.21P8 36.58 61.71 128.01 181.41P9 35.26 62.19 108.38 145.04

DReW outperforms TD-MLP in all tests, within a constant factor.

DReW's lead shrinks with the number of dl-atoms in P5�P9.

Intuition:• DReW creates copies of subprograms for DL-atoms upfront, while in

TD-MLP copies are created by the implementation• Current TD-MLP implementation has overhead for instantiating modules

during evaluation (room for improvement)

T. Eiter/TU Wien EPCL 21.12.2012 63/64

Uniform DL-Program Evaluation 7. Appendix: Modular Datalog¬ 7.2 Experiments

Discussion

Experiment: the MLP encoding lags in total runtime behind the adhoc inlined approach, but it scales at a slower growth rate

For large amounts of data, the gap may get closed

Issue: design of modules for dl-atoms• Few, general modules (a universal one for all dl-atoms, cf. DL-pluginin dlvhex)

• Many specialized modules (e.g. one module per dl-atom)

T. Eiter/TU Wien EPCL 21.12.2012 64/64