首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Grakn中出现“规则图不可分层”错误

Grakn中出现“规则图不可分层”错误
EN

Stack Overflow用户
提问于 2020-06-01 03:07:13
回答 1查看 44关注 0票数 0

我正在尝试插入此规则(数据被屏蔽):

代码语言:javascript
复制
when {
    $d isa person; 
    $a isa animal; 
    $r (role-1: $d, role-2: $a) isa relation-1, has attr $ds; 
    not {$r1 (role-3: $d, role-4: $a) isa relation-2; };
    $ds > 0.5;
}, then {
    (role-3: $a, role-4: $d, role-5: $ds) isa relation-2;
};

然而,在我执行commit之后,我一直收到这个结构验证错误。请帮帮忙

代码语言:javascript
复制
INVALID_ARGUMENT: InvalidKBException-A structural validation error has occurred. Please correct the [`1`] errors found. 
The rule graph is not stratifiable - it contains following cycles with negation: [[[Base Type [RELATION_TYPE] - Id [V65648]  - Label [relation-2] ]]]
. Please check server logs for the stack trace.
All uncommitted data is cleared
EN

回答 1

Stack Overflow用户

发布于 2020-06-01 17:54:48

在Grakn中不允许出现导致循环的规则-例如,在when子句中否定结论。

这里有一个例子来说明原因。

代码语言:javascript
复制
define
person sub entity, plays employee;
employment sub relation, relates employee;

there-are-no-unemployed sub rule,
when {
    $p isa person;
    not {
        (employee: $p) isa employment;
    };
}, then {
    (employee: $p) isa employment;
}

如果我们有一个人不在employment关系中,那么他们就是在employment关系中。但现在,我们已经反驳了规则的最初前提-它们不在employment关系中。因此,我们有一个逻辑上的矛盾。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62121188

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档