This paper is devoted to formats and translations for Datalog+. We
first introduce the dlgp format, which extends classical Datalog format to Datalog+.
It allows to encode facts, existential rules (including equality), negative
constraints and conjunctive queries. Moreover, for compatibility with Semantic
Web languages, this format includes Web notions (IRIs and literals, according to
Turtle syntax). Second, we define a translation from dlgp to the Datalog+ fragment
of RuleML. Third, we define a translation from OWL 2 to dlgp. We point
out that the composition of both translations allows to import OWL 2 to RuleML.
The associated parsers and translators are available.
FAIRSpectra - Enabling the FAIRification of Analytical Science
Challenge@RuleML2015 Datalog+, RuleML and OWL 2 - Formats and Translations for Existential Rules
1. Datalog+, RuleML and OWL 2:
Formats and Translations for Existential Rules
Jean-François Baget (baget@lirmm.fr)
Alain Gutierrez
Michel Leclère
Marie-Laure Mugnier
Swan Rocher
Clément Sipieter
PROJECT TEAM
GraphIK
INRIA Sophia-Antiplis
LIRMM
The 9th International Web Rule
Symposium (RuleML) 2015
2. An overview of GRAAL
• GRAAL: a platform for reasoning with Existential Rules/Datalog+
(see yesterday’s talk by C. Sipieter « Graal: A Toolkit for Query
Answering with Existential Rules»)
Facts
Ontology
Conjunctive
query
KnowledgeBase
7. OWL2 and Existential Rules
- 7
OWL 2 Existential Rules
A ⊑ B ⊔ C
P(Y, T), r(Z, T) :- r(X, Y), p(X, Z)
q(a, b, c)
ER
RLQLEL
¬ A ⊑ B
8. Adding IRIs in DLGP
• constants and predicate names are now IRIs (turtle-
like syntax)
– absolute IRI: <http://example.org/pred>
– prefixed IRI:
• @prefix ex: <http://example.org>
• ex:pred
– relative IRI:
• @base <http://example.org>
• <pred>
• And we can still write (datalog compatibility): pred
- 8
9. From OWL 2 to DLGP
• Assertions without class expressions can always be translated
– parent . mother ⊑ grandmother
– grandmother(X,Z) :- parent (X,Y), mother(Y,Z).
• Translation of assertions with class expressions in inclusions
– (( parent. Human) ⊓ ( parent . God))(hercules)
– {hercules} ⊑ ( parent. Human) ⊓ ( parent . God)
- 9
11. Analysis of Inclusions: principle
• A ⊑ B
– Can be translated as a single rule when A and B are EquivClass
expressions.
– When A is a SubClass expression and B is a SuperClass
expression, can be rewritten as a set of inclusions of form A’ ⊑ B’
where A’ and B’ are EquivClass expressions.
• The ER profile limits OWL 2 assertions to those whose
associated class inclusions are of form SubClass ⊑ SuperClass
- 11
13. SubClass Expressions
- 13
• Rationale: when A is a SubClass expression, A is the existential
closure of conjunctions and disjunctions. Its disjunctive normal
form is A1 ⊔ … ⊔ Ak where the Ai are EquivClass expressions.
So A ⊑ B is equivalent to the set of inclusions Ai ⊑ B.
14. SuperClass Expressions
• Example: A ⊑ ¬ B is equivalent to A ⊓ B ⊑ Nothing. When A
and B are SubClass expressions, A ⊓ B is also a SubClass
expression. Thus ¬ B is a SuperClass expression when B is
a SubClass expression.
- 14
15. Our algorithm: partial translation of
non ER assertions
- 15
A ⊔ ¬ B ⊑ ∀ r . (C ⊓ ¬ B) ⊓ r . (B ⊔ C)
A ⊔ ¬ B ⊑ ∀ r . (C ⊓ ¬ B) A ⊔ ¬ B ⊑ r . (B ⊔ C)
r- . (A ⊔ ¬ B) ⊑ C ⊓ ¬ B
r- . (A ⊔ ¬ B) ⊑ C r- . (A ⊔ ¬ B) ⊑ ¬ B
r- . (A ⊔ ¬ B) ⊓ B ⊑ ( r- . A) ⊔ ( r- . ¬ B) ⊑ C
( r- . A) ⊑ C r- . ¬ B ⊑ C
C(X) :- r(Y,X), A(Y).
(( r- . A) ⊓ B) ⊔ (( r- . ¬ B) ⊓ B) ⊑
( r- . A) ⊓ B ⊑ ( r- . ¬ B) ⊓ B ⊑
! :- r(Y,X), A(Y), B(X).