我创建了以下 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(药物、公司和合同)药物具有产品名称(唯一)和代码公司有manufacturer_name(唯一)合同具有产品名称和制造商名称(两者结合的唯一性)我正在使用 grakn [修改表的名称] 提供的相同 migrate.py。在摄取期间,会弹出以下错误。<_Rendezvous of RPC 终止于:status = StatusCode.INVALID_ARGUMENT details = "GraqlSemanticException-name 没有 'isa'、'sub' 或 'id'。请检查服务器日志以获取堆栈跟踪。" debug_error_string = "{"created":"@1588172437.178000000","description":"从对等 ipv4:127.0.0.1:48555 收到错误","file":"src/core/lib/surface/call.cc"," file_line":1055,"grpc_message":"GraqlSemanticException-name 没有 'isa'、'sub' 或 'id'。请检查堆栈跟踪的服务器日志。","grpc_status":3}" >在 grakn 提供的 phone_calls 示例中,我看到正在生成 ID(它是自动生成的吗?)我需要将数据插入到字段(公司、合同和药物)中。如果需要,我可以分享我写的 migrate.py。
1 回答

慕尼黑的夜晚无繁华
TA贡献1864条经验 获得超6个赞
请检查 migrate.py 和 csv 文件中使用的名称。两者都应该相同才能将数据插入 grakn-DB。示例:如果您的查询是这样的:
'insert $company isa company, has name "' + company["name"] + '";'
因此,在您的 csv 文件中,标题应为“名称”。希望这可以帮助。
添加回答
举报
0/150
提交
取消