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

我现在已经hugegraph中创建好了电网知识图谱 如下: 
图ID hugegraph

图名称 hugegraph

主机名 server

端口号 8080


在hugegraph-hubble中测试g.V()可以全部查询出所有的连接关系图
那么我现在想在dify工作流中的http节点中访问hugegraph知识图谱查询g,V(),我的dify中http节点该怎么配置呢?
1、API怎么填写
2、HEADERS怎么填写
3、PARAMS怎么填写
4、BODY怎么填写 






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




你的 struct_1.json 里 edges 的 field_mapping 必须写成:
"field_mapping": { "from": "from", "to": "to" }

不能写成 { "from": "id", "to": "id" },否则 loader 会把 CSV 的 id 列当作边属性导入,但 
schema.groovy 的 edgeLabel 没有声明 id 属性,导致 “Invalid property 'id' for edge label” 
或 “主键字段 [id] 为空” 的报错。

如果你已经这样写了但还是报错,请务必检查以下几点:

source/target 配置必须是 "source": ["from"], "target": ["to"],不能写反。

field_mapping 必须是 { "from": "from", "to": "to" },不要有 id。

CSV header 必须严格为 id,from,to,label,source_label,target_label,不能有多余空格或 BOM。

所有 from/to 字段都不能有空值,且和顶点 id 完全一致(无多余空格、无大小写问题、无空行)。

null_values 建议只保留 ["NULL", "null"],不要加 "",否则空字符串会被判定为 null。

schema.groovy 的边标签 .properties() 只包含实际需要的属性(如 "source_label", 
"target_label"),不要加 "id"。

如果你已经全部按上述做了,还是报 “Make sure the primary key fields [id] are not empty, or check 
whether the headers or field_mapping are configured correctly”,请贴出:

edge_connected_to.csv 的 header 和前 2 行原始数据(不要做任何处理)

struct_1.json 某个 edges 配置的完整内容(尤其是 source/target/field_mapping/value_mapping)

这样我可以帮你定位具体是哪一行或哪一列有问题。

常见坑:

source/target 写反了(比如 "source": ["to"], "target": ["from"])

field_mapping 写成了 id

CSV header 有隐藏字符或 BOM

null_values 配置了空字符串

顶点 id 有重复或空行

只要这几点全部做到,边就能正常导入且无报错,所有关系都能导入。官方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-15274097

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

Reply via email to