SWRL is a Semantic Web Rule Language, which combines OWL and RuleML

An OWL ontology in the abstract syntax contains a sequence of axioms and facts. Axioms may be of various kinds, e.g., subClass axioms and equivalentClass axioms. It is proposed to extend this with rule axioms.

axiom ::= rule

A rule axiom consists of an antecedent (body) and a consequent (head), each of which consists of a (posibly empty) set of atoms. A rule axiom can also be assigned a URI reference, which could serve to identify the rule.

rule ::= 'Implies(' [ URIreference ] { annotation } antecedent consequent ')'
antecedent ::= 'Antecedent(' { atom } ')'
consequent ::= 'Consequent(' { atom } ')'

Informally, a rule may be read as meaning that if the antecedent holds (is “true”), then the consequent must also hold. An empty antecedent is treated as trivially holding (true), and an empty consequent is treated as trivially not holding (false). Rules with an empty antecedent can thus be used to provide unconditional facts; however such unconditional facts are better stated in OWL itself, i.e., without the use of the rule construct. Non-empty antecedents and consequents hold iff all of their constituent atoms hold, i.e., they are treated as conjunctions of their atoms. As mentioned above, rules with conjunctive consequents could easily transformed into multiple rules each with an atomic consequent. This principles leads to an atomistic approach, similar to Symbolic Analysis.

OWL’s atom is like this:

atom ::= description '(' i-object ')'
	 | dataRange '(' d-object ')'
	 | individualvaluedPropertyID '(' i-object i-object ')'
	 | datavaluedPropertyID '(' i-object d-object ')'
	 | sameAs '(' i-object i-object ')'
	 | differentFrom '(' i-object i-object ')'
	 | builtIn '(' builtinID { d-object } ')'
builtinID ::= URIreference

Let’s see AHO to compare it into the atom of Symbolic Analysis.

Comparing RuleML and Prolog


discount(customer,product1,’5.0 percent’) :-

The corresponding XML-query in RuleML:

<ind>5.0 percent</ind>


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) and 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 as a brother then John has Bill as an uncle.

In RuleML it is:

  <ruleml:_rlab ruleml:href="#example1"/>
    <swrlx:individualPropertyAtom  swrlx:property="hasParent">
    <swrlx:individualPropertyAtom  swrlx:property="hasBrother">
    <swrlx:individualPropertyAtom  swrlx:property="hasUncle">

In Prolog it is:

hasUncle(X1, X3):-

hasParent(X1, X2), hasBrother(X2, X3).

Comparison: Semantics of Semantic Web and Symbolic Analysis

Some differences between the Semantic Web policy and the one of Symbolic Analysis.

Atom Condition on Interpretation
C(x) S(x) ∈ EC(C)
D(z) S(z) ∈ EC(D)
P(x,y) <S(x),S(y)> ∈ ER(P)
Q(x,z) <S(x),L(z)> ∈ ER(Q)
sameAs(x,y) S(x) = S(y)
differentFrom(x,y) S(x) ≠ S(y)
builtIn(r,z1,…,zn) <S(z1),…,S(zn)> ∈ D(f)

In Symbolic Analysis all definitions are clauses. The clause has its Prolog-based syntax, being a fact. However, the principles and the main goal have many similar features.

Some links


Atom is a system for distribution of information on the web (see http://semtext.org/atom/atom-semweb.htm). It is also a project that aims to create weblog and syndication formats and APIs that the developers can unite behind, allowing future progress in these fields without the political and technical problems that have plagued developers over recent years. The project was initiated by Sam Ruby, and is being developed collaboratively on a Wiki.