linked-rolls 0.65.0 → 0.67.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 +8 -0
- package/lib/analysis/paper.d.ts +28 -1
- package/lib/analysis/paper.js +60 -2
- package/lib/analysis/reservations.js +2 -2
- package/lib/emulation/Emulation.js +59 -4
- package/lib/io/migrate.js +67 -2
- package/lib/model/Agent.d.ts +17 -0
- package/lib/model/Assumption.d.ts +53 -8
- package/lib/model/Edition.d.ts +1 -8
- package/lib/model/FeatureSource.d.ts +2 -17
- package/lib/model/RollCopy.d.ts +44 -52
- package/lib/model/RollCopy.js +10 -0
- package/lib/model/Version.d.ts +30 -0
- package/lib/readers/stanfordAton.js +18 -13
- package/lib/schema.json +287 -200
- package/lib/spec/context.json +12 -15
- package/lib/systems/ReproducingSystem.d.ts +21 -28
- package/lib/systems/welte.d.ts +31 -7
- package/lib/systems/welte.js +37 -13
- package/lib/systems/welteLicensee/system.d.ts +10 -4
- package/lib/systems/welteLicensee/system.js +11 -5
- package/lib/systems/welteT100/system.d.ts +6 -5
- package/lib/systems/welteT100/system.js +7 -5
- package/lib/systems/welteT98/system.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -55,6 +55,14 @@ between the two. What the alignments say about the paper of the copies,
|
|
|
55
55
|
how far each has stretched and how the papers of the systems relate, is
|
|
56
56
|
worked out by `paperOf`.
|
|
57
57
|
|
|
58
|
+
What is worked out is not stated. Where the edition holds to the ratio a
|
|
59
|
+
re-cut gave the paper of its version, the creation of the version states
|
|
60
|
+
it (`lengthRatio`, as `lengthRatioOf` gives it), so that others can take
|
|
61
|
+
it as a premise. A measured value, such as that ratio, a copy's
|
|
62
|
+
dimensions and hole separation, or the setting of its perforator, is
|
|
63
|
+
held on the strength of a measurement, which names what it was taken
|
|
64
|
+
on, the program and its version, and the day.
|
|
65
|
+
|
|
58
66
|
Documents written by earlier releases are brought up to date on import.
|
|
59
67
|
To check a document against the schema:
|
|
60
68
|
|
package/lib/analysis/paper.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Edition } from "../model/Edition.js";
|
|
2
2
|
import { Strain } from "../model/RollCopy.js";
|
|
3
|
-
import {
|
|
3
|
+
import { LengthRatio } from "../model/Version.js";
|
|
4
|
+
import { MetersPerMinute, Percent } from "../model/Quantity.js";
|
|
4
5
|
/**
|
|
5
6
|
* How far the paper of one copy is taken to have stretched or shrunk
|
|
6
7
|
* along the roll, as a standard deviation, where the edition has too few
|
|
@@ -120,6 +121,16 @@ export type AlignmentProblem = {
|
|
|
120
121
|
*/
|
|
121
122
|
by?: number;
|
|
122
123
|
};
|
|
124
|
+
/**
|
|
125
|
+
* The speed the version's paper starts at, as the copies of its own system
|
|
126
|
+
* that bear witness to it at first hand state they were cut for: the mean
|
|
127
|
+
* of the speeds the edition holds true or likely. A stated speed is the
|
|
128
|
+
* speed at the beginning of the roll, as a tempo marking gives it. Nothing
|
|
129
|
+
* where no such copy states one; in particular, a copy that reaches the
|
|
130
|
+
* version only through a later one says nothing about it, since the later
|
|
131
|
+
* one may have been cut for another speed.
|
|
132
|
+
*/
|
|
133
|
+
export declare const paperSpeedOf: (edition: Edition, versionId: string) => MetersPerMinute | undefined;
|
|
123
134
|
/**
|
|
124
135
|
* Where the alignments of the edition's copies, or what they say about
|
|
125
136
|
* the paper, want looking into. None of it is recomputed, so it is cheap
|
|
@@ -127,3 +138,19 @@ export type AlignmentProblem = {
|
|
|
127
138
|
* is `alignmentFor`'s to say.
|
|
128
139
|
*/
|
|
129
140
|
export declare const alignmentProblems: (edition: Pick<Edition, 'copies' | 'referenceCopy'>) => AlignmentProblem[];
|
|
141
|
+
/**
|
|
142
|
+
* How long the version's paper runs for a length of the paper of the
|
|
143
|
+
* version it derives from, as the alignments give it: the ratio of the
|
|
144
|
+
* two versions' systems' papers, with its uncertainty. It is what the
|
|
145
|
+
* creation of the version states where the edition holds to it
|
|
146
|
+
* (`VersionCreation.lengthRatio`).
|
|
147
|
+
*
|
|
148
|
+
* The reading pools the copies of a system, so the ratio is only given
|
|
149
|
+
* for a version that one of those copies bears witness to: a second
|
|
150
|
+
* re-cut for the same system, whose copies measure no paper, is not
|
|
151
|
+
* credited with the first one's ratio. Where the reading has copies of
|
|
152
|
+
* two versions re-cut for one system, the ratio is theirs together.
|
|
153
|
+
* Nothing is given for a version that derives from none, or from one on
|
|
154
|
+
* its own system, whose paper it keeps.
|
|
155
|
+
*/
|
|
156
|
+
export declare const lengthRatioOf: (edition: Edition, versionId: string) => LengthRatio | undefined;
|
package/lib/analysis/paper.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { referenceCopyOf } from "../model/Edition.js";
|
|
2
2
|
import { barOf, featuresOf, paperStretchOf } from "../model/RollCopy.js";
|
|
3
|
-
import { certaintyOf, isAsserted } from "../model/Assumption.js";
|
|
4
|
-
import {
|
|
3
|
+
import { certaintyOf, idOf, isAsserted } from "../model/Assumption.js";
|
|
4
|
+
import { principalDerivationOf } from "../model/Version.js";
|
|
5
|
+
import { versionIn } from "../lookup/lookup.js";
|
|
6
|
+
import { witnessesOf } from "./witnesses.js";
|
|
7
|
+
import { inMetersPerMinute, mean, percent } from "../model/Quantity.js";
|
|
8
|
+
import { defaultTrackerBar, trackerBarOf } from "../systems/index.js";
|
|
5
9
|
/**
|
|
6
10
|
* How far the paper of one copy is taken to have stretched or shrunk
|
|
7
11
|
* along the roll, as a standard deviation, where the edition has too few
|
|
@@ -213,6 +217,27 @@ const statedSpeed = (copy) => {
|
|
|
213
217
|
const speed = copy.production?.speed;
|
|
214
218
|
return speed && isAsserted(certaintyOf(speed)) ? inMetersPerMinute(speed) : undefined;
|
|
215
219
|
};
|
|
220
|
+
/**
|
|
221
|
+
* The speed the version's paper starts at, as the copies of its own system
|
|
222
|
+
* that bear witness to it at first hand state they were cut for: the mean
|
|
223
|
+
* of the speeds the edition holds true or likely. A stated speed is the
|
|
224
|
+
* speed at the beginning of the roll, as a tempo marking gives it. Nothing
|
|
225
|
+
* where no such copy states one; in particular, a copy that reaches the
|
|
226
|
+
* version only through a later one says nothing about it, since the later
|
|
227
|
+
* one may have been cut for another speed.
|
|
228
|
+
*/
|
|
229
|
+
export const paperSpeedOf = (edition, versionId) => {
|
|
230
|
+
const version = versionIn(edition, versionId);
|
|
231
|
+
if (!version)
|
|
232
|
+
return undefined;
|
|
233
|
+
const system = (trackerBarOf(version.system) ?? defaultTrackerBar).id;
|
|
234
|
+
const speeds = witnessesOf(edition, versionId)
|
|
235
|
+
.filter(witness => witness.through === undefined)
|
|
236
|
+
.flatMap(witness => edition.copies.filter(copy => copy.id === witness.copy && barOf(copy).id === system))
|
|
237
|
+
.map(statedSpeed)
|
|
238
|
+
.filter(speed => speed !== undefined);
|
|
239
|
+
return speeds.length > 0 ? mean(speeds) : undefined;
|
|
240
|
+
};
|
|
216
241
|
/** The speed the reference copy was cut at: as stated for it, or as its system runs. */
|
|
217
242
|
const referenceSpeed = (reference) => {
|
|
218
243
|
const system = barOf(reference).paperSpeed;
|
|
@@ -258,3 +283,36 @@ export const alignmentProblems = (edition) => {
|
|
|
258
283
|
});
|
|
259
284
|
return [...unaligned, ...elsewhere, ...beyond, ...speeds];
|
|
260
285
|
};
|
|
286
|
+
/**
|
|
287
|
+
* How long the version's paper runs for a length of the paper of the
|
|
288
|
+
* version it derives from, as the alignments give it: the ratio of the
|
|
289
|
+
* two versions' systems' papers, with its uncertainty. It is what the
|
|
290
|
+
* creation of the version states where the edition holds to it
|
|
291
|
+
* (`VersionCreation.lengthRatio`).
|
|
292
|
+
*
|
|
293
|
+
* The reading pools the copies of a system, so the ratio is only given
|
|
294
|
+
* for a version that one of those copies bears witness to: a second
|
|
295
|
+
* re-cut for the same system, whose copies measure no paper, is not
|
|
296
|
+
* credited with the first one's ratio. Where the reading has copies of
|
|
297
|
+
* two versions re-cut for one system, the ratio is theirs together.
|
|
298
|
+
* Nothing is given for a version that derives from none, or from one on
|
|
299
|
+
* its own system, whose paper it keeps.
|
|
300
|
+
*/
|
|
301
|
+
export const lengthRatioOf = (edition, versionId) => {
|
|
302
|
+
const version = versionIn(edition, versionId);
|
|
303
|
+
const derivation = version && principalDerivationOf(version);
|
|
304
|
+
const base = derivation && versionIn(edition, idOf(derivation));
|
|
305
|
+
const reading = paperOf(edition);
|
|
306
|
+
if (!version || !base || !reading)
|
|
307
|
+
return undefined;
|
|
308
|
+
const systemOf = (of) => reading.systems.find(paper => paper.system === trackerBarOf(of.system)?.id);
|
|
309
|
+
const own = systemOf(version);
|
|
310
|
+
const theirs = systemOf(base);
|
|
311
|
+
if (!own || !theirs || own.system === theirs.system)
|
|
312
|
+
return undefined;
|
|
313
|
+
const witnesses = new Set(witnessesOf(edition, versionId).map(witness => witness.copy));
|
|
314
|
+
if (!own.copies.some(copy => witnesses.has(copy)))
|
|
315
|
+
return undefined;
|
|
316
|
+
const value = own.ratio / theirs.ratio;
|
|
317
|
+
return { value, uncertainty: value * Math.hypot(own.ratioError / own.ratio, theirs.ratioError / theirs.ratio) };
|
|
318
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { bearsPhysicalEvidence, isMeasured, sourceLabels } from "../model/FeatureSource.js";
|
|
2
|
-
import { calibrationOf, featuresOf } from "../model/RollCopy.js";
|
|
2
|
+
import { calibrationOf, featuresOf, measuringSoftwareOf } from "../model/RollCopy.js";
|
|
3
3
|
import { trackerBarOf } from "../systems/index.js";
|
|
4
4
|
import { witnessesOf } from "./witnesses.js";
|
|
5
5
|
export const reservationTypes = [
|
|
@@ -49,7 +49,7 @@ const physicalEvidence = copy => copy.readFrom && !bearsPhysicalEvidence(copy.re
|
|
|
49
49
|
type: 'no-physical-evidence',
|
|
50
50
|
note: 'Punch diameter, hole separation, punching pattern, marks and writings cannot be observed on this source.'
|
|
51
51
|
} : undefined;
|
|
52
|
-
const measurementDocumented = copy =>
|
|
52
|
+
const measurementDocumented = copy => measuringSoftwareOf(copy).length === 0 && copy.readFrom?.kind !== 'roll' ? {
|
|
53
53
|
type: 'measurement-undocumented',
|
|
54
54
|
note: 'No measuring software is recorded for this copy.'
|
|
55
55
|
} : undefined;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { MIDIControlEvents } from "midifile-ts";
|
|
2
|
-
import { idOf } from "../model/Assumption.js";
|
|
2
|
+
import { certaintyOf, idOf, isAsserted } from "../model/Assumption.js";
|
|
3
3
|
import { isCommand, pairsAmong, placementsOf } from "../model/Symbol.js";
|
|
4
|
+
import { principalDerivationOf } from "../model/Version.js";
|
|
4
5
|
import { add, mean, mm, seconds, subtract } from "../model/Quantity.js";
|
|
5
6
|
import { punchDiameterOf } from "../model/RollCopy.js";
|
|
6
7
|
import { toOwnPaperOf } from "../analysis/ownPaper.js";
|
|
8
|
+
import { paperSpeedOf } from "../analysis/paper.js";
|
|
9
|
+
import { defaultTrackerBar, trackerBarOf } from "../systems/index.js";
|
|
7
10
|
import { negotiatedEventOf } from "./negotiation.js";
|
|
8
11
|
import { placedCarriersOf, snapshotOf } from "../analysis/text.js";
|
|
9
|
-
import { copyOfFeature, symbolIn } from "../lookup/lookup.js";
|
|
12
|
+
import { copyOfFeature, symbolIn, versionIn } from "../lookup/lookup.js";
|
|
10
13
|
/** The punch diameter the edition's copies report, where any of them does. */
|
|
11
14
|
const meanPunchDiameterOf = (edition) => {
|
|
12
15
|
const measured = edition.copies
|
|
@@ -14,10 +17,62 @@ const meanPunchDiameterOf = (edition) => {
|
|
|
14
17
|
.filter(value => value !== undefined);
|
|
15
18
|
return measured.length > 0 ? mean(measured) : undefined;
|
|
16
19
|
};
|
|
20
|
+
/** The version this one derives from, where it names one the edition has. */
|
|
21
|
+
const baseOf = (edition, version) => {
|
|
22
|
+
const derivation = principalDerivationOf(version);
|
|
23
|
+
return derivation && versionIn(edition, idOf(derivation));
|
|
24
|
+
};
|
|
25
|
+
const onOneSystem = (one, other) => (trackerBarOf(one.system) ?? defaultTrackerBar).id === (trackerBarOf(other.system) ?? defaultTrackerBar).id;
|
|
26
|
+
/**
|
|
27
|
+
* The speed the version starts at, as far as the edition states one: as
|
|
28
|
+
* its own copies state it (`paperSpeedOf`), or else as stated for the
|
|
29
|
+
* version it derives from on the same system, whose paper it keeps.
|
|
30
|
+
*/
|
|
31
|
+
const statedSpeedOf = (edition, version, seen = new Set()) => {
|
|
32
|
+
const own = paperSpeedOf(edition, version.id);
|
|
33
|
+
if (own !== undefined || seen.has(version.id))
|
|
34
|
+
return own;
|
|
35
|
+
const base = baseOf(edition, version);
|
|
36
|
+
return base && onOneSystem(base, version)
|
|
37
|
+
? statedSpeedOf(edition, base, new Set([...seen, version.id]))
|
|
38
|
+
: undefined;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* How long the version's paper runs for a length of the paper of the
|
|
42
|
+
* version it derives from: as its creation states it where the edition
|
|
43
|
+
* holds to that, else as the papers the two are performed on relate. That
|
|
44
|
+
* is what the alignments give for the two systems (`toOwnPaperOf`), which
|
|
45
|
+
* a performance credits every version of a system with, whether or not its
|
|
46
|
+
* own copies measure the paper (cf. `lengthRatioOf`).
|
|
47
|
+
*/
|
|
48
|
+
const lengthRatioIn = (edition, version, base) => {
|
|
49
|
+
const stated = version.creation?.lengthRatio;
|
|
50
|
+
if (stated && isAsserted(certaintyOf(stated)))
|
|
51
|
+
return stated.value;
|
|
52
|
+
const own = toOwnPaperOf(edition, version);
|
|
53
|
+
const theirs = toOwnPaperOf(edition, base);
|
|
54
|
+
return own !== undefined && theirs !== undefined ? own / theirs : undefined;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* The roll a re-cut was made from, as far as its timing goes: the length
|
|
58
|
+
* ratio, and the speed stated for the original. Nothing for a version that
|
|
59
|
+
* derives from none, or from one on its own system.
|
|
60
|
+
*/
|
|
61
|
+
const recutFromOf = (edition, version) => {
|
|
62
|
+
const base = baseOf(edition, version);
|
|
63
|
+
if (!base || onOneSystem(base, version))
|
|
64
|
+
return undefined;
|
|
65
|
+
const lengthRatio = lengthRatioIn(edition, version, base);
|
|
66
|
+
if (lengthRatio === undefined)
|
|
67
|
+
return undefined;
|
|
68
|
+
const paperSpeed = statedSpeedOf(edition, base);
|
|
69
|
+
return { lengthRatio, ...(paperSpeed !== undefined && { paperSpeed }) };
|
|
70
|
+
};
|
|
17
71
|
const propertiesOf = (edition, version) => ({
|
|
18
72
|
punchDiameter: meanPunchDiameterOf(edition),
|
|
19
|
-
|
|
20
|
-
|
|
73
|
+
toOwnPaper: toOwnPaperOf(edition, version),
|
|
74
|
+
paperSpeed: statedSpeedOf(edition, version),
|
|
75
|
+
recutFrom: recutFromOf(edition, version)
|
|
21
76
|
});
|
|
22
77
|
/** The onset a symbol has on each copy carrying it, by the copy's id, as the mean of its chains there. */
|
|
23
78
|
const onsetsByCopy = (edition, symbolId) => {
|
package/lib/io/migrate.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { v4 } from "uuid";
|
|
1
2
|
import { systemIdIn, systemOf, translationBetween } from "../systems/TrackerBar.js";
|
|
2
3
|
import { trackerBars } from "../systems/index.js";
|
|
3
4
|
import { welteT100 } from "../systems/welteT100/bar.js";
|
|
@@ -451,9 +452,61 @@ const withTimeSpanDates = (node) => {
|
|
|
451
452
|
const { '@value': within, '@type': _typed, ...rest } = node;
|
|
452
453
|
return { ...rest, within };
|
|
453
454
|
};
|
|
455
|
+
/** The values a copy's one `measuredBy` stood for, of those the edition exports: what the analysis it named had given. */
|
|
456
|
+
const measuredByCovered = ['dimensions', 'holeSeparation'];
|
|
457
|
+
/** A day written as a date, of a date written with or without its time. */
|
|
458
|
+
const dayOf = (date) => typeof date === 'string' && /^\d{4}-\d{2}-\d{2}/.test(date) ? date.slice(0, 10) : undefined;
|
|
459
|
+
/**
|
|
460
|
+
* A copy once named one program for all its measurements, beside values
|
|
461
|
+
* that could not say what took them. Each value the edition exports now
|
|
462
|
+
* carries the measurement it rests on, so the program, its version and
|
|
463
|
+
* the day go into the reasons of the dimensions and the hole separation,
|
|
464
|
+
* which the analysis it named had given. The scan resolution is read
|
|
465
|
+
* off the file rather than measured, and the margins are not exported;
|
|
466
|
+
* nothing is said of them. The ids are the copy's, so that migrating a
|
|
467
|
+
* file twice writes the same document.
|
|
468
|
+
*/
|
|
469
|
+
const withMeasuredByInReasons = (node) => {
|
|
470
|
+
const measurements = node?.measurements;
|
|
471
|
+
if (!measurements || typeof measurements !== 'object' || !Object.hasOwn(measurements, 'measuredBy'))
|
|
472
|
+
return node;
|
|
473
|
+
const { measuredBy, ...rest } = measurements;
|
|
474
|
+
const day = dayOf(measuredBy?.date);
|
|
475
|
+
const reason = measuredBy?.software && {
|
|
476
|
+
'@type': 'measurement',
|
|
477
|
+
software: [{ name: measuredBy.software, ...(measuredBy.version && { version: measuredBy.version }) }],
|
|
478
|
+
...(day && { date: { within: day } })
|
|
479
|
+
};
|
|
480
|
+
const owner = typeof node['@id'] === 'string' ? plainCopyId(node['@id']) : v4();
|
|
481
|
+
const withReason = (key, value) => {
|
|
482
|
+
if (!reason || !value || typeof value !== 'object')
|
|
483
|
+
return value;
|
|
484
|
+
const annotation = value['@annotation'];
|
|
485
|
+
if (annotation?.belief) {
|
|
486
|
+
return { ...value, '@annotation': { ...annotation, belief: { ...annotation.belief, reasons: [...(annotation.belief.reasons ?? []), reason] } } };
|
|
487
|
+
}
|
|
488
|
+
return {
|
|
489
|
+
...value,
|
|
490
|
+
'@annotation': {
|
|
491
|
+
'@id': `${owner}-${key}-annotation`,
|
|
492
|
+
belief: { '@type': 'belief', '@id': `${owner}-${key}-belief`, certainty: 'true', reasons: [reason] }
|
|
493
|
+
}
|
|
494
|
+
};
|
|
495
|
+
};
|
|
496
|
+
return {
|
|
497
|
+
...node,
|
|
498
|
+
measurements: {
|
|
499
|
+
...rest,
|
|
500
|
+
...Object.fromEntries(measuredByCovered
|
|
501
|
+
.filter(key => Object.hasOwn(rest, key))
|
|
502
|
+
.map(key => [key, withReason(key, rest[key])]))
|
|
503
|
+
}
|
|
504
|
+
};
|
|
505
|
+
};
|
|
454
506
|
const nodeSteps = [withRenamedKeys, withRenamedEditType, withTypology, withRenamedType, withoutVersionType, withoutVersionSiglum, withLowerCaseTerms, withSplitMethod, withReferences, withKeeper, withoutEmptyKeeper,
|
|
455
507
|
withPerforator, withProductionNodes, withTypedPerforator, withScale, withoutOps, withDerivationList, withReadingKind, withTimeSpanDates,
|
|
456
|
-
withoutFeatureKind, withBorneFeaturesNamed, withFeaturesInActs, withOwnPlaces, withDriveOfStaggering, withoutPattern, withoutBearings, withoutEntailedType
|
|
508
|
+
withoutFeatureKind, withBorneFeaturesNamed, withFeaturesInActs, withOwnPlaces, withDriveOfStaggering, withoutPattern, withoutBearings, withoutEntailedType,
|
|
509
|
+
withMeasuredByInReasons];
|
|
457
510
|
const migrateNode = (node) => nodeSteps.reduce((result, step) => step(result), node);
|
|
458
511
|
/** The value with every node in it migrated, a node before its children; the very same value where nothing changed. */
|
|
459
512
|
const walk = (value) => {
|
|
@@ -591,6 +644,18 @@ const withoutFormatVersion = (edition) => {
|
|
|
591
644
|
const { formatVersion: _stated, ...rest } = edition;
|
|
592
645
|
return rest;
|
|
593
646
|
};
|
|
647
|
+
/**
|
|
648
|
+
* An edition once stated one tempo for the roll, which cannot hold where the
|
|
649
|
+
* roll was issued for systems whose papers run at different speeds. A copy
|
|
650
|
+
* states the speed it was cut for, and a re-cut's follows from its original's
|
|
651
|
+
* and the length ratio, so the edition's goes.
|
|
652
|
+
*/
|
|
653
|
+
const withoutTempoAdjustment = (edition) => {
|
|
654
|
+
if (!Object.hasOwn(edition, 'tempoAdjustment'))
|
|
655
|
+
return edition;
|
|
656
|
+
const { tempoAdjustment: _stated, ...rest } = edition;
|
|
657
|
+
return rest;
|
|
658
|
+
};
|
|
594
659
|
/** Whether the copy states features, in either shape. */
|
|
595
660
|
const hasFeatures = (copy) => [copy?.features, copy?.production?.produced, copy?.productionEvent?.produced]
|
|
596
661
|
.some(features => Array.isArray(features) && features.length > 0);
|
|
@@ -611,5 +676,5 @@ const withReferenceCopy = (edition) => {
|
|
|
611
676
|
? { ...edition, referenceCopy: plainCopyId(reference['@id']) }
|
|
612
677
|
: edition;
|
|
613
678
|
};
|
|
614
|
-
const editionSteps = [withoutFormatVersion, withoutEditionType, withSystems, withEditors, withDerivationTolerance, withReferenceCopy];
|
|
679
|
+
const editionSteps = [withoutFormatVersion, withoutTempoAdjustment, withoutEditionType, withSystems, withEditors, withDerivationTolerance, withReferenceCopy];
|
|
615
680
|
export const migrate = (edition) => walk(editionSteps.reduce((result, step) => step(result), edition));
|
package/lib/model/Agent.d.ts
CHANGED
|
@@ -78,4 +78,21 @@ export interface Place extends Named {
|
|
|
78
78
|
* @see crm:E55 Type
|
|
79
79
|
*/
|
|
80
80
|
export type Concept = (WithId & Partial<Named>) | (Named & Partial<WithId>);
|
|
81
|
+
/**
|
|
82
|
+
* Software that captured a copy or measured it: the transcriber that
|
|
83
|
+
* read a recording into notes, the emulator that wrote a MIDI file, the
|
|
84
|
+
* program that found the holes on a scan or aligned two copies.
|
|
85
|
+
* @see crmdig:D14 Software
|
|
86
|
+
*/
|
|
87
|
+
export interface Software {
|
|
88
|
+
/**
|
|
89
|
+
* @see rdfs:label
|
|
90
|
+
*/
|
|
91
|
+
name: string;
|
|
92
|
+
/**
|
|
93
|
+
* The release, the commit, or the model checkpoint of a transcriber.
|
|
94
|
+
* @see owl:versionInfo
|
|
95
|
+
*/
|
|
96
|
+
version?: string;
|
|
97
|
+
}
|
|
81
98
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WithNote, WithId } from "../shared/utils.js";
|
|
2
|
-
import { Person, WithActor } from "./Agent.js";
|
|
2
|
+
import { Concept, Person, Software, WithActor } from "./Agent.js";
|
|
3
3
|
export declare const certainties: readonly ['true', 'likely', 'possible', 'unlikely', 'false'];
|
|
4
4
|
/**
|
|
5
5
|
* Certainty levels for beliefs, ranging from 'true' to 'false'
|
|
@@ -102,6 +102,11 @@ export interface BeliefAdoption extends Argumentation<'beliefAdoption'> {
|
|
|
102
102
|
* premises. CRMinf counts observations, and a measurement is one, among
|
|
103
103
|
* the ways a belief comes about, so the value does not have to be
|
|
104
104
|
* passed off as an inference.
|
|
105
|
+
*
|
|
106
|
+
* A measurement a program took names the program and its version, so
|
|
107
|
+
* that the value can be taken again and a value taken by a program
|
|
108
|
+
* later found wanting can be told from the rest. Naming software makes
|
|
109
|
+
* it a digital measurement event in the sense of CRMdig.
|
|
105
110
|
* @see crmsci:S21 Measurement
|
|
106
111
|
*/
|
|
107
112
|
export interface Measurement extends Argumentation<'measurement'> {
|
|
@@ -111,6 +116,24 @@ export interface Measurement extends Argumentation<'measurement'> {
|
|
|
111
116
|
* @see crm:P16 used specific object
|
|
112
117
|
*/
|
|
113
118
|
used?: string[];
|
|
119
|
+
/**
|
|
120
|
+
* The method followed, where it has a name apart from the program
|
|
121
|
+
* that carries it out, such as a line of Theil and Sen through the
|
|
122
|
+
* matched notes of two copies.
|
|
123
|
+
* @see crm:P33 used specific technique
|
|
124
|
+
*/
|
|
125
|
+
procedure?: Concept;
|
|
126
|
+
/**
|
|
127
|
+
* The programs that took the measurement, each with its version.
|
|
128
|
+
* @see crmdig:L23 used software or firmware
|
|
129
|
+
*/
|
|
130
|
+
software?: Software[];
|
|
131
|
+
/**
|
|
132
|
+
* When the measurement was taken. It is part of the reason and
|
|
133
|
+
* carries no belief of its own.
|
|
134
|
+
* @see crm:P4 has time-span
|
|
135
|
+
*/
|
|
136
|
+
date?: TimeSpan;
|
|
114
137
|
}
|
|
115
138
|
/**
|
|
116
139
|
* An argumentation can be either a plain argumentation, a
|
|
@@ -185,7 +208,6 @@ export type ObjectAssumption<O extends object> = Assumption & O;
|
|
|
185
208
|
* annotated with a belief about its certainty.
|
|
186
209
|
*/
|
|
187
210
|
export type ActorAssignment = ObjectAssumption<Person>;
|
|
188
|
-
/** The day an event falls within. */
|
|
189
211
|
interface DateWithin {
|
|
190
212
|
/**
|
|
191
213
|
* The day the event falls within.
|
|
@@ -194,8 +216,7 @@ interface DateWithin {
|
|
|
194
216
|
*/
|
|
195
217
|
within: Date;
|
|
196
218
|
}
|
|
197
|
-
|
|
198
|
-
interface DateBounds {
|
|
219
|
+
interface DateAfter {
|
|
199
220
|
/**
|
|
200
221
|
* The earliest day the event can have happened on: it did not
|
|
201
222
|
* happen before it.
|
|
@@ -203,6 +224,22 @@ interface DateBounds {
|
|
|
203
224
|
* @see crm:P82a begin of the begin
|
|
204
225
|
*/
|
|
205
226
|
after: Date;
|
|
227
|
+
/**
|
|
228
|
+
* The latest day the event can have happened on: it did not
|
|
229
|
+
* happen after it.
|
|
230
|
+
* @format date
|
|
231
|
+
* @see crm:P82b end of the end
|
|
232
|
+
*/
|
|
233
|
+
before?: Date;
|
|
234
|
+
}
|
|
235
|
+
interface DateBefore {
|
|
236
|
+
/**
|
|
237
|
+
* The earliest day the event can have happened on: it did not
|
|
238
|
+
* happen before it.
|
|
239
|
+
* @format date
|
|
240
|
+
* @see crm:P82a begin of the begin
|
|
241
|
+
*/
|
|
242
|
+
after?: Date;
|
|
206
243
|
/**
|
|
207
244
|
* The latest day the event can have happened on: it did not
|
|
208
245
|
* happen after it.
|
|
@@ -212,12 +249,20 @@ interface DateBounds {
|
|
|
212
249
|
before: Date;
|
|
213
250
|
}
|
|
214
251
|
/**
|
|
215
|
-
* When something happened
|
|
216
|
-
*
|
|
217
|
-
*
|
|
252
|
+
* When something happened: the day it falls `within`, or the bounds it
|
|
253
|
+
* lies between. A bound nobody can give is left out, so `after` alone
|
|
254
|
+
* says "not before".
|
|
255
|
+
* @see crm:E52 Time-Span
|
|
256
|
+
*/
|
|
257
|
+
export type TimeSpan = DateWithin | DateAfter | DateBefore;
|
|
258
|
+
/**
|
|
259
|
+
* When something happened, as far as the edition can state it, and as
|
|
260
|
+
* an assumption, so that a dating can carry the belief it rests on: the
|
|
261
|
+
* day it falls `within`, or the bounds it lies between. A bound nobody
|
|
262
|
+
* can give is left out, so `after` alone says "not before".
|
|
218
263
|
* @see crm:E52 Time-Span
|
|
219
264
|
*/
|
|
220
|
-
export type DateAssignment = Assumption &
|
|
265
|
+
export type DateAssignment = Assumption & TimeSpan;
|
|
221
266
|
export declare function valueOf<ValueT>(assumption: ValueAssumption<ValueT>): ValueT;
|
|
222
267
|
export declare function valuesOf<ValueT>(assumptions: ValueAssumption<ValueT>[]): ValueT[];
|
|
223
268
|
export declare function idOf(assumption: ReferenceAssumption): string;
|
package/lib/model/Edition.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { RollCopy } from "./RollCopy.js";
|
|
2
2
|
import { Version } from "./Version.js";
|
|
3
|
-
import { DateAssignment
|
|
3
|
+
import { DateAssignment } from "./Assumption.js";
|
|
4
4
|
import { Editor, Person, Place } from "./Agent.js";
|
|
5
|
-
import { RollTempo } from "../systems/ReproducingSystem.js";
|
|
6
5
|
/**
|
|
7
6
|
* This type describes the creation of an edition,
|
|
8
7
|
* i.e. the editor, publisher, and publication date.
|
|
@@ -145,12 +144,6 @@ export interface Edition {
|
|
|
145
144
|
* @see lrmoo:R75 incorporates
|
|
146
145
|
*/
|
|
147
146
|
versions: Version[];
|
|
148
|
-
/**
|
|
149
|
-
* An optional tempo adjustment for playback of the roll,
|
|
150
|
-
* annotatable with a belief about its correctness.
|
|
151
|
-
* @see reo:tempo
|
|
152
|
-
*/
|
|
153
|
-
tempoAdjustment?: ObjectAssumption<RollTempo>;
|
|
154
147
|
}
|
|
155
148
|
export type EditionMetadata = Pick<Edition, 'base' | 'title' | 'license' | 'creation' | 'roll'>;
|
|
156
149
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ActorAssignment, DateAssignment, ObjectAssumption } from "./Assumption.js";
|
|
2
|
-
import { Concept, Named } from "./Agent.js";
|
|
2
|
+
import { Concept, Named, Software } from "./Agent.js";
|
|
3
3
|
import { ConditionState } from "./ConditionState.js";
|
|
4
4
|
import { WithNote } from "../shared/utils.js";
|
|
5
5
|
/**
|
|
@@ -25,22 +25,7 @@ export declare const isMeasured: (kind: SourceKind) => boolean;
|
|
|
25
25
|
* be observed on the roll and on an image of it, and on nothing else.
|
|
26
26
|
*/
|
|
27
27
|
export declare const bearsPhysicalEvidence: (kind: SourceKind) => boolean;
|
|
28
|
-
|
|
29
|
-
* Software a capture ran, such as the transcriber that read a recording
|
|
30
|
-
* into notes or the emulator that wrote a MIDI file.
|
|
31
|
-
* @see crmdig:D14 Software
|
|
32
|
-
*/
|
|
33
|
-
export interface Software {
|
|
34
|
-
/**
|
|
35
|
-
* @see rdfs:label
|
|
36
|
-
*/
|
|
37
|
-
name: string;
|
|
38
|
-
/**
|
|
39
|
-
* The release, or the model checkpoint of a transcriber.
|
|
40
|
-
* @see owl:versionInfo
|
|
41
|
-
*/
|
|
42
|
-
version?: string;
|
|
43
|
-
}
|
|
28
|
+
export type { Software } from "./Agent.js";
|
|
44
29
|
/**
|
|
45
30
|
* An instrument a copy was played on to be recorded. How it was
|
|
46
31
|
* regulated, where that is known, is its condition.
|