GitHub user dosubot[bot] edited a comment on the discussion: 关于电网拓扑数据导入
<!-- Greeting --> Hi @wangzhewwzz! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the incubator-hugegraph team. <!-- Answer --> 关于“仅支持单标签”,在 HugeGraph 1.7.0 版本中,每个边标签(EdgeLabel)只能定义一个源点标签和一个目标点标签(比如 schema.edgeLabel("knows").sourceLabel("person").targetLabel("person").create()),不能用一个边标签连接多种类型的点。如果你的电网拓扑数据里有“变电站-设备”、“变电站-线路”等多种关系,需要为每种关系分别创建边标签,比如: ```groovy schema.edgeLabel("substation_to_equipment").sourceLabel("substation").targetLabel("equipment").create() schema.edgeLabel("substation_to_line").sourceLabel("substation").targetLabel("line").create() ``` 只有“变电站-变电站”关系导入成功,说明你的 schema 只定义了这一个边标签,其他关系没有定义或数据标签与 schema 不匹配。修改标签后导入失败,是因为 HugeGraph 不允许修改已创建的边标签的源/目标标签或 link,必须先删除原标签再重新创建。 正确做法是:先根据你的数据类型,分别定义所有需要的点标签和边标签,确保每个边标签只连接一种源点和目标点类型。数据导入时,点和边的 label 必须和 schema 完全一致,否则会报错。 目前没有官方技术咨询群,大家一般通过 GitHub issues 或 discussions 交流。 如果需要更详细的 schema 示例或导入流程,可以补充你的数据结构,我可以帮你梳理具体 schema 定义和导入步骤。 相关源码和示例可参考: - [边标签只能有一个源/目标标签](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/schema/builder/EdgeLabelBuilder.java) - [schema 定义与数据导入示例](https://github.com/apache/incubator-hugegraph/blob/a53af864b31f803780a1db31cb20d3d94d5d34fc/hugegraph-server/hugegraph-dist/src/assembly/static/scripts/example.groovy) <!-- 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=06d1d046-586f-451d-ac5c-fc29ae832119) [](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-15192447 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected]
