Safe Rules for OWL 1.1⋆
Peter F. Patel-Schneider (editor)
Bell Labs Research, Alcatel-Lucent
Email: pfps@research.bell-labs.com
Abstract. The DL Safe SWRL Rules task force was tasked at OWLED
2007 to generate a proposal for how to add decidable and implementable
rules to OWL in a manner consistent with the Semantic Web. This is
the initial report from the task force.
1 Introduction
The general idea of Safe Rules for OWL is to add rules to OWL in a way that
does not lead to undecidability and also provides a good chance of effective
implementation. The main approach to achieving this in the literature has been
via DL-Safe rules [4]. As well, the result should abide by relevant Semantic Web
standards.
There are several options that one could think of in adding rules to OWL:
1. Should the rules be Horn rules or disjunctive rules?
It seems that a conservative stance is just to start with Horn rules.
2. Should the rules have n-ary predicates, as opposed to just unary predicates
(classes) and binary predicates (properties)?
As the idea is to maintain implementability, it seems that just unary and
binary predicates are the best way to start, except for n-ary datatype pred-
icates (if these are added to OWL).
3. Should the rules have a distinction between OWL and non-OWL predicates?
As the rules are likely to be used in situations where the OWL portion
may be extended, it seems difficult to reserve some predicates as non-OWL
predicates.
4. Should the rules have variables that range over datatypes?
As OWL has datatypes, it seems obvious that this should be allowed.
5. Which version of safety should be allowed - the orginal one (DL-safety [4])
or the newer one (weak safety [5])? DL-safety is more conservative and thus
may be better to start with.
One consequence of not dividing predicates into OWL and non-OWL is that
safety cannot be syntactically obtained, by requiring variables to occur in non-DL
atoms. Instead, safety has to be obtained by restricting non-datatype variables
to the individual names in the ontology. (This is the same as using a special
non-DL predicate, O, that has been asserted only for individual names.)
⋆
This paper summarizes the interim results of the DL Safe SWRL Rules task force.
Allowing datatypes means that obtaining decidability becomes slightly more
difficult. The problem is that if the rules are treated as if every data value is
allowed as a variable binding, then decidability may be lost. The special predicate
treatment works here, but is less intuitive.
2 Syntax
As far as syntax goes there are several options open. The rules could use the
XML syntax utilized in SWRL [2]. Alternatively, the rules could abide by the
new XML syntax for RIF rules [1]. Given that RIF is probably going to be a
W3C recommendation it makes sense to go with the RIF syntax, except that
the RIF syntax is extremely verbose. The RIF presentation syntax, on the other
hand, is actually quite nice and compact, particularly if the Forall construct
around the rule is removed.
One problem with using RIF is whether to go with an RDF-compatible ver-
sion of RIF rules [3] or a first-order version of RIF rules. In the RDF-compatible
version rule atoms line up with RDF triples (e.g., john[rdf:type Person]). In
a first-order version, rule atoms look more like what one would expect in a De-
scription Logic (e.g., Person(john). It appears that RIF will allow the first-order
style, which is much more OWL friendly.
2.1 Examples of the Various Syntaxes
Example rule in RIF presentation syntax (modulo isses with IRI syntax):
Forall(?x (Teenager(?x) :-
And(Person(?x) age(?x,"15"^^xsd:integer))))
Example rule in RIF XML syntax:
x
Person
x
agex
15
Teenager
x
Example rule in SWRL abstract syntax:
Implies(Antecedent(Person(I-variable(x))
age(I-variable(x,"15"^^xsd:integer)))
Consequent(Teenager(I-variable(x))))
Example rule in SWRL XML syntax:
x
x
15
x
3 Semantics
The semantics of safe rules for OWL is determined by the semantics of DL-
Safe rules, so the rules are treated as disjunctions where object variables can be
instantiated as individual names that appear in the ontology or the rules and
datatype variables can be instantiated as data values that appear in the ontology
or the rules.
This is consistent with the semantics of RIF rules, provided that the special
literal O(x) is added to rules for each individual variable in the rule and O’(x) is
added to rules for each datatype variable in the rule. Neither O nor O’ appear
in the ontology. O(x) is true for individual names that appear in the ontology or
the rules. O’(x) is true for data values that appear in the ontology or the rules.
4 A Possible Solution
It thus appears that a possible solution for Safe Rules for OWL is to have Horn
rules with unary and binary predicates interpreted according to the DL-Safe rules
semantics with individual variables restricted to individual names appearing in
the ontology or rules and datatype variables restricted to values appearing in
the ontology or rules.
To conform with Semantic Web standards the exchange syntax could be the
RIF XML syntax. The presentation syntax could be the RIF presentation syntax
with the option of leaving out enclosing universal constructs.
References
1. Rif basic logic dialect. W3C Working Draft, 30 October 2007.
http://www.w3.org/TR/rif-bld, 2007.
2. Ian Horrocks, Peter F. Patel-Schneider, Harold Boley, Said Tabet, Benjamin Grosof,
and Mike Dean. SWRL: A semantic web rule language. W3C Member Submission,
21 May 2004. http://www.w3.org/Submission/SWRL/, 2004.
3. Rif rdf and owl compatability. W3C Working Draft, 30 October 2007,
http://www.w3.org/TR/rif-rdf-owl/, 2007.
4. Boris Motik, Ulrike Sattler, and Rudi Studer. Query answering for
OWL-DL with rules. Journal of Web Semantics, 3(1):41–60, 2005.
http://web.comlab.ox.ac.uk/oucl/work/boris.motik/publications/mss05query-
journal.pdf.
5. Riccardo Rosati. DL+log: Tight integration of description logics and disjunctive
datalog. In Proceedings of the Tenth International Conference on Principles of
Knowledge Representation and Reasoning (KR 2006), pages 68–78, 2006.