require 'ontologies/tasks'

Thingy.topic_map 'mlanza:todos' do |m|
  m.import 'mlanza:tasks'

  bar = m.topic :task do |t|
    t[:summary] = 'Before Action Review'
  end

  bar1 = m.topic :task do |t|
    t[:summary] = 'What did we or others learn in similar situations?'
  end

  bar2 = m.topic :task do |t|
    t[:summary] = 'What challenges do we anticipate?'
  end

  bar3 = m.topic :task do |t|
    t[:summary] = 'What do we think will make the biggest difference this time?'
  end

  bar4 = m.topic :task do |t|
    t[:summary] = 'What are our intended results and measures?'
  end

  m.association :decomposition do |a|
    a.role :task, bar
    a.role :subtask, bar1
  end

  m.association :decomposition do |a|
    a.role :task, bar
    a.role :subtask, bar2
  end

  m.association :decomposition do |a|
    a.role :task, bar
    a.role :subtask, bar3
  end

  m.association :decomposition do |a|
    a.role :task, bar
    a.role :subtask, bar4
  end

  aar = m.topic :task do |t|
    t[:summary] = 'After Action Review'
  end

  aar1 = m.topic :task do |t|
    t[:summary] = 'What were our intended results?'
  end

  aar2 = m.topic :task do |t|
    t[:summary] = 'What were our actual results?'
  end

  aar3 = m.topic :task do |t|
    t[:summary] = 'What caused our results?'
  end

  aar4 = m.topic :task do |t|
    t[:summary] = 'What will we sustain or improve?'
  end

  m.association :decomposition do |a|
    a.role :task, aar
    a.role :subtask, aar1
  end

  m.association :decomposition do |a|
    a.role :task, aar
    a.role :subtask, aar2
  end

  m.association :decomposition do |a|
    a.role :task, aar
    a.role :subtask, aar3
  end

  m.association :decomposition do |a|
    a.role :task, aar
    a.role :subtask, aar4
  end

  picnic = m.topic :task do |t|
    t[:summary] = 'Organize picnic'
  end

  who = m.topic :task do |t|
    t[:summary] = 'Make guest list'
  end

  when_where = m.topic :task do |t|
    t[:summary] = 'Choose time and place'
  end

  select_date = m.topic :task do |t|
    t[:summary] = 'Select date'
  end

  select_place = m.topic :task do |t|
    t[:summary] = 'Select place and rain place/date alternatives'
  end

  invitations = m.topic :task do |t|
    t[:summary] = 'Send invitations'
  end

  m.association :decomposition do |a|
    a.role :task, picnic
    a.role :subtask, bar
  end

  m.association :decomposition do |a|
    a.role :task, picnic
    a.role :subtask, who
  end

  m.association :decomposition do |a|
    a.role :task, picnic
    a.role :subtask, when_where
  end

  m.association :decomposition do |a|
    a.role :task, when_where
    a.role :subtask, select_date
  end

  m.association :decomposition do |a|
    a.role :task, when_where
    a.role :subtask, select_place
  end

  m.association :decomposition do |a|
    a.role :task, picnic
    a.role :subtask, invitations
  end

  m.association :decomposition do |a|
    a.role :task, picnic
    a.role :subtask, aar
  end
end
