linked-rolls 0.41.0 → 0.42.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/Feature.d.ts +25 -20
- package/lib/Feature.js +2 -2
- package/lib/migrate.js +21 -3
- package/lib/schema.json +57 -37
- package/lib/spec/context.json +7 -2
- package/package.json +1 -1
package/lib/Feature.d.ts
CHANGED
|
@@ -131,36 +131,46 @@ export interface OnAFace {
|
|
|
131
131
|
*/
|
|
132
132
|
side?: 'recto' | 'verso';
|
|
133
133
|
}
|
|
134
|
+
export declare const techniques: readonly ['print', 'handwriting', 'stamp'];
|
|
135
|
+
/** How a trace was put on the paper. */
|
|
136
|
+
export type Technique = typeof techniques[number];
|
|
137
|
+
export declare const media: readonly ['ink', 'pencil', 'crayon'];
|
|
138
|
+
/** What a trace was put on with. */
|
|
139
|
+
export type Medium = typeof media[number];
|
|
134
140
|
/**
|
|
135
141
|
* A trace is a visible mark or writing on the roll surface.
|
|
136
142
|
* Traces may fade over time.
|
|
137
143
|
*/
|
|
138
144
|
export interface Trace<T extends FeatureType> extends RollFeature<T, typeof conditions[T][number]>, OnAFace {
|
|
145
|
+
/**
|
|
146
|
+
* How the trace was put on the paper.
|
|
147
|
+
* @see reo:technique
|
|
148
|
+
*/
|
|
149
|
+
technique?: Technique;
|
|
150
|
+
/**
|
|
151
|
+
* What it was put on with, where it can be told. A date may be
|
|
152
|
+
* known to be handwritten where the pencil cannot be told from
|
|
153
|
+
* the ink, and a stamp leaves its ink as much as a pen does,
|
|
154
|
+
* which is why the two are stated apart.
|
|
155
|
+
* @see reo:medium
|
|
156
|
+
*/
|
|
157
|
+
medium?: Medium;
|
|
139
158
|
}
|
|
140
|
-
export declare const writingMethods: readonly ['print', 'handwriting', 'stamp'];
|
|
141
|
-
/**
|
|
142
|
-
* The method by which a writing was produced on the roll:
|
|
143
|
-
* printed, handwritten, or stamped.
|
|
144
|
-
*/
|
|
145
|
-
export type WritingMethod = typeof writingMethods[number];
|
|
146
|
-
export declare const markMethods: readonly ['ink', 'pencil', 'crayon'];
|
|
147
|
-
/** The medium a mark was drawn in. */
|
|
148
|
-
export type MarkMethod = typeof markMethods[number];
|
|
149
159
|
/** The text a writing carries. It names no carriers of its own, the writing being its carrier. */
|
|
150
160
|
export type Transcription = Omit<Text, 'carriers'>;
|
|
151
161
|
/**
|
|
152
162
|
* A piece of writing found on the roll, such as a label,
|
|
153
|
-
* catalogue number, or annotation. Writings
|
|
154
|
-
*
|
|
163
|
+
* catalogue number, or annotation. Writings state how they were made
|
|
164
|
+
* and a transcription of their content.
|
|
155
165
|
* @see reo:Writing
|
|
156
166
|
*/
|
|
157
167
|
export interface Writing extends Trace<'Writing'> {
|
|
158
168
|
/**
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
* @see reo:
|
|
169
|
+
* A writing always states how it was put on the paper, which can
|
|
170
|
+
* be read off it where the medium cannot.
|
|
171
|
+
* @see reo:technique
|
|
162
172
|
*/
|
|
163
|
-
|
|
173
|
+
technique: Technique;
|
|
164
174
|
/**
|
|
165
175
|
* A transcription of the text content of the writing.
|
|
166
176
|
* This is an object assumption so that the transcription
|
|
@@ -186,11 +196,6 @@ export interface Writing extends Trace<'Writing'> {
|
|
|
186
196
|
* @see reo:Mark
|
|
187
197
|
*/
|
|
188
198
|
export interface Mark extends Trace<'Mark'> {
|
|
189
|
-
/**
|
|
190
|
-
* The medium the mark was drawn in, where it can be told.
|
|
191
|
-
* @see reo:method
|
|
192
|
-
*/
|
|
193
|
-
method?: MarkMethod;
|
|
194
199
|
}
|
|
195
200
|
/**
|
|
196
201
|
* A piece of material (paper or tape) glued onto the roll surface.
|
package/lib/Feature.js
CHANGED
|
@@ -6,8 +6,8 @@ export const conditions = {
|
|
|
6
6
|
Mark: ['faded'],
|
|
7
7
|
GluedOn: ['detaching', 'ripped']
|
|
8
8
|
};
|
|
9
|
-
export const
|
|
10
|
-
export const
|
|
9
|
+
export const techniques = ['print', 'handwriting', 'stamp'];
|
|
10
|
+
export const media = ['ink', 'pencil', 'crayon'];
|
|
11
11
|
export const isRollFeature = (obj) => {
|
|
12
12
|
return 'type' in obj && isFeatureType(obj.type);
|
|
13
13
|
};
|
package/lib/migrate.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { conditions, isFeatureType } from "./Feature";
|
|
1
|
+
import { conditions, isFeatureType, media, techniques } from "./Feature";
|
|
2
2
|
import { rollConditions } from "./RollCopy";
|
|
3
3
|
import { systemIdIn, systemOf, translationBetween } from "./TrackerBar";
|
|
4
4
|
import { trackerBars } from "./systems";
|
|
@@ -14,7 +14,7 @@ const renamedKeys = {
|
|
|
14
14
|
const referenceKeys = ['alignedWith', 'pairedWith', 'basedOn'];
|
|
15
15
|
/**
|
|
16
16
|
* The five type terms that were capitalised while the rest of the
|
|
17
|
-
* vocabulary was not, under the keys that
|
|
17
|
+
* vocabulary was not, under the keys that carried them then.
|
|
18
18
|
*/
|
|
19
19
|
const lowerCasedTerms = {
|
|
20
20
|
method: { Print: 'print', Handwriting: 'handwriting', Stamp: 'stamp' },
|
|
@@ -44,6 +44,24 @@ const withLowerCaseTerms = (node) => Object.entries(lowerCasedTerms).reduce((res
|
|
|
44
44
|
const lowered = terms[result[key]];
|
|
45
45
|
return lowered ? { ...result, [key]: lowered } : result;
|
|
46
46
|
}, node);
|
|
47
|
+
/** The key each term of the one-time `method` belongs under. */
|
|
48
|
+
const splitMethods = {
|
|
49
|
+
...Object.fromEntries(techniques.map(term => [term, 'technique'])),
|
|
50
|
+
...Object.fromEntries(media.map(term => [term, 'medium']))
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* How a writing or a mark was put on the paper and what it was put on
|
|
54
|
+
* with stood under one key, which left a handwriting no room to say it
|
|
55
|
+
* was pencilled. A term the format no longer knows stays where it is,
|
|
56
|
+
* so that it fails validation rather than being filed under a guess.
|
|
57
|
+
*/
|
|
58
|
+
const withSplitMethod = (node) => {
|
|
59
|
+
const key = splitMethods[node.method];
|
|
60
|
+
if (!key)
|
|
61
|
+
return node;
|
|
62
|
+
const { method, ...rest } = node;
|
|
63
|
+
return { ...rest, [key]: method };
|
|
64
|
+
};
|
|
47
65
|
const withReferences = (node) => referenceKeys.reduce((result, key) => {
|
|
48
66
|
const reference = result[key];
|
|
49
67
|
if (reference && typeof reference === 'object' && '@value' in reference) {
|
|
@@ -203,7 +221,7 @@ const withTimeSpanDates = (node) => {
|
|
|
203
221
|
const { '@value': within, '@type': _typed, ...rest } = node;
|
|
204
222
|
return { ...rest, within };
|
|
205
223
|
};
|
|
206
|
-
const migrateNode = (node) => [withRenamedKeys, withTypology, withoutVersionType, withLowerCaseTerms, withReferences, withKeeper, withoutEmptyKeeper,
|
|
224
|
+
const migrateNode = (node) => [withRenamedKeys, withTypology, withoutVersionType, withLowerCaseTerms, withSplitMethod, withReferences, withKeeper, withoutEmptyKeeper,
|
|
207
225
|
withProductionNodes, withScale, withDerivationList, withReadingKind, withTimeSpanDates, withoutFeatureKind,
|
|
208
226
|
withBorneFeaturesNamed, withFeaturesInActs]
|
|
209
227
|
.reduce((result, step) => step(result), node);
|
package/lib/schema.json
CHANGED
|
@@ -1024,10 +1024,10 @@
|
|
|
1024
1024
|
"description": "Horizontal span of the feature on the roll.",
|
|
1025
1025
|
"ontology": "crm:P43 has dimension"
|
|
1026
1026
|
},
|
|
1027
|
-
"
|
|
1028
|
-
"$ref": "#/definitions/
|
|
1029
|
-
"description": "
|
|
1030
|
-
"ontology": "reo:
|
|
1027
|
+
"medium": {
|
|
1028
|
+
"$ref": "#/definitions/Medium",
|
|
1029
|
+
"description": "What it was put on with, where it can be told. A date may be known to be handwritten where the pencil cannot be told from the ink, and a stamp leaves its ink as much as a pen does, which is why the two are stated apart.",
|
|
1030
|
+
"ontology": "reo:medium"
|
|
1031
1031
|
},
|
|
1032
1032
|
"side": {
|
|
1033
1033
|
"description": "The face of the roll it lies on: the side that faces the reader as the roll plays, or the back of it.",
|
|
@@ -1038,6 +1038,11 @@
|
|
|
1038
1038
|
"type": "string",
|
|
1039
1039
|
"ontology": "reo:side"
|
|
1040
1040
|
},
|
|
1041
|
+
"technique": {
|
|
1042
|
+
"$ref": "#/definitions/Technique",
|
|
1043
|
+
"description": "How the trace was put on the paper.",
|
|
1044
|
+
"ontology": "reo:technique"
|
|
1045
|
+
},
|
|
1041
1046
|
"vertical": {
|
|
1042
1047
|
"$ref": "#/definitions/VerticalSpan",
|
|
1043
1048
|
"description": "Vertical span of the feature on the roll.",
|
|
@@ -1063,15 +1068,6 @@
|
|
|
1063
1068
|
"type": "object",
|
|
1064
1069
|
"ontology": "reo:Mark"
|
|
1065
1070
|
},
|
|
1066
|
-
"MarkMethod": {
|
|
1067
|
-
"description": "The medium a mark was drawn in.",
|
|
1068
|
-
"enum": [
|
|
1069
|
-
"ink",
|
|
1070
|
-
"pencil",
|
|
1071
|
-
"crayon"
|
|
1072
|
-
],
|
|
1073
|
-
"type": "string"
|
|
1074
|
-
},
|
|
1075
1071
|
"MeaningComprehension": {
|
|
1076
1072
|
"description": "A meaning comprehension interprets or disambiguates the meaning of symbols or features. For example, interpreting a pencil mark as an instruction to add or remove a perforation or as the dating of the roll.",
|
|
1077
1073
|
"properties": {
|
|
@@ -1195,6 +1191,15 @@
|
|
|
1195
1191
|
"type": "object",
|
|
1196
1192
|
"ontology": "crm:E54 Dimension"
|
|
1197
1193
|
},
|
|
1194
|
+
"Medium": {
|
|
1195
|
+
"description": "What a trace was put on with.",
|
|
1196
|
+
"enum": [
|
|
1197
|
+
"ink",
|
|
1198
|
+
"pencil",
|
|
1199
|
+
"crayon"
|
|
1200
|
+
],
|
|
1201
|
+
"type": "string"
|
|
1202
|
+
},
|
|
1198
1203
|
"Millimeters": {
|
|
1199
1204
|
"$ref": "#/definitions/Quantity%3C%22mm%22%3E",
|
|
1200
1205
|
"description": "A place along the roll, or any length on the paper."
|
|
@@ -1451,10 +1456,10 @@
|
|
|
1451
1456
|
"description": "Horizontal span of the feature on the roll. Left out by a feature a patch bears.",
|
|
1452
1457
|
"ontology": "crm:P43 has dimension"
|
|
1453
1458
|
},
|
|
1454
|
-
"
|
|
1455
|
-
"$ref": "#/definitions/
|
|
1456
|
-
"description": "
|
|
1457
|
-
"ontology": "reo:
|
|
1459
|
+
"medium": {
|
|
1460
|
+
"$ref": "#/definitions/Medium",
|
|
1461
|
+
"description": "What it was put on with, where it can be told. A date may be known to be handwritten where the pencil cannot be told from the ink, and a stamp leaves its ink as much as a pen does, which is why the two are stated apart.",
|
|
1462
|
+
"ontology": "reo:medium"
|
|
1458
1463
|
},
|
|
1459
1464
|
"rotation": {
|
|
1460
1465
|
"$ref": "#/definitions/Measure%3C%22deg%22%3E",
|
|
@@ -1470,6 +1475,11 @@
|
|
|
1470
1475
|
"type": "string",
|
|
1471
1476
|
"ontology": "reo:side"
|
|
1472
1477
|
},
|
|
1478
|
+
"technique": {
|
|
1479
|
+
"$ref": "#/definitions/Technique",
|
|
1480
|
+
"description": "A writing always states how it was put on the paper, which can be read off it where the medium cannot.",
|
|
1481
|
+
"ontology": "reo:technique"
|
|
1482
|
+
},
|
|
1473
1483
|
"transcription": {
|
|
1474
1484
|
"$ref": "#/definitions/ObjectAssumption%3CTranscription%3E",
|
|
1475
1485
|
"description": "A transcription of the text content of the writing. This is an object assumption so that the transcription can be annotated with a belief about its correctness.",
|
|
@@ -1493,7 +1503,7 @@
|
|
|
1493
1503
|
},
|
|
1494
1504
|
"required": [
|
|
1495
1505
|
"@id",
|
|
1496
|
-
"
|
|
1506
|
+
"technique",
|
|
1497
1507
|
"transcription",
|
|
1498
1508
|
"@type"
|
|
1499
1509
|
],
|
|
@@ -1516,10 +1526,10 @@
|
|
|
1516
1526
|
"description": "Horizontal span of the feature on the roll. Left out by a feature a patch bears.",
|
|
1517
1527
|
"ontology": "crm:P43 has dimension"
|
|
1518
1528
|
},
|
|
1519
|
-
"
|
|
1520
|
-
"$ref": "#/definitions/
|
|
1521
|
-
"description": "
|
|
1522
|
-
"ontology": "reo:
|
|
1529
|
+
"medium": {
|
|
1530
|
+
"$ref": "#/definitions/Medium",
|
|
1531
|
+
"description": "What it was put on with, where it can be told. A date may be known to be handwritten where the pencil cannot be told from the ink, and a stamp leaves its ink as much as a pen does, which is why the two are stated apart.",
|
|
1532
|
+
"ontology": "reo:medium"
|
|
1523
1533
|
},
|
|
1524
1534
|
"side": {
|
|
1525
1535
|
"description": "The face of the roll it lies on: the side that faces the reader as the roll plays, or the back of it.",
|
|
@@ -1530,6 +1540,11 @@
|
|
|
1530
1540
|
"type": "string",
|
|
1531
1541
|
"ontology": "reo:side"
|
|
1532
1542
|
},
|
|
1543
|
+
"technique": {
|
|
1544
|
+
"$ref": "#/definitions/Technique",
|
|
1545
|
+
"description": "How the trace was put on the paper.",
|
|
1546
|
+
"ontology": "reo:technique"
|
|
1547
|
+
},
|
|
1533
1548
|
"vertical": {
|
|
1534
1549
|
"$ref": "#/definitions/VerticalSpan",
|
|
1535
1550
|
"description": "Vertical span of the feature on the roll. Left out by a feature a patch bears.",
|
|
@@ -2888,6 +2903,15 @@
|
|
|
2888
2903
|
],
|
|
2889
2904
|
"type": "string"
|
|
2890
2905
|
},
|
|
2906
|
+
"Technique": {
|
|
2907
|
+
"description": "How a trace was put on the paper.",
|
|
2908
|
+
"enum": [
|
|
2909
|
+
"print",
|
|
2910
|
+
"handwriting",
|
|
2911
|
+
"stamp"
|
|
2912
|
+
],
|
|
2913
|
+
"type": "string"
|
|
2914
|
+
},
|
|
2891
2915
|
"Text": {
|
|
2892
2916
|
"description": "A textual symbol, e.g. a label or annotation found on the roll.",
|
|
2893
2917
|
"properties": {
|
|
@@ -3068,7 +3092,7 @@
|
|
|
3068
3092
|
"ontology": "crm:E54 Dimension"
|
|
3069
3093
|
},
|
|
3070
3094
|
"Writing": {
|
|
3071
|
-
"description": "A piece of writing found on the roll, such as a label, catalogue number, or annotation. Writings
|
|
3095
|
+
"description": "A piece of writing found on the roll, such as a label, catalogue number, or annotation. Writings state how they were made and a transcription of their content.",
|
|
3072
3096
|
"properties": {
|
|
3073
3097
|
"condition": {
|
|
3074
3098
|
"$ref": "#/definitions/ObjectAssumption%3CConditionState%3C(%22illegible%22)%3E%3E",
|
|
@@ -3085,10 +3109,10 @@
|
|
|
3085
3109
|
"description": "Horizontal span of the feature on the roll.",
|
|
3086
3110
|
"ontology": "crm:P43 has dimension"
|
|
3087
3111
|
},
|
|
3088
|
-
"
|
|
3089
|
-
"$ref": "#/definitions/
|
|
3090
|
-
"description": "
|
|
3091
|
-
"ontology": "reo:
|
|
3112
|
+
"medium": {
|
|
3113
|
+
"$ref": "#/definitions/Medium",
|
|
3114
|
+
"description": "What it was put on with, where it can be told. A date may be known to be handwritten where the pencil cannot be told from the ink, and a stamp leaves its ink as much as a pen does, which is why the two are stated apart.",
|
|
3115
|
+
"ontology": "reo:medium"
|
|
3092
3116
|
},
|
|
3093
3117
|
"rotation": {
|
|
3094
3118
|
"$ref": "#/definitions/Measure%3C%22deg%22%3E",
|
|
@@ -3104,6 +3128,11 @@
|
|
|
3104
3128
|
"type": "string",
|
|
3105
3129
|
"ontology": "reo:side"
|
|
3106
3130
|
},
|
|
3131
|
+
"technique": {
|
|
3132
|
+
"$ref": "#/definitions/Technique",
|
|
3133
|
+
"description": "A writing always states how it was put on the paper, which can be read off it where the medium cannot.",
|
|
3134
|
+
"ontology": "reo:technique"
|
|
3135
|
+
},
|
|
3107
3136
|
"transcription": {
|
|
3108
3137
|
"$ref": "#/definitions/ObjectAssumption%3CTranscription%3E",
|
|
3109
3138
|
"description": "A transcription of the text content of the writing. This is an object assumption so that the transcription can be annotated with a belief about its correctness.",
|
|
@@ -3128,22 +3157,13 @@
|
|
|
3128
3157
|
"required": [
|
|
3129
3158
|
"horizontal",
|
|
3130
3159
|
"@id",
|
|
3131
|
-
"
|
|
3160
|
+
"technique",
|
|
3132
3161
|
"transcription",
|
|
3133
3162
|
"@type",
|
|
3134
3163
|
"vertical"
|
|
3135
3164
|
],
|
|
3136
3165
|
"type": "object",
|
|
3137
3166
|
"ontology": "reo:Writing"
|
|
3138
|
-
},
|
|
3139
|
-
"WritingMethod": {
|
|
3140
|
-
"description": "The method by which a writing was produced on the roll: printed, handwritten, or stamped.",
|
|
3141
|
-
"enum": [
|
|
3142
|
-
"print",
|
|
3143
|
-
"handwriting",
|
|
3144
|
-
"stamp"
|
|
3145
|
-
],
|
|
3146
|
-
"type": "string"
|
|
3147
3167
|
}
|
|
3148
3168
|
}
|
|
3149
3169
|
}
|
package/lib/spec/context.json
CHANGED
|
@@ -241,8 +241,13 @@
|
|
|
241
241
|
"@type": "@vocab",
|
|
242
242
|
"@context": { "@vocab": "https://w3id.org/reo/type/" }
|
|
243
243
|
},
|
|
244
|
-
"
|
|
245
|
-
"@id": "reo:
|
|
244
|
+
"technique": {
|
|
245
|
+
"@id": "reo:technique",
|
|
246
|
+
"@type": "@vocab",
|
|
247
|
+
"@context": { "@vocab": "https://w3id.org/reo/type/" }
|
|
248
|
+
},
|
|
249
|
+
"medium": {
|
|
250
|
+
"@id": "reo:medium",
|
|
246
251
|
"@type": "@vocab",
|
|
247
252
|
"@context": { "@vocab": "https://w3id.org/reo/type/" }
|
|
248
253
|
},
|
package/package.json
CHANGED