Keywords

These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

1 Introduction

The Web Ontology Language OWL, as introduced in chapter “Web Ontology Language: OWL,” is the language recommended by the World Wide Web consortium (W3C) for expressing ontologies for the Semantic Web. OWL is based on Description Logics, see chapter “Description Logics,” and as such is based on first-order predicate logic as underlying knowledge representation and reasoning paradigm.

Throughout the advent of the Semantic Web, however, F-Logic as an alternative approach for expressing ontologies has been based on rules, more precisely on the logic programming paradigm, see chapter “Ontologies in F-logic.” Due to this, and also due to the importance of rule-based systems in industrial practice, it is natural to ask how OWL and rule-based knowledge-representation and reasoning can be combined.

Achieving a conceptually clear integration of OWL and rules, however, is not a trivial task. The reason for the difficulties lies in the fact that OWL – based on first-order predicate logic – adheres to the open-world assumption, while rules generally follow the closed-world assumption. Consequently, the semantics of OWL and rules differs considerably, and achieving a meaningful, intuitive, and formally clear combined semantics is not straightforward.

Research on the topic of ontologies and rules has thus spawned into several different directions. In this chapter, we provide an overview of the state of the art, by discussing briefly some of the approaches which we consider to be most promising or interesting. Since we want to be brief and to the point, our selection is naturally subjective, but we made an effort to include references to many of the recent publications on the topic.

In Sect. 2, we present the Semantic Web Rules Language SWRL, a rule extension of OWL DL which adheres to the open-world paradigm, and is thus entirely in the spirit of the OWL DL language. We also introduce the decidable fragment of SWRL known as DL-Safe rules. SWRL adds to the expressive power or OWL by allowing the modelling of certain axioms which lie outside the capability of OWL DL.

In Sect. 3, we change perspective and consider rule fragments of OWL DL. In particular, we present its naive Horn fragment DLP – description logic programs – and a more sophisticated fragment called Horn-SHIQ, which encompasses DLP.

In Sect. 4, we briefly address hybrid approaches, i.e. theories and systems which combine OWL with some existing rules language, and thus combine the open- and the closed-world assumption.

We conclude in Sect. 5.

Throughout the chapter, we will employ the syntax for Description Logics as introduced in chapter “Description Logics.”

2 SWRL and DL-Safe Rules

Attempts to combine some sort of rules with a description logic go back at least as far as the Classic system [2]. Starting in the late 1990s, there were a number of attempts to combine Datalog (as the premier deductive database language) with description logics; notable examples include AL-log [6] and CARIN [22]. While partially motivated by the desire to increase the expressive power of both components, these attempts (esp. AL-log) at hybrid systems were strongly constrained by the desire to retain both the modeling and the computational properties of the respective components, and even, perhaps, the implementation techniques or actual implementations. (For example, the proof procedure for AL-log described in [6] calls an independently developed description logic reasoner as a oracle.)

In general, when considering combination formalisms, the upper bound is the unrestricted union of the two systems. In essence, the Semantic Web Rule Language (SWRL)Footnote 1 [13] is the unrestricted union of OWL DL (i.e. roughly the description logic SHOIN(D))) and (binary) function-free Horn logic. The result is a very expressive formalism which is, unsurprisingly, undecidable. Also, it is comparatively not well understood: there are no native reasoners for it, relationships to other formalisms are not precisely mapped out, and there is almost no experience in using SWRL for ontology modeling. However, it does serve as a unifying overarching formalism for various rule and rule like extension to OWL DL. It is, for example, a superset of (binary) AL-log and of CARIN.

Decidability can be regained with the imposition of a safety condition on SWRL rules. Essentially, the possible values of (explicit) variables in SWRL rules are restricted to named individuals only which confines the direct effects of such rules to the ABox. This safety condition is known as “DL-Safety” and such SWRL rules are generally called “DL-Safe SWRL rules” or “DL-Safe rules”. Not only are DL-Safe rules (in combination with OWL-DL) decidable, but reasonable implementations are emerging.

SWRL was first proposed under the name OWL Rules Language [13] before gaining built-in atoms and a more RuleMLFootnote 2 flavored syntax. In that form, it was published as a W3C member submission. The decidability of SWRL rules with the DL-Safety condition was established in [32, 33], and further elaborated in [29], including a discussion of a robust implementation of (most of) OWL plus DL-safe rules, KAON2.

2.1 Definition of SWRL

SWRL contains OWL DL as a proper part, that is, all OWL DL axioms are SWRL axioms. Additionally, a SWRL knowledge base may contain a set of rules, which consist of an antecedent (body) and a consequent (head) which themselves are sets of SWRL atoms.

