{# FE2-4: knowledge-graph fragment — lazy-loaded into #corpus-graph. Context: doi — the seed paper's DOI. snapshot — get_paper_snapshot() shape, or None when the graph isn't built: {metadata, entities_by_type, relationships_in, relationships_out}. entities_by_type : {type: [{canonical_id, type, surface, ...}]} relationships_out : [{predicate, target_kind, target_id, evidence, ...}] relationships_in : [{predicate, source_doi, evidence, ...}] error — True when the snapshot raised (generic notice, no detail leaked). All content is rendered through Jinja autoescape ONLY — never |safe, never striptags (scientific text legitimately contains < and >). #}
Could not load the knowledge graph — check the server logs.
{% elif snapshot is none %}
No knowledge graph is built yet. Run
lit-monitor graph backfill --all to build the graph for this
paper.
No entities linked to this paper in the graph.
{% endif %} {# --- Relationships (outgoing + incoming) -------------------------------- #}| Direction | Predicate | Other paper / entity | Evidence |
|---|---|---|---|
| out | {{ r.predicate }} | {% if r.target_kind == "Paper" and r.target_id %} {{ r.target_id }} {% else %} {{ r.target_id }} {% endif %} | {{ r.evidence or "" }} |
| in | {{ r.predicate }} | {% if r.source_doi %} {{ r.source_doi }} {% else %} — {% endif %} | {{ r.evidence or "" }} |
No relationships recorded for this paper in the graph.
{% endif %} {% endif %}