SlideShare a Scribd company logo
A Toolkit for Query Answering with Existential Rules
Jean-François Baget, Michel Leclère, Marie-Laure Mugnier,
Swan Rocher, and Clément Sipieter
RuleML 2015
sipieter@lirmm.fr Graal 1
Ontology-mediated Query Answering
Query
Ontology
Data
Knowledge
base
sipieter@lirmm.fr Graal 2
Ontology language
Existential rules framework
=
Datalog+
[Calì et al., 2009]
sipieter@lirmm.fr Graal 3
What is Datalog+
?
An extension of positive Datalog:
sipieter@lirmm.fr Graal 4
What is Datalog+
?
An extension of positive Datalog:
Existentially quantied variables in rule heads
∀x (human(x) → ∃y parentOf (y, x))
sipieter@lirmm.fr Graal 4
What is Datalog+
?
An extension of positive Datalog:
Existentially quantied variables in rule heads
∀x (human(x) → ∃y parentOf (y, x))
Negative constraints
∀x (man(x) ∧ woman(x) → ⊥)
sipieter@lirmm.fr Graal 4
What is Datalog+
?
An extension of positive Datalog:
Existentially quantied variables in rule heads
∀x (human(x) → ∃y parentOf (y, x))
Negative constraints
∀x (man(x) ∧ woman(x) → ⊥)
Equality rules
∀x∀y∀z (motherOf (y, x) ∧ motherOf (z, x) → y = z)
sipieter@lirmm.fr Graal 4
What is Datalog+
?
An extension of positive Datalog:
Existentially quantied variables in rule heads
∀x (human(x) → ∃y parentOf (y, x))
Negative constraints
∀x (man(x) ∧ woman(x) → ⊥)
Equality rules
∀x∀y∀z (motherOf (y, x) ∧ motherOf (z, x) → y = z)
Generalizes:
Horn description logics
(e.g. DL-Lite, the 3 tractable proles of OWL2),
database dependencies (TGDs and EGDs).
sipieter@lirmm.fr Graal 4
Graal, an architecture overview
sipieter@lirmm.fr Graal 5
Graal - General architecture
chaining
core
RDBMS
Triple Store
InMemory GraphDB
store
io
DLGP
ruleset-
analyser
OWL2
fragment
forward-
chaining
backward-
homomorphism
RuleML
Rule
AtomSet
Query
ConjunctiveQuery UnionConjunctiveQuery
Atom Substitution
GraphOfRuleDependencies
NegativeConstraint
Predicate Term
1
0..*
2
0..*
0..* 0..*1
0..*
sipieter@lirmm.fr Graal 6
Graal - General architecture
chaining
core
RDBMS
Triple Store
InMemory GraphDB
store
io
DLGP
ruleset-
analyser
OWL2
fragment
forward-
chaining
backward-
homomorphism
RuleML
Rule
AtomSet
Query
ConjunctiveQuery UnionConjunctiveQuery
Atom Substitution
GraphOfRuleDependencies
NegativeConstraint
Predicate Term
1
0..*
2
0..*
0..* 0..*1
0..*
sipieter@lirmm.fr Graal 6
Store: Storing data
RDBMS Triple Store GraphDB
store
core
InMemory
AtomSet
IteratorAtom iterator()
SetTerm getTerms()
boolean contains(Atom)
boolean addAtom(Atom)
boolean removeAtom(Atom)
Atom
Predicate
Term
0..*
0..*
1
sipieter@lirmm.fr Graal 7
Homomorphism: Querying data
Query
sipieter@lirmm.fr Graal 8
Homomorphism: Querying data
store
Query
homomorphismRecursive backtrack
coreAtomSet
IteratorAtom iterator()
SetTerm getTerms()
boolean contains(Atom)
boolean addAtom(Atom)
boolean removeAtom(Atom)
RDBMS
sipieter@lirmm.fr Graal 8
Homomorphism: Querying data
store
Query
Triple Store
homomorphismRecursive backtrack
coreAtomSet
IteratorAtom iterator()
SetTerm getTerms()
boolean contains(Atom)
boolean addAtom(Atom)
boolean removeAtom(Atom)
sipieter@lirmm.fr Graal 8
Homomorphism: Querying data
store
Query
homomorphismRecursive backtrack
coreAtomSet
IteratorAtom iterator()
SetTerm getTerms()
boolean contains(Atom)
boolean addAtom(Atom)
boolean removeAtom(Atom)
GraphDB
sipieter@lirmm.fr Graal 8
Homomorphism: Querying data
store
homomorphism
Query
SQL
RDBMS
sipieter@lirmm.fr Graal 8
Homomorphism: Querying data
store
homomorphism
Query
Sparql
Triple Store
sipieter@lirmm.fr Graal 8
Homomorphism: Querying data
store
homomorphism
Query
Cypher
Neo4j
sipieter@lirmm.fr Graal 8
Taking ontology in account
chaining
core
RDBMS
Triple Store
InMemory GraphDB
store
io
DLGP
ruleset-
analyser
OWL2
fragment
forward-
chaining
backward-
homomorphism
RuleML
Rule
AtomSet
Query
ConjunctiveQuery UnionConjunctiveQuery
Atom Substitution
GraphOfRuleDependencies
NegativeConstraint
Predicate Term
1
0..*
2
0..*
0..* 0..*1
0..*
sipieter@lirmm.fr Graal 9
Forward Chaining / Chase
QueryRules
sipieter@lirmm.fr Graal 10
Forward Chaining / Chase
QueryRules
homomorphism
store
SQL
forward-
chaining
RDBMS
sipieter@lirmm.fr Graal 10
Forward Chaining / Chase
QueryRules
homomorphism
store
SQL
forward-
chaining
RDBMS
sipieter@lirmm.fr Graal 10
Backward Chaining / Query rewriting
QueryRules
sipieter@lirmm.fr Graal 11
Backward Chaining / Query rewriting
RDBMS
SQL
Q1 v Q2 v Q3 v Q4 v Q5 v Q6 v … v Qn
store
homomorphism
query-rewriting
QueryRules
sipieter@lirmm.fr Graal 11
Pure - A compilation based query rewriter
sipieter@lirmm.fr Graal 12
Eciency of the Query Rewriting approach in practice?
+ data do not grow
− the size of the rewriting set can be prohibitive in practice
A
B1
B2
Bn
B1(x) ∧ A(x)
B2(x) ∧ B1(x)
Bn(x) ∧ Bn−1(x)
A1
A2
A3
An
A2(x) → A1(x)
A3(x) → A2(x)
An(x) → An−1(x)
q = A1(x1) ∧ . . . ∧ A1(xk)
rewriting set: nk CQs
It is not a theoretical worst-case: it happens often in practice
because hierarchies are at the heart of ontologies.
sipieter@lirmm.fr Graal 13
Compilation-based Query Rewriting
Preprocess some simple rules known as sources of combinatorial
explosion:
atom1 → atom2
without existential variable
E.g., subclass, subproperty, domain, range, inverse properties. . .
R = RC ∪ RE
1. Compile RC into a preorder over atoms
2. Embed this preorder into the rewrite process
RC Preorder
RE
q
query
pivotal
preorder
Oine compilation
Query rewriting
sipieter@lirmm.fr Graal 14
Example
R0 : project(x, y, z, w) → hasArea(x, y)
R1 : project(x, y, z, w) → hasScManager(x, z)
R2 : project(x, y, z, w) → hasAdmManager(x, w)
R3 : sensitiveArea(x) → area(x)
R4 : security(x) → sensitiveArea(x)
R5 : innovation(x) → sensitiveArea(x)
R6 : hasScManager(x, y) → hasManager(x, y)
R7 : hasAdmManager(x, y) → hasManager(x, y)
R8 : isManagerOf (y, x) → hasManager(x, y)
R9 : hasManager(y, x) → isManagerOf (x, y)
R10 : manager(x) → isManager(x, y)
R11 : isManagerOf (x, y) ∧ hasArea(y, z) ∧ sensitiveArea(z) → criticalManager(x)
R12 : criticalManager(x) → isManagerOf (x, y) ∧ hasArea(y, z) ∧ sensitiveArea(z)
R13 : accreditatedManager(x) → isManagerOf (x, y) ∧ project(y, z, v, w) ∧ security(z)
sipieter@lirmm.fr Graal 15
Example
R0 : project(x, y, z, w) → hasArea(x, y)
R1 : project(x, y, z, w) → hasScManager(x, z)
R2 : project(x, y, z, w) → hasAdmManager(x, w)
R3 : sensitiveArea(x) → area(x)
R4 : security(x) → sensitiveArea(x)
R5 : innovation(x) → sensitiveArea(x)
R6 : hasScManager(x, y) → hasManager(x, y)
R7 : hasAdmManager(x, y) → hasManager(x, y)
R8 : isManagerOf (y, x) → hasManager(x, y)
R9 : hasManager(y, x) → isManagerOf (x, y)
R10 : manager(x) → isManager(x, y)
R11 : isManagerOf (x, y) ∧ hasArea(y, z) ∧ sensitiveArea(z) → criticalManager(x)
R12 : criticalManager(x) → isManagerOf (x, y) ∧ hasArea(y, z) ∧ sensitiveArea(z)
R13 : accreditatedManager(x) → isManagerOf (x, y) ∧ project(y, z, v, w) ∧ security(z)
sipieter@lirmm.fr Graal 16
Closure of the compilable rules
R0 : project(x, y, z, w) → hasArea(x, y)
R1 : project(x, y, z, w) → hasScManager(x, z)
R2 : project(x, y, z, w) → hasAdmManager(x, w)
R3 : sensitiveArea(x) → area(x)
R4 : security(x) → sensitiveArea(x)
R5 : innovation(x) → sensitiveArea(x)
R6 : hasScManager(x, y) → hasManager(x, y)
R7 : hasAdmManager(x, y) → hasManager(x, y)
R8 : isManagerOf (y, x) → hasManager(x, y)
R9 : hasManager(y, x) → isManagerOf (x, y)
We compute all inferred rules obtained by composition:
Ra : R1 · R6 = project(x, y, z, w) → hasManager(x, z)
Rb : R2 · R7 = project(x, y, z, w) → hasManager(x, w)
Rc : R4 · R3 = security(x) → area(x)
Rd : R5 · R3 = innovation(x) → area(x)
Re : R6 · R9 = hasScManager(x, y) → isManagerOf (y, x)
Rf : R7 · R9 = hasAdmManager(x, y) → isManagerOf (y, x)
Rg : Ra · R9 = project(x, y, z, w) → isManagerOf (z, x)
Rh : Rb · R9 = project(x, y, z, w) → isManagerOf (w, x)
sipieter@lirmm.fr Graal 17
Preorder
isManagerOf (x, y)
hasScManager(y, x)
hasAdmManager(y, x)
hasManager(y, x)
project(y, z, x, w)
project(y, z, w, x)
area(x)
security(x)
innovation(x)
sensitiveArea(x)
hasManager(x, y)
hasScManager(x, y)
hasAdmManager(x, y)
isManagerOf (y, x)
project(x, z, y, w)
project(x, z, w, y)
hasAdmManager(x, y)
project(x, z, w, x)
hasScManager(x, y)
project(x, z, x, w)
sensitiveArea(x)
security(x)
innovation(x)
hasArea(x, y)
project(x, y, z, w)
sipieter@lirmm.fr Graal 18
-Homomorphism
Q = isManagerOf (x, y) ∧ hasArea(y, z) ∧ sensitiveArea(z)
F = isManagerOf (M1, P) ∧ project(P, A, M1, M2) ∧ security(A)
hasArea(x, y)
project(x, y, z, w)
sensitiveArea(x)
security(x)
innovation(x)
...
COMPILED
sipieter@lirmm.fr Graal 19
-Homomorphism
Q = isManagerOf (x, y) ∧ hasArea(y, z) ∧ sensitiveArea(z)
F = isManagerOf (M1, P) ∧ project(P, A, M1, M2) ∧ security(A)
h = {{x, M1}, {y, P}, {z, A}}
hasArea(x, y)
project(x, y, z, w)
sensitiveArea(x)
security(x)
innovation(x)
...
COMPILED
sipieter@lirmm.fr Graal 19
Query rewriting using -Homomorphism
Q = criticalManager(x)
[Classical rewriting: 38 CQs]
R10 : manager(x) → isManager(x, y)
R11 : isManagerOf (x, y) ∧ hasArea(y, z) ∧ sensitiveArea(z) → criticalManager(x)
R12 : criticalManager(x) → isManagerOf (x, y) ∧ hasArea(y, z) ∧ sensitiveArea(z)
R13 : accreditatedManager(x) → isManagerOf (x, y) ∧ project(y, z, v, w) ∧ security(z)
hasArea(x, y)
project(x, y, z, w)
sensitiveArea(x)
security(x)
innovation(x)
...
COMPILED
sipieter@lirmm.fr Graal 20
Query rewriting using -Homomorphism
Q = criticalManager(x)
Q = isManagerOf (x, y) ∧ hasArea(y, z) ∧ sensitiveArea(z)
[Classical rewriting: 38 CQs]
R10 : manager(x) → isManager(x, y)
R11 : isManagerOf (x, y) ∧ hasArea(y, z) ∧ sensitiveArea(z) → criticalManager(x)
R12 : criticalManager(x) → isManagerOf (x, y) ∧ hasArea(y, z) ∧ sensitiveArea(z)
R13 : accreditatedManager(x) → isManagerOf (x, y) ∧ project(y, z, v, w) ∧ security(z)
hasArea(x, y)
project(x, y, z, w)
sensitiveArea(x)
security(x)
innovation(x)
...
COMPILED
sipieter@lirmm.fr Graal 20
Query rewriting using -Homomorphism
Q = criticalManager(x)
Q = isManagerOf (x, y) ∧ hasArea(y, z) ∧ sensitiveArea(z)
Q = accreditatedManager(x)
[Classical rewriting: 38 CQs]
R10 : manager(x) → isManager(x, y)
R11 : isManagerOf (x, y) ∧ hasArea(y, z) ∧ sensitiveArea(z) → criticalManager(x)
R12 : criticalManager(x) → isManagerOf (x, y) ∧ hasArea(y, z) ∧ sensitiveArea(z)
R13 : accreditatedManager(x) → isManagerOf (x, y) ∧ project(y, z, v, w) ∧ security(z)
hasArea(x, y)
project(x, y, z, w)
sensitiveArea(x)
security(x)
innovation(x)
...
COMPILED
sipieter@lirmm.fr Graal 20
Results - Impact of compilation on rewriting sizes
Benchmark:
translation of DL-LiteR ontologies:
Adolena (102 rules, 75% compilable)
Vicodi (222 rules, 100% compilable)
OpenGalen2-Lite (51k rules, 55%
compilable)
OBOprotein (43k rules, 82% compilable)
Each ontology is provided with 5 queries.
UCQ p-UCQ
A Q1 27 2
Q2 50 2
Q3 104 1
Q4 224 2
Q5 624 1
V Q1 15 1
Q2 10 1
Q3 72 1
Q4 185 1
Q5 30 1
G Q1 2 1
Q2 1152 1
Q3 488 5
Q4 147 1
Q5 324 19
O Q1 27 20
Q2 1356 1264
Q3 33887 1
Q4 34733 682
Q5 36612 -
sipieter@lirmm.fr Graal 21
Results - Impact of compilation on rewriting times
Pure PureC PureC
to UCQ
A Q1 190 20 140
Q2 100 10 50
Q3 180 20 40
Q4 290 10 140
Q5 1510 10 450
V Q1 20 10 10
Q2 20 10 20
Q3 120 10 80
Q4 130 10 70
Q5 20 10 20
G Q1 10 10 20
Q2 1070 60 630
Q3 1030 80 270
Q4 30 20 20
Q5 900 40 100
O Q1 450 140 150
Q2 1170 1120 1880
Q3 TO 100 558000
Q4 TO 440 TO
Q5 TO TO TO
TO = 10min.
sipieter@lirmm.fr Graal 22
Query evaluation (Futur work)
In central memory, compute -homomorphisms from Q to F.
Otherwise:
Unfold Q using the preorder,
Transform Q + the compilable rules into a Datalog program P,
Saturate F with Rc (the set of compilable rules).
sipieter@lirmm.fr Graal 23
https://graphik-team.github.io/graal/
sipieter@lirmm.fr Graal 24
Results - Impact of compilation on rewriting times
Pure PureC PureC Nyaya Requiem Iqaros tw Rapid
to UCQ
A Q1 190 20 140 1130 270 60 20 20
Q2 100 10 50 870 110 60 20 30
Q3 180 20 40 2370 140 200 10 40
Q4 290 10 140 5560 260 140 20 50
Q5 1510 10 450 33210 470 580 20 100
V Q1 20 10 10 20 20 20 10 10
Q2 20 10 20 60 20 20 10 10
Q3 120 10 80 30 70 30 10 30
Q4 130 10 70 30 140 40 10 40
Q5 20 10 20 30 80 50 20 30
G Q1 10 10 20 - 50 50 10 10
Q2 1070 60 630 - 209050 5870 20 80
Q3 1030 80 270 - 259110 9190 30 60
Q4 30 20 20 - 190260 780 10 20
Q5 900 40 100 - 238460 7410 30 50
O Q1 450 140 150 - 3450 6680 20 30
Q2 1170 1120 1880 - 21790 27820 580 960
Q3 TO 100 558000 - TO TO 80 620
Q4 TO 440 TO - TO 139990 1240 14700
Q5 TO TO TO - TO TO TO 562230
TO = 10min.
sipieter@lirmm.fr Graal 25

