Interface KnowledgeRelation

Represents a relationship (edge) between entities

interface KnowledgeRelation {
    id: string;
    sourceId: string;
    targetId: string;
    type: RelationType;
    label: string;
    properties?: Record<string, unknown>;
    weight: number;
    bidirectional: boolean;
    confidence: number;
    source: KnowledgeSource;
    createdAt: string;
    validFrom?: string;
    validTo?: string;
}

Properties

id: string

Unique relation ID

sourceId: string

Source entity ID

targetId: string

Target entity ID

Relation type

label: string

Relation label (e.g., "works_at", "knows", "caused_by")

properties?: Record<string, unknown>

Relation properties

weight: number

Relation strength/weight (0-1)

bidirectional: boolean

Is this relation bidirectional?

confidence: number

Confidence score

Source of this relation

createdAt: string

Creation timestamp

validFrom?: string

Temporal validity (when was this relation true?)

validTo?: string