Section 4. Example Rules


4. Example Rules

Example 4.1-1

A simple use of these rules would be to assert that the combination of the hasParent and hasBrother properties implies the hasUncle property. Informally, this rule could be written as:

hasParent(?x1,?x2) ∧ hasBrother(?x2,?x3) ⇒ hasUncle(?x1,?x3) 

In the abstract syntax the rule would be written like:

Implies(Antecedent(hasParent(I-variable(x1) I-variable(x2))
		   hasBrother(I-variable(x2) I-variable(x3)))
	Consequent(hasUncle(I-variable(x1) I-variable(x3))))

From this rule, if John has Mary as a parent and Mary has Bill has a brother then John has Bill as an uncle.

Example 4.1-2

An even simpler rule would be to assert that Students are Persons, as in Student(?x1) ⇒ Person(?x1).


However, this kind of use for rules in OWL just duplicates the OWL subclass facility. It is logically equivalent to write instead

Class(Student partial Person)


SubClassOf(Student Person)

which would make the information directly available to an OWL reasoner.

Example 4.1-3

A very common use for rules is to move property values from one individual to a related individual, as in the following example that expresses the fact that the style of an art object is the same as the style of the creator.

Artist(?x) & artistStyle(?x,?y) & Style(?y) & creator(?z,?x) ⇒ style/period(?z,?y)
		   artistStyle(I-variable(x) I-variable(y))
		   creator(I-variable(z) I-variable(x)))
	Consequent(style/period(I-variable(z) I-variable(y))))
Example 4.1-4

It is useful to include OWL descriptions in rules, instead of using named classes. The above rule could be augmented with a separate rule to provide information about exclusivity of style (assuming that style is not always exclusive).

Artist(?x) & (≤1 artistStyle)(?x) & creator(?z,?x) ⇒ (≤1 style/period)(?z)
		   (restriction(artistStyle maxCardinality(1)))(I-variable(x))
		   creator(I-variable(z) I-variable(x)))
	Consequent((restriction(style/period maxCardinality(1)))(I-variable(z))))