Skip to main content

agrag.common.data_models.relation.Relation

Bases: DataPoint

A resolved relationship between two Entity nodes.

Attributes:

  • type (str) – The RelationType label this relationship was resolved as.
  • source_id (UUID) – The id of the source Entity.
  • target_id (UUID) – The id of the target Entity.
  • properties (dict[str, object]) – Field-resolved property values.
  • source_chunk_ids (list[UUID]) – Ids of every Chunk a mention contributing to this relationship came from. A relationship attested by more than one source has more than one id here, rather than existing as parallel edges.

Functions:

created_at​

created_at: datetime = Field(default_factory=lambda: datetime.now(UTC))

id​

id: UUID

metadata​

metadata: dict[str, Any] = Field(default_factory=dict)

properties​

properties: dict[str, object] = Field(default_factory=dict)

source_chunk_ids​

source_chunk_ids: list[UUID] = Field(default_factory=list)

source_id​

source_id: UUID

target_id​

target_id: UUID

to_relation_record​

to_relation_record() -> RelationRecord

Return this relationship as a GraphStore write record.

type​

type: str