GitHub user dosubot[bot] added a comment to the discussion: 关于电网拓扑数据导入

<!-- Answer -->
edge_connected_to.csv 里的 source_label 和 target_label 两列,应该分别填写 from 和 to 对应顶点的 
label(类型),而且必须和 schema.groovy 里定义的顶点 label 完全一致(区分大小写)。

举例:假设有一行

```
id,from,to,label,source_label,target_label
edge_2,XLD-3445,HWX-3087,CONNECTED_TO,LineSegment,StationHouse
```

这里 XLD-3445 在 vertex_linesegment-1.csv 里,label 是 LineSegment;HWX-3087 在 
vertex_stationhouse-1.csv 里,label 是 StationHouse,所以 source_label 填 
LineSegment,target_label 填 StationHouse。

你可以用 Excel 或脚本批量查找 from/to 在各自顶点 CSV 里的 label,然后填到 source_label/target_label 
列。只要这两列和 schema.groovy 里的顶点 label 完全一致,struct.json 的 value_mapping 
就能正确筛选和导入所有关系,否则会被跳过但不会报错([官方文档说明](https://github.com/apache/incubator-hugegraph-doc/blob/master/content/cn/docs/quickstart/toolchain/hugegraph-loader.md))。

导入后建议用 REST API 查询边类型和数量,确认关系是否齐全。如需自动化脚本或 Excel 公式思路可以随时补充需求。


<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*

---
<sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/13ccfdcc-a9c1-4e00-9a50-6d0ba3ea8304?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/13ccfdcc-a9c1-4e00-9a50-6d0ba3ea8304?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/13ccfdcc-a9c1-4e00-9a50-6d0ba3ea8304?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/13ccfdcc-a9c1-4e00-9a50-6d0ba3ea8304?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/13ccfdcc-a9c1-4e00-9a50-6d0ba3ea8304?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/13ccfdcc-a9c1-4e00-9a50-6d0ba3ea8304?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/13ccfdcc-a9c1-4e00-9a50-6d0ba3ea8304?feedback_type=other)</sup>

[![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/e5e246fa-a522-4d8a-ab3c-e2588b5b501b/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=edge_connected_to.csv%20%E9%87%8C%E7%9A%84%20source_label%20%E5%92%8C%20target_label%20%E4%B8%A4%E5%88%97%EF%BC%8C%E5%BA%94%E8%AF%A5%E5%88%86%E5%88%AB%E5%A1%AB%E5%86%99%20from%20%E5%92%8C%20to%20%E5%AF%B9%E5%BA%94%E9%A1%B6%E7%82%B9%E7%9A%84%20label%EF%BC%88%E7%B1%BB%E5%9E%8B%EF%BC%89%EF%BC%8C%E8%80%8C%E4%B8%94%E5%BF%85%E9%A1%BB%E5%92%8C%20schema.groovy%20%E9%87%8C%E5%AE%9A%E4%B9%89%E7%9A%84%E9%A1%B6%E7%82%B9%20label%20%E5%AE%8C%E5%85%A8%E4%B8%80%E8%87%B4%EF%BC%88%E5%8C%BA%E5%88%86%E5%A4%A7%E5%B0%8F%E5%86%99%EF%BC%89%E3%80%82%0A%0A%E4%B8%BE%E4%BE%8B%EF%BC%9A%E5%81%87%E8%AE%BE%E6%9C%89%E4%B8%80%E8%A1%8C%0A%0A%60%60%60%0Aid%2Cfrom%2Cto%2Clabel%2Csource_label%2Ctarget_label%0Aedge_2%2CXLD-3445%2CHWX-3087%2CCONNECTED_TO%2CLineSegment%2CStationHouse%0A%60%6
 
0%60%0A%0A%E8%BF%99%E9%87%8C%20XLD-3445%20%E5%9C%A8%20vertex_linesegment-1.csv%20%E9%87%8C%EF%BC%8Clabel%20%E6%98%AF%20LineSegment%EF%BC%9BHWX-3087%20%E5%9C%A8%20vertex_stationhouse-1.csv%20%E9%87%8C%EF%BC%8Clabel%20%E6%98%AF%20StationHouse%EF%BC%8C%E6%89%80%E4%BB%A5%20source_label%20%E5%A1%AB%20LineSegment%EF%BC%8Ctarget_label%20%E5%A1%AB%20StationHouse%E3%80%82%0A%0A%E4%BD%A0%E5%8F%AF%E4%BB%A5%E7%94%A8%20Excel%20%E6%88%96%E8%84%9A%E6%9C%AC%E6%89%B9%E9%87%8F%E6%9F%A5%E6%89%BE%20from/to%20%E5%9C%A8%E5%90%84%E8%87%AA%E9%A1%B6%E7%82%B9%20CSV%20%E9%87%8C%E7%9A%84%20label%EF%BC%8C%E7%84%B6%E5%90%8E%E5%A1%AB%E5%88%B0%20source_label/target_label%20%E5%88%97%E3%80%82%E5%8F%AA%E8%A6%81%E8%BF%99%E4%B8%A4%E5%88%97%E5%92%8C%20schema.groovy%20%E9%87%8C%E7%9A%84%E9%A1%B6%E7%82%B9%20label%20%E5%AE%8C%E5%85%A8%E4%B8%80%E8%87%B4%EF%BC%8Cstruct.json%20%E7%9A%84%20value_mapping%20%E5%B0%B1%E8%83%BD%E6%AD%A3%E7%A1%AE%E7%AD%9B%E9%80%89%E5%92%8C%E5%AF%BC%E5%85%A5%E6%89%80%E6%9C%89%E5%85%B3%E7%B3%BB%EF%B
 
C%8C%E5%90%A6%E5%88%99%E4%BC%9A%E8%A2%AB%E8%B7%B3%E8%BF%87%E4%BD%86%E4%B8%8D%E4%BC%9A%E6%8A%A5%E9%94%99%EF%BC%88%5B%E5%AE%98%E6%96%B9%E6%96%87%E6%A1%A3%E8%AF%B4%E6%98%8E%5D%28https%3A//github.com/apache/incubator-hugegraph-doc/blob/master/content/cn/docs/quickstart/toolchain/hugegraph-loader.md%29%EF%BC%89%E3%80%82%0A%0A%E5%AF%BC%E5%85%A5%E5%90%8E%E5%BB%BA%E8%AE%AE%E7%94%A8%20REST%20API%20%E6%9F%A5%E8%AF%A2%E8%BE%B9%E7%B1%BB%E5%9E%8B%E5%92%8C%E6%95%B0%E9%87%8F%EF%BC%8C%E7%A1%AE%E8%AE%A4%E5%85%B3%E7%B3%BB%E6%98%AF%E5%90%A6%E9%BD%90%E5%85%A8%E3%80%82%E5%A6%82%E9%9C%80%E8%87%AA%E5%8A%A8%E5%8C%96%E8%84%9A%E6%9C%AC%E6%88%96%20Excel%20%E5%85%AC%E5%BC%8F%E6%80%9D%E8%B7%AF%E5%8F%AF%E4%BB%A5%E9%9A%8F%E6%97%B6%E8%A1%A5%E5%85%85%E9%9C%80%E6%B1%82%E3%80%82)&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40d
 
osu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/incubator-hugegraph/discussions/2917)

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

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

Reply via email to