Spec: Cross-link wiki pages with hypotheses and analyses

← All Specs

Spec: Cross-link wiki pages with hypotheses and analyses

Task ID: 3dcdb410-66f6-4899-ba84-39b4745e9d24 Layer: Atlas Priority: 85

Problem

Wiki pages contain entity information (genes, proteins, diseases) that also appear in hypotheses and analyses, but there are no explicit artifact_links connecting them. Users browsing wiki pages can't easily discover related scientific analyses.

Solution

  • Register all wiki pages as artifacts in the artifact registry
  • Create artifact_links (type: mentions) between wiki pages and hypotheses/analyses based on entity matching (kg_node_id ↔ target_gene)
  • Update wiki sidebar to show linked analyses alongside hypotheses
  • Update hypothesis detail page to show linked wiki pages
  • Update analysis detail page to show linked wiki pages
  • Matching Strategy

    • Direct gene match: wiki kg_node_id matches hypothesis target_gene
    • Title match: wiki title matches hypothesis target_gene
    • Title keyword: hypothesis title contains wiki entity name (≥4 chars)
    • Analysis inheritance: wiki→analysis links created via linked hypotheses

    Work Log

    • 2026-04-02: Created migration script, registered 17k wiki artifacts, created 428 cross-links (226 wiki→hypothesis, 202 wiki→analysis). Updated wiki sidebar, hypothesis detail, and analysis detail pages with cross-link UI.

    Verification — 2026-04-26

    • DB check: 18,447 wiki_page artifacts registered (SELECT COUNT(*) FROM artifacts WHERE artifact_type='wiki_page' → 18447)
    • DB check: 667,870 mentions artifact_links exist (SELECT COUNT(*) FROM artifact_links WHERE link_type='mentions' → 667870)
    • Wiki sidebar: Lines 58043-58089 in api.py fetch linked hypotheses, analyses, experiments, papers via artifact_links
    • Hypothesis detail: Wiki tab added at commit 45805fd4a (line 37745-37747 in api.py shows hyp-tab-wiki button)
    • Analysis detail: Related Wiki Pages section at lines 41127-41180
    • Commit on branch: 45805fd4a [Atlas] Add Wiki tab to hypothesis detail page displaying linked wiki pages via artifact_links [task:3dcdb410-66f6-4899-ba84-39b4745e9d24]

    File: 3dcdb410_crosslink_wiki_spec.md
    Modified: 2026-04-25 23:40
    Size: 2.1 KB