A SWRL atom may be of the followingFootnote 3 forms:

  • Unary atoms:

Table 1
  • Binary atoms:

Table 2

Where arguments are of the form:

Table 3

A SWRL rule is of the form:

  • \(Ato{m}_{1} \wedge \ldots \wedge Ato{m}_{n} \rightarrow Ato{m}_{n+1} \wedge \ldots \wedge Ato{m}_{m}\)

where atoms 1 through n form the antecedent (i.e. body) and atoms n+1 through m form the consequent (i.e. the head).

The semantics of SWRL are traditionally given via an extension of the “direct” model theory for OWL DL.Footnote 4 However, for current purposes it is is a little more perspicuous to present the semantics as an extension of the standard translationFootnote 5 of description logics to first order logic. To avoid various tedious details of the translation of SHOIN(D) which are irrelevant to understanding SWRL, we give only the translation of the simpler description logic SH, that is, omitting nominals, inverse roles, number restrictions, and datatypes (but retaining (in)equality). We therefore also eliminate SWRL atoms with data valued arguments.

In the table below, X and Y are meta-linguistic variables that range over constants (i.e. names of individuals) or object variables (i.e. x, y, and z). A represents an arbitrary atomic concept, C and D represent arbitrary class expressions, a and b represent arbitrary constants, and P represents an arbitrary role:

  • Atomics

Table 4
  • Concept expressions

Table 5
Table 6

It is clear that, except for transitivity axioms, \(\mathcal{SH}\) can be encoded into first order logic using only two distinct variables (i.e. x and y) and transitivity only needs one additional variable (i.e. z). To extend this translation to a SWRL extension of \(\mathcal{SH}\), we need an arbitrary supply of variables, that is, at least enough for each distinct variable in the rule with the largest number of distinct variables in a given rule set. To help distinguish translations of \(\mathcal{SH}\) axioms from translations of SWRL rules, we shall use capital letters from {X, Y, Z} with subscripts when necessary.

Let \(\Psi = {\psi }_{1} \wedge \ldots \wedge {\psi }_{n} \rightarrow {\psi }_{n+1} \wedge \ldots \wedge {\psi }_{m}\) be a SWRL rule, such that \(V ar(\Psi ) = {V }_{1} \ldots {V }_{k}\) are all the SWRL variables in the atoms \({\psi }_{1} \ldots {\psi }_{m}\). Then we can extend the translation function, π, as follows (note that the meta-variables \(\mathcal{X}\) and \(\mathcal{Y}\) now also range over SWRL variables):

  • Atomics

Table 7
  • Axioms

Table 8

One immediate consequence of the translation is that it is obvious that SWRL rules can entirely replace the role axioms of \(\mathcal{SH}\):

Table 9

Clearly, replacing the variables in the first order translation of the \(\mathcal{SH}\) axioms with their uppercased versions results in the first order translation of the SWRL rule. Thus \(\mathcal{SH}\)+SWRL is trivially reducible to \(\mathcal{ALC}\)+SWRL. Of course, concept inclusion axioms may be encoded as SWRL rules analogously to how property inclusions are (at least, if we allow concept expressions as the functor of atoms; otherwise, we need at least some definitions). If, as the SWRL submission does, we permit SWRL rules with empty antecedents, then we can assimilate the ABox axioms (i.e. type, property, and (in)equality assertions) as well.

These reductions, as observed in [13], highlight the fact that Description Logics can be see as rule languages, given a sufficiently liberal notion of rule. The flip side is that SWRL rules have more in common with description logic axioms than with Datalog rules and certainly more than with production or ECA rules.

While we know of no user study comparing the usability of explicit rules to Description Logic style variable free axioms (and we believe that this would be a very difficult study to conduct), there is no shortage of claims that one style or the other is more usable, transparent, or easy to learn. For example, some researchers working on controlled natural langauges (CNLs) for OWL argue that it is better to produce a CNL sentence corresponding to the SWRL rule (including explicit variables!) for transitivity instead of using the more succinct “Property P is transitive”. At least one trade off seems clear: Description Logic “variable free” style is less cluttered with (clearly redundant!) variables, whereas SWRL style is probably initially more comfortable for people familiar with rule languages such as Prolog or with first order logic or with query languages like SQL. The lack of “visual noise” for standard Description Logic axioms (i.e. concept and property subsumption, transitivity, inverse, etc.) seems decisive except for explication purposes. Similarly, the operator style syntax of Description Logics makes it easier to manage complex nested expressions. This suggests that there may be user advantages to continuing to adopt more expressive role constructors (such as the expanded role composition operator in OWL 1.1).