More Related Content

PDF
Extend R with Rcpp!!!
PPTX
ES6(ES2015) is beautiful
PDF
深入浅出Jscex
PDF
The Ring programming language version 1.5.4 book - Part 10 of 185
PDF
PDF
The Ring programming language version 1.5.3 book - Part 10 of 184
PDF
JVM Mechanics: Understanding the JIT's Tricks
Extend R with Rcpp!!!
ES6(ES2015) is beautiful
深入浅出Jscex
The Ring programming language version 1.5.4 book - Part 10 of 185
The Ring programming language version 1.5.3 book - Part 10 of 184
JVM Mechanics: Understanding the JIT's Tricks

What's hot (20)

PPTX
C++ and Assembly: Debugging and Reverse Engineering
PDF
JVM Mechanics
PDF
Java Performance Puzzlers
PDF
Jscex: Write Sexy JavaScript
PDF
[Codemotion 2015] patrones de diseño con java8
PDF
Futures e abstração - QCon São Paulo 2015
PDF
Declarative Datalog Debugging for Mere Mortals
PDF
Beyond tf idf why, what & how
PDF
Introduction to Polyhedral Compilation
PDF
662305 LAB13
PDF
The Ring programming language version 1.3 book - Part 84 of 88
PDF
The Evolution of Async-Programming (SD 2.0, JavaScript)
PDF
Building Machine Learning Algorithms on Apache Spark with William Benton
PDF
Regression_Sample
DOCX
Cg my own programs
PDF
The Ring programming language version 1.7 book - Part 71 of 196
PDF
Swift for tensorflow
KEY
openFrameworks 007 - utils
DOCX
Computer graphics programs in c++
C++ and Assembly: Debugging and Reverse Engineering
JVM Mechanics
Java Performance Puzzlers
Jscex: Write Sexy JavaScript
[Codemotion 2015] patrones de diseño con java8
Futures e abstração - QCon São Paulo 2015
Declarative Datalog Debugging for Mere Mortals
Beyond tf idf why, what & how
Introduction to Polyhedral Compilation
662305 LAB13
The Ring programming language version 1.3 book - Part 84 of 88
The Evolution of Async-Programming (SD 2.0, JavaScript)
Building Machine Learning Algorithms on Apache Spark with William Benton
Regression_Sample
Cg my own programs
The Ring programming language version 1.7 book - Part 71 of 196
Swift for tensorflow
openFrameworks 007 - utils
Computer graphics programs in c++
Ad

