linked-rolls 0.25.1 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -9
- package/lib/Assumption.d.ts +10 -1
- package/lib/Assumption.js +2 -0
- package/lib/EditionView.d.ts +1 -0
- package/lib/EditionView.js +10 -8
- package/lib/FeatureSource.d.ts +52 -12
- package/lib/FeatureSource.js +11 -8
- package/lib/RollCopy.d.ts +11 -3
- package/lib/Version.d.ts +28 -7
- package/lib/Version.js +17 -2
- package/lib/asJsonLd.js +2 -2
- package/lib/editionOps.d.ts +36 -5
- package/lib/editionOps.js +119 -19
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/migrate.js +22 -2
- package/lib/readers/phillipsEroll.js +1 -2
- package/lib/readers/spencerBar.js +0 -1
- package/lib/readers/stanfordAton.js +0 -1
- package/lib/reservations.d.ts +16 -9
- package/lib/reservations.js +57 -7
- package/lib/schema.json +155 -11
- package/lib/spec/context.json +13 -1
- package/lib/witnesses.d.ts +33 -0
- package/lib/witnesses.js +48 -0
- package/package.json +1 -1
package/lib/schema.json
CHANGED
|
@@ -628,7 +628,7 @@
|
|
|
628
628
|
"ontology": "reo:scope"
|
|
629
629
|
},
|
|
630
630
|
"FeatureSource": {
|
|
631
|
-
"description": "The capture by which a copy's features became data: what they were read from, who read them, on what device and when. It states where the numbers of the edition come from and says nothing about the state of the paper, which is a condition.\n\nWhat is not known is left out. A reader is told about the gap by `reservationsAbout`, which works out what a copy cannot vouch for from what it states here.",
|
|
631
|
+
"description": "The capture by which a copy's features became data: what they were read from, who read them, on what device, with what software and when. It states where the numbers of the edition come from and says nothing about the state of the paper, which is a condition.\n\nWhat is not known is left out. A reader is told about the gap by `reservationsAbout`, which works out what a copy cannot vouch for from what it states here.",
|
|
632
632
|
"properties": {
|
|
633
633
|
"actor": {
|
|
634
634
|
"$ref": "#/definitions/ActorAssignment",
|
|
@@ -646,6 +646,11 @@
|
|
|
646
646
|
"description": "The make and model of the scanner, camera or player the capture ran on.",
|
|
647
647
|
"ontology": "crmdig:L12 happened on device"
|
|
648
648
|
},
|
|
649
|
+
"instrument": {
|
|
650
|
+
"$ref": "#/definitions/ObjectAssumption%3CInstrument%3E",
|
|
651
|
+
"description": "The instrument the copy was played on, where the capture is a recording of it.",
|
|
652
|
+
"ontology": "crm:P16 used specific object"
|
|
653
|
+
},
|
|
649
654
|
"kind": {
|
|
650
655
|
"$ref": "#/definitions/SourceKind",
|
|
651
656
|
"description": "What the features were read from.",
|
|
@@ -660,6 +665,14 @@
|
|
|
660
665
|
"description": "The file the capture produced, where it has an address.",
|
|
661
666
|
"type": "string",
|
|
662
667
|
"ontology": "crmdig:L11 had output"
|
|
668
|
+
},
|
|
669
|
+
"software": {
|
|
670
|
+
"description": "The software the capture ran, each with its version.",
|
|
671
|
+
"items": {
|
|
672
|
+
"$ref": "#/definitions/Software"
|
|
673
|
+
},
|
|
674
|
+
"type": "array",
|
|
675
|
+
"ontology": "crmdig:L23 used software or firmware"
|
|
663
676
|
}
|
|
664
677
|
},
|
|
665
678
|
"required": [
|
|
@@ -823,13 +836,21 @@
|
|
|
823
836
|
"ontology": "crm:P3 has note"
|
|
824
837
|
},
|
|
825
838
|
"premises": {
|
|
826
|
-
"description": "References (by `@id`) to the beliefs
|
|
839
|
+
"description": "References (by `@id`) to the beliefs from which the conclusion is drawn.",
|
|
827
840
|
"items": {
|
|
828
841
|
"type": "string"
|
|
829
842
|
},
|
|
830
843
|
"type": "array",
|
|
831
844
|
"ontology": "crminf:J1 used as premise"
|
|
832
845
|
},
|
|
846
|
+
"used": {
|
|
847
|
+
"description": "References (by `@id`) to what the inference worked on besides beliefs, such as the versions it compared or the analysis output it cites.",
|
|
848
|
+
"items": {
|
|
849
|
+
"type": "string"
|
|
850
|
+
},
|
|
851
|
+
"type": "array",
|
|
852
|
+
"ontology": "crm:P16 used specific object"
|
|
853
|
+
},
|
|
833
854
|
"@type": {
|
|
834
855
|
"const": "inference",
|
|
835
856
|
"type": "string",
|
|
@@ -1312,6 +1333,52 @@
|
|
|
1312
1333
|
],
|
|
1313
1334
|
"description": "An object assumption wraps a complex object with an optional annotation. Used for structured values (e.g. persons, conditions) whose properties may be uncertain."
|
|
1314
1335
|
},
|
|
1336
|
+
"ObjectAssumption<ConditionState<\"general\">>": {
|
|
1337
|
+
"description": "An object assumption wraps a complex object with an optional annotation. Used for structured values (e.g. persons, conditions) whose properties may be uncertain.",
|
|
1338
|
+
"properties": {
|
|
1339
|
+
"@annotation": {
|
|
1340
|
+
"description": "An optional annotation expressing a belief about this assumption. Uses the JSON-LD-star `@annotation` mechanism to attach epistemic metadata (certainty and reasons) to any triple.",
|
|
1341
|
+
"properties": {
|
|
1342
|
+
"belief": {
|
|
1343
|
+
"$ref": "#/definitions/Belief",
|
|
1344
|
+
"description": "The belief held about the annotated statement.",
|
|
1345
|
+
"ontology": "crminf:J4i is subject of"
|
|
1346
|
+
},
|
|
1347
|
+
"@id": {
|
|
1348
|
+
"description": "A unique identifier for this object.",
|
|
1349
|
+
"type": "string"
|
|
1350
|
+
}
|
|
1351
|
+
},
|
|
1352
|
+
"required": [
|
|
1353
|
+
"belief",
|
|
1354
|
+
"@id"
|
|
1355
|
+
],
|
|
1356
|
+
"type": "object"
|
|
1357
|
+
},
|
|
1358
|
+
"conditionType": {
|
|
1359
|
+
"const": "general",
|
|
1360
|
+
"description": "The kind of condition, from the list the roll or the kind of feature allows.",
|
|
1361
|
+
"type": "string",
|
|
1362
|
+
"ontology": "crm:P2 has type"
|
|
1363
|
+
},
|
|
1364
|
+
"description": {
|
|
1365
|
+
"description": "A free-text description of the condition, providing details beyond the type classification.",
|
|
1366
|
+
"type": "string",
|
|
1367
|
+
"ontology": "crm:P3 has note"
|
|
1368
|
+
},
|
|
1369
|
+
"@type": {
|
|
1370
|
+
"const": "ConditionState",
|
|
1371
|
+
"description": "The type discriminator for this object.",
|
|
1372
|
+
"type": "string",
|
|
1373
|
+
"ontology": "rdf:type"
|
|
1374
|
+
}
|
|
1375
|
+
},
|
|
1376
|
+
"required": [
|
|
1377
|
+
"conditionType",
|
|
1378
|
+
"@type"
|
|
1379
|
+
],
|
|
1380
|
+
"type": "object"
|
|
1381
|
+
},
|
|
1315
1382
|
"ObjectAssumption<ConditionState<(\"detaching\"|\"ripped\")>>": {
|
|
1316
1383
|
"description": "An object assumption wraps a complex object with an optional annotation. Used for structured values (e.g. persons, conditions) whose properties may be uncertain.",
|
|
1317
1384
|
"properties": {
|
|
@@ -1502,6 +1569,55 @@
|
|
|
1502
1569
|
],
|
|
1503
1570
|
"type": "object"
|
|
1504
1571
|
},
|
|
1572
|
+
"ObjectAssumption<Instrument>": {
|
|
1573
|
+
"description": "An object assumption wraps a complex object with an optional annotation. Used for structured values (e.g. persons, conditions) whose properties may be uncertain.",
|
|
1574
|
+
"properties": {
|
|
1575
|
+
"@annotation": {
|
|
1576
|
+
"description": "An optional annotation expressing a belief about this assumption. Uses the JSON-LD-star `@annotation` mechanism to attach epistemic metadata (certainty and reasons) to any triple.",
|
|
1577
|
+
"properties": {
|
|
1578
|
+
"belief": {
|
|
1579
|
+
"$ref": "#/definitions/Belief",
|
|
1580
|
+
"description": "The belief held about the annotated statement.",
|
|
1581
|
+
"ontology": "crminf:J4i is subject of"
|
|
1582
|
+
},
|
|
1583
|
+
"@id": {
|
|
1584
|
+
"description": "A unique identifier for this object.",
|
|
1585
|
+
"type": "string"
|
|
1586
|
+
}
|
|
1587
|
+
},
|
|
1588
|
+
"required": [
|
|
1589
|
+
"belief",
|
|
1590
|
+
"@id"
|
|
1591
|
+
],
|
|
1592
|
+
"type": "object"
|
|
1593
|
+
},
|
|
1594
|
+
"condition": {
|
|
1595
|
+
"$ref": "#/definitions/ObjectAssumption%3CConditionState%3C%22general%22%3E%3E",
|
|
1596
|
+
"ontology": "crm:P44 has condition"
|
|
1597
|
+
},
|
|
1598
|
+
"name": {
|
|
1599
|
+
"description": "The name, e.g. \"Grünfeld, Alfred\", \"Wien\", \"M. Welte & Söhne\".",
|
|
1600
|
+
"type": "string",
|
|
1601
|
+
"ontology": "rdfs:label"
|
|
1602
|
+
},
|
|
1603
|
+
"sameAs": {
|
|
1604
|
+
"description": "Authority records for the same thing: GND, Wikidata, geonames or similar.",
|
|
1605
|
+
"examples": [
|
|
1606
|
+
"https://d-nb.info/gnd/116888652"
|
|
1607
|
+
],
|
|
1608
|
+
"items": {
|
|
1609
|
+
"type": "string"
|
|
1610
|
+
},
|
|
1611
|
+
"type": "array",
|
|
1612
|
+
"ontology": "owl:sameAs"
|
|
1613
|
+
}
|
|
1614
|
+
},
|
|
1615
|
+
"required": [
|
|
1616
|
+
"name",
|
|
1617
|
+
"sameAs"
|
|
1618
|
+
],
|
|
1619
|
+
"type": "object"
|
|
1620
|
+
},
|
|
1505
1621
|
"ObjectAssumption<PaperSpeed>": {
|
|
1506
1622
|
"anyOf": [
|
|
1507
1623
|
{
|
|
@@ -1984,6 +2100,14 @@
|
|
|
1984
2100
|
"RollCopy": {
|
|
1985
2101
|
"description": "A physical copy of a roll, held at a specific location. Each roll copy has its own set of features, measurements, conditions, and modifications. Multiple copies of the same roll may exist across different archives or collections.",
|
|
1986
2102
|
"properties": {
|
|
2103
|
+
"carries": {
|
|
2104
|
+
"description": "The versions this copy is held to carry, where its features are not read into symbols, as for a copy known only from a recording. Each statement carries the belief it rests on.",
|
|
2105
|
+
"items": {
|
|
2106
|
+
"$ref": "#/definitions/ReferenceAssumption"
|
|
2107
|
+
},
|
|
2108
|
+
"type": "array",
|
|
2109
|
+
"ontology": "crm:P128 carries"
|
|
2110
|
+
},
|
|
1987
2111
|
"conditions": {
|
|
1988
2112
|
"description": "Condition assessments of this roll copy (e.g. paper stretch, general wear). Each condition is an assumption annotatable with a belief.",
|
|
1989
2113
|
"items": {
|
|
@@ -2002,7 +2126,7 @@
|
|
|
2002
2126
|
},
|
|
2003
2127
|
"keeper": {
|
|
2004
2128
|
"$ref": "#/definitions/Agent",
|
|
2005
|
-
"description": "The institution or person holding this copy.",
|
|
2129
|
+
"description": "The institution or person holding this copy. Left out where it is not known, as for a copy known only from a recording.",
|
|
2006
2130
|
"ontology": "crm:P50 has current keeper"
|
|
2007
2131
|
},
|
|
2008
2132
|
"measurements": {
|
|
@@ -2161,7 +2285,6 @@
|
|
|
2161
2285
|
"conditions",
|
|
2162
2286
|
"features",
|
|
2163
2287
|
"@id",
|
|
2164
|
-
"keeper",
|
|
2165
2288
|
"measurements",
|
|
2166
2289
|
"modifications",
|
|
2167
2290
|
"ops",
|
|
@@ -2188,11 +2311,31 @@
|
|
|
2188
2311
|
],
|
|
2189
2312
|
"type": "object"
|
|
2190
2313
|
},
|
|
2314
|
+
"Software": {
|
|
2315
|
+
"description": "Software a capture ran, such as the transcriber that read a recording into notes or the emulator that wrote a MIDI file.",
|
|
2316
|
+
"properties": {
|
|
2317
|
+
"name": {
|
|
2318
|
+
"type": "string",
|
|
2319
|
+
"ontology": "rdfs:label"
|
|
2320
|
+
},
|
|
2321
|
+
"version": {
|
|
2322
|
+
"description": "The release, or the model checkpoint of a transcriber.",
|
|
2323
|
+
"type": "string",
|
|
2324
|
+
"ontology": "owl:versionInfo"
|
|
2325
|
+
}
|
|
2326
|
+
},
|
|
2327
|
+
"required": [
|
|
2328
|
+
"name"
|
|
2329
|
+
],
|
|
2330
|
+
"type": "object",
|
|
2331
|
+
"ontology": "crmdig:D14 Software"
|
|
2332
|
+
},
|
|
2191
2333
|
"SourceKind": {
|
|
2192
2334
|
"enum": [
|
|
2193
2335
|
"roll",
|
|
2194
2336
|
"scan",
|
|
2195
2337
|
"analysis",
|
|
2338
|
+
"reading",
|
|
2196
2339
|
"emulation",
|
|
2197
2340
|
"recording"
|
|
2198
2341
|
],
|
|
@@ -2270,8 +2413,11 @@
|
|
|
2270
2413
|
"description": "A version is defined by the sum of edits applied to the version it is based on. For simple identification, a siglum is given to each version.",
|
|
2271
2414
|
"properties": {
|
|
2272
2415
|
"basedOn": {
|
|
2273
|
-
"
|
|
2274
|
-
"
|
|
2416
|
+
"description": "The versions this one is held to derive from, each under the belief it rests on. The text is read against the principal one (`principalDerivationOf`); the others stand as hypotheses, such as a contamination. A version that names none represents the mother roll.",
|
|
2417
|
+
"items": {
|
|
2418
|
+
"$ref": "#/definitions/Derivation"
|
|
2419
|
+
},
|
|
2420
|
+
"type": "array",
|
|
2275
2421
|
"ontology": "lrmoo:R76 is derivative of"
|
|
2276
2422
|
},
|
|
2277
2423
|
"creation": {
|
|
@@ -2280,7 +2426,7 @@
|
|
|
2280
2426
|
"ontology": "lrmoo:R17i was created by"
|
|
2281
2427
|
},
|
|
2282
2428
|
"edits": {
|
|
2283
|
-
"description": "The list of edits that, applied to the base version, produce this version.",
|
|
2429
|
+
"description": "The list of edits that, applied to the base version, produce this version. A hypothetical version whose changes nobody can state leaves it out; it then reads as the version it derives from.",
|
|
2284
2430
|
"items": {
|
|
2285
2431
|
"$ref": "#/definitions/Edit"
|
|
2286
2432
|
},
|
|
@@ -2306,7 +2452,7 @@
|
|
|
2306
2452
|
},
|
|
2307
2453
|
"versionType": {
|
|
2308
2454
|
"$ref": "#/definitions/VersionType",
|
|
2309
|
-
"description": "Whether the version served as a master for reproductions or exists on one copy only.",
|
|
2455
|
+
"description": "Whether the version served as a master for reproductions or exists on one copy only. Left out where that is not known, as for a version only a secondary witness hints at.",
|
|
2310
2456
|
"ontology": "crm:P2 has type"
|
|
2311
2457
|
},
|
|
2312
2458
|
"@id": {
|
|
@@ -2321,13 +2467,11 @@
|
|
|
2321
2467
|
}
|
|
2322
2468
|
},
|
|
2323
2469
|
"required": [
|
|
2324
|
-
"edits",
|
|
2325
2470
|
"@id",
|
|
2326
2471
|
"motivations",
|
|
2327
2472
|
"siglum",
|
|
2328
2473
|
"system",
|
|
2329
|
-
"@type"
|
|
2330
|
-
"versionType"
|
|
2474
|
+
"@type"
|
|
2331
2475
|
],
|
|
2332
2476
|
"type": "object",
|
|
2333
2477
|
"ontology": "lrmoo:F2 Expression"
|
package/lib/spec/context.json
CHANGED
|
@@ -60,7 +60,13 @@
|
|
|
60
60
|
},
|
|
61
61
|
"inference": {
|
|
62
62
|
"@id": "crminf:I5_Inference_Making",
|
|
63
|
-
"@context": {
|
|
63
|
+
"@context": {
|
|
64
|
+
"note": "crm:P3_has_note",
|
|
65
|
+
"used": {
|
|
66
|
+
"@id": "crm:P16_used_specific_object",
|
|
67
|
+
"@type": "@id"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
64
70
|
},
|
|
65
71
|
"beliefAdoption": {
|
|
66
72
|
"@id": "crminf:I7_Belief_Adoption",
|
|
@@ -168,6 +174,7 @@
|
|
|
168
174
|
"factor": "rdf:value",
|
|
169
175
|
"keeper": "crm:P50_has_current_keeper",
|
|
170
176
|
"features": "crm:P56_bears_feature",
|
|
177
|
+
"carries": "crm:P128_carries",
|
|
171
178
|
"modifications": "crm:P31i_was_modified_by",
|
|
172
179
|
"scan": {
|
|
173
180
|
"@id": "crm:P138i_has_representation",
|
|
@@ -190,6 +197,11 @@
|
|
|
190
197
|
"@type": "@id"
|
|
191
198
|
},
|
|
192
199
|
"device": "crmdig:L12_happened_on_device",
|
|
200
|
+
"software": {
|
|
201
|
+
"@id": "crmdig:L23_used_software_or_firmware",
|
|
202
|
+
"@context": { "version": "owl:versionInfo" }
|
|
203
|
+
},
|
|
204
|
+
"instrument": "crm:P16_used_specific_object",
|
|
193
205
|
"note": "crm:P3_has_note"
|
|
194
206
|
}
|
|
195
207
|
},
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Certainty } from "./Assumption";
|
|
2
|
+
import { EditionView } from "./EditionView";
|
|
3
|
+
export type WitnessBy = 'carriers' | 'statement';
|
|
4
|
+
/** A copy that bears witness to a version, and how. */
|
|
5
|
+
export interface Witness {
|
|
6
|
+
/** The copy, by id. */
|
|
7
|
+
copy: string;
|
|
8
|
+
/** Whether the copy's features carry what the version inserts, or the copy states that it carries the version. */
|
|
9
|
+
by: WitnessBy;
|
|
10
|
+
/** How certainly a statement is held. Carriage through features is no statement and holds none. */
|
|
11
|
+
certainty?: Certainty;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The copies that bear witness to the version: those whose features carry
|
|
15
|
+
* a symbol the version's own edits insert, and those that state they carry
|
|
16
|
+
* it, with the certainty each statement is held with.
|
|
17
|
+
*
|
|
18
|
+
* What a version inherits is carried by nearly every copy of the roll, so
|
|
19
|
+
* only what it inserts tells its witnesses apart. A version whose edits
|
|
20
|
+
* are not stated is witnessed by statement alone.
|
|
21
|
+
*/
|
|
22
|
+
export declare const witnessesOf: (view: EditionView, versionId: string) => Witness[];
|
|
23
|
+
export type CarriageProblem = {
|
|
24
|
+
copy: string;
|
|
25
|
+
version: string;
|
|
26
|
+
problem: 'stated-beside-carriers' | 'version-missing';
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Where a copy's statement that it carries a version cannot stand: one
|
|
30
|
+
* made although the copy's features carry symbols, which say by
|
|
31
|
+
* themselves what it carries, and one naming a version the edition lacks.
|
|
32
|
+
*/
|
|
33
|
+
export declare const carriageProblems: (view: EditionView) => CarriageProblem[];
|
package/lib/witnesses.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { certaintyOf, idOf, idsOf } from "./Assumption";
|
|
2
|
+
import { insertedBy } from "./Version";
|
|
3
|
+
/** The copies whose features carry any of the symbols. */
|
|
4
|
+
const copiesCarrying = (view, symbols) => new Set(symbols
|
|
5
|
+
.flatMap(symbol => idsOf(symbol.carriers))
|
|
6
|
+
.flatMap(id => {
|
|
7
|
+
const copy = view.copyOf(id);
|
|
8
|
+
return copy ? [copy.id] : [];
|
|
9
|
+
}));
|
|
10
|
+
/**
|
|
11
|
+
* The copies that bear witness to the version: those whose features carry
|
|
12
|
+
* a symbol the version's own edits insert, and those that state they carry
|
|
13
|
+
* it, with the certainty each statement is held with.
|
|
14
|
+
*
|
|
15
|
+
* What a version inherits is carried by nearly every copy of the roll, so
|
|
16
|
+
* only what it inserts tells its witnesses apart. A version whose edits
|
|
17
|
+
* are not stated is witnessed by statement alone.
|
|
18
|
+
*/
|
|
19
|
+
export const witnessesOf = (view, versionId) => {
|
|
20
|
+
const version = view.get(versionId);
|
|
21
|
+
if (!version)
|
|
22
|
+
return [];
|
|
23
|
+
const carrying = copiesCarrying(view, insertedBy(version));
|
|
24
|
+
const byCarriers = view.edition.copies
|
|
25
|
+
.filter(copy => carrying.has(copy.id))
|
|
26
|
+
.map((copy) => ({ copy: copy.id, by: 'carriers' }));
|
|
27
|
+
const byStatement = view.edition.copies
|
|
28
|
+
.filter(copy => !carrying.has(copy.id))
|
|
29
|
+
.flatMap(copy => (copy.carries ?? [])
|
|
30
|
+
.filter(statement => idOf(statement) === versionId)
|
|
31
|
+
.map((statement) => ({ copy: copy.id, by: 'statement', certainty: certaintyOf(statement) })));
|
|
32
|
+
return [...byCarriers, ...byStatement];
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Where a copy's statement that it carries a version cannot stand: one
|
|
36
|
+
* made although the copy's features carry symbols, which say by
|
|
37
|
+
* themselves what it carries, and one naming a version the edition lacks.
|
|
38
|
+
*/
|
|
39
|
+
export const carriageProblems = (view) => {
|
|
40
|
+
const carrying = copiesCarrying(view, view.edition.versions.flatMap(insertedBy));
|
|
41
|
+
return view.edition.copies.flatMap(copy => (copy.carries ?? []).flatMap((statement) => {
|
|
42
|
+
const version = idOf(statement);
|
|
43
|
+
return [
|
|
44
|
+
...(carrying.has(copy.id) ? [{ copy: copy.id, version, problem: 'stated-beside-carriers' }] : []),
|
|
45
|
+
...(view.get(version)?.type === 'Version' ? [] : [{ copy: copy.id, version, problem: 'version-missing' }])
|
|
46
|
+
];
|
|
47
|
+
}));
|
|
48
|
+
};
|
package/package.json
CHANGED