Add the data annotation body (spec 18.8)
A data body says what kind of data a table, figure panel or passage presents: one of fifteen kinds, the dataset that holds the values, what each field measures (with the dataset's own unit) and the molecules and sequences it is about, by the identities of structure and sequence bodies. Where the values came from stays the dataset's origin. - spec/18 section 18.8, the body in annotation.schema.json, 'data' in the store's body_kind CHECK, five terms in the JSON-LD context. - paperspec.data.problems and the rules layer.data.type, layer.data.quantity, layer.data.subject and layer.data.dataset. Units are compared as strings with the dataset's; no unit library is needed. - fixtures/records/data/ (three annotations on the main example) and vectors/data.jsonl (35 cases); paperspec check covers both, and the determinism rebuild matches. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B8cL4zN4XpaQF5cBtASzfq
This commit is contained in:
25 files changed
+670
-33
No files matched your search
+13
-5
@@ -57,14 +57,14 @@ This context defines `kind`, `status`, `audience`, `AnchorSelector` and `anchor`
|
||||
|
||||
## What it defines
|
||||
|
||||
The file defines 36 terms.
|
||||
Thirty-five map to IRIs under `https://paperspec.scient.ing/vocab#`: `format`, `kind`, `status`, `receipt`, `layer`, `audience`, `visibility`, `purpose`, `project`, `docs`, `pin`, `role`, `symbol`, `key`, `verdict`, `reason`, `reference`, `note`, `proposer`, `identity`, `written`, `alphabet`, `organism`, `start`, `accessions`, `terms`, `regions`, `variants`, `for`, `category`, `generator`, `exercise`, `anchor`, `rights_use` and the class `AnchorSelector`.
|
||||
Six are renamed: `key`, the key of a `symbol` body's symbol, is `sct:symbolKey`, `for` is `sct:questionFor`, `generator` is `sct:generatedBy`, `proposer`, the tool that found a trace, is `sct:proposedBy`, `terms`, the force-field terms of a structure, is `sct:structureTerms`, and `rights_use` is `sct:rightsUse`.
|
||||
The thirty-sixth, `total`, maps to `totalItems` in the ActivityStreams namespace.
|
||||
The file defines 41 terms.
|
||||
Forty map to IRIs under `https://paperspec.scient.ing/vocab#`: `format`, `kind`, `status`, `receipt`, `layer`, `audience`, `visibility`, `purpose`, `project`, `docs`, `pin`, `role`, `symbol`, `key`, `verdict`, `reason`, `reference`, `note`, `proposer`, `identity`, `written`, `alphabet`, `organism`, `start`, `accessions`, `terms`, `regions`, `variants`, `data_type`, `dataset`, `method`, `quantities`, `subjects`, `for`, `category`, `generator`, `exercise`, `anchor`, `rights_use` and the class `AnchorSelector`.
|
||||
Seven are renamed: `key`, the key of a `symbol` body's symbol, is `sct:symbolKey`, `for` is `sct:questionFor`, `generator` is `sct:generatedBy`, `proposer`, the tool that found a trace, is `sct:proposedBy`, `terms`, the force-field terms of a structure, is `sct:structureTerms`, `data_type`, the kind of data a `data` body names, is `sct:dataType`, and `rights_use` is `sct:rightsUse`.
|
||||
The forty-first, `total`, maps to `totalItems` in the ActivityStreams namespace.
|
||||
Two terms carry a type rule.
|
||||
A processor reads `layer` as an IRI, and it always reads `docs` as a set, so a one-element list stays a list.
|
||||
|
||||
The file declares `anchor`, `exercise`, `proposer`, `accessions`, `terms`, `regions` and `variants` as JSON literals (`"@type": "@json"`, a JSON-LD 1.1 feature, which is why the file sets `"@version": 1.1`).
|
||||
The file declares `anchor`, `exercise`, `proposer`, `accessions`, `terms`, `regions`, `variants`, `quantities` and `subjects` as JSON literals (`"@type": "@json"`, a JSON-LD 1.1 feature, which is why the file sets `"@version": 1.1`).
|
||||
A JSON-LD processor then keeps a `scienting-anchor/1` record intact instead of expanding it.
|
||||
An anchor holds hashes (fixed-length fingerprints of text) and a `span`, a pair of character offsets whose order carries meaning.
|
||||
Expansion would drop the anchor's unmapped field names ([JSON-LD 1.1 API, expansion step 13.3](https://www.w3.org/TR/json-ld11-api/#alg-expand-each-key-value)) and would give its arrays no order ([JSON-LD 1.1 §4.3](https://www.w3.org/TR/json-ld11/#sets-and-lists)).
|
||||
@@ -105,6 +105,14 @@ Both are text bodies, so the Web Annotation context supplies `value` and this on
|
||||
`terms` maps to `sct:structureTerms`, because the word alone is too general for a vocabulary that other kinds of body may join.
|
||||
[`fixtures/records/chemistry/annotations.jsonl`](../fixtures/records/chemistry/annotations.jsonl) and [`fixtures/records/biology/annotations.jsonl`](../fixtures/records/biology/annotations.jsonl) hold four structures on the example paper and three sequences on the draft.
|
||||
|
||||
## Bodies that hold data
|
||||
|
||||
A `data` body ([spec/18 §18.8](../spec/18-layers.md#188-data)) says what kind of data a table, a figure panel or a passage presents and what it is about.
|
||||
It is a text body, so the Web Annotation context supplies `value`, and this one adds `data_type`, `dataset` and `method`.
|
||||
`data_type` maps to `sct:dataType`, as `rights_use` maps to `sct:rightsUse`.
|
||||
`quantities` and `subjects` are lists of objects, so the context declares them JSON literals, as it does `accessions`, and a processor keeps them whole.
|
||||
[`fixtures/records/data/annotations.jsonl`](../fixtures/records/data/annotations.jsonl) holds three on the example paper.
|
||||
|
||||
## Using the context
|
||||
|
||||
- Writer: Put both URLs (web addresses), in the order shown, in `@context` of `layer.json` and of every line of `annotations.jsonl`. [Chapter 18](../spec/18-layers.md) defines layers (§18.2), annotations (§18.3) and bodies (§18.4).
|
||||
|
||||
Reference in new issue
Block a user