Viewers also liked (17)

PDF
RuleML2015: FOWLA, a federated architecture for ontologies
PDF
RuleML2015: Explanation of proofs of regulatory (non-)complianceusing semanti...
PDF
RuleML2015: Semantics of Notation3 Logic: A Solution for Implicit Quantifica...
PDF
Transformation and aggregation preprocessing for top-k recommendation GAP rul...
PDF
RuleML2015: Input-Output STIT Logic for Normative Systems
PDF
RuleML2015: Ontology-Based Multidimensional Contexts with Applications to Qua...
PDF
RuleML2015: Using PSL to Extend and Evaluate Event Ontologies
PDF
RuleML2015 PSOA RuleML: Integrated Object-Relational Data and Rules
PDF
RuleML2015: Norwegian State of Estate: A Reporting Service for the State-Owne...
PDF
RuleML2015: Rule Generalization Strategies in Incremental Learning of Disjunc...
PDF
RuleML2015: Towards Formal Semantics for ODRL Policies
PDF
RuleML2015: Rule-based data transformations in electricity smart grids
PDF
RuleML2015 : Hybrid Relational and Graph Reasoning
PDF
RuleML2015: How to combine event stream reasoning with transactions for the...
PDF
RuleML2015 - Tutorial - Powerful Practical Semantic Rules in Rulelog - Funda...
PDF
RuleML2015 The Herbrand Manifesto - Thinking Inside the Box
PDF
RuleML 2015 Constraint Handling Rules - What Else?
RuleML2015: FOWLA, a federated architecture for ontologies
RuleML2015: Explanation of proofs of regulatory (non-)complianceusing semanti...
RuleML2015: Semantics of Notation3 Logic: A Solution for Implicit Quantifica...
Transformation and aggregation preprocessing for top-k recommendation GAP rul...
RuleML2015: Input-Output STIT Logic for Normative Systems
RuleML2015: Ontology-Based Multidimensional Contexts with Applications to Qua...
RuleML2015: Using PSL to Extend and Evaluate Event Ontologies
RuleML2015 PSOA RuleML: Integrated Object-Relational Data and Rules
RuleML2015: Norwegian State of Estate: A Reporting Service for the State-Owne...
RuleML2015: Rule Generalization Strategies in Incremental Learning of Disjunc...
RuleML2015: Towards Formal Semantics for ODRL Policies
RuleML2015: Rule-based data transformations in electricity smart grids
RuleML2015 : Hybrid Relational and Graph Reasoning
RuleML2015: How to combine event stream reasoning with transactions for the...
RuleML2015 - Tutorial - Powerful Practical Semantic Rules in Rulelog - Funda...
RuleML2015 The Herbrand Manifesto - Thinking Inside the Box
RuleML 2015 Constraint Handling Rules - What Else?
Ad

