# =============================================================================
# Concept-to-Concept Relationships
# =============================================================================
#
# Global relationships between concepts in the knowledge graph.
# These are independent of any data contract and represent domain knowledge.
#
# Each entry:
#   source  – Source concept id (from ontologies.yaml)
#   target  – Target concept id (from ontologies.yaml)
#   type    – Relationship type (from knowledge_schema.yaml)
#
# =============================================================================

version: "1.0.0"

relationships:
  # Orders depend on accounts
  - source: OrderIdentifier
    target: AccountIdentifier
    type: depends_on

  # Orders trade instruments
  - source: OrderIdentifier
    target: TradingInstrument
    type: depends_on

  # Lifecycle states describe their entities
  - source: OrderLifecycleState
    target: OrderIdentifier
    type: describes

  - source: SignalLifecycleState
    target: SignalIdentifier
    type: describes

  - source: SessionLifecycleState
    target: SessionIdentifier
    type: describes

  - source: PortfolioLifecycleState
    target: PortfolioIdentifier
    type: describes

  - source: CycleLifecycleState
    target: RunIdentifier
    type: describes

  # Signals precede orders (signal triggers order)
  - source: SignalIdentifier
    target: OrderIdentifier
    type: precedes

  # Signal strength describes a signal
  - source: SignalStrength
    target: SignalIdentifier
    type: describes

  # Order quantities describe orders
  - source: OrderQuantity
    target: OrderIdentifier
    type: describes

  - source: FilledQuantity
    target: OrderIdentifier
    type: describes

  # Portfolios contain orders
  - source: PortfolioIdentifier
    target: OrderIdentifier
    type: has

  # Sessions contain orders
  - source: SessionIdentifier
    target: OrderIdentifier
    type: has

  # Monetary amounts describe portfolios
  - source: MonetaryAmount
    target: PortfolioIdentifier
    type: describes

  # Temporal events describe sessions
  - source: SessionStart
    target: SessionIdentifier
    type: describes

  - source: SessionEnd
    target: SessionIdentifier
    type: describes

  # Order side describes orders
  - source: OrderSide
    target: OrderIdentifier
    type: describes

  # Signal direction describes signals
  - source: SignalDirection
    target: SignalIdentifier
    type: describes