The undecidability of \(\mathcal{SHOIN}\)+SWRL can easily be seen by the fact that it is possible to encode the transitivity of an otherwise simple role using a SWRL rule. Transitive roles in number restrictions are a well known source of undecidability for \(\mathcal{SHIQ}\) (e.g. see [14]), and thus of OWL DL as well. Of course, it is also easy to directly encode undecidable domino tiling problems in SWRL (as described in [13], for which \(\mathcal{SH}\)+SWRL is sufficient) or other known undecidable extensions (such as role-value-maps).

We have seen that we can see SWRL as a very straightforward generalisation of description logics. The addition of arbitrary variables to conditionals brings in a lot of expressive power. However, SWRL is a somewhat strange fragment of first order logic. It lacks, at least, n-ary predications and function symbols, but it nevertheless is only semi-decidable. Of course, pure Prolog is another case of an undecidable fragment of first order logic, but there the question of “Why not move to full first order logic?” has a well known answer: Prolog has a proof procedure which gives rise to a powerful, reasonably efficient in the common case, and understandable performance model for computations. In fact various compromises (such as omitting the occurs check) have well understood performance (and soundness/completeness) tradeoffs. Unfortunately, there is no such body of knowledge about SWRL yet.

2.2 Definition of DL-Safe SWRL

The free syntax of SWRL (e.g. conjunctions in the head and arbitrary concept expressions as atoms) helps emphasis the similarities of SWRL rules with Description Logic axioms, but it obscures the relation between SWRL rules and rules systems based on Horn clauses, such as Datalog. However, it is easy enough to transform an arbitrary SWRL knowledge base (consisting of a rules part and a Description Logic part) into a form where all the SWRL rules consequents contain only a single conjunct and all the atoms are atomic. (Essentially, definitions are added to the description logic part that replace each complex class atom with a fresh atomic atom, and conjunctive consequences are eliminated via the Lloyd–Topor transformations [24] as mentioned in the SWRL submission.)

SWRL ontologies in this form of a knowledge base resemble hybrid Description logic and Datalog knowledge bases. By adjusting the rules portion to be semantically more like Datalog rules (that is, so that the rules act only on the explicit facts in the knowledge and other rules), the hybrid flavor becomes stronger including regained decidability. In the translation to first order logic, one can impose the safety restriction (of variables to named individuals) by means of a special DL predicate, O, which is true of all named individuals (i.e. there is a fact of the form O(a) for all individual names, a, appearing in the ontology) and does not appear in any concept expression of the ontology (and thus not in the scope of any existential quantifier).Footnote 7 Then, for each variable in the DL-safe rule, an O-atom with that variable is added to the body.Footnote 8

