Skip to content

build-story: render audience tabs from published AI-summary nanopubs - #27

Merged
annefou merged 1 commit into
mainfrom
feat/blog-published-summaries
Jul 27, 2026
Merged

build-story: render audience tabs from published AI-summary nanopubs#27
annefou merged 1 commit into
mainfrom
feat/blog-published-summaries

Conversation

@annefou

@annefou annefou commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

What

build_story.py now renders the story page's audience tabs ("For the general public", "For schools", …) from the published, signed AI-summary nanopublications on the network — instead of a local audience.json. Each tab links back to its nanopublication, which is schema:about the chain apex and attributed to an AI software agent (see the AI plain-language summary template).

Why

The AI plain-language summaries are first-class, signed artefacts on the nanopub network (agent-attributed, versioned, supersede-able). The reader-facing page should render those on-network artefacts and cite them, rather than an ad-hoc committed file — so what the reader sees is exactly what was published, with a provenance link to verify it.

How

  • fetch_published_summaries(apex) — SPARQL-queries the nanopub network for AI-summary nanopubs schema:about the apex, carrying schema:audience + rdfs:comment; keeps one live summary per audience.
  • render_audience — links each tab to its signed nanopub (.aud-prov) when present; skips empty headings (a published summary is a single prose block).
  • main() — prefers published summaries; falls back to nanopubs/audience.json when none are published or the network is unavailable, so existing behaviour is unchanged.

Verification

  • 129 offline tests pass (+5 new: parsing, one-per-audience, network-error fallback, provenance link present with a network summary, absent with a file-backed one).
  • Live end-to-end build of the Westerschelde synthesis (sado-estuary-replication-2026) against the dev Science Live API renders both published summary nanopubs as audience tabs, each with a provenance link to platform-dev.

No new dependencies (stdlib urllib).

fetch_published_summaries() queries the nanopub network for AI plain-language
summary nanopubs schema:about the apex (see the AI-summary template), and the
blog renders the audience tabs from those signed, agent-attributed nanopubs —
each tab links back to its nanopublication. Falls back to a committed
audience.json when none are published (or the network is unavailable), so
existing behaviour is unchanged.

- render_audience: link to the signed nanopub (aud-prov) when np_uri is present;
  skip empty section headings / title (a published summary is one prose block).
- main(): prefer published summaries over audience.json.
- 5 new offline tests (parsing, one-per-audience, network-error fallback,
  provenance link, file-backed has no link). 129 tests pass; live smoke against
  the sado synthesis renders both published summaries with provenance links.
@annefou
annefou merged commit 7c8dd7c into main Jul 27, 2026
3 checks passed
@annefou
annefou deleted the feat/blog-published-summaries branch July 27, 2026 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant