GitHub user wangzhewwzz added a comment to the discussion: 关于电网拓扑数据导入

不是跟你说了 写成"field_mapping": { "from": "from", "to": "to" }导入报错呀 你AI的时候可以认真点吗







         原始邮件
         
       
发件人:dosubot[bot] ***@***.***>
发件时间:2025年12月11日 11:32
收件人:apache/incubator-hugegraph ***@***.***>
抄送:wangzhewwzz ***@***.***>, Mention ***@***.***>
主题:Re: [apache/incubator-hugegraph] 关于电网拓扑数据导入 (Discussion #2917)




你的 struct_1.json 里 edges 的 field_mapping 还是写成了 "from": "id", "to": "id",这会导致 
loader 把 edge CSV 的 id 列当作边属性导入,但 schema.groovy 的 edgeLabel 没有声明 id 属性,所以报错 
“Make sure the primary key fields [id] are not empty, or check whether the 
headers or field_mapping are configured correctly” 或 “Invalid property 'id' for 
edge label”参考。

正确做法:


struct_1.json 的 edges 部分 field_mapping 必须全部为:
"field_mapping": { "from": "from", "to": "to" }

不能有 id。



edgeLabel 的 .properties() 只包含 "source_label", "target_label",不要加 "id"。



value_mapping 必须是平铺结构(你现在的写法没问题)。



edge_connected_to.csv 的 source_label/target_label 必须和顶点 label 完全一致(区分大小写)。


请你把 struct_1.json 里所有 edges 的 field_mapping 全部改成上面这样(只写 from/to),不要写 id,其他配置不用动。

如果还有报错,请贴出 edge_connected_to.csv 的 header 和前几行原始数据,以及 struct.json 某个 edges 
配置的完整内容,我可以帮你定位具体是哪一行或哪一列有问题。

只要这几点全部做到,边就能正常导入且无报错,所有关系都能导入。详细机制见官方FAQ。

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | 
Hallucination | Report 🐛 | Other

   

—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.

GitHub link: 
https://github.com/apache/incubator-hugegraph/discussions/2917#discussioncomment-15226339

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to