我正在尝试插入此规则(数据被屏蔽):
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之后,我一直收到这个结构验证错误。请帮帮忙
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发布于 2020-06-01 17:54:48
在Grakn中不允许出现导致循环的规则-例如,在when子句中否定结论。
这里有一个例子来说明原因。
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关系中。因此,我们有一个逻辑上的矛盾。
https://stackoverflow.com/questions/62121188
复制相似问题