我已经创建了下面的grakn模式
define
contract sub relation,
relates manufacturer,
relates product;
drug sub entity,
plays product,
has product_name,
has code;
company sub entity,
plays manufacturer,
has manufacturer_name;
product_name sub attribute,
datatype string;
manufacturer_name sub attribute,
datatype string;
code sub attribute,
datatype string;
我有3 csv(药品、公司和合同(
- 药物具有product_name(唯一(和代码
- 公司有制造商名称(唯一(
- 合同具有product_name和manufacturer_name(两者结合在一起是唯一的(
我使用的是grakn提供的相同的migrate.py[修改表的名称]。在摄取过程中,会弹出以下错误。
<_终止于的RPC的集合:status=状态代码.INVALID_ARGUMENTdetails="GraqlSemanticException名称没有'isa'、'sub'或'id'。请检查服务器日志中的堆栈跟踪。"debug_error_string="{"created":"@11588172437.178000000","description":"从对等ipv4:127.0.1:48555收到错误","file":"src/core/lib/surface/call.cc","file_line":1055,"grpc_message":"GraqlSemanticException名称没有"isa"、"sub"或"id"。请检查服务器日志中的堆栈跟踪。","grpc_status":3}">
在grakn提供的phone_calls示例中,我看到ID正在生成(它是自动生成的吗?(我需要在字段(公司、合同和药品(中插入数据。如果需要,我可以分享我写的migrate.py。
'insert $company isa company, has name "' + company["name"] + '";'
因此,在csv文件中,标题应该是"name"。希望这能有所帮助。