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

已经全部改成
"field_mapping": { "from": "from", "to": "to" }刚贴了代码呀 您好 您是人工回复的还是AI呢 
我怎么感觉每次都是贴了代码没有看一样呢




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




你的配置还有一个关键点没改对,导致还是报错:

你的 struct.json 里 edges 的 field_mapping 现在是:
"field_mapping": { "from": "id", "to": "id" }

这会把 edge_connected_to.csv 的 id 列当作边属性导入,但 schema.groovy 的 edgeLabel 没有声明 id 
属性,所以报 “Invalid property 'id' for edge label” 错误。

正确写法应该是:
"field_mapping": { "from": "from", "to": "to" }

这样 loader 只会用 from/to 字段去查找顶点,不会把 id 字段当作边属性导入。

你只需要把 struct.json 里所有 edges 的 field_mapping 全部改成上面这样(只写 from/to),不要写 
id,其他配置不用动。edge_connected_to.csv 的 id 列可以保留,但 loader 不会导入它为边属性。

这样配置后,边就能正常导入且无报错,所有关系都能导入。详细机制见官方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-15206209

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

Reply via email to