【问题标题】:recursion : from Prolog to SWRL递归:从 Prolog 到 SWRL
【发布时间】:2017-09-04 01:14:00
【问题描述】:

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

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

【问题讨论】:

    标签: prolog swrl


    【解决方案1】:

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

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

    Protégé 中的 SWRLTab:

    初始断言:

    推断(通过 Pellet)断言:

    当然,纯OWL方案也存在。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-04-26
      • 2011-12-09
      • 2014-06-16
      • 2018-10-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多