首页 > 解决方案 > 无法在 Grakn 中插入带有键的数据

问题描述

我正在将数据摄取到 Grakn 并收到此错误

[person] 类型的事物不止一个拥有 [person-id] 类型的密钥 [949]。

这是我的查询:

insert $a isa customer, has customer-id "94929", has person-id "949";

这是我的架构:

person sub entity, 
key person-id;

customer sub person, 
key customer-id;

标签: vaticle-typedbvaticle-typeql

解决方案


这表明存在类型的实体person或类型的子类型person,在数据库中已经具有 id "949"。如果您运行以下查询,您应该会找到 1 个结果。

match $x isa person, has person-id "949"; get;

推荐阅读