Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .claude/skills/import-from-nanopub/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ The 200 JSON response is the constellation. Top-level keys:
- `chains[]` — array of `{id, outcomeUri, outcomeVerdict, outcomeConfidence, citoRelations[], steps[]}`
- `chains[].steps[]` — array of `{step, uri, …}` where `step` is `"AIDA"`, `"Claim"`, `"Study"`, `"Outcome"`, or `"CiTO"` and each step type carries its substantive prose fields inline (Study has `scope`, `method`, `deviations`; Outcome has `label`, `verdict`, `confidence`, `conclusion`, `evidence`, `limitations`, `repository`; CiTO has `relations[]`, `targets[]`)

**Upstream terminus — the constellation may not reach AIDA or Quote.** The Claim→AIDA link is a shared AIDA-statement IRI (`asAidaStatement → http://purl.org/aida/<sentence>`), not a nanopub-to-nanopub reference, and the `/np/constellation` walk follows only nanopub references. For some chain shapes it therefore terminates at the **Claim**: `steps[]` has no `"AIDA"` entry, and the upstream Quote-with-comment / PICO / PCC (step 1) is absent too. This is expected, not a missing-data failure — those upstream nanopubs exist and are valid. If you need the AIDA / Quote prose, recover their URIs from the source chain's `PUBLISHED.md` (or from the Claim's `asAidaStatement` IRI) and fetch them directly via the **bare resolver form** (see Step 3's archival loop). An API-side fix to bridge the AIDA-statement IRI is tracked separately.

### Step 3 — Cache the response

Write the raw response to `nanopubs/imported/constellation.json` (this directory is gitignored by the template). This is the single source of truth for the rest of the skill.
Expand All @@ -96,7 +98,10 @@ Optionally also fetch each step URI's TriG for archival (useful if the user want
mkdir -p nanopubs/imported/trig
for uri in $(printf '%s' "$body" | jq -r '.chains[].steps[].uri'); do
ra_id=$(printf '%s' "$uri" | sed 's|.*/||')
curl -sL -H "Accept: application/trig" -o "nanopubs/imported/trig/${ra_id}.trig" "$uri"
# The …/sciencelive/np/… form redirects to the HTML viewer; only the bare
# w3id.org/np/ resolver form serves TriG. Swap the prefix before fetching.
resolver_uri=$(printf '%s' "$uri" | sed 's#/sciencelive/np/#/np/#')
curl -sL -H "Accept: application/trig" -o "nanopubs/imported/trig/${ra_id}.trig" "$resolver_uri"
done
```

Expand Down
17 changes: 11 additions & 6 deletions .claude/skills/verify-chain/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,21 @@ Build a set of all URIs returned by the API (across `researchSynthesis.uri`, `ap

If a URI in `PUBLISHED.md` is missing from the constellation, that's a chain-integrity failure: the URI exists but isn't reachable from the entry point via FORRT chain links. Record it.

The constellation API does NOT enumerate Quote-with-comment / PICO / PCC URIs as a separate `step` (they sit upstream of AIDA). For step 1, verify reachability with a direct fetch:
The constellation API does NOT enumerate Quote-with-comment / PICO / PCC URIs as a separate `step` (they sit upstream of AIDA). In some chain shapes it also omits the **AIDA** (step 2): the Claim→AIDA link is a shared AIDA-statement IRI (`asAidaStatement → http://purl.org/aida/<sentence>`), not a nanopub reference, so the walk can terminate at the Claim. Treat a missing step 1 — and a missing step-2 AIDA — as **upstream-not-enumerated**, not a chain-integrity failure; still verify those URIs in `PUBLISHED.md` resolve.

Verify each upstream URI with a direct TriG fetch. **Do not test the `…/sciencelive/np/…` form** — it redirects to the HTML viewer and returns HTTP 200 on the SPA shell, so a status-only check passes even when no nanopub is served. Use the **bare resolver form** `https://w3id.org/np/RA…` (swap the prefix) and assert the body is TriG, not HTML:

```bash
quote_uri="<step-1-URI>"
curl -sI --max-time 30 -H "Accept: application/trig" -L "$quote_uri" \
| grep -E '^HTTP/' | tail -1
upstream_uri="<step-1 or, if absent, step-2 AIDA URI>"
resolver_uri=$(printf '%s' "$upstream_uri" | sed 's#/sciencelive/np/#/np/#')
body=$(curl -sL --max-time 30 -H "Accept: application/trig" "$resolver_uri")
case "$(printf '%s' "$body" | head -c 16 | tr 'A-Z' 'a-z')" in
'@prefix'*) echo "PASS — TriG served" ;;
'<!doctype'*|'<html'*) echo "FAIL — HTML viewer, not a nanopub" ;;
*) echo "FAIL — unexpected response" ;;
esac
```

Pass: `200`. Fail: anything else.

### Step 4 — External consistency

**Outcome's Repository URL matches this repo's GitHub remote.**
Expand Down
Loading