Node

class Node(BaseModel):

Represents a node in a graph with associated properties.

Parameters:

  • id (Union[str, int]): A unique identifier for the node.
  • type (str): The type of the relationship.
  • properties (dict): Additional properties and metadata associated with the node.

Relationship

class Relationship(BaseModel):

Represents a directed relationship between two nodes in a graph.

Parameters:

  • subj (Node): The subject/source node of the relationship.
  • obj (Node): The object/target node of the relationship.
  • type (str): The type of the relationship.
  • timestamp (str, optional): The timestamp of the relationship.
  • properties (dict): Additional properties associated with the relationship.

GraphElement

class GraphElement(BaseModel):

A graph element with lists of nodes and relationships.

Parameters:

  • nodes (List[Node]): A list of nodes in the graph.
  • relationships (List[Relationship]): A list of relationships in the graph.
  • source (Element): The element from which the graph information is derived.

post_init

def __post_init__(self):