1

你知道如何在 SWRL 中翻译递归吗?例如,这种类型的 Prolog 规则:(祖先是父母或父母的祖先。

ancestor(X,Y):- parent (X,Y).
ancestor(X,Y):- parent(X,Z), ancestor(Z,Y).
4

1 回答 1

0

本质上,SWRL 是Datalog。只是颠倒头部和身体:

hasParent(?x, ?y) -> hasAncestor(?x, ?y)
hasAncestor(?y, ?z) ^ hasParent(?x, ?y) -> hasAncestor(?x, ?z)

Protégé 中的 SWRLTab:

swrltab

初步断言:

断言

推断(通过 Pellet)断言:

推断

当然,也存在纯 OWL 解决方案。

于 2017-05-11T10:31:51.370 回答