GitHub user dosubot[bot] edited a comment on the discussion: 关于电网拓扑数据导入
<!-- Answer -->
你的配置还有一个关键点没改对,导致还是报错:
你的 struct.json 里 edges 的 field_mapping 现在是:
```json
"field_mapping": { "from": "id", "to": "id" }
```
这会把 edge_connected_to.csv 的 id 列当作边属性导入,但 schema.groovy 的 edgeLabel 没有声明 id
属性,所以报 “Invalid property 'id' for edge label” 错误。
**正确写法应该是:**
```json
"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](https://github.com/apache/incubator-hugegraph-doc/blob/master/content/en/docs/guides/faq.md)
<!-- Dosu Comment Footer -->
*To reply, just mention
[@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fhugegraph).*
---
Docs are dead. Just use
[Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-tagline&utm_term=apache%2Fhugegraph).
[](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-feedback&utm_term=apache%2Fhugegraph#message_id=208b3933-37fe-4841-bf75-7d3078c7e965)
[](https://github.dosu.com/apache/hugegraph?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-ask-repo&utm_term=apache%2Fhugegraph)
[](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-share-team&utm_term=apache%2Fhugegraph)
GitHub link:
https://github.com/apache/hugegraph/discussions/2917#discussioncomment-15206167
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]