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
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, )
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
# 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, )
graph_store = NebulaGraphStore( space_name='knmi_graph', edge_types=edge_types, rel_prop_names=rel_prop_names, tags=tags, )
nebula_graph_store = NebulaGraphStore( space_name='knmi_graph', host="localhost", port=9669, user="root", password="nebula" )