Nanopublication claims
A skill for the four questions that decide whether a nanopublication is usable:
| Question | Mechanism in this skill |
|---|---|
| 拆得细 Can a conclusion be split into assertions that are each true or false on their own? | clause-level decomposition rubric, atomicity_flags with reproducible criteria, one proposition per claim record |
| 对得上 Does every assertion point at the minimal fragment that actually supports it? | lexical+number binding over sentence units, span minimisation, quote == page_text[start:end] check |
| 追得回 Can a stranger walk assertion -> evidence -> paper -> authors/version? | evidence offsets, pdf_sha256, identifier, TriG provenance graph, provenance_gaps |
| 读得懂 Can a downstream program parse the export without cleaning it? | fixed claim schema, claims.jsonl, result.json, TriG + JSON-LD, contract validation |
The skill does not invent paper content. Every quote is a slice of the extracted page text, so a reviewer can re-derive it byte for byte.
1. When to use it
Use when the task asks for any of: atomic claims / assertions from a paper, claim-evidence alignment, evidence snippets with page locations, provenance or traceability, nanopublications, knowledge units, structured reading with verifiable citations, or a JSON export that a downstream tool will consume.
Do not use it for: free-form summarisation with no evidence requirement, literature reviews across many papers, figure reproduction, or translation of whole documents.
2. Inputs
At run time the case supplies:
/input/case.json—case_id,title,language,materials, and anoutput_contract(a JSON-Schema subset:type,properties,required,items,enum,description). The contract is authoritative; field names differ between cases./input/task.md— the task statement and any evidence scope.- One or more PDFs (or another material). Read the actual files; never assume content from a filename or a label.
3. Operating procedure
Work under /app/work, write deliverables under /app/output. The skill
scripts live next to this file; TOOL="$SKILL_ROOT/scripts/nanopub_tool.py".
Step 0 — capability probe (always)
python "$TOOL" doctor --work /app/work
It reports which PDF text backends exist (pymupdf, pypdf, PyPDF2,
pdftotext, builtin). Record this honestly: a run that used OCR is not a run
that used a text layer.
Step 1 — read the case and write an honest partial result
python "$TOOL" init \
--case /input/case.json --task /input/task.md \
--input-dir /input --work /app/work --output /app/output
This parses the contract, discovers materials, and writes a result.json with
status=partial immediately. If the run is cut short by the budget, the
deliverable exists and states what is missing.
Step 2 — acquire the text
python "$TOOL" extract --work /app/work # uses /input PDF automatically
python "$TOOL" extract --work /app/work --pdf input/paper.pdf --backend pypdf
If a platform PDF/OCR tool is available, prefer it and feed the records:
python "$TOOL" ingest --records /app/work/ocr_pages.jsonl --source dsh-pdf-text-tool --work /app/work
Accepted record shape: {"page": 3, "text": "..."} (one page) or
{"page": 3, "text": "...", "kind": "text"} (one block). Check the summary:
page count, block count, extracted characters. Zero characters means a scanned
PDF - go to the failure matrix (§9), not to guesswork.
Step 3 — mine candidate spans
python "$TOOL" candidates --work /app/work --max 120
Writes work/candidates.jsonl: sentence spans that contain result verbs,
numbers, causal markers or captions, each with page, char_start,
char_end, clause_count, clauses and atomicity_flags. This is a map, not
the answer: choose the spans that carry the paper's actual conclusions.
Step 4 — author the assertions (the semantic step)
Write work/claims_draft.jsonl, one JSON object per line. This is where you,
the reading agent, do the part no script can: decide what the paper claims.
The record only needs the semantic core; the binder adds evidence, offsets,
identifiers, confidence and flags.
{"claim_id": "np-c001",
"text": "RefreshKV with QC=5 recovers 52% of full-attention performance on the HTML to TSV task for Llama-3.1-8B.",
"subject": {"label": "RefreshKV (QC=5)", "type": "method"},
"relation": {"id": "recovers", "surface": "recovers"},
"object": {"label": "full-attention performance", "type": "metric", "value": "52%"},
"qualifiers": {"task": "HTML to TSV", "model": "Llama-3.1-8B"},
"claim_type": "empirical_result",
"evidence_hint_page": 6}
Split rules (each is checked again by atomicity_flags):
- One proposition per record. "X improves A and reduces B" is two claims.
- Keep the conditions. Model, dataset, context length, metric and budget
belong in
qualifiers, never dropped and never stuffed intoobject.label. - No pronouns. Resolve "it / this method / our approach" to the named subject - that is what makes the assertion checkable months later.
- Keep the paper's strength. A hedged sentence stays hedged
(
assertion_strength: "hedged"); an author-claimed cause stayscausesonly if the paper tested it, otherwisecorrelates_withorreports. - One relation from the vocabulary.
assets/relations.jsonis the allowed set; seereferences/relation-vocabulary.md. Do not invent relations. - Tables and figures are evidence, not sentence text. For a value that
exists only in a table, assert the row's meaning and let the binder cite the
caption/table region; expect
evidence_kind: table_regionand record the visual check inuncertainty. - Do not assert what the paper does not say. Reviewer-inferred readings go
to
uncertainty, not into a claim.
Useful target density: 6-20 assertions for a 8-20 page paper, covering the abstract's results, the main comparison, the ablation, and the stated limitations. Coverage beats volume: one assertion per conclusion that a reader would actually check.
Step 5 — bind evidence
python "$TOOL" bind --work /app/work --topk 3 --min-score 0.5
For each draft it scores every sentence unit (weighted content tokens, numbers,
relation surface), takes the best candidates, shrinks each to the minimal
clause that still contains the required terms (numbers, subject and object
head terms), and re-ranks by support on the shrunk quote. Output:
work/claims.jsonl with per-claim status:
supported— direct quote, all claim numbers verbatim, relation wording present;partially_supported— evidence found but indirect or partially matching;unsupported— no span met the threshold (the claim is not necessarily false, it is unproven here: keep it, and say so);unverifiable— no page text at all.
Step 6 — validate and repair
python "$TOOL" validate --work /app/work
Read work/validation_report.json. Errors must be fixed (broken offsets,
quote mismatches, missing pages). Warnings are decisions: either fix the
claim, split it, add evidence, or record why the warning is acceptable with:
python "$TOOL" review --work /app/work --target np-c006 --code atomicity_many_numbers \
--reviewer "reading agent" --rationale "the three thresholds are one comparison, not three findings"
Loop until errors are zero. Warnings that stay must be visible in
uncertainty at export time.
Step 7 — fill the contract, export, self-check
Write work/contract_values.json with exactly the fields the case contract
requires (nothing else is needed; unknown extra keys are ignored):
python "$TOOL" validate --work /app/work # re-checks contract conformance
python "$TOOL" export --work /app/work --output /app/output
python "$TOOL" check --output /app/output --case /input/case.json
export merges contract fields at the top level of result.json, adds
case_id, claims, evidence, sources, uncertainty, quality_report,
artifacts, and writes the nanopublication serialisations. check re-reads its
own output and fails loudly if a declared artifact is missing, a contract field
is empty, a claim has no evidence, or the TriG graph count disagrees.
Contract mapping when a field is ambiguous: prefer the claims list for
array-of-results fields, the evidence index for evidence fields, the
paper metadata for provenance fields, and a plain string only when the
description says so. If a required field cannot be filled honestly, leave it
out and let the status become partial with the field named in
uncertainty - never invent content to fill a field.
4. The assertion record
Condensed schema (full dictionary: references/field-dictionary.md):
claim_id, text, language, claim_type, assertion_strength, polarity
subject{label,type,mention?}, relation{id,surface}, object{label,type,value?,comparator?}
qualifiers{...free but typed: model, dataset, metric, context, task, budget...}
evidence[{quote, page, char_start, char_end, block_id, section, support_type,
verification, support_check{coverage,numbers_matched,numbers_missing},
quote_matches_page_text, evidence_kind}]
provenance{paper_id,title,authors,year,identifier,version,pdf_sha256,page,source}
identifiers{nanopub_id, assertion_id}
confidence{level,basis[]}, flags[], status, generated_at
quote is always pages.jsonl[page].text[char_start:char_end].
5. Controlled relations
assets/relations.json holds 30 relations with direction, inverse and usage
notes. Mapping guidance and the "use reports when the paper only tabulates"
rule are in references/relation-vocabulary.md. An unknown relation is not an
error: it surfaces as relation_outside_vocabulary so a reviewer sees it.
6. Quality criteria (reproducible, not vibes)
Every check has an id, a criterion and a remedy; see
references/quality-checks.md. Highlights:
compound_predicate— two result verbs in one assertion;contrast_bundled—while/whereas/butjoining two findings;claim_too_long— more than 45 words;many_numbers— four or more result values in one assertion;evidence_below_threshold— coverage below 0.55 after minimisation;number_not_in_any_quote— a number in the assertion is absent from its evidence;evidence_quote_mismatch— the stored quote no longer matches the page text;duplicate_claim— Jaccard similarity >= 0.85 with another assertion;provenance_incomplete— missing title/authors/year/identifier/hash.
7. Budget
The platform budget is 64 model requests / 900 s / 16k tokens per response.
Extraction, binding, validation and export are local and take seconds. A case
typically needs 3-6 model calls: read task, read candidates, write assertions,
maybe one repair pass, write contract values. Log batches with
nanopub_tool.py request --work ... --stage ...; check status for elapsed
time. Write the partial result early and improve incrementally rather than
saving everything for the end.
8. Output files
| File | Content |
|---|---|
result.json | contract fields + case_id, status, claims, evidence, sources, uncertainty, quality_report |
claims.jsonl | one assertion per line, full record |
nanopublications.trig | TriG: head / assertion / provenance / pubinfo graph per claim |
nanopublications.jsonld | same content, JSON-LD |
evidence_table.md | human review table: assertion -> quote -> page [start,end) |
validation_report.json | every check with code, path and detail |
README.md | run report: paper, backend, counts, how to re-verify |
9. Failure handling
| Situation | Detection | Handling |
|---|---|---|
| Scanned PDF, no text layer | extract reports 0 chars / extraction_unavailable | run an OCR pass, ingest the records, or return status=unable naming the missing text layer. Never guess page content. |
| PDF missing or unreadable | resolve_pdf exits non-zero | status=unable, status_reason names the path; keep the partial skeleton. |
| Paper identifier not detected | doc_meta.identifier empty | provenance_incomplete warning; state it in uncertainty; do not fabricate a DOI. |
| Authors not detected | doc_meta.authors empty | same; a reports-style claim with unknown authors is still allowed but flagged. |
| Evidence only in a figure/table | evidence_kind: table_region, no prose span | keep the claim, cite the table region, add uncertainty: "value read from a table region; visual check required". |
| Assertion has no supporting span | unsupported / no_evidence | keep the record with its status, or delete the claim if it was your over-reading. Never let it become supported. |
| Conflicting spans | two evidence quotes disagree | attach both, set flags: ["conflicting_evidence"], explain in uncertainty; do not silently pick one. |
| Contract field unknown | required field with an unusual name | read its description; map by meaning (§3 step 7); if still unclear, leave it and report partial. |
| Budget exhausted | status shows elapsed close to 900 s | export the partial result immediately. |
10. Honesty rules
statusis one ofsuccess,partial,unable,refused;successonly when every required contract field is filled and no validation errors remain.- An assertion's
statusdescribes its evidence, not the paper's truth. uncertainty.itemslists what a reviewer must not assume: undetected metadata, table-only values, unsupported claims, warnings you accepted.- Do not claim a benchmark, score, comparison or reproducibility result you did not run.
11. Files in this skill
SKILL.md this file
USAGE.md operator manual: copy-paste commands per case
REVIEWER_GUIDE.md 5-minute audit path for a reviewer
references/field-dictionary.md every field, type, allowed values
references/relation-vocabulary.md how to choose and map relations
references/evidence-anchors.md anchor format and verification procedure
references/quality-checks.md check ids, criteria, remedies
assets/relations.json controlled relation vocabulary (30 entries)
assets/claim.schema.json machine-readable claim schema
assets/contract_values.template.json dissection of a contract-filling task
examples/minimal_example.md one worked example (marked as example)
scripts/nanopub_tool.py CLI: doctor/init/extract/ingest/candidates/bind/validate/export/check/compare
scripts/nanopub_core.py text, binding, quality and serialisation primitives
scripts/pdf_text.py PDF text backends, ingest, metadata heuristics
scripts/check_package.py skill package limits and frontmatter check
scripts/self_test.py dependency-free regression tests on synthetic fixtures