-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/COG-341-log-interactions
- Loading branch information
Showing
19 changed files
with
738 additions
and
563 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from abc import ABC, abstractmethod | ||
from typing import List, Dict, Union | ||
from cognee.modules.graph.cognee_graph.CogneeGraphElements import Node, Edge | ||
from cognee.infrastructure.databases.graph.graph_db_interface import GraphDBInterface | ||
|
||
class CogneeAbstractGraph(ABC): | ||
""" | ||
Abstract base class for representing a graph structure. | ||
""" | ||
|
||
@abstractmethod | ||
def add_node(self, node: Node) -> None: | ||
"""Add a node to the graph.""" | ||
pass | ||
|
||
@abstractmethod | ||
def add_edge(self, edge: Edge) -> None: | ||
"""Add an edge to the graph.""" | ||
pass | ||
|
||
@abstractmethod | ||
def get_node(self, node_id: str) -> Node: | ||
"""Retrieve a node by its ID.""" | ||
pass | ||
|
||
@abstractmethod | ||
def get_edges(self, node_id: str) -> List[Edge]: | ||
"""Retrieve edges connected to a specific node.""" | ||
pass | ||
|
||
@abstractmethod | ||
async def project_graph_from_db(self, adapter: GraphDBInterface, directed: bool, dimension: int) -> None: | ||
"""Project the graph structure from a database using the provided adapter.""" | ||
pass |
Oops, something went wrong.