Skip to main content

materialize_knowledge_shares

Function materialize_knowledge_shares 

pub fn materialize_knowledge_shares(db: &FactsDb, opts: &Options) -> Result<()>
Expand description

Materialises two temporary tables into db:

  • knowledge_shares(path TEXT, author TEXT, k DOUBLE, k_norm DOUBLE) — per-author raw knowledge score k and its within-path normalised share k_norm (summing to ~1.0 per path after reviewer credit).
  • doe_scores(path TEXT, author TEXT, doe DOUBLE, is_expert BOOLEAN) — DOE scores and expert flags per Cury & Avelino, SBES’24 (arXiv 2408.08733).

Both tables are idempotent: calling this function more than once on the same FactsDb is a no-op (guarded by FactsDb::is_knowledge_shares_built).

§Errors

Returns crate::CodeLoreError::Analysis on DuckDB errors.