Fix: Fixes import paths
This commit is contained in:
parent
d3fdddaa52
commit
b516862edc
2 changed files with 30 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
|||
from abc import ABC, abstractmethod
|
||||
from typing import List, Dict, Union
|
||||
from CogneeGraphElements import Node, Edge
|
||||
from cognee.modules.graph.cognee_graph.CogneeGraphElements import Node, Edge
|
||||
from cognee.infrastructure.databases.graph.graph_db_interface import GraphDBInterface
|
||||
|
||||
class CogneeAbstractGraph(ABC):
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from typing import List, Dict, Union
|
||||
from CogneeGraphElements import Node, Edge
|
||||
from CogneeAbstractGraph import CogneeAbstractGraph
|
||||
from cognee.modules.graph.cognee_graph.CogneeGraphElements import Node, Edge
|
||||
from cognee.modules.graph.cognee_graph.CogneeAbstractGraph import CogneeAbstractGraph
|
||||
from cognee.infrastructure.databases.graph import get_graph_engine
|
||||
from cognee.infrastructure.databases.graph.neo4j_driver.adapter import Neo4jAdapter
|
||||
from cognee.infrastructure.databases.graph.networkx.adapter import NetworkXAdapter
|
||||
|
|
@ -90,3 +90,30 @@ class CogneeGraph(CogneeAbstractGraph):
|
|||
print(f"Error projecting graph: {e}")
|
||||
except Exception as ex:
|
||||
print(f"Unexpected error: {ex}")
|
||||
|
||||
|
||||
"""
|
||||
The following code only used for test purposes and will be deleted later
|
||||
"""
|
||||
import asyncio
|
||||
|
||||
async def main():
|
||||
# Choose the adapter (Neo4j or NetworkX)
|
||||
adapter = await get_graph_engine()
|
||||
|
||||
# Create an instance of CogneeGraph
|
||||
graph = CogneeGraph()
|
||||
|
||||
# Project the graph from the database
|
||||
await graph.project_graph_from_db(adapter,
|
||||
["description", "name", "type", "text"],
|
||||
["relationship_name"],
|
||||
directed=True,
|
||||
node_dimension=1,
|
||||
edge_dimension=10000)
|
||||
|
||||
# Access nodes and edges
|
||||
print(f"Graph has {len(graph.nodes)} nodes and {len(graph.edges)} edges.")
|
||||
|
||||
# Run the main function
|
||||
asyncio.run(main())
|
||||
Loading…
Add table
Reference in a new issue