Do you know how to translate recursion in SWRL. For example, this type of Prolog rules : (an ancestor is a parent or an ancestor of a parent.
ancestor(X,Y):- parent (X,Y).
ancestor(X,Y):- parent(X,Z), ancestor(Z,Y).
In essence, SWRL is Datalog. Just reverse heads and bodies:
hasParent(?x, ?y) -> hasAncestor(?x, ?y)
hasAncestor(?y, ?z) ^ hasParent(?x, ?y) -> hasAncestor(?x, ?z)
SWRLTab in Protégé:
Initial assertions:
Inferred (via Pellet) assertions:
Of course, pure OWL solution also exists.