Similar to RuleML2015: GRAAL - a toolkit for query answering with existential rules (20)

PDF
Challenge@RuleML2015 Datalog+, RuleML and OWL 2 - Formats and Translations f...
PDF
Formal methods 4 - Z notation
PDF
Cascon2011_5_rules+owl
PDF
Scala jargon cheatsheet
PDF
OXFORD'13 Optimising OWL 2 QL query rewriring
PPT
Ontology Engineering: Ontology Use
PDF
Query Rewriting and Optimization for Ontological Databases
PDF
Ontology-mediated query answering with data-tractable description logics
PDF
IncQuery Labs Models 2020 MIP Talk
PDF
Datalog+-Track Introduction & Reasoning on UML Class Diagrams via Datalog+-
PDF
Ti1220 Lecture 7: Polymorphism
PDF
Functional Operations - Susan Potter
PPTX
A Two-Fold Quality Assurance Approach for Dynamic Knowledge Bases : The 3cixt...
PDF
Monads and Monoids by Oleksiy Dyagilev
PDF
Normative Requirements as Linked Data
PDF
Fosdem 2013 petra selmer flexible querying of graph data
PDF
thesis-despoina
PDF
Which Model Does Not Belong: A Dialogue
PDF
Semantic Data Box
PDF
Orsi Vldb11
Challenge@RuleML2015 Datalog+, RuleML and OWL 2 - Formats and Translations f...
Formal methods 4 - Z notation
Cascon2011_5_rules+owl
Scala jargon cheatsheet
OXFORD'13 Optimising OWL 2 QL query rewriring
Ontology Engineering: Ontology Use
Query Rewriting and Optimization for Ontological Databases
Ontology-mediated query answering with data-tractable description logics
IncQuery Labs Models 2020 MIP Talk
Datalog+-Track Introduction & Reasoning on UML Class Diagrams via Datalog+-
Ti1220 Lecture 7: Polymorphism
Functional Operations - Susan Potter
A Two-Fold Quality Assurance Approach for Dynamic Knowledge Bases : The 3cixt...
Monads and Monoids by Oleksiy Dyagilev
Normative Requirements as Linked Data
Fosdem 2013 petra selmer flexible querying of graph data
thesis-despoina
Which Model Does Not Belong: A Dialogue
Semantic Data Box
Orsi Vldb11

