This web page categorizes so-called n-ary rules, which refer to a finite list of elements, and present different solutions for supporting them in a rule-based system. These solutions have been implemented in MobiBench.

**Contact**: William Van Woensel

A first subset **(L1)** of n-ary rules enumerate one or more restrictions, each referring to a list element (*#eq-diff2, #eq-diff3, #prp-adp, #cax-adc, #cls-uni*). For instance, rule *#eq-diff2* flags an ontology inconsistency if two equivalent elements of an *owl:AllDifferent* construct are found:

In contrast, rules from a second subset **(L2)** restrain all elements in a list (*#prp-spo2, #prp-key, #cls-int1*). As an example, rule *#cls-int1* infers that y is an instance of an intersection in case it is typed by all intersection member classes:

A third ruleset **(L3)** yields inferences for all list elements (*#cls-int2, #cls-oo, #scm-int, #scm-uni*). As an example, rule #scm-uni infers that each member class of a union is a subclass of that union:

In this section, we present solutions for the different types of n-ary rules.

To support rules from **(L1)** and **(L3)**, the first solution can be applied. To support rules from **(L2)**, one of the other three solutions is needed.

The following two rules infer list membership; i.e., they link each list element (indicated by *rdf:first*) to all preceding list cells (i.e., blank nodes making up the linked list), meaning that the first cell will be directly linked to all list elements.

Using these two rules, rules from **(L1)** and **(L3)** can be supported. As an example, using these rules, *#scm-uni* **(L3)** may be represented as follows:

Since the list membership rules link each list element (in this case, union member class) to the first list cell $?l$, the rule will yield inferences for all member classes of the union.

Based on relevant n-ary assertions from the ontology, this solution instantiates rules from **(L2)**. In particular, an OWL2 RL rule is instantiated for each relevant n-ary assertion (e.g., *propertyChainAxiom* for rule *#prp-spo2*), leading to multiple instantiated rules per original rule. E.g., a property chain axiom P with constituent properties P_{1}-P_{3} will yield the following rule:

In related work, this kind of instantiation (or "rule-templates") approach is applied for any n-ary rule [1] or even for all (instance-based) OWL2 RL rules [2, 3, 4]

Normalize (or "binarize") the input ontology to only contain binary versions of n-ary assertions relevant to **(L2)**. For instance, an n-ary intersection can be converted to a set of binary intersections as follows:

The binary version of rule *#cls-int1* looks as follows:

This rule may be considered recursive, since it both references and infers the same kind of assertion (i.e., *T(?y, type, ?c)*). It is not hard to see how this approach only works for recursive rules, since it relies on producing partial inferences to generate the final inference. Rule *#prp-key* is not a recursive rule, since it infers equivalence between resources but does not refer to such relations. Consequently, this approach only works for rules *#prp-spo2* and *#cls-int1* from **(L2)**.

Replace each rule from **(L2)** by 3 auxiliary rules. Bishop et al. [5] suggested this solution for OWLIM, based on a W3C note [6]. We show the auxiliary rules for *#cls-int* below:

In this solution, a first auxiliary rule starts at the end of any list ($T(?l, rest, nil)$ ), and infers an intermediary assertion for the last element (cell *n*). Starting from the first inference, a second rule travels up the list structure ($T(?l, rest, ?l_2)$ ) by inferring the same kind of assertions for cells *n-1* up until cell *1*. In case the first cell is related to the relevant assertion (e.g., intersection, property chain or has-key), a third auxiliary rule generates the original, n-ary inference.