eosphoros-ai / DB-GPT

AI Native Data App Development framework with AWEL(Agentic Workflow Expression Language) and Agents
http://docs.dbgpt.cn
MIT License
13.75k stars 1.86k forks source link

fix(tugraph_store.py): _create_schema crash #2079

Closed tpoisonooo closed 4 weeks ago

tpoisonooo commented 1 month ago

Description

Fix tugraph creation error

How Has This Been Tested?

Here is my KG result

image

Checklist:

Appointat commented 1 month ago

@tpoisonooo Thanks so much for your PR.

Issue: when GraphRAG builds the DB schema, different versions of TuGraph handle the types STRING and "STRING" differently (one version supports STRING; while the other version supports "STRING"). It is caused by the TuGraph version update.

We fixed it in another PR (document structure search in GraphRAG), and will release it in the next released version of DB-GPT.

Solutions: We used statements createVertexLabelByJson and createEdgeLabelByJson to be compatible with the new and old versions of feat. (note: createVertexLabelByJson and createEdgeLabelByJson have not yet been updated in the official documentation of TuGraph)

            gql_data = json.dumps({
                "label": graph_elem_type.value,
                "type": "EDGE",
                "constraints": edge_direction(graph_elem_type),
                "properties": graph_properties,
            })
            gql = f"""CALL db.createEdgeLabelByJson('{data}')"""

Related issue [closed]: https://github.com/eosphoros-ai/DB-GPT/pull/2073

csunny commented 1 month ago

@tpoisonooo Thanks for your contribution, we already fix this issue in another PR #2033 and will add you as a co-contributor about this issue #2073

Appointat commented 1 month ago

@tpoisonooo could you provide me your email?, so that I can add you to the contributors of pr https://github.com/eosphoros-ai/DB-GPT/pull/2033 (reply to me today if possible). :)

Appointat commented 1 month ago

@tpoisonooo you were added to the co-author of pr https://github.com/eosphoros-ai/DB-GPT/pull/2033. Thank you. I think this pr can be closed now. : )

tpoisonooo commented 4 weeks ago

@tpoisonooo could you provide me your email?, so that I can add you to the contributors of pr #2033 (reply to me today if possible). :)

khj.application@aliyun.com