More from RuleML (20)

PDF
Aggregates in Recursion: Issues and Solutions
PDF
A software agent controlling 2 robot arms in co-operating concurrent tasks
PDF
Port Clearance Rules in PSOA RuleML: From Controlled-English Regulation to Ob...
PDF
RuleML 2015: When Processes Rule Events
PDF
RuleML 2015: Ontology Reasoning using Rules in an eHealth Context
PDF
RuleML 2015: Semantics of Notation3 Logic: A Solution for Implicit Quantifica...
PDF
Challenge@RuleML2015 Developing Situation-Aware Applications for Disaster Man...
PDF
Rule Generalization Strategies in Incremental Learning of Disjunctive Concepts
PDF
Industry@RuleML2015: Norwegian State of Estate A Reporting Service for the St...
PDF
A Service for Improving the Assignments of Common Agriculture Policy Funds to...
PDF
RuleML2015: Binary Frontier-guarded ASP with Function Symbols
PDF
RuleML2015: API4KP Metamodel: A Meta-API for Heterogeneous Knowledge Platforms
PDF
RuleML2015: Rule-Based Exploration of Structured Data in the Browser
PDF
RuleML2015: Ontology-Based Multidimensional Contexts with Applications to Qua...
PDF
RuleML2015: Compact representation of conditional probability for rule-based...
PDF
RuleML2015: Learning Characteristic Rules in Geographic Information Systems
PDF
RuleML2015: Using Substitutive Itemset Mining Framework for Finding Synonymou...
PDF
RuleML2015: User Extensible System to Identify Problems in OWL Ontologies and...
PDF
RuleML2015: Representing Flexible Role-Based Access Control Policies Using Ob...
PDF
RuleML2015: Rule Generalization Strategies in Incremental Learning of Disjunc...
Aggregates in Recursion: Issues and Solutions
A software agent controlling 2 robot arms in co-operating concurrent tasks
Port Clearance Rules in PSOA RuleML: From Controlled-English Regulation to Ob...
RuleML 2015: When Processes Rule Events
RuleML 2015: Ontology Reasoning using Rules in an eHealth Context
RuleML 2015: Semantics of Notation3 Logic: A Solution for Implicit Quantifica...
Challenge@RuleML2015 Developing Situation-Aware Applications for Disaster Man...
Rule Generalization Strategies in Incremental Learning of Disjunctive Concepts
Industry@RuleML2015: Norwegian State of Estate A Reporting Service for the St...
A Service for Improving the Assignments of Common Agriculture Policy Funds to...
RuleML2015: Binary Frontier-guarded ASP with Function Symbols
RuleML2015: API4KP Metamodel: A Meta-API for Heterogeneous Knowledge Platforms
RuleML2015: Rule-Based Exploration of Structured Data in the Browser
RuleML2015: Ontology-Based Multidimensional Contexts with Applications to Qua...
RuleML2015: Compact representation of conditional probability for rule-based...
RuleML2015: Learning Characteristic Rules in Geographic Information Systems
RuleML2015: Using Substitutive Itemset Mining Framework for Finding Synonymou...
RuleML2015: User Extensible System to Identify Problems in OWL Ontologies and...
RuleML2015: Representing Flexible Role-Based Access Control Policies Using Ob...
RuleML2015: Rule Generalization Strategies in Incremental Learning of Disjunc...

Recently uploaded (20)

PPTX
SCIENCE 4 Q2W5 PPT.pptx Lesson About Plnts and animals and their habitat
PDF
Assessment of environmental effects of quarrying in Kitengela subcountyof Kaj...
PPTX
Substance Disorders- part different drugs change body
PDF
Cosmic Outliers: Low-spin Halos Explain the Abundance, Compactness, and Redsh...
PPTX
Fluid dynamics vivavoce presentation of prakash
PPTX
Lesson-1-Introduction-to-the-Study-of-Chemistry.pptx
PPTX
TORCH INFECTIONS in pregnancy with toxoplasma
PDF
Placing the Near-Earth Object Impact Probability in Context
PDF
Looking into the jet cone of the neutrino-associated very high-energy blazar ...
PPTX
Hypertension_Training_materials_English_2024[1] (1).pptx
PDF
GROUP 2 ORIGINAL PPT. pdf Hhfiwhwifhww0ojuwoadwsfjofjwsofjw
PPTX
GREEN FIELDS SCHOOL PPT ON HOLIDAY HOMEWORK
PPTX
gene cloning powerpoint for general biology 2
PPTX
Seminar Hypertension and Kidney diseases.pptx
PPTX
Introcution to Microbes Burton's Biology for the Health
PPTX
Welcome-grrewfefweg-students-of-2024.pptx
PPTX
INTRODUCTION TO PAEDIATRICS AND PAEDIATRIC HISTORY TAKING-1.pptx
PDF
Science Form five needed shit SCIENEce so
PPTX
POULTRY PRODUCTION AND MANAGEMENTNNN.pptx
PDF
Warm, water-depleted rocky exoplanets with surfaceionic liquids: A proposed c...
SCIENCE 4 Q2W5 PPT.pptx Lesson About Plnts and animals and their habitat
Assessment of environmental effects of quarrying in Kitengela subcountyof Kaj...
Substance Disorders- part different drugs change body
Cosmic Outliers: Low-spin Halos Explain the Abundance, Compactness, and Redsh...
Fluid dynamics vivavoce presentation of prakash
Lesson-1-Introduction-to-the-Study-of-Chemistry.pptx
TORCH INFECTIONS in pregnancy with toxoplasma
Placing the Near-Earth Object Impact Probability in Context
Looking into the jet cone of the neutrino-associated very high-energy blazar ...
Hypertension_Training_materials_English_2024[1] (1).pptx
GROUP 2 ORIGINAL PPT. pdf Hhfiwhwifhww0ojuwoadwsfjofjwsofjw
GREEN FIELDS SCHOOL PPT ON HOLIDAY HOMEWORK
gene cloning powerpoint for general biology 2
Seminar Hypertension and Kidney diseases.pptx
Introcution to Microbes Burton's Biology for the Health
Welcome-grrewfefweg-students-of-2024.pptx
INTRODUCTION TO PAEDIATRICS AND PAEDIATRIC HISTORY TAKING-1.pptx
Science Form five needed shit SCIENEce so
POULTRY PRODUCTION AND MANAGEMENTNNN.pptx
Warm, water-depleted rocky exoplanets with surfaceionic liquids: A proposed c...

