vaticle-typedb - 无法在 Grakn 中创建 [id] 属性
问题描述
我正在尝试id
像这样定义一个新属性:
define
id sub attribute, datatype double;
但是,当我尝试这个时,我得到了这个语法错误:
define id sub attribute, datatype double;
^
no viable alternative at input 'id'
syntax error at line 1:
define id sub attribute, datatype double;
^
mismatched input 'id' expecting {'match', 'define', 'undefine', 'insert', 'compute'}
All uncommitted data is cleared
不能创建一个名为的属性id
吗?
解决方案
id
is a reserved keyword in Graql.
Therefore, you cannot have a user-defined type called id
, I suggest using identifier
instead.
id
is used for matching concepts in Grakn by their Grakn-generated id, like so:
match $x id V12345; get;
although the recommended approach is instead to match using a user-defined key
.
推荐阅读
- typescript - 如何确保一个接口只包含另一个接口的属性?
- php - 在初始化期间在另一个常量中使用一个常量
- android - 如何在android中制作半径边框?
- c - C - 将结构变量从一个函数传递到另一个函数
- networking - VirtualService 路由只使用一台主机
- highcharts - Angular 8 和 Highcharts - 如何显示工具提示十字准线
- php - 由于重定向或服务器资源导致的流量丢失
- python - 如何使用 PySpark 在数据框中删除基于多个过滤器的列?
- laravel - 无法手动设置会话
- go - 为什么 http.NotFound() 将请求作为参数?