from abc import ABC, abstractmethod
from typing import TypedDict

from networkx import MultiDiGraph
from pandas import DataFrame


class NodeData(TypedDict):
    """Type definition for serialized Node data."""
    id: str

    _id: str
    _label: str

    _dku_grp_def_id: str
    _dku_reserved_user_defined_pk_prop: str

    # Additional properties from the node are added dynamically


class RelationshipData(TypedDict):
    """Type definition for serialized Relationship data."""
    _src: str
    _dst: str
    _label: str

    _dku_grp_def_id: str
    # Additional properties from the relationship are added dynamically

class QueryResult(ABC):
    @abstractmethod
    def get_as_df(self) -> DataFrame:
        pass

    @abstractmethod
    def get_as_networkx(self) -> MultiDiGraph:
        pass

    @abstractmethod
    def close(self) -> None:
        pass