RuleML2015: GRAAL - a toolkit for query answering with existential rules

  • 1. A Toolkit for Query Answering with Existential Rules Jean-François Baget, Michel Leclère, Marie-Laure Mugnier, Swan Rocher, and Clément Sipieter RuleML 2015 sipieter@lirmm.fr Graal 1
  • 3. Ontology language Existential rules framework = Datalog+ [Calì et al., 2009] sipieter@lirmm.fr Graal 3
  • 4. What is Datalog+ ? An extension of positive Datalog: sipieter@lirmm.fr Graal 4
  • 5. What is Datalog+ ? An extension of positive Datalog: Existentially quantied variables in rule heads ∀x (human(x) → ∃y parentOf (y, x)) sipieter@lirmm.fr Graal 4
  • 6. What is Datalog+ ? An extension of positive Datalog: Existentially quantied variables in rule heads ∀x (human(x) → ∃y parentOf (y, x)) Negative constraints ∀x (man(x) ∧ woman(x) → ⊥) sipieter@lirmm.fr Graal 4
  • 7. What is Datalog+ ? An extension of positive Datalog: Existentially quantied variables in rule heads ∀x (human(x) → ∃y parentOf (y, x)) Negative constraints ∀x (man(x) ∧ woman(x) → ⊥) Equality rules ∀x∀y∀z (motherOf (y, x) ∧ motherOf (z, x) → y = z) sipieter@lirmm.fr Graal 4
  • 8. What is Datalog+ ? An extension of positive Datalog: Existentially quantied variables in rule heads ∀x (human(x) → ∃y parentOf (y, x)) Negative constraints ∀x (man(x) ∧ woman(x) → ⊥) Equality rules ∀x∀y∀z (motherOf (y, x) ∧ motherOf (z, x) → y = z) Generalizes: Horn description logics (e.g. DL-Lite, the 3 tractable proles of OWL2), database dependencies (TGDs and EGDs). sipieter@lirmm.fr Graal 4
  • 9. Graal, an architecture overview sipieter@lirmm.fr Graal 5
  • 10. Graal - General architecture chaining core RDBMS Triple Store InMemory GraphDB store io DLGP ruleset- analyser OWL2 fragment forward- chaining backward- homomorphism RuleML Rule AtomSet Query ConjunctiveQuery UnionConjunctiveQuery Atom Substitution GraphOfRuleDependencies NegativeConstraint Predicate Term 1 0..* 2 0..* 0..* 0..*1 0..* sipieter@lirmm.fr Graal 6
  • 11. Graal - General architecture chaining core RDBMS Triple Store InMemory GraphDB store io DLGP ruleset- analyser OWL2 fragment forward- chaining backward- homomorphism RuleML Rule AtomSet Query ConjunctiveQuery UnionConjunctiveQuery Atom Substitution GraphOfRuleDependencies NegativeConstraint Predicate Term 1 0..* 2 0..* 0..* 0..*1 0..* sipieter@lirmm.fr Graal 6
  • 12. Store: Storing data RDBMS Triple Store GraphDB store core InMemory AtomSet IteratorAtom iterator() SetTerm getTerms() boolean contains(Atom) boolean addAtom(Atom) boolean removeAtom(Atom) Atom Predicate Term 0..* 0..* 1 sipieter@lirmm.fr Graal 7
  • 14. Homomorphism: Querying data store Query homomorphismRecursive backtrack coreAtomSet IteratorAtom iterator() SetTerm getTerms() boolean contains(Atom) boolean addAtom(Atom) boolean removeAtom(Atom) RDBMS sipieter@lirmm.fr Graal 8
  • 15. Homomorphism: Querying data store Query Triple Store homomorphismRecursive backtrack coreAtomSet IteratorAtom iterator() SetTerm getTerms() boolean contains(Atom) boolean addAtom(Atom) boolean removeAtom(Atom) sipieter@lirmm.fr Graal 8
  • 16. Homomorphism: Querying data store Query homomorphismRecursive backtrack coreAtomSet IteratorAtom iterator() SetTerm getTerms() boolean contains(Atom) boolean addAtom(Atom) boolean removeAtom(Atom) GraphDB sipieter@lirmm.fr Graal 8
  • 20. Taking ontology in account chaining core RDBMS Triple Store InMemory GraphDB store io DLGP ruleset- analyser OWL2 fragment forward- chaining backward- homomorphism RuleML Rule AtomSet Query ConjunctiveQuery UnionConjunctiveQuery Atom Substitution GraphOfRuleDependencies NegativeConstraint Predicate Term 1 0..* 2 0..* 0..* 0..*1 0..* sipieter@lirmm.fr Graal 9
  • 21. Forward Chaining / Chase QueryRules sipieter@lirmm.fr Graal 10
  • 22. Forward Chaining / Chase QueryRules homomorphism store SQL forward- chaining RDBMS sipieter@lirmm.fr Graal 10
  • 23. Forward Chaining / Chase QueryRules homomorphism store SQL forward- chaining RDBMS sipieter@lirmm.fr Graal 10
  • 24. Backward Chaining / Query rewriting QueryRules sipieter@lirmm.fr Graal 11
  • 25. Backward Chaining / Query rewriting RDBMS SQL Q1 v Q2 v Q3 v Q4 v Q5 v Q6 v … v Qn store homomorphism query-rewriting QueryRules sipieter@lirmm.fr Graal 11
  • 26. Pure - A compilation based query rewriter sipieter@lirmm.fr Graal 12
  • 27. Eciency of the Query Rewriting approach in practice? + data do not grow − the size of the rewriting set can be prohibitive in practice A B1 B2 Bn B1(x) ∧ A(x) B2(x) ∧ B1(x) Bn(x) ∧ Bn−1(x) A1 A2 A3 An A2(x) → A1(x) A3(x) → A2(x) An(x) → An−1(x) q = A1(x1) ∧ . . . ∧ A1(xk) rewriting set: nk CQs It is not a theoretical worst-case: it happens often in practice because hierarchies are at the heart of ontologies. sipieter@lirmm.fr Graal 13
  • 28. Compilation-based Query Rewriting Preprocess some simple rules known as sources of combinatorial explosion: atom1 → atom2 without existential variable E.g., subclass, subproperty, domain, range, inverse properties. . . R = RC ∪ RE 1. Compile RC into a preorder over atoms 2. Embed this preorder into the rewrite process RC Preorder RE q query pivotal preorder Oine compilation Query rewriting sipieter@lirmm.fr Graal 14
  • 29. Example R0 : project(x, y, z, w) → hasArea(x, y) R1 : project(x, y, z, w) → hasScManager(x, z) R2 : project(x, y, z, w) → hasAdmManager(x, w) R3 : sensitiveArea(x) → area(x) R4 : security(x) → sensitiveArea(x) R5 : innovation(x) → sensitiveArea(x) R6 : hasScManager(x, y) → hasManager(x, y) R7 : hasAdmManager(x, y) → hasManager(x, y) R8 : isManagerOf (y, x) → hasManager(x, y) R9 : hasManager(y, x) → isManagerOf (x, y) R10 : manager(x) → isManager(x, y) R11 : isManagerOf (x, y) ∧ hasArea(y, z) ∧ sensitiveArea(z) → criticalManager(x) R12 : criticalManager(x) → isManagerOf (x, y) ∧ hasArea(y, z) ∧ sensitiveArea(z) R13 : accreditatedManager(x) → isManagerOf (x, y) ∧ project(y, z, v, w) ∧ security(z) sipieter@lirmm.fr Graal 15
  • 30. Example R0 : project(x, y, z, w) → hasArea(x, y) R1 : project(x, y, z, w) → hasScManager(x, z) R2 : project(x, y, z, w) → hasAdmManager(x, w) R3 : sensitiveArea(x) → area(x) R4 : security(x) → sensitiveArea(x) R5 : innovation(x) → sensitiveArea(x) R6 : hasScManager(x, y) → hasManager(x, y) R7 : hasAdmManager(x, y) → hasManager(x, y) R8 : isManagerOf (y, x) → hasManager(x, y) R9 : hasManager(y, x) → isManagerOf (x, y) R10 : manager(x) → isManager(x, y) R11 : isManagerOf (x, y) ∧ hasArea(y, z) ∧ sensitiveArea(z) → criticalManager(x) R12 : criticalManager(x) → isManagerOf (x, y) ∧ hasArea(y, z) ∧ sensitiveArea(z) R13 : accreditatedManager(x) → isManagerOf (x, y) ∧ project(y, z, v, w) ∧ security(z) sipieter@lirmm.fr Graal 16
  • 31. Closure of the compilable rules R0 : project(x, y, z, w) → hasArea(x, y) R1 : project(x, y, z, w) → hasScManager(x, z) R2 : project(x, y, z, w) → hasAdmManager(x, w) R3 : sensitiveArea(x) → area(x) R4 : security(x) → sensitiveArea(x) R5 : innovation(x) → sensitiveArea(x) R6 : hasScManager(x, y) → hasManager(x, y) R7 : hasAdmManager(x, y) → hasManager(x, y) R8 : isManagerOf (y, x) → hasManager(x, y) R9 : hasManager(y, x) → isManagerOf (x, y) We compute all inferred rules obtained by composition: Ra : R1 · R6 = project(x, y, z, w) → hasManager(x, z) Rb : R2 · R7 = project(x, y, z, w) → hasManager(x, w) Rc : R4 · R3 = security(x) → area(x) Rd : R5 · R3 = innovation(x) → area(x) Re : R6 · R9 = hasScManager(x, y) → isManagerOf (y, x) Rf : R7 · R9 = hasAdmManager(x, y) → isManagerOf (y, x) Rg : Ra · R9 = project(x, y, z, w) → isManagerOf (z, x) Rh : Rb · R9 = project(x, y, z, w) → isManagerOf (w, x) sipieter@lirmm.fr Graal 17
  • 32. Preorder isManagerOf (x, y) hasScManager(y, x) hasAdmManager(y, x) hasManager(y, x) project(y, z, x, w) project(y, z, w, x) area(x) security(x) innovation(x) sensitiveArea(x) hasManager(x, y) hasScManager(x, y) hasAdmManager(x, y) isManagerOf (y, x) project(x, z, y, w) project(x, z, w, y) hasAdmManager(x, y) project(x, z, w, x) hasScManager(x, y) project(x, z, x, w) sensitiveArea(x) security(x) innovation(x) hasArea(x, y) project(x, y, z, w) sipieter@lirmm.fr Graal 18
  • 33. -Homomorphism Q = isManagerOf (x, y) ∧ hasArea(y, z) ∧ sensitiveArea(z) F = isManagerOf (M1, P) ∧ project(P, A, M1, M2) ∧ security(A) hasArea(x, y) project(x, y, z, w) sensitiveArea(x) security(x) innovation(x) ... COMPILED sipieter@lirmm.fr Graal 19
  • 34. -Homomorphism Q = isManagerOf (x, y) ∧ hasArea(y, z) ∧ sensitiveArea(z) F = isManagerOf (M1, P) ∧ project(P, A, M1, M2) ∧ security(A) h = {{x, M1}, {y, P}, {z, A}} hasArea(x, y) project(x, y, z, w) sensitiveArea(x) security(x) innovation(x) ... COMPILED sipieter@lirmm.fr Graal 19
  • 35. Query rewriting using -Homomorphism Q = criticalManager(x) [Classical rewriting: 38 CQs] R10 : manager(x) → isManager(x, y) R11 : isManagerOf (x, y) ∧ hasArea(y, z) ∧ sensitiveArea(z) → criticalManager(x) R12 : criticalManager(x) → isManagerOf (x, y) ∧ hasArea(y, z) ∧ sensitiveArea(z) R13 : accreditatedManager(x) → isManagerOf (x, y) ∧ project(y, z, v, w) ∧ security(z) hasArea(x, y) project(x, y, z, w) sensitiveArea(x) security(x) innovation(x) ... COMPILED sipieter@lirmm.fr Graal 20
  • 36. Query rewriting using -Homomorphism Q = criticalManager(x) Q = isManagerOf (x, y) ∧ hasArea(y, z) ∧ sensitiveArea(z) [Classical rewriting: 38 CQs] R10 : manager(x) → isManager(x, y) R11 : isManagerOf (x, y) ∧ hasArea(y, z) ∧ sensitiveArea(z) → criticalManager(x) R12 : criticalManager(x) → isManagerOf (x, y) ∧ hasArea(y, z) ∧ sensitiveArea(z) R13 : accreditatedManager(x) → isManagerOf (x, y) ∧ project(y, z, v, w) ∧ security(z) hasArea(x, y) project(x, y, z, w) sensitiveArea(x) security(x) innovation(x) ... COMPILED sipieter@lirmm.fr Graal 20
  • 37. Query rewriting using -Homomorphism Q = criticalManager(x) Q = isManagerOf (x, y) ∧ hasArea(y, z) ∧ sensitiveArea(z) Q = accreditatedManager(x) [Classical rewriting: 38 CQs] R10 : manager(x) → isManager(x, y) R11 : isManagerOf (x, y) ∧ hasArea(y, z) ∧ sensitiveArea(z) → criticalManager(x) R12 : criticalManager(x) → isManagerOf (x, y) ∧ hasArea(y, z) ∧ sensitiveArea(z) R13 : accreditatedManager(x) → isManagerOf (x, y) ∧ project(y, z, v, w) ∧ security(z) hasArea(x, y) project(x, y, z, w) sensitiveArea(x) security(x) innovation(x) ... COMPILED sipieter@lirmm.fr Graal 20
  • 38. Results - Impact of compilation on rewriting sizes Benchmark: translation of DL-LiteR ontologies: Adolena (102 rules, 75% compilable) Vicodi (222 rules, 100% compilable) OpenGalen2-Lite (51k rules, 55% compilable) OBOprotein (43k rules, 82% compilable) Each ontology is provided with 5 queries. UCQ p-UCQ A Q1 27 2 Q2 50 2 Q3 104 1 Q4 224 2 Q5 624 1 V Q1 15 1 Q2 10 1 Q3 72 1 Q4 185 1 Q5 30 1 G Q1 2 1 Q2 1152 1 Q3 488 5 Q4 147 1 Q5 324 19 O Q1 27 20 Q2 1356 1264 Q3 33887 1 Q4 34733 682 Q5 36612 - sipieter@lirmm.fr Graal 21
  • 39. Results - Impact of compilation on rewriting times Pure PureC PureC to UCQ A Q1 190 20 140 Q2 100 10 50 Q3 180 20 40 Q4 290 10 140 Q5 1510 10 450 V Q1 20 10 10 Q2 20 10 20 Q3 120 10 80 Q4 130 10 70 Q5 20 10 20 G Q1 10 10 20 Q2 1070 60 630 Q3 1030 80 270 Q4 30 20 20 Q5 900 40 100 O Q1 450 140 150 Q2 1170 1120 1880 Q3 TO 100 558000 Q4 TO 440 TO Q5 TO TO TO TO = 10min. sipieter@lirmm.fr Graal 22
  • 40. Query evaluation (Futur work) In central memory, compute -homomorphisms from Q to F. Otherwise: Unfold Q using the preorder, Transform Q + the compilable rules into a Datalog program P, Saturate F with Rc (the set of compilable rules). sipieter@lirmm.fr Graal 23
  • 42. Results - Impact of compilation on rewriting times Pure PureC PureC Nyaya Requiem Iqaros tw Rapid to UCQ A Q1 190 20 140 1130 270 60 20 20 Q2 100 10 50 870 110 60 20 30 Q3 180 20 40 2370 140 200 10 40 Q4 290 10 140 5560 260 140 20 50 Q5 1510 10 450 33210 470 580 20 100 V Q1 20 10 10 20 20 20 10 10 Q2 20 10 20 60 20 20 10 10 Q3 120 10 80 30 70 30 10 30 Q4 130 10 70 30 140 40 10 40 Q5 20 10 20 30 80 50 20 30 G Q1 10 10 20 - 50 50 10 10 Q2 1070 60 630 - 209050 5870 20 80 Q3 1030 80 270 - 259110 9190 30 60 Q4 30 20 20 - 190260 780 10 20 Q5 900 40 100 - 238460 7410 30 50 O Q1 450 140 150 - 3450 6680 20 30 Q2 1170 1120 1880 - 21790 27820 580 960 Q3 TO 100 558000 - TO TO 80 620 Q4 TO 440 TO - TO 139990 1240 14700 Q5 TO TO TO - TO TO TO 562230 TO = 10min. sipieter@lirmm.fr Graal 25