Skip to content

Bridge asAidaStatement IRI in /np/constellation walk#97

Open
annefou wants to merge 1 commit into
mainfrom
fix/constellation-aida-statement-bridge
Open

Bridge asAidaStatement IRI in /np/constellation walk#97
annefou wants to merge 1 commit into
mainfrom
fix/constellation-aida-statement-bridge

Conversation

@annefou
Copy link
Copy Markdown
Contributor

@annefou annefou commented May 31, 2026

Problem

A /np/constellation walk terminates at the Claim and never surfaces the upstream AIDA (step 2) or Quote (step 1).

Root cause: a FORRT Claim links to its AIDA only via sciencelive:asAidaStatement → http://purl.org/aida/<sentence> — a content-derived statement IRI, not a nanopub-to-nanopub reference. The walk discovers neighbours only through npa:refersToNanopub (both directions) and by mining np/RA… URIs from TriG bodies; neither can cross the Claim→AIDA boundary. Losing the AIDA also loses the Quote, which is only reachable through it.

(Diagnosed against the coastal-rom-replication chain; both upstream nanopubs exist and resolve — the projection just couldn't reach them.)

Fix

A third discovery mechanism in discoverNeighbours's caller: for each AIDA-statement IRI in a node's TriG, resolve the nanopub that asserts it (the AIDA Sentence nanopub) via a new SPARQL query, and add it as a neighbour. From the AIDA, existing TriG mining reaches the Quote via skos:related, so the whole upstream chain surfaces again.

  • queries.ts: new AIDA_STATEMENT_NANOPUB query (inline mirror of the new canonical frontend/src/lib/queries/aida-statement-nanopub.rq); bindUri gains an optional placeholder arg.
  • constellation.ts: extractAidaStatementIris (exported, unit-tested) + discoverAidaStatementNeighbours, merged into each node's neighbour set. Best-effort — a SPARQL failure never aborts the BFS.
  • Tests: unit coverage for the extractor + an integration test proving Claim → AIDA → Quote now surfaces across the content IRI.

Validation

  • npx vitest run api/src/np/219 passing; tsc --noEmit clean; eslint clean.
  • Live-validated against query.knowledgepixels.com: the new query returns the AIDA nanopub RAPii6l2XAP… for the coastal-rom chain's Claim.

Related

Resolves the template-side workaround documented in ScienceLiveHub/forrt-replication-template#2 and GRID4EARTH/grid4earth-benchmark-template#1 (those keep the doc notes + the bare-resolver TriG fetch, which remain correct).

A FORRT Claim links to its AIDA only via
`sciencelive:asAidaStatement -> http://purl.org/aida/<sentence>` — a
content-derived statement IRI, not a nanopub-to-nanopub reference. The
constellation walk discovers neighbours only through `npa:refersToNanopub`
(both directions) and by mining `np/RA…` URIs from TriG bodies, so neither
mechanism can cross the Claim->AIDA boundary. The walk therefore terminated
at the Claim and never surfaced the upstream AIDA (step 2) or the Quote
(step 1, reachable only through the AIDA).

Add a third discovery mechanism: for each AIDA-statement IRI found in a
node's TriG, resolve the nanopub that asserts it (the AIDA Sentence nanopub)
via a new SPARQL query, and add it as a neighbour. From the AIDA, the
existing TriG mining reaches the Quote via skos:related, so the whole
upstream chain surfaces again.

- queries.ts: AIDA_STATEMENT_NANOPUB query (mirrors the new canonical
  frontend/src/lib/queries/aida-statement-nanopub.rq); generalise bindUri
  with an optional placeholder arg.
- constellation.ts: extractAidaStatementIris (exported, unit-tested) +
  discoverAidaStatementNeighbours, merged into each node's neighbour set;
  best-effort so a SPARQL failure never aborts the BFS.
- Tests: unit coverage for the IRI extractor + an integration test proving
  Claim -> AIDA -> Quote now surfaces across the content IRI.

Query validated live against query.knowledgepixels.com: it returns the
AIDA nanopub for the coastal-rom chain's claim. Resolves the template-side
workaround documented in forrt-replication-template#2 /
grid4earth-benchmark-template#1.
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