Fix upstream-node handling in nanopub chain skills#2
Merged
Conversation
The /np/constellation walk terminates at the Claim when the Claim->AIDA link is a shared AIDA-statement IRI (asAidaStatement -> purl.org/aida/...) rather than a nanopub-to-nanopub reference, so AIDA (step 2) and the upstream Quote/PICO/PCC (step 1) can both be absent from steps[]. Document this in both skills and stop treating it as a chain-integrity failure. verify-chain: the old upstream-reachability check used the .../sciencelive/np/... URI form, which redirects to the HTML viewer and returns HTTP 200 on the SPA shell -- so a status-only check passed even for non-existent nanopubs. Switch to the bare w3id.org/np/ resolver form (which serves TriG) and assert the body is TriG, not HTML. import-from-nanopub: same prefix bug in the optional archival loop was silently saving HTML viewer pages as .trig files; swap the prefix there too. Add an "upstream terminus" note explaining the constellation may not reach AIDA/Quote and how to recover them via direct TriG fetch. API-side fix (bridge the asAidaStatement IRI to its asserting nanopub in discoverNeighbours) is tracked separately in science-live-platform.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two related fixes to the
import-from-nanopubandverify-chainskills, found while diagnosing why a/np/constellationwalk terminated at the Claim without surfacing the upstream AIDA (step 2) or Quote (step 1).Root cause
The Claim→AIDA link is a shared AIDA-statement IRI (
asAidaStatement → http://purl.org/aida/<sentence>), not a nanopub-to-nanopub reference. The constellation walk follows only nanopub references, so for some chain shapes it stops at the Claim:steps[]has noAIDA, and the upstream Quote/PICO/PCC is absent too. Both skills now document this as upstream-not-enumerated, not a chain-integrity failure.Reachability bug (correctness)
verify-chainchecked upstream URIs against the…/sciencelive/np/…form, which redirects to the HTML viewer and returns HTTP 200 on the SPA shell — so a status-only check passed even for non-existent nanopubs. Fixed by swapping to the barew3id.org/np/resolver form (serves TriG) and asserting the body is TriG, not HTML. Verified: the old check returnsHTTP/2 200for a bogus URI; the new check correctly FAILs it and PASSes real Quote/AIDA URIs.import-from-nanopub's optional archival loop had the same prefix bug — it was silently saving HTML viewer pages as.trigfiles. Swapped the prefix there too.Follow-up (not in this PR)
API-side fix to bridge the
asAidaStatementIRI to its asserting nanopub indiscoverNeighboursis tracked separately inscience-live-platform.