Find answers from the community

Updated 3 months ago

Hey All, I've been working with the

Hey All, I've been working with the NebulaGraphStore, and for some reason my code seems to append a rogue comma (,) to my edge parameter?

I have a full on default NebulaGraph setup, in which I've followed the llamaindex docs. I have the following atm
O
L
8 comments
Basic setup
Plain Text
os.environ["NEBULA_USER"] = "root"
os.environ["NEBULA_PASSWORD"] = "nebula"  # default is "nebula"
os.environ[
    "NEBULA_ADDRESS"
] = "127.0.0.1:9669"  # assumed we have NebulaGraph installed locally
os.environ["OPENAI_API_KEY"] = "sk-"
]
space_name = "knmi_graph"
tags = ["entity"]  # default, could be omit if create from an empty kg
edge_types, rel_prop_names = ["relationship"], [
    "relationship"
]  # default, could be omit if create from an empty kg
Setup Graphstore etc.

Plain Text
from llama_index.core import StorageContext
from llama_index.graph_stores.nebula import NebulaGraphStore

nebula_graph_store = NebulaGraphStore(
    space_name='knmi_graph',
    host="localhost",
    port=9669,
    user="root",
    password="nebula"
)

storage_context = StorageContext.from_defaults(graph_store=nebula_graph_store)

# NOTE: can take a while!
index = KnowledgeGraphIndex.from_documents(
    documents,
    storage_context=storage_context,
    max_triplets_per_chunk=3,
    space_name=space_name,
    edge_types='abcd',
    rel_prop_names='asdf',
    tags=tags,
)
And for some reason when I try to run the knowledgegraphindex I get the following error:
Plain Text
Query failed. Query: INSERT VERTEX `entity`(name)   VALUES "Knmi":("Knmi");INSERT VERTEX `entity`(name)   VALUES "Meteorologisch instituut":("Meteorologisch instituut");INSERT EDGE `relationship`(`relationship,`)   VALUES "Knmi"->"Meteorologisch instituut"@1219213115886635090:("Is");, Param: {}Error message: Query failed. Query: INSERT VERTEX `entity`(name)   VALUES "Knmi":("Knmi");INSERT VERTEX `entity`(name)   VALUES "Meteorologisch instituut":("Meteorologisch instituut");INSERT EDGE `relationship`(`relationship,`)   VALUES "Knmi"->"Meteorologisch instituut"@1219213115886635090:("Is");, Param: {}Error message: SemanticError: Unknown column `relationship,' in schema
Please note the random comma in the stacktrace relationship, <----
When I update my index to
Plain Text
# NOTE: can take a while!
index = KnowledgeGraphIndex.from_documents(
    documents,
    storage_context=storage_context,
    max_triplets_per_chunk=3,
    space_name=space_name,
    edge_types='abcd',
    rel_prop_names='asdf',
    tags=tags,
)


I still get the same error, suggesting that the rel_prop_names isn't the cause of this..?
Update: It does work when I instantiate my NebulaGraphStore with

Plain Text
graph_store = NebulaGraphStore(
    space_name='knmi_graph',
    edge_types=edge_types,
    rel_prop_names=rel_prop_names,
    tags=tags,
)


But not when I use
Plain Text
nebula_graph_store = NebulaGraphStore(
    space_name='knmi_graph',
    host="localhost",
    port=9669,
    user="root",
    password="nebula"
)


In my StorageContext
Maybe a typo in the code in the NebulaGraphStore rel_prop_names ? Idk, might research if I have some free time
might be a typo, not sure how often this gets used πŸ˜… Definitely open to a PR!
Add a reply
Sign up and join the conversation on Discord