linked-rolls 0.28.0 → 0.29.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/lib/Version.d.ts +0 -23
- package/lib/Version.js +0 -11
- package/lib/editionOps.js +0 -2
- package/lib/migrate.js +11 -5
- package/lib/reservations.d.ts +1 -1
- package/lib/reservations.js +1 -6
- package/lib/schema.json +0 -13
- package/lib/spec/context.json +0 -5
- package/package.json +1 -1
package/lib/Version.d.ts
CHANGED
|
@@ -4,22 +4,6 @@ import { ActorAssignment, Belief, Certainty, DateAssignment, ReferenceAssumption
|
|
|
4
4
|
import { CollationTolerance } from "./Collation";
|
|
5
5
|
import { AnySymbol } from "./Symbol";
|
|
6
6
|
import { WithId, WithNote, WithType } from "./utils";
|
|
7
|
-
export declare const versionTypes: readonly [
|
|
8
|
-
/**
|
|
9
|
-
* The roll is in a state where it is (possibly) used as
|
|
10
|
-
* the master roll for several new reproductions.
|
|
11
|
-
*/
|
|
12
|
-
'edition',
|
|
13
|
-
/**
|
|
14
|
-
* A version that exists only on one specific copy of a roll.
|
|
15
|
-
*/
|
|
16
|
-
'unicum'];
|
|
17
|
-
/**
|
|
18
|
-
* The type of a version. An 'edition' version may serve as the
|
|
19
|
-
* master for several roll copies; a 'unicum' version exists only
|
|
20
|
-
* on one specific copy.
|
|
21
|
-
*/
|
|
22
|
-
export type VersionType = typeof versionTypes[number];
|
|
23
7
|
/**
|
|
24
8
|
* A motivation provides a reason or rationale for an editorial change.
|
|
25
9
|
* Motivations are defined at the version level and referenced by edits.
|
|
@@ -96,13 +80,6 @@ export interface Version extends WithId, WithType<'Version'> {
|
|
|
96
80
|
* @see crm:P2 has type
|
|
97
81
|
*/
|
|
98
82
|
system: Concept;
|
|
99
|
-
/**
|
|
100
|
-
* Whether the version served as a master for reproductions
|
|
101
|
-
* or exists on one copy only. Left out where that is not known,
|
|
102
|
-
* as for a version only a secondary witness hints at.
|
|
103
|
-
* @see crm:P2 has type
|
|
104
|
-
*/
|
|
105
|
-
versionType?: VersionType;
|
|
106
83
|
/**
|
|
107
84
|
* The versions this one is held to derive from, each under the
|
|
108
85
|
* belief it rests on. The text is read against the principal one
|
package/lib/Version.js
CHANGED
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
import { certainties, certaintyOf, idOf } from "./Assumption";
|
|
2
2
|
import { defaultCollationTolerance } from "./Collation";
|
|
3
|
-
export const versionTypes = [
|
|
4
|
-
/**
|
|
5
|
-
* The roll is in a state where it is (possibly) used as
|
|
6
|
-
* the master roll for several new reproductions.
|
|
7
|
-
*/
|
|
8
|
-
'edition',
|
|
9
|
-
/**
|
|
10
|
-
* A version that exists only on one specific copy of a roll.
|
|
11
|
-
*/
|
|
12
|
-
'unicum'
|
|
13
|
-
];
|
|
14
3
|
/** The tolerance the derivation was collated at, or the default where it states none. */
|
|
15
4
|
export const collationToleranceOf = (derivation) => derivation.collationTolerance ?? defaultCollationTolerance;
|
|
16
5
|
/** The edits the version states, none where it leaves its text unstated. */
|
package/lib/editionOps.js
CHANGED
|
@@ -83,7 +83,6 @@ export const createVersion = (siglum, copy) => draft => {
|
|
|
83
83
|
id: v4(),
|
|
84
84
|
siglum,
|
|
85
85
|
system: systemOf(bar),
|
|
86
|
-
versionType: 'edition',
|
|
87
86
|
edits: asSymbols(copy.features, bar).map(insertion),
|
|
88
87
|
motivations: []
|
|
89
88
|
});
|
|
@@ -649,7 +648,6 @@ export const deriveVersion = (versionId, editIds) => onVersion(versionId, (versi
|
|
|
649
648
|
id: v4(),
|
|
650
649
|
siglum: `${version.siglum}_derived`,
|
|
651
650
|
system: stateOf(version).system,
|
|
652
|
-
versionType: 'unicum',
|
|
653
651
|
basedOn: [assignReference(versionId)],
|
|
654
652
|
edits: moved,
|
|
655
653
|
motivations: []
|
package/lib/migrate.js
CHANGED
|
@@ -3,8 +3,7 @@ import { rollConditions } from "./RollCopy";
|
|
|
3
3
|
import { systemIdIn, systemOf, translationBetween } from "./TrackerBar";
|
|
4
4
|
import { trackerBars } from "./systems";
|
|
5
5
|
import { welteT100 } from "./systems/welteT100/bar";
|
|
6
|
-
|
|
7
|
-
const versionTypeValues = new Set(versionTypes);
|
|
6
|
+
const retiredVersionTypes = new Set(['edition', 'unicum']);
|
|
8
7
|
const conditionTypeValues = new Set([...rollConditions, ...Object.values(conditions).flat()]);
|
|
9
8
|
const renamedKeys = {
|
|
10
9
|
productionEvent: 'production',
|
|
@@ -17,14 +16,21 @@ const withRenamedKeys = (node) => Object.keys(node).some(key => Object.hasOwn(re
|
|
|
17
16
|
? Object.fromEntries(Object.entries(node).map(([key, value]) => [renamedKeys[key] ?? key, value]))
|
|
18
17
|
: node;
|
|
19
18
|
const withTypology = (node) => {
|
|
20
|
-
if (
|
|
21
|
-
return { ...node, '@type': 'Version'
|
|
19
|
+
if (retiredVersionTypes.has(node['@type'])) {
|
|
20
|
+
return { ...node, '@type': 'Version' };
|
|
22
21
|
}
|
|
23
22
|
if (conditionTypeValues.has(node['@type'])) {
|
|
24
23
|
return { ...node, '@type': 'ConditionState', conditionType: node['@type'] };
|
|
25
24
|
}
|
|
26
25
|
return node;
|
|
27
26
|
};
|
|
27
|
+
/** A version once stated whether it served as a master or stood on one copy. */
|
|
28
|
+
const withoutVersionType = (node) => {
|
|
29
|
+
if (!Object.hasOwn(node, 'versionType'))
|
|
30
|
+
return node;
|
|
31
|
+
const { versionType: _retired, ...rest } = node;
|
|
32
|
+
return rest;
|
|
33
|
+
};
|
|
28
34
|
const withReferences = (node) => referenceKeys.reduce((result, key) => {
|
|
29
35
|
const reference = result[key];
|
|
30
36
|
if (reference && typeof reference === 'object' && '@value' in reference) {
|
|
@@ -88,7 +94,7 @@ const withoutEmptyKeeper = (node) => {
|
|
|
88
94
|
const { keeper: _unnamed, ...rest } = node;
|
|
89
95
|
return rest;
|
|
90
96
|
};
|
|
91
|
-
const migrateNode = (node) => [withRenamedKeys, withTypology, withReferences, withKeeper, withoutEmptyKeeper, withProductionNodes, withScale,
|
|
97
|
+
const migrateNode = (node) => [withRenamedKeys, withTypology, withoutVersionType, withReferences, withKeeper, withoutEmptyKeeper, withProductionNodes, withScale,
|
|
92
98
|
withDerivationList, withReadingKind]
|
|
93
99
|
.reduce((result, step) => step(result), node);
|
|
94
100
|
/** The items each walked, or the very same list where the walk changed none. */
|
package/lib/reservations.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export interface Reservation<T extends string = ReservationType> {
|
|
|
24
24
|
* the measurement leaves open, then who holds it.
|
|
25
25
|
*/
|
|
26
26
|
export declare const reservationsAbout: (copy: RollCopy) => Reservation[];
|
|
27
|
-
export declare const versionReservationTypes: readonly ['text-not-stated', '
|
|
27
|
+
export declare const versionReservationTypes: readonly ['text-not-stated', 'witnessed-by-statement-only'];
|
|
28
28
|
export type VersionReservationType = typeof versionReservationTypes[number];
|
|
29
29
|
/** What the edition cannot vouch for in a version, in the order the checks are listed. */
|
|
30
30
|
export declare const reservationsAboutVersion: (view: EditionView, version: Readonly<Version>) => Reservation<VersionReservationType>[];
|
package/lib/reservations.js
CHANGED
|
@@ -102,17 +102,12 @@ const checks = [
|
|
|
102
102
|
export const reservationsAbout = (copy) => checks.flatMap(check => check(copy) ?? []);
|
|
103
103
|
export const versionReservationTypes = [
|
|
104
104
|
'text-not-stated',
|
|
105
|
-
'type-not-stated',
|
|
106
105
|
'witnessed-by-statement-only'
|
|
107
106
|
];
|
|
108
107
|
const textStated = (_view, version) => version.edits ? undefined : {
|
|
109
108
|
type: 'text-not-stated',
|
|
110
109
|
note: 'The version does not state its edits, so it reads as the version it derives from.'
|
|
111
110
|
};
|
|
112
|
-
const typeStated = (_view, version) => version.versionType ? undefined : {
|
|
113
|
-
type: 'type-not-stated',
|
|
114
|
-
note: 'The version does not say whether it served as a master for several copies or exists on one only.'
|
|
115
|
-
};
|
|
116
111
|
const witnessedByFeatures = (view, version) => {
|
|
117
112
|
const witnesses = witnessesOf(view, version.id);
|
|
118
113
|
return witnesses.length > 0 && witnesses.every(({ by }) => by === 'statement') ? {
|
|
@@ -120,6 +115,6 @@ const witnessedByFeatures = (view, version) => {
|
|
|
120
115
|
note: 'No copy\'s features carry what the version inserts; only copies that state they carry it bear witness to it.'
|
|
121
116
|
} : undefined;
|
|
122
117
|
};
|
|
123
|
-
const versionChecks = [textStated,
|
|
118
|
+
const versionChecks = [textStated, witnessedByFeatures];
|
|
124
119
|
/** What the edition cannot vouch for in a version, in the order the checks are listed. */
|
|
125
120
|
export const reservationsAboutVersion = (view, version) => versionChecks.flatMap(check => check(view, version) ?? []);
|
package/lib/schema.json
CHANGED
|
@@ -2455,11 +2455,6 @@
|
|
|
2455
2455
|
"description": "The reproducing system this version is coded for. One roll was often issued for several of them, and a version is a reading in one system's words: its expression types are that system's vocabulary and its notes sit on that bar's positions. A system the type vocabulary knows carries the IRI of its concept as `id`, from which the export takes the system's own context.",
|
|
2456
2456
|
"ontology": "crm:P2 has type"
|
|
2457
2457
|
},
|
|
2458
|
-
"versionType": {
|
|
2459
|
-
"$ref": "#/definitions/VersionType",
|
|
2460
|
-
"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.",
|
|
2461
|
-
"ontology": "crm:P2 has type"
|
|
2462
|
-
},
|
|
2463
2458
|
"@id": {
|
|
2464
2459
|
"description": "A unique identifier for this object.",
|
|
2465
2460
|
"type": "string"
|
|
@@ -2503,14 +2498,6 @@
|
|
|
2503
2498
|
"type": "object",
|
|
2504
2499
|
"ontology": "lrmoo:F28 Expression Creation"
|
|
2505
2500
|
},
|
|
2506
|
-
"VersionType": {
|
|
2507
|
-
"description": "The type of a version. An 'edition' version may serve as the master for several roll copies; a 'unicum' version exists only on one specific copy.",
|
|
2508
|
-
"enum": [
|
|
2509
|
-
"edition",
|
|
2510
|
-
"unicum"
|
|
2511
|
-
],
|
|
2512
|
-
"type": "string"
|
|
2513
|
-
},
|
|
2514
2501
|
"VerticalSpan": {
|
|
2515
2502
|
"description": "Describes the vertical extent of a feature on the roll, measured in track numbers. Track numbers correspond to positions on the tracker bar.",
|
|
2516
2503
|
"properties": {
|
package/lib/spec/context.json
CHANGED
|
@@ -249,11 +249,6 @@
|
|
|
249
249
|
"@context": { "@vocab": "https://w3id.org/reo/type/" }
|
|
250
250
|
},
|
|
251
251
|
"siglum": "reo:siglum",
|
|
252
|
-
"versionType": {
|
|
253
|
-
"@id": "crm:P2_has_type",
|
|
254
|
-
"@type": "@vocab",
|
|
255
|
-
"@context": { "@vocab": "https://w3id.org/reo/type/" }
|
|
256
|
-
},
|
|
257
252
|
"basedOn": "lrmoo:R76_is_derivative_of",
|
|
258
253
|
"edits": "reo:involvedEdit",
|
|
259
254
|
"motivations": "@included",
|
package/package.json
CHANGED