你知道如何在SWRL中转换递归吗?例如,这种类型的Prolog规则:(祖先是父或父的祖先。
ancestor(X,Y):- parent (X,Y).
ancestor(X,Y):- parent(X,Z), ancestor(Z,Y).发布于 2017-05-11 18:31:51
从本质上讲,SWRL就是Datalog。只需颠倒头部和身体:
hasParent(?x, ?y) -> hasAncestor(?x, ?y)
hasAncestor(?y, ?z) ^ hasParent(?x, ?y) -> hasAncestor(?x, ?z)Protégé中的SWRLTab:

初始断言:

推断(通过Pellet)断言:

当然,也存在纯OWL解决方案。
https://stackoverflow.com/questions/43298673
复制相似问题