That is, we extend the translation to first order in the following way. Let \(\Omega (K) = {c}_{1} \ldots \ {c}_{n}\) be the set of individual names appearing in a knowledge base K. \(K' = K \cup \{ {c}_{1} : O \ldots {c}_{n} : O\}\). Π is then applied to the elements of K′. Furthermore, let \({\Psi }_{dls} = {\alpha }_{1} \wedge \ldots \wedge {\alpha }_{n} \rightarrow {\alpha }_{n+1}\) be a DL-Safe rule such that every α is atomic and \(V ar({\Psi }_{dls}) = {v}_{1} \ldots {v}_{k}\) are all the SWRL variables in the atoms \({\alpha }_{1} \ldots {\alpha }_{n+1}\). Then:

Table 10

It is clear from the translation that the DL-Safe version of the SWRL rule is much weaker than the unrestricted version. Consider the following simple example (adapted from [39]):

$$\begin{array}{rlrlrl} \text{Foot} & \sqsubseteq \exists \text{partOf}.\text{Leg} &1 \\ \text{BurnOnFoot} & \sqsubseteq \exists \text{locatedIn}.\text{Foot} &2 \\ \text{LegInjury} & \equiv \exists \text{locatedIn}.\text{Leg} &3 \\ <\text{burn1, foot1}> & : \text{locatedIn} &4 \\ <\text{foot1, leg1}> & : \text{partOf} &5 \\ \text{leg1} & : \text{Leg} &6 \\ \text{foot1} & : \text{Foot} &7 \\ \text{burn2} & : \text{BurnOnFoot} &8 \\ \text{locatedIn(X, Y)} \wedge \text{partOf(Y, Z)} & \rightarrow \text{locatedIn(X, Z)} &\end{array}$$
(9)

If we interpret (8) as an unrestricted SWRL rule, then we can conclude:

$$\begin{array}{rlrlrl} <\text{burn1},\text{leg1}> & : \text{locatedIn} &10 \\ \text{burn1} & : \text{LegInjury} &11 \\ \text{BurnOnFoot} & \sqsubseteq \text{LegInjury} &12 \\ \text{burn2} & : \text{LegInjury} &\end{array}$$
(13)

whereas, if we impose DL-Safety on (8), we can only conclude (10) and (11). Clearly, with DL-Safety, rules can still interact with Description Logic axioms, but only through new ground facts. It is because we infer (10) (via (9)) that we can conclude (11) (via the class definition (3)). Thus, DL-Safety constrains rules to work on and through ground facts.

DL-Safe SWRL rules, in addition to being much more computationally reasonable, may be more cognitively adequate, perhaps due to their relative expressive weakness. For users coming from a database background, they can be seen as a data manipulation language. It is at least plausible that it is somewhat easier for the typical user to understand why a missing fact blocks an entailment, than to understand why a subsumption fails because of there only being necessary, but not sufficient, conditions defined.

2.3 Built-ins

This more programmatic feel is enhanced by the presence of built-in atoms, that is, atoms with a fixed, predefined interpretation. The SWRL submission includes built-ins for value comparison, mathematics, and string manipulation among others. There are several issues with built-ins with perhaps the most prominent being how they are to be interpreted if their variables are under-instantiated when being evaluated (that is, whether they should be interpreted as arbitrary constraints or more procedurally, e.g. “throwing” an error when an binding is of an inappropriate type or must be drawn arbitrarily from the domain rather than determined by the knowledge base). However, SWRL built-ins seem fairly popular: at least they are reported as desired, as a supplement to OWL’s datatype facility. In spite of this clamor, it is unclear what the right semantics of built-ins (or even just data property atoms) should be, in part due to the fact that the most natural reading of data property atoms (and built-ins) is as general constraints, whereas many users talk about built-ins as if they were procedural attachments.

3 Rule Fragments of OWL

3.1 Description Logic Programs

DLP are a naive Horn fragment of OWL. They inherit their semantics from OWL, thus adhering to the open world assumption. At the same time, DLPs can be transformed syntactically into Logic Programming syntax, and thus provide a kind of basic interoperability between OWL and Logic Programming. Let it be noted, though, that DLP is not a common fragment of OWL and Logic Programming, because the two semantics normally considered are different. Nevertheless, the two semantics have a clearly understood and strong relationship, about which we will talk later in Sect. 3.2.3.

Compared to OWL DL, DLP is a rather primitive ontology language. It strictly contains, however, the OWL DL fragment of RDFS (see chapter “Resource Description Framework.”) and has the pleasing property of having polynomial data complexity. It is thus one of the tractable OWL fragmentsFootnote 9 discussed within the currently ongoing OWL 2 standardisation effort.Footnote 10

According to an analysis in [41], most of the existing OWL ontologies are almost completely contained in DLP.Footnote 11 An example is the Semantic Web Research Community ontology, SWRC [40],Footnote 12 which is the most imported ontology on the web.Footnote 13

DLP was originally presented in [11], and a thorough treatment can be found in [41].

3.1.1 Definition of DLP

Originally, DLP was presented as fragment of OWL. We present DLP in an alternative and more constructive way, which exposes the modeling capabilities and the limitations of it. It can be considered a kind of normal form for DLP.

We need to fix terminology first. We understand DLP as a semantic fragment of OWL, i.e. we abstract (for the time being) from a concrete syntax: Every OWL statement which is semantically equivalent – in the sense of first order logic – to a (finite) set of function-free Horn clauses constitutes a valid DLP statement.Footnote 14 Allowing integrity constraints, we call the resulting fragment DLP IC (or just IC). Allowing integrity constraints and equality, we call the resulting fragment DLP ICE (or ICE). We write DLP + for the (semantic) fragment common to OWL DL and (function-free non-disjunctive) Datalog. Analogously, we write DLP + IC, IC +, etc.

Now to the definition. Allowed are the following, where a, b, a i stand for individuals, C stands for a concept name and R, Q, R i , Qi, j stand for role names.

  • ABox:

Table 11
  • Property Characteristics:

Table 12
  • TBox: We allow expressions of the form

    $$\exists {Q}_{1,1}^{(-)} \ldots \exists {Q}_{1,{m}_{1}}^{(-)}\!.{\texttt{Left}}_{1}\sqcap \cdot \sqcap \exists {Q}_{k,1}^{(-)} \ldots \exists {Q}_{k,{m}_{k}}^{(-)}.{\texttt{Left}}_{k} \sqsubseteq \forall {R}_{1}^{(-)} \ldots \forall {R}_{n}^{(-)}.\texttt{Right}$$

    where the following apply.

    • For DLP we allow Left j to be of the forms C, {o1, , o n },⊥or⊤ , and Right to be of the forms C or⊤.

    • For DLP IC we allow Left j to be of the forms C, {o1, , o n },⊥ , or⊤ , and Right to be of the form C,⊤ , or⊥.

    • For DLP ICE we allow Left j to be of the forms C, {o1, , o n },⊥ , or⊤ , and Right to be of the form C,⊤ ,⊥ , or {o}.

    • For the DLP + versions we furthermore allow Right to be of the form ∃R(−). {a}.

    The superscript (−) shall indicate that an inverse symbol may occur in these places. Note that (by a common abuse of notation) we allow any of k, m i , n to be zero. For k=0 the left hand side becomes⊤. Note also that we could have disallowed⊥on the left and⊤on the right, since in either case the statement becomes void. Likewise, it would suffice to require n=0 in all cases, since universal quantifiers on the right are expressable using existentials on the left. Disallowing the existential quantifiers on the left (while keeping universals on the right) is also possible, but at the expense of the introduction of an abundance of new concept names. As an example, note that ∃R. C ⊓ ∃Q. DE would have to be translated into the set of statements \(\{{C}_{1} \sqcap {D}_{1} \sqsubseteq E,C \sqsubseteq \forall {R}^{-}.{C}_{1},D \sqsubseteq \forall {Q}^{-}.{D}_{1}\}\), where C1 and D1 are new concept names. Our representation is more compact.

Using any of the established syntaxes of the OWL language, an OWL axiom is said to be in DLP if its translation into Description Logic syntax results in a finite set of statements of the above mentioned form.

3.1.2 An Example

We give a small example ontology which displays the modeling expressivity of DLP:

For the TBox, we model the following sentences

  1. (1)

    Every man or woman is an adult

  2. (2)

    A grown-up is a human who is an adult

  3. (3)

    A woman who has somebody as a child, is a mother

  4. (4)

    An orphan is the child of humans who are dead

  5. (5)

    A lonely child has no siblings

  6. (6)

    AIFB researchers are employed by the University of Karlsruhe

They can be written in DL syntax as follows – the axioms actually constitute an \(\mathcal{ALCIO}\) TBox (see chapter “Description Logics”).

$$\begin{array}{rlrlrl} \text{Man} \sqcup \text{Woman} & \sqsubseteq \text{Adult} &14 \\ \text{GrownUp} & \sqsubseteq \text{Human} \sqcap \text{Adult} &15 \\ \text{Woman} \sqcap \exists {\text{childOf}}^{-}.\top &\sqsubseteq \text{Mother} &16 \\ \text{Orphan} & \sqsubseteq \forall \text{childOf}.(\text{Dead} \sqcap \text{Human}) &17 \\ \text{LonelyChild} & \sqsubseteq \neg \exists \text{siblingOf}.\top &18 \\ \text{AIFBResearcher} & \sqsubseteq \exists \text{employedBy}.\{\text{UKARL}\} &\end{array}$$
(19)

Using the forms of DLP statements which we introduced, the TBox can be written as follows.

$$\begin{array}{rlrlrl} \text{Man} & \sqsubseteq \text{Adult} &1 \\ \text{Woman} & \sqsubseteq \text{Adult} &1 \\ \text{GrownUp} & \sqsubseteq \text{Human} &2 \\ \text{GrownUp} & \sqsubseteq \text{Adult} &2 \\ \text{Woman} \sqcap \exists {\text{childOf}}^{-}.\top &\sqsubseteq \text{Mother} &3 \\ \text{Orphan} & \sqsubseteq \forall \text{childOf}.\text{Dead} &4 \\ \text{Orphan} & \sqsubseteq \forall \text{childOf}.\text{Human} &4 \\ \text{LonelyChild} & \sqsubseteq \,\forall \text{siblingOf}.\perp &5 \\ \text{AIFBResearcher} & \sqsubseteq \exists \text{employedBy}.\{\text{UKARL}\} &\end{array}$$
(6)

We note that for (5) we require DLP IC, while for (6) we require DLP+. As an example for an RBox, we use the following.

$$\begin{array}{rlrlrl} \text{parentOf} \equiv {\text{childOf}}^{-} &\qquad \text{parentOf and childOf are inverse roles.} & & \\ \text{parentOf} \sqsubseteq \text{ancestorOf} &\qquad \text{parentOf is a subrole of ancestorOf.} & & \\ \text{fatherOf} \sqsubseteq \text{parentOf} &\qquad \text{fatherOf is a subrole of parentOf.} & & \\ \top \sqsubseteq \forall \text{ancestorOf}.\text{Human} &\qquad \text{Human is the domain of ancestorOf.} & & \\ \top \sqsubseteq \,\leq \! 1{\text{fatherOf}}^{-} &\qquad \text{fatherOf is inverse functional.} & & \end{array}$$

We can populate the classes and roles by means of an ABox, e.g. in the following way.

$$\begin{array}{rlrlrl} \{\text{Ian},\text{Benjamin},\text{Raphael},\text{Horrocks}\} & \sqsubseteq \text{Man} & & \\ \{\text{Yue},\text{Ulrike}\} & \sqsubseteq \text{Woman} & & \\ \text{Ian} & = \text{Horrocks} & & \\ <\text{Ian},\text{UMAN}> & : \text{employedBy} \ldots & & \end{array}$$

Note that an ABox statement such as

$$\{\text{Yue},\text{Ulrike}\} \sqsubseteq \text{Woman}$$

is simply syntactic sugar for the two statements

$$\text{Yue} : \text{Woman}\qquad \text{Ulrike} : \text{Woman}.$$

We therefore consider it to be part of the ABox. To be precise, the original statement actually is (syntactically) not in OWL Lite, but the equivalent set of three ABox statements is. The statement {Ian}={Horrocks} requires DLP ICE.

Note also that class inclusions cannot in general be replaced by equivalences. For example, the statement

$$\text{Adult} \sqsubseteq \text{Man} \sqcup \text{Woman}$$

is not in DLP.

3.1.3 Relation to Logic Programming

A DLP knowledge base can be translated into Horn logic, and the latter can be expressed using Logic Programming syntax. To be more precise, DLP translates syntactically into Datalog. Let us first continue our example, giving the knowledge base in Datalog form.

The TBox is as follows.

$$\begin{array}{rlrlrl} \text{Adult}(y) & \leftarrow \text{Man}(y) &1 \\ \text{Adult}(y) & \leftarrow \text{Woman}(y) &1 \\ \text{Human}(y) & \leftarrow \text{GrownUp}(y) &2 \\ \text{Adult}(y) & \leftarrow \text{GrownUp}(y) &2 \\ \text{Mother}(y) & \leftarrow \text{childOf}(x,y) \wedge \text{Woman}(y) &3 \\ \text{Dead}(y) & \leftarrow \text{Orphan}(x) \wedge \text{childOf}(x,y) &4 \\ \text{Human}(y) & \leftarrow \text{Orphan}(x) \wedge \text{childOf}(x,y) &4 \\ & \leftarrow \text{LonelyChild}(x) \wedge \text{siblingOf}(x,y) &5 \\ y = \text{UKARL} & \leftarrow \text{AIFBResearcher}(x) \wedge \text{employedBy}(x,y) &\end{array}$$
(6)

Translating the RBox yields the following statements.

$$\begin{array}{rlrlrl} \text{parentOf}(x,y) & \leftarrow \text{childOf}(y,x) & & \\ \text{childOf}(x,y) & \leftarrow \text{childOf}(y,x) & & \\ \text{ancestorOf}(x,y) & \leftarrow \text{parentOf}(x,y) & & \\ \text{parentOf}(x,y) & \leftarrow \text{fatherOf}(x,y) & & \\ \text{Human}(y) & \leftarrow \text{ancestorOf}(x,y) & & \\ y = z & \leftarrow \text{fatherOf}(y,x) \wedge \text{fatherOf}(z,x) & & \end{array}$$

Translated as such, DLP knowledge bases can also be evaluated under Datalog semantics, which differs from the OWL semantics. The two semantics, however, coincide on the set of inferred instances of named classes, i.e. ABox reasoning in DLP can be done using Datalog semantics. The formal relationship between the two semantics is as follows.

Theorem 1.

Let K be a DLP knowledge base and let K′ be the translation of K into Datalog syntax. Let C be a named class and a be a named individual. Then K⊧ {OWL} C(a) under the OWL semantics iff K⊧ {Datalog} C(a) under the Datalog semantics. Footnote 15

Very recently, in the wake of the already mentioned forthcoming revision of the OWL standard, which will be based on the \(\mathcal{SROIQ}\) description logic, a naive rule fragment of \(\mathcal{SROIQ}\) has been identified which considerably extends DLP, but is not a fragment of \(\mathcal{SHOIN}\)(D) (i.e. of OWL DL). It is called \(\mathcal{SROIQ}\) Rules, and the interested reader shall be pointed to [21] (see also [10, 36]).

3.2 Horn-SHIQ

Horn-SHIQ is another Horn fragment of OWL DL, which encompasses DLP. To be precise, Horn-SHIQ has a feature which lies outside OWL DL, namely the use of qualified number restrictions.Footnote 16 The corresponding fragment lying within OWL DL would be Horn--SHIQ, which is obtained from Horn--SHIQ by simply disallowing the use of qualified number restrictions.

Horn--SHIQ has the pleasing property that it is of tractable (i.e. polynomial) data complexity [15, 29], while its combined complexity is ExpTime [20]. It thus provides striking balance between expressivity and ABox reasoning scalability. While Horn-SHIQ can be dealt with by any of the standard OWL reasoners, it is specifically supported by KAON2Footnote 17 [29] – see chapter “Resolution-Based Reasoning for Ontologies” – and by the new HermiT systemFootnote 18 [34].

The original definition of Horn-SHIQ, due to [15, 29], remained implicit. It was defined as the fragment of \(\mathcal{SHIQ}\) which, after transformation by the KAON2 algorithms, resulted in (non-disjunctive) Datalog. It is outside the scope of this chapter to detail the underlying KAON2 algorithms, and we refer the reader to chapter “Resolution-Based Reasoning for Ontologies” and to [29] for this. Instead, we give an alternative definition by means of a grammar.

3.2.1 Definition of Horn--SHIQ

The following definition is taken from [19], where also a formal proof can be found that this definition coincides with the original notion.

We say that a \(\mathcal{SHIQ}\) axiom CD is Horn if the concept expression ¬CD has the form C1+ as defined by the context-free grammar in Table 1. A \(\mathcal{SHIQ}\) knowledge base with an extensionally reduced ABox is in Horn-SHIQif all of its TBox axioms are Horn.

Table 1 A grammar for defining Horn-SHIQ

It is easily seen by referring to the definition on page 10, that DLP IC is indeed contained in Horn-SHIQ. Just note that the use of {o1, , o n } on the Left is removed by extensionally reducing the ABox. Intuitively speaking, Horn-SHIQ adds the free use of role restrictions to DLP, as, e.g. existential restriction can be used freely.

3.2.2 An Example

As an example for a Horn-SHIQknowledge base, consider the ontology in Table 2, which exemplifies the expressivity possible in Horn-SHIQ. Note in particular the free use of role restrictions which is not possible in DLP.

Table 2 An example ontology in Horn-SHIQ

3.2.3 Relation to Logic Programming

Horn-SHIQ can be translated into Datalog syntax, i.e. it can be understood as a rule fragment of \(\mathcal{SHIQ}\). We do not have the space to detail the underlying KAON2 translation algorithms, and refer to chapter “Resolution-Based Reasoning for Ontologies” and [29] for this. It shall be noted, though, that this transformation is not an equivalence translation in the sense that the original ontology and its translation have the same models. The relationship is more intricate, as given in the following theorem from [29].

Theorem 2.

Let K be a Horn-SHIQ knowledge base and let D(K) be the transformation of K into Datalog syntax resulting from the application of the KAON2 transformation algorithms. Then the following hold.

  1. 1.

    K is unsatisfiable if and only if D(K) is unsatisfiable.

  2. 2.

    K⊧α if and only if D(K) entails α under Datalog semantics, where α is of the form A(a) or R(a,b), and A is an atomic concept.

  3. 3.

    K⊧C(a) for a non-atomic concept C if and only if, for Q a new atomic concept, Q(a) is entailed by D(K ∪{ C ⊑ Q}) under the Datalog semantics.

In order to exemplify the mentioned transformation, we give a translation of the ontology from Table 2 into a logic program which can be executed under Prolog with tabling.Footnote 19 This example is due to [37].

So consider the ontology given in Table 2. The corresponding translation to logic programming is given in Table 3. Let us first consider the upper part, which shows the rules directly created in the translation. Some of the rules clearly represent (part of) some \(\mathcal{SHIQ}\)-axiom, as is the case for “person(X)← nosiblings(X). ” and axiom (4). Other rules are obtained by more complicated reasoning steps, such as, e.g. “parent(X)← manychildren(X). ” which is obtained from axioms (3) and (1). While such rules are still fairly self-explanatory, there are also a number of axioms that include predicates of the form Sf(X, X f ) which do not appear in the original knowledge base. These predicates are introduced during the transformation process, more precisely during a step for eliminating Skolem-functions. Intuitively, Sf(X, Y ) holds if and only if Y=f(X). However, the predicates Sf are only satisfied for a finite number of constants, since arbitrary application of functions is not needed and might even lead to undecidability. The exact number of additional function symbols may vary from case to case. Finally, two of the rules represent integrity constraints by means of the predicate {inc}, in the sense that {inc} evaluates to true if the integrity constraint is violated.

Table 3 Continuation of the example from Table 2: Its translation into Horn-logic, consisting of the translated rules (middle) and auxiliary axioms (bottom)

The rules in the lower part of Table 3 define various auxiliary predicates that are needed for the correctness of the translation. In order to restrict these definitions to a finite number of terms, we introduce a predicate O that specifies the individuals for which the program applies. In our case, these are just the individuals from the ABox. Using O, we define Sf as discussed above. Further, we introduce a predicate HU defining which terms are considered in the program, namely individuals from O and their immediate successors for each function symbol. The remaining rules yield a necessary equality theory, restricted to the terms in HU.

The resulting program now allows us to conclude several ABox statements. For example, we can derive that “parent({Elaine})” and that “{Sir Lancelot}≈ {Lancelot du Lac}”.

4 Hybrid Approaches

In Sect. 2, we discussed the SWRL rule extension of OWL, which basically follows the design principles of OWL DL by adhering to the open world assumption and by being semantically based on first-order predicate logic. In Sect. 3, we discussed rule languages which are fragments of OWL DL, and thus inherit its semantics.

We have focussed on these perspectives for several reasons:

  • They align with OWL DL semantically in a very natural way

  • They are supported by some of the most prominent and powerful OWL reasoning engines

  • They appear to be least disputed as to their importance for ontology modeling

At the same time, there is a multitude of proposals for hybrid systems which comprise both classical OWL reasoning and traditional rule-based approaches like logic programming in different variants. The quest for such hybrid solutions is currently still ongoing, but is not yet close to a conclusion. We briefly discuss the two approaches which we consider to be most mature at this stage.

The first of these is called Hybrid MKNF knowledge bases due to [30, 31], which roughly is an autoepistemic extension of OWL DL with DL-safe rules. The result is a seamless integration of open- and closed-world reasoning within a single framework which encompasses both OWL DL reasoning and prominent forms of non-monotonic reasoning. Recent investigations [17, 18] strive at establishing an implementable semantics for this approach.

The second approach is based on an integration of OWL DL reasoning with Answer Set Programming, which has been realised as the dlvhex system [8, 9, 38]. The integration is less strong as for Hybrid MKNF knowledge bases, and basically consists of two reasoning engines which interact in a bidirectional way when reasoning over knowledge bases.

Many additional approaches are currently being investigated and proposed, ranging from tightly integrated ones to loosely coupled systems. We list recent references as a starting point for the interested reader [4, 5, 7, 12, 23, 2527, 34, ].

5 Conclusions

Our discussion of ontologies and rules is centered on two specific paradigms of “ontology” formalisms and rule formalisms: Description Logics and logic programming (though we have only lightly touched on issues with various forms of non-monotonicy and similar core features of logic programming systems). While arguably these are both very prominent, one might say dominant, formalisms in the ontology engineering communities today – and there is an enormous amount of work on their combination as we have seen – historically, this was not always the case. For example, if we consider expert systems of the 1970s and 1980s such as Mycin [3] we find that production rule languages were quite prominent as rule formalisms for ontologies, and for knowledge representation more generally. Today, that community generally represents itself as dealing with “business rules” almost exclusively.Footnote 20 This is reflected in the make up of the currently ongoing rules interchange format (RIF) working groupFootnote 21 of the W3C.

Integrating logic programming and business rules, much less description logics, has proven to be challenging. This is rather surprising given the obvious parallels between Prolog and OPS5 style rules and the natural thought that use of forward chaining inference methods – or more specifically variants of the Rete algorithm – is irrelevant to the semantics of the rules. It seems very natural to think that a (simple) relational database with some (simple) event-condition-action (ECA) rules is equivalent to that relational database with some Datalog rules. However, a database administrator may have reason to prefer that the ECA rule evaluation modified the database. In fact, that may have been a key feature of those rules: consider a situation where one wished to validate certain inputs but only at input time, that is, subsequent operations are licensed to violate the validation criteria. In such contexts, the notion of “assert” and “retract” have representational significance. If you add, in the action language, the ability to execute code fragments written in a programming language, it seems clear that there is a fundamental divergence. Unfortunately, unlike with Description Logics and logic programming, we do not currently have a well established common semantic framework (i.e. modal theory) ready to hand to aid us with integration.