# Eléments à traiter pour la cohérence de la base


## Alias de projets à traiter

${query[[
  from i = index.paragraphs('new') 
  order by i.text desc 
  limit 100
  select {
    REF = "[[" .. i.ref .. "]]",
    TEXT =  i.text,
    TAGS = i.tags
  }
]]}


## Attributs “projects” à compléter

Total : ${#query[[
  from p = index.pages()
  where p.projects and (
    table.includes(p.projects, "PROJET")
    or table.includes(p.projects, "None")
  )
  limit 200
  select {
    PAGE = "[[" .. p.name .. "]]",
    PROJETS = table.concat(p.projects, ", ")
  }
]]}

${query[[
  from p = index.pages()
  where p.projects and (
    table.includes(p.projects, "PROJET")
    or table.includes(p.projects, "None")
  )
  limit 10
  select {
    PAGE = "[[" .. p.name .. "]]",
    PROJETS = table.concat(p.projects, ", ")
  }
]]}

## Evénements à traiter

Événements gérés selon l'ancien système de saisie avec les headers directement dans le journal.

Total : ${#query[[
  from o = index.tag "header" 
  where table.includes(o.tags, "event")
  select {
    REF = "[[" .. o.ref .. "]]",
    NAME =  o.name
  }
]]}

${query[[
  from o = index.tag "header" 
  where table.includes(o.tags, "event")
  order by o.page desc 
  limit 10
  select {
    REF = "[[" .. o.ref .. "]]",
    NAME =  o.name
  }
]]}

