cognee/cognee/infrastructure/databases/graph/graph_db_interface.py
Boris 14555a25d0
feat: pipelines and tasks (#119)
* feat: simple graph pipeline

* feat: implement incremental graph generation

* fix: various bug fixes

* fix: upgrade weaviate-client

---------

Co-authored-by: Vasilije <8619304+Vasilije1990@users.noreply.github.com>
2024-07-20 16:49:00 +02:00

64 lines
1.4 KiB
Python

from typing import Protocol, Optional, Dict, Any
from abc import abstractmethod
class GraphDBInterface(Protocol):
@abstractmethod
async def graph(self):
raise NotImplementedError
@abstractmethod
async def add_node(
self,
node_id: str,
node_properties: dict
): raise NotImplementedError
@abstractmethod
async def add_nodes(
self,
nodes: list[tuple[str, dict]]
): raise NotImplementedError
@abstractmethod
async def delete_node(
self,
node_id: str
): raise NotImplementedError
@abstractmethod
async def delete_nodes(
self,
node_ids: list[str]
): raise NotImplementedError
@abstractmethod
async def extract_node(
self,
node_id: str
): raise NotImplementedError
@abstractmethod
async def extract_nodes(
self,
node_ids: list[str]
): raise NotImplementedError
@abstractmethod
async def add_edge(
self,
from_node: str,
to_node: str,
relationship_name: str,
edge_properties: Optional[Dict[str, Any]] = None
): raise NotImplementedError
@abstractmethod
async def add_edges(
self,
edges: tuple[str, str, str, dict]
): raise NotImplementedError
@abstractmethod
async def delete_graph(
self,
): raise NotImplementedError