linked-rolls 0.69.0 → 0.71.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 +20 -5
- package/lib/analysis/constraints.d.ts +7 -0
- package/lib/analysis/constraints.js +1 -0
- package/lib/analysis/ownPaper.d.ts +5 -1
- package/lib/analysis/ownPaper.js +5 -1
- package/lib/analysis/paper.d.ts +22 -4
- package/lib/analysis/paper.js +6 -0
- package/lib/analysis/reservations.d.ts +24 -1
- package/lib/analysis/reservations.js +15 -1
- package/lib/analysis/sigla.d.ts +6 -1
- package/lib/analysis/sigla.js +5 -1
- package/lib/analysis/stemma.d.ts +6 -1
- package/lib/analysis/stemma.js +6 -1
- package/lib/analysis/text.d.ts +16 -2
- package/lib/analysis/text.js +16 -2
- package/lib/analysis/witnesses.d.ts +20 -1
- package/lib/analysis/witnesses.js +4 -0
- package/lib/collation/Collation.d.ts +47 -8
- package/lib/collation/Collation.js +29 -5
- package/lib/collation/alignment.d.ts +16 -3
- package/lib/collation/alignment.js +15 -3
- package/lib/collation/scatter.d.ts +50 -9
- package/lib/collation/scatter.js +11 -1
- package/lib/collation/statistics.d.ts +39 -9
- package/lib/collation/statistics.js +27 -6
- package/lib/collation/substitution.d.ts +5 -0
- package/lib/collation/substitution.js +4 -0
- package/lib/emulation/Emulation.d.ts +16 -1
- package/lib/emulation/Emulation.js +10 -0
- package/lib/emulation/negotiation.d.ts +1 -0
- package/lib/emulation/negotiation.js +1 -0
- package/lib/index.d.ts +33 -2
- package/lib/index.js +2 -1
- package/lib/io/asJsonLd.d.ts +10 -0
- package/lib/io/asJsonLd.js +10 -0
- package/lib/io/context.d.ts +16 -2
- package/lib/io/context.js +16 -2
- package/lib/io/importJsonLd.d.ts +1 -0
- package/lib/io/importJsonLd.js +1 -0
- package/lib/io/migrate.d.ts +8 -0
- package/lib/io/migrate.js +8 -0
- package/lib/lookup/lookup.d.ts +29 -5
- package/lib/lookup/lookup.js +29 -5
- package/lib/lookup/paths.d.ts +23 -3
- package/lib/lookup/paths.js +17 -3
- package/lib/model/Agent.d.ts +28 -2
- package/lib/model/Agent.js +15 -1
- package/lib/model/Assumption.d.ts +96 -7
- package/lib/model/Assumption.js +65 -7
- package/lib/model/ConditionState.d.ts +1 -0
- package/lib/model/Edit.d.ts +10 -0
- package/lib/model/Edit.js +8 -0
- package/lib/model/Edition.d.ts +12 -1
- package/lib/model/Edition.js +1 -0
- package/lib/model/Feature.d.ts +74 -7
- package/lib/model/Feature.js +41 -3
- package/lib/model/FeatureSource.d.ts +14 -1
- package/lib/model/FeatureSource.js +7 -1
- package/lib/model/Perforator.d.ts +10 -0
- package/lib/model/Perforator.js +1 -0
- package/lib/model/Quantity.d.ts +160 -13
- package/lib/model/Quantity.js +110 -6
- package/lib/model/RollCopy.d.ts +74 -12
- package/lib/model/RollCopy.js +53 -10
- package/lib/model/Symbol.d.ts +38 -1
- package/lib/model/Symbol.js +16 -0
- package/lib/model/TrackCalibration.d.ts +10 -2
- package/lib/model/TrackCalibration.js +9 -2
- package/lib/model/Version.d.ts +24 -4
- package/lib/model/Version.js +19 -4
- package/lib/model/notes.d.ts +15 -2
- package/lib/model/notes.js +9 -2
- package/lib/model/procedures.d.ts +5 -1
- package/lib/model/procedures.js +5 -1
- package/lib/model/vocabulary.d.ts +6 -1
- package/lib/model/vocabulary.js +6 -1
- package/lib/ops/beliefs.d.ts +23 -1
- package/lib/ops/beliefs.js +23 -1
- package/lib/ops/collation.d.ts +3 -0
- package/lib/ops/collation.js +3 -0
- package/lib/ops/commands.d.ts +17 -2
- package/lib/ops/commands.js +17 -2
- package/lib/ops/copies.d.ts +37 -6
- package/lib/ops/copies.js +37 -6
- package/lib/ops/draft.d.ts +2 -0
- package/lib/ops/draft.js +1 -0
- package/lib/ops/edits.d.ts +5 -1
- package/lib/ops/edits.js +5 -1
- package/lib/ops/features.d.ts +12 -1
- package/lib/ops/features.js +7 -0
- package/lib/ops/versions.d.ts +15 -3
- package/lib/ops/versions.js +15 -3
- package/lib/readers/phillipsEroll.d.ts +12 -1
- package/lib/readers/phillipsEroll.js +6 -1
- package/lib/readers/spencerBar.d.ts +12 -1
- package/lib/readers/spencerBar.js +7 -1
- package/lib/readers/stanfordAton.d.ts +15 -0
- package/lib/readers/stanfordAton.js +9 -0
- package/lib/schema.json +13 -2
- package/lib/shared/utils.d.ts +12 -0
- package/lib/spec/context.json +8 -1
- package/lib/systems/ReproducingSystem.d.ts +46 -3
- package/lib/systems/TrackerBar.d.ts +45 -4
- package/lib/systems/TrackerBar.js +20 -3
- package/lib/systems/index.d.ts +9 -2
- package/lib/systems/index.js +9 -2
- package/lib/systems/velocity.d.ts +1 -0
- package/lib/systems/velocity.js +1 -0
- package/lib/systems/welte.d.ts +18 -3
- package/lib/systems/welte.js +9 -2
- package/lib/systems/welteLicensee/bar.d.ts +1 -0
- package/lib/systems/welteLicensee/bar.js +1 -0
- package/lib/systems/welteLicensee/system.d.ts +18 -0
- package/lib/systems/welteLicensee/system.js +17 -0
- package/lib/systems/welteT100/bar.d.ts +8 -0
- package/lib/systems/welteT100/bar.js +4 -0
- package/lib/systems/welteT100/system.d.ts +46 -5
- package/lib/systems/welteT100/system.js +29 -3
- package/lib/systems/welteT98/bar.d.ts +6 -0
- package/lib/systems/welteT98/bar.js +2 -0
- package/lib/systems/welteT98/system.d.ts +58 -5
- package/lib/systems/welteT98/system.js +42 -3
- package/lib/validate.d.ts +16 -0
- package/lib/validate.js +15 -0
- package/package.json +2 -1
package/lib/lookup/paths.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { perState } from "./perState.js";
|
|
2
|
+
/**
|
|
3
|
+
* What stands at the path in an edition or a draft of one, or nothing
|
|
4
|
+
* where the path leads nowhere.
|
|
5
|
+
* @category Lookups
|
|
6
|
+
*/
|
|
2
7
|
export const getAt = (path, obj) => {
|
|
3
8
|
let node = obj;
|
|
4
9
|
for (const key of path) {
|
|
@@ -69,12 +74,21 @@ const placesIn = perState((edition) => {
|
|
|
69
74
|
traverse(edition, null);
|
|
70
75
|
return { paths, links };
|
|
71
76
|
});
|
|
72
|
-
/**
|
|
77
|
+
/**
|
|
78
|
+
* Where the entity with the id stands in the edition, or nothing where it holds none.
|
|
79
|
+
* @category Lookups
|
|
80
|
+
*/
|
|
73
81
|
export const pathIn = (edition, id) => {
|
|
74
82
|
const trail = placesIn(edition).paths.get(id);
|
|
75
83
|
return trail === undefined ? undefined : laidOut(trail);
|
|
76
84
|
};
|
|
77
|
-
/**
|
|
85
|
+
/**
|
|
86
|
+
* Every id the edition gives an entity of its own, references left out.
|
|
87
|
+
* @category Lookups
|
|
88
|
+
*/
|
|
78
89
|
export const idsIn = (edition) => placesIn(edition).paths.keys();
|
|
79
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* Where the edition references the id.
|
|
92
|
+
* @category Lookups
|
|
93
|
+
*/
|
|
80
94
|
export const linksTo = (edition, id) => (placesIn(edition).links.get(id) ?? []).map(laidOut);
|
package/lib/model/Agent.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { WithId } from "../shared/utils.js";
|
|
2
2
|
/**
|
|
3
3
|
* Something with a name and, where one exists, an authority record.
|
|
4
|
+
* @category Format types
|
|
4
5
|
*/
|
|
5
6
|
export interface Named {
|
|
6
7
|
/**
|
|
@@ -16,21 +17,38 @@ export interface Named {
|
|
|
16
17
|
*/
|
|
17
18
|
sameAs: string[];
|
|
18
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* The parts an editor may take in the editorial work.
|
|
22
|
+
* @category Vocabulary
|
|
23
|
+
*/
|
|
19
24
|
export declare const editorialRoles: readonly ['editor', 'transcription', 'collation', 'encoding', 'commentary', 'proofreading'];
|
|
20
25
|
/**
|
|
21
26
|
* The part an editor took in the editorial work.
|
|
27
|
+
* @category Format types
|
|
22
28
|
*/
|
|
23
29
|
export type EditorialRole = typeof editorialRoles[number];
|
|
24
|
-
|
|
30
|
+
/**
|
|
31
|
+
* The roles an agent may play in the context of the edition besides the
|
|
32
|
+
* editorial ones.
|
|
33
|
+
* @category Vocabulary
|
|
34
|
+
*/
|
|
35
|
+
export declare const nonEditorialRoles: readonly ['pianist', 'publisher'];
|
|
25
36
|
/**
|
|
26
37
|
* The role an agent plays in the context of the edition.
|
|
38
|
+
* @category Format types
|
|
27
39
|
*/
|
|
28
40
|
export type AgentRole = EditorialRole | typeof nonEditorialRoles[number];
|
|
41
|
+
/**
|
|
42
|
+
* Every role an agent may play in the context of the edition, those
|
|
43
|
+
* that are not editorial first.
|
|
44
|
+
* @category Vocabulary
|
|
45
|
+
*/
|
|
29
46
|
export declare const agentRoles: readonly AgentRole[];
|
|
30
47
|
/**
|
|
31
48
|
* A person or a group: a pianist, an editor, a publisher,
|
|
32
49
|
* a manufacturer, a library.
|
|
33
50
|
* @see crm:E39 Actor
|
|
51
|
+
* @category Format types
|
|
34
52
|
*/
|
|
35
53
|
export interface Agent extends Named, Partial<WithId> {
|
|
36
54
|
/**
|
|
@@ -41,10 +59,12 @@ export interface Agent extends Named, Partial<WithId> {
|
|
|
41
59
|
}
|
|
42
60
|
/**
|
|
43
61
|
* An agent that is a person.
|
|
62
|
+
* @category Format types
|
|
44
63
|
*/
|
|
45
64
|
export type Person = Agent;
|
|
46
65
|
/**
|
|
47
66
|
* A person who took part in preparing the edition.
|
|
67
|
+
* @category Format types
|
|
48
68
|
*/
|
|
49
69
|
export interface Editor extends Person {
|
|
50
70
|
/**
|
|
@@ -53,6 +73,10 @@ export interface Editor extends Person {
|
|
|
53
73
|
*/
|
|
54
74
|
role: EditorialRole;
|
|
55
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* An activity that may name the person who carried it out.
|
|
78
|
+
* @category Format types
|
|
79
|
+
*/
|
|
56
80
|
export type WithActor = {
|
|
57
81
|
/**
|
|
58
82
|
* The person who carried out this activity.
|
|
@@ -63,6 +87,7 @@ export type WithActor = {
|
|
|
63
87
|
/**
|
|
64
88
|
* A place, e.g. a recording location, publishing location, etc.
|
|
65
89
|
* @see crm:E53 Place
|
|
90
|
+
* @category Format types
|
|
66
91
|
*/
|
|
67
92
|
export interface Place extends Named {
|
|
68
93
|
}
|
|
@@ -76,6 +101,7 @@ export interface Place extends Named {
|
|
|
76
101
|
* vocabulary does not have is given by name, which is then all there is
|
|
77
102
|
* to go on.
|
|
78
103
|
* @see crm:E55 Type
|
|
104
|
+
* @category Format types
|
|
79
105
|
*/
|
|
80
106
|
export type Concept = (WithId & Partial<Named>) | (Named & Partial<WithId>);
|
|
81
107
|
/**
|
|
@@ -83,6 +109,7 @@ export type Concept = (WithId & Partial<Named>) | (Named & Partial<WithId>);
|
|
|
83
109
|
* read a recording into notes, the emulator that wrote a MIDI file, the
|
|
84
110
|
* program that found the holes on a scan or aligned two copies.
|
|
85
111
|
* @see crmdig:D14 Software
|
|
112
|
+
* @category Format types
|
|
86
113
|
*/
|
|
87
114
|
export interface Software {
|
|
88
115
|
/**
|
|
@@ -95,4 +122,3 @@ export interface Software {
|
|
|
95
122
|
*/
|
|
96
123
|
version?: string;
|
|
97
124
|
}
|
|
98
|
-
export {};
|
package/lib/model/Agent.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The parts an editor may take in the editorial work.
|
|
3
|
+
* @category Vocabulary
|
|
4
|
+
*/
|
|
1
5
|
export const editorialRoles = [
|
|
2
6
|
'editor',
|
|
3
7
|
'transcription',
|
|
@@ -6,5 +10,15 @@ export const editorialRoles = [
|
|
|
6
10
|
'commentary',
|
|
7
11
|
'proofreading'
|
|
8
12
|
];
|
|
9
|
-
|
|
13
|
+
/**
|
|
14
|
+
* The roles an agent may play in the context of the edition besides the
|
|
15
|
+
* editorial ones.
|
|
16
|
+
* @category Vocabulary
|
|
17
|
+
*/
|
|
18
|
+
export const nonEditorialRoles = ['pianist', 'publisher'];
|
|
19
|
+
/**
|
|
20
|
+
* Every role an agent may play in the context of the edition, those
|
|
21
|
+
* that are not editorial first.
|
|
22
|
+
* @category Vocabulary
|
|
23
|
+
*/
|
|
10
24
|
export const agentRoles = [...nonEditorialRoles, ...editorialRoles];
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { WithNote, WithId } from "../shared/utils.js";
|
|
2
2
|
import { Concept, Person, Software, WithActor } from "./Agent.js";
|
|
3
|
+
/**
|
|
4
|
+
* The certainties a belief may be held with, from the most certain to
|
|
5
|
+
* the least.
|
|
6
|
+
* @category Vocabulary
|
|
7
|
+
*/
|
|
3
8
|
export declare const certainties: readonly ['true', 'likely', 'possible', 'unlikely', 'false'];
|
|
4
9
|
/**
|
|
5
10
|
* Certainty levels for beliefs, ranging from 'true' to 'false'
|
|
6
11
|
* and some values in between.
|
|
12
|
+
* @category Format types
|
|
7
13
|
*/
|
|
8
14
|
export type Certainty = typeof certainties[number];
|
|
9
15
|
/**
|
|
@@ -11,14 +17,19 @@ export type Certainty = typeof certainties[number];
|
|
|
11
17
|
* the edition is read as RDF. One held possible, unlikely or false is
|
|
12
18
|
* only quoted, so that a reader who leaves the beliefs aside does not
|
|
13
19
|
* take a doubted statement for the edition's own.
|
|
20
|
+
* @category Assumptions and beliefs
|
|
14
21
|
*/
|
|
15
22
|
export declare const isAsserted: (certainty: Certainty) => boolean;
|
|
16
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* The certainty a statement is held with. One that carries no belief is stated plainly, and so held true.
|
|
25
|
+
* @category Assumptions and beliefs
|
|
26
|
+
*/
|
|
17
27
|
export declare const certaintyOf: (assumption: Readonly<Assumption>) => Certainty;
|
|
18
28
|
/**
|
|
19
29
|
* An argumentation provides reasons for a belief and
|
|
20
30
|
* may be associated with a person carrying out that argumentation.
|
|
21
31
|
* @see crminf:I1 Argumentation
|
|
32
|
+
* @category Format types
|
|
22
33
|
*/
|
|
23
34
|
export interface Argumentation<T extends string = 'simpleArgumentation'> extends WithActor, WithNote {
|
|
24
35
|
type: T;
|
|
@@ -29,6 +40,7 @@ export interface Argumentation<T extends string = 'simpleArgumentation'> extends
|
|
|
29
40
|
* as an instruction to add or remove a perforation or as the dating
|
|
30
41
|
* of the roll.
|
|
31
42
|
* @see crminf:I16 Meaning Comprehension
|
|
43
|
+
* @category Format types
|
|
32
44
|
*/
|
|
33
45
|
export interface MeaningComprehension extends Argumentation<'meaningComprehension'> {
|
|
34
46
|
/**
|
|
@@ -41,6 +53,7 @@ export interface MeaningComprehension extends Argumentation<'meaningComprehensio
|
|
|
41
53
|
/**
|
|
42
54
|
* An inference draws a conclusion from given premises.
|
|
43
55
|
* @see crminf:I5 Inference Making
|
|
56
|
+
* @category Format types
|
|
44
57
|
*/
|
|
45
58
|
export interface Inference extends Argumentation<'inference'> {
|
|
46
59
|
/**
|
|
@@ -64,6 +77,19 @@ export interface Inference extends Argumentation<'inference'> {
|
|
|
64
77
|
* @see crm:P16 used specific object
|
|
65
78
|
*/
|
|
66
79
|
used?: string[];
|
|
80
|
+
/**
|
|
81
|
+
* The rules the inference draws its conclusion by, by IRI: a
|
|
82
|
+
* regularity of how the rolls were edited, such as that the same
|
|
83
|
+
* addition at the same place is not made twice independently, a
|
|
84
|
+
* default, such as that copies were not made from two exemplars, or
|
|
85
|
+
* a method, such as how the tolerance of a collation is found. The
|
|
86
|
+
* rules are stated once where they are published, and each
|
|
87
|
+
* inference names those it follows, so that a reader can see what
|
|
88
|
+
* a conclusion rests on besides its premises, and which conclusions
|
|
89
|
+
* rest on a rule.
|
|
90
|
+
* @see crminf:J3 applied
|
|
91
|
+
*/
|
|
92
|
+
applies?: string[];
|
|
67
93
|
}
|
|
68
94
|
/**
|
|
69
95
|
* A belief adoption takes over someone else's belief without checking it:
|
|
@@ -76,6 +102,7 @@ export interface Inference extends Argumentation<'inference'> {
|
|
|
76
102
|
* The editor's own beliefs need no adoption, wherever they are
|
|
77
103
|
* published: an inference names them directly (see `Inference`).
|
|
78
104
|
* @see crminf:I7 Belief Adoption
|
|
105
|
+
* @category Format types
|
|
79
106
|
*/
|
|
80
107
|
export interface BeliefAdoption extends Argumentation<'beliefAdoption'> {
|
|
81
108
|
/**
|
|
@@ -108,6 +135,7 @@ export interface BeliefAdoption extends Argumentation<'beliefAdoption'> {
|
|
|
108
135
|
* later found wanting can be told from the rest. Naming software makes
|
|
109
136
|
* it a digital measurement event in the sense of CRMdig.
|
|
110
137
|
* @see crmsci:S21 Measurement
|
|
138
|
+
* @category Format types
|
|
111
139
|
*/
|
|
112
140
|
export interface Measurement extends Argumentation<'measurement'> {
|
|
113
141
|
/**
|
|
@@ -139,6 +167,7 @@ export interface Measurement extends Argumentation<'measurement'> {
|
|
|
139
167
|
* An argumentation can be either a plain argumentation, a
|
|
140
168
|
* meaning comprehension, an inference, a belief adoption or a
|
|
141
169
|
* measurement.
|
|
170
|
+
* @category Format types
|
|
142
171
|
*/
|
|
143
172
|
export type AnyArgumentation = MeaningComprehension | Inference | BeliefAdoption | Measurement | Argumentation;
|
|
144
173
|
/**
|
|
@@ -146,6 +175,7 @@ export type AnyArgumentation = MeaningComprehension | Inference | BeliefAdoption
|
|
|
146
175
|
* a statement) with a certainty. It comes into existence through
|
|
147
176
|
* argumentations (reasons).
|
|
148
177
|
* @see crminf:I2 Belief
|
|
178
|
+
* @category Format types
|
|
149
179
|
*/
|
|
150
180
|
export interface Belief extends WithId {
|
|
151
181
|
type: 'belief';
|
|
@@ -165,6 +195,7 @@ export interface Belief extends WithId {
|
|
|
165
195
|
* `@annotation` element from JSON-LD-star. Any property in the edition
|
|
166
196
|
* can be annotated with a belief to express uncertainty or provide
|
|
167
197
|
* justification for the stated value.
|
|
198
|
+
* @category Format types
|
|
168
199
|
*/
|
|
169
200
|
export interface Assumption {
|
|
170
201
|
/**
|
|
@@ -184,6 +215,7 @@ export interface Assumption {
|
|
|
184
215
|
* A value assumption wraps a literal value, e.g. a string, a number, a date, with an optional annotation.
|
|
185
216
|
* Used for properties where the value itself may be uncertain,
|
|
186
217
|
* e.g. dates.
|
|
218
|
+
* @category Format types
|
|
187
219
|
*/
|
|
188
220
|
export interface ValueAssumption<ValueT> extends Assumption {
|
|
189
221
|
/**
|
|
@@ -194,20 +226,24 @@ export interface ValueAssumption<ValueT> extends Assumption {
|
|
|
194
226
|
/**
|
|
195
227
|
* A reference assumption wraps a reference (by `@id`) with an optional annotation.
|
|
196
228
|
* Used when pointing to another entity whose association may be uncertain.
|
|
229
|
+
* @category Format types
|
|
197
230
|
*/
|
|
198
231
|
export type ReferenceAssumption = Assumption & WithId;
|
|
199
232
|
/**
|
|
200
233
|
* An object assumption wraps a complex object with an optional annotation.
|
|
201
234
|
* Used for structured values (e.g. persons, conditions) whose properties
|
|
202
235
|
* may be uncertain.
|
|
236
|
+
* @category Format types
|
|
203
237
|
*/
|
|
204
238
|
export type ObjectAssumption<O extends object> = Assumption & O;
|
|
205
239
|
/**
|
|
206
240
|
* An actor assignment associates a person with an action.
|
|
207
241
|
* It is an object assumption so that the attribution can be
|
|
208
242
|
* annotated with a belief about its certainty.
|
|
243
|
+
* @category Format types
|
|
209
244
|
*/
|
|
210
245
|
export type ActorAssignment = ObjectAssumption<Person>;
|
|
246
|
+
/** @inline */
|
|
211
247
|
interface DateWithin {
|
|
212
248
|
/**
|
|
213
249
|
* The day the event falls within.
|
|
@@ -216,6 +252,7 @@ interface DateWithin {
|
|
|
216
252
|
*/
|
|
217
253
|
within: Date;
|
|
218
254
|
}
|
|
255
|
+
/** @inline */
|
|
219
256
|
interface DateAfter {
|
|
220
257
|
/**
|
|
221
258
|
* The earliest day the event can have happened on: it did not
|
|
@@ -232,6 +269,7 @@ interface DateAfter {
|
|
|
232
269
|
*/
|
|
233
270
|
before?: Date;
|
|
234
271
|
}
|
|
272
|
+
/** @inline */
|
|
235
273
|
interface DateBefore {
|
|
236
274
|
/**
|
|
237
275
|
* The earliest day the event can have happened on: it did not
|
|
@@ -253,6 +291,7 @@ interface DateBefore {
|
|
|
253
291
|
* lies between. A bound nobody can give is left out, so `after` alone
|
|
254
292
|
* says "not before".
|
|
255
293
|
* @see crm:E52 Time-Span
|
|
294
|
+
* @category Format types
|
|
256
295
|
*/
|
|
257
296
|
export type TimeSpan = DateWithin | DateAfter | DateBefore;
|
|
258
297
|
/**
|
|
@@ -261,25 +300,75 @@ export type TimeSpan = DateWithin | DateAfter | DateBefore;
|
|
|
261
300
|
* day it falls `within`, or the bounds it lies between. A bound nobody
|
|
262
301
|
* can give is left out, so `after` alone says "not before".
|
|
263
302
|
* @see crm:E52 Time-Span
|
|
303
|
+
* @category Format types
|
|
264
304
|
*/
|
|
265
305
|
export type DateAssignment = Assumption & TimeSpan;
|
|
306
|
+
/**
|
|
307
|
+
* The value the assumption holds, without the belief about it.
|
|
308
|
+
* @category Assumptions and beliefs
|
|
309
|
+
*/
|
|
266
310
|
export declare function valueOf<ValueT>(assumption: ValueAssumption<ValueT>): ValueT;
|
|
311
|
+
/**
|
|
312
|
+
* The values the assumptions hold, in their order.
|
|
313
|
+
* @category Assumptions and beliefs
|
|
314
|
+
*/
|
|
267
315
|
export declare function valuesOf<ValueT>(assumptions: ValueAssumption<ValueT>[]): ValueT[];
|
|
316
|
+
/**
|
|
317
|
+
* The id of the entity the reference points to.
|
|
318
|
+
* @category Lookups
|
|
319
|
+
*/
|
|
268
320
|
export declare function idOf(assumption: ReferenceAssumption): string;
|
|
321
|
+
/**
|
|
322
|
+
* The ids of the entities the references point to, in their order.
|
|
323
|
+
* @category Lookups
|
|
324
|
+
*/
|
|
269
325
|
export declare function idsOf(assumptions: ReferenceAssumption[]): string[];
|
|
326
|
+
/**
|
|
327
|
+
* The value stated plainly: an assumption that carries no belief, and
|
|
328
|
+
* so is held true.
|
|
329
|
+
* @category Assumptions and beliefs
|
|
330
|
+
*/
|
|
270
331
|
export declare function assignValue<ValueT>(value: ValueT): ValueAssumption<ValueT>;
|
|
332
|
+
/**
|
|
333
|
+
* A reference to the entity with the id, stated plainly: an assumption
|
|
334
|
+
* that carries no belief, and so is held true.
|
|
335
|
+
* @category Assumptions and beliefs
|
|
336
|
+
*/
|
|
271
337
|
export declare function assignReference(id: string): ReferenceAssumption;
|
|
338
|
+
/**
|
|
339
|
+
* The object stated plainly: an assumption that carries no belief, and
|
|
340
|
+
* so is held true. The object given is copied rather than changed.
|
|
341
|
+
* @category Assumptions and beliefs
|
|
342
|
+
*/
|
|
272
343
|
export declare function assignObject<O extends object>(obj: O): ObjectAssumption<O>;
|
|
273
|
-
/**
|
|
344
|
+
/**
|
|
345
|
+
* A date the edition states: the day the event falls within.
|
|
346
|
+
* @category Assumptions and beliefs
|
|
347
|
+
*/
|
|
274
348
|
export declare const assignDate: (within: Date) => DateAssignment;
|
|
275
|
-
/**
|
|
349
|
+
/**
|
|
350
|
+
* A date the edition can only bound from below, as in "not before 1924".
|
|
351
|
+
* @category Assumptions and beliefs
|
|
352
|
+
*/
|
|
276
353
|
export declare const notBefore: (after: Date) => DateAssignment;
|
|
277
|
-
/**
|
|
354
|
+
/**
|
|
355
|
+
* A date the edition can only bound from above.
|
|
356
|
+
* @category Assumptions and beliefs
|
|
357
|
+
*/
|
|
278
358
|
export declare const notAfter: (before: Date) => DateAssignment;
|
|
279
|
-
/**
|
|
359
|
+
/**
|
|
360
|
+
* The day the event falls within, where the edition states one.
|
|
361
|
+
* @category Assumptions and beliefs
|
|
362
|
+
*/
|
|
280
363
|
export declare const dateOf: (assignment: DateAssignment) => Date | undefined;
|
|
281
|
-
/**
|
|
364
|
+
/**
|
|
365
|
+
* The earliest the event can have happened, as far as the edition states it.
|
|
366
|
+
* @category Assumptions and beliefs
|
|
367
|
+
*/
|
|
282
368
|
export declare const earliestOf: (assignment: DateAssignment) => Date | undefined;
|
|
283
|
-
/**
|
|
369
|
+
/**
|
|
370
|
+
* The latest the event can have happened, as far as the edition states it.
|
|
371
|
+
* @category Assumptions and beliefs
|
|
372
|
+
*/
|
|
284
373
|
export declare const latestOf: (assignment: DateAssignment) => Date | undefined;
|
|
285
374
|
export {};
|
package/lib/model/Assumption.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The certainties a belief may be held with, from the most certain to
|
|
3
|
+
* the least.
|
|
4
|
+
* @category Vocabulary
|
|
5
|
+
*/
|
|
1
6
|
export const certainties = [
|
|
2
7
|
'true',
|
|
3
8
|
'likely',
|
|
@@ -10,46 +15,99 @@ export const certainties = [
|
|
|
10
15
|
* the edition is read as RDF. One held possible, unlikely or false is
|
|
11
16
|
* only quoted, so that a reader who leaves the beliefs aside does not
|
|
12
17
|
* take a doubted statement for the edition's own.
|
|
18
|
+
* @category Assumptions and beliefs
|
|
13
19
|
*/
|
|
14
20
|
export const isAsserted = (certainty) => certainty === 'true' || certainty === 'likely';
|
|
15
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* The certainty a statement is held with. One that carries no belief is stated plainly, and so held true.
|
|
23
|
+
* @category Assumptions and beliefs
|
|
24
|
+
*/
|
|
16
25
|
export const certaintyOf = (assumption) => assumption['@annotation']?.belief.certainty ?? 'true';
|
|
26
|
+
/**
|
|
27
|
+
* The value the assumption holds, without the belief about it.
|
|
28
|
+
* @category Assumptions and beliefs
|
|
29
|
+
*/
|
|
17
30
|
export function valueOf(assumption) {
|
|
18
31
|
return assumption['@value'];
|
|
19
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* The values the assumptions hold, in their order.
|
|
35
|
+
* @category Assumptions and beliefs
|
|
36
|
+
*/
|
|
20
37
|
export function valuesOf(assumptions) {
|
|
21
38
|
return assumptions.map(a => a['@value']);
|
|
22
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* The id of the entity the reference points to.
|
|
42
|
+
* @category Lookups
|
|
43
|
+
*/
|
|
23
44
|
export function idOf(assumption) {
|
|
24
45
|
return assumption.id;
|
|
25
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* The ids of the entities the references point to, in their order.
|
|
49
|
+
* @category Lookups
|
|
50
|
+
*/
|
|
26
51
|
export function idsOf(assumptions) {
|
|
27
52
|
return assumptions.map(a => a.id);
|
|
28
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* The value stated plainly: an assumption that carries no belief, and
|
|
56
|
+
* so is held true.
|
|
57
|
+
* @category Assumptions and beliefs
|
|
58
|
+
*/
|
|
29
59
|
export function assignValue(value) {
|
|
30
60
|
return {
|
|
31
61
|
'@value': value
|
|
32
62
|
};
|
|
33
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* A reference to the entity with the id, stated plainly: an assumption
|
|
66
|
+
* that carries no belief, and so is held true.
|
|
67
|
+
* @category Assumptions and beliefs
|
|
68
|
+
*/
|
|
34
69
|
export function assignReference(id) {
|
|
35
70
|
return {
|
|
36
71
|
id
|
|
37
72
|
};
|
|
38
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* The object stated plainly: an assumption that carries no belief, and
|
|
76
|
+
* so is held true. The object given is copied rather than changed.
|
|
77
|
+
* @category Assumptions and beliefs
|
|
78
|
+
*/
|
|
39
79
|
export function assignObject(obj) {
|
|
40
80
|
return {
|
|
41
81
|
...obj
|
|
42
82
|
};
|
|
43
83
|
}
|
|
44
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* A date the edition states: the day the event falls within.
|
|
86
|
+
* @category Assumptions and beliefs
|
|
87
|
+
*/
|
|
45
88
|
export const assignDate = (within) => ({ within });
|
|
46
|
-
/**
|
|
89
|
+
/**
|
|
90
|
+
* A date the edition can only bound from below, as in "not before 1924".
|
|
91
|
+
* @category Assumptions and beliefs
|
|
92
|
+
*/
|
|
47
93
|
export const notBefore = (after) => ({ after });
|
|
48
|
-
/**
|
|
94
|
+
/**
|
|
95
|
+
* A date the edition can only bound from above.
|
|
96
|
+
* @category Assumptions and beliefs
|
|
97
|
+
*/
|
|
49
98
|
export const notAfter = (before) => ({ before });
|
|
50
|
-
/**
|
|
99
|
+
/**
|
|
100
|
+
* The day the event falls within, where the edition states one.
|
|
101
|
+
* @category Assumptions and beliefs
|
|
102
|
+
*/
|
|
51
103
|
export const dateOf = (assignment) => 'within' in assignment ? assignment.within : undefined;
|
|
52
|
-
/**
|
|
104
|
+
/**
|
|
105
|
+
* The earliest the event can have happened, as far as the edition states it.
|
|
106
|
+
* @category Assumptions and beliefs
|
|
107
|
+
*/
|
|
53
108
|
export const earliestOf = (assignment) => 'within' in assignment ? assignment.within : assignment.after;
|
|
54
|
-
/**
|
|
109
|
+
/**
|
|
110
|
+
* The latest the event can have happened, as far as the edition states it.
|
|
111
|
+
* @category Assumptions and beliefs
|
|
112
|
+
*/
|
|
55
113
|
export const latestOf = (assignment) => 'within' in assignment ? assignment.within : assignment.before;
|
package/lib/model/Edit.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { Assumption } from "./Assumption.js";
|
|
2
2
|
import { AnySymbol } from "./Symbol.js";
|
|
3
3
|
import { WithId } from "../shared/utils.js";
|
|
4
|
+
/**
|
|
5
|
+
* The types of editorial change an edit may state.
|
|
6
|
+
* @category Vocabulary
|
|
7
|
+
*/
|
|
4
8
|
export declare const editTypes: readonly ['additional-accent', 'add-redundancy', 'remove-redundancy',
|
|
5
9
|
/**
|
|
6
10
|
* Carries the text into another reproducing system's coding: a
|
|
@@ -13,6 +17,7 @@ export declare const editTypes: readonly ['additional-accent', 'add-redundancy',
|
|
|
13
17
|
* The type of editorial change applied to a symbol or set of symbols.
|
|
14
18
|
* Classifies the nature of the edit, e.g. whether it corrects an error,
|
|
15
19
|
* adds an accent, shifts a note, or shortens/prolongs a perforation.
|
|
20
|
+
* @category Format types
|
|
16
21
|
*/
|
|
17
22
|
export type EditType = typeof editTypes[number];
|
|
18
23
|
/**
|
|
@@ -28,6 +33,7 @@ export type EditType = typeof editTypes[number];
|
|
|
28
33
|
* the axioms of reo.ttl; which of those dates bounds it closest is for
|
|
29
34
|
* a query to pick.
|
|
30
35
|
* @see reo:Edit
|
|
36
|
+
* @category Format types
|
|
31
37
|
*/
|
|
32
38
|
export interface Edit extends WithId, Assumption {
|
|
33
39
|
type: 'edit';
|
|
@@ -53,4 +59,8 @@ export interface Edit extends WithId, Assumption {
|
|
|
53
59
|
*/
|
|
54
60
|
delete?: string[];
|
|
55
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Whether the object is an edit.
|
|
64
|
+
* @category Lookups
|
|
65
|
+
*/
|
|
56
66
|
export declare const isEdit: (object: any) => object is Edit;
|
package/lib/model/Edit.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The types of editorial change an edit may state.
|
|
3
|
+
* @category Vocabulary
|
|
4
|
+
*/
|
|
1
5
|
export const editTypes = [
|
|
2
6
|
'additional-accent',
|
|
3
7
|
'add-redundancy',
|
|
@@ -14,6 +18,10 @@ export const editTypes = [
|
|
|
14
18
|
'shorten',
|
|
15
19
|
'prolong',
|
|
16
20
|
];
|
|
21
|
+
/**
|
|
22
|
+
* Whether the object is an edit.
|
|
23
|
+
* @category Lookups
|
|
24
|
+
*/
|
|
17
25
|
export const isEdit = (object) => {
|
|
18
26
|
return 'type' in object && object.type === 'edit';
|
|
19
27
|
};
|
package/lib/model/Edition.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { Editor, Person, Place } from "./Agent.js";
|
|
|
6
6
|
* This type describes the creation of an edition,
|
|
7
7
|
* i.e. the editor, publisher, and publication date.
|
|
8
8
|
* @see lrmoo:F28 Expression Creation
|
|
9
|
+
* @category Format types
|
|
9
10
|
*/
|
|
10
11
|
export interface EditionCreation {
|
|
11
12
|
/**
|
|
@@ -33,6 +34,7 @@ export interface EditionCreation {
|
|
|
33
34
|
* the persons involved in the process (e.g. pianist),
|
|
34
35
|
* the place, and the date of the recording.
|
|
35
36
|
* @see lrmoo:F28 Expression Creation
|
|
37
|
+
* @category Format types
|
|
36
38
|
*/
|
|
37
39
|
export interface RecordingEvent {
|
|
38
40
|
/**
|
|
@@ -76,6 +78,7 @@ export interface RecordingEvent {
|
|
|
76
78
|
* The abstract concept of a roll, identified
|
|
77
79
|
* by its catalogue number.
|
|
78
80
|
* @see lrmoo:F1 Work
|
|
81
|
+
* @category Format types
|
|
79
82
|
*/
|
|
80
83
|
export interface Roll {
|
|
81
84
|
/**
|
|
@@ -92,6 +95,7 @@ export interface Roll {
|
|
|
92
95
|
/**
|
|
93
96
|
* Describes the specific digital edition of a piano roll.
|
|
94
97
|
* @see lrmoo:F2 Expression
|
|
98
|
+
* @category Format types
|
|
95
99
|
*/
|
|
96
100
|
export interface Edition {
|
|
97
101
|
/**
|
|
@@ -146,7 +150,7 @@ export interface Edition {
|
|
|
146
150
|
* best, since its places are what notes and readers cite. Left out,
|
|
147
151
|
* it is the first copy with features that is not aligned
|
|
148
152
|
* (`referenceCopyOf`).
|
|
149
|
-
*
|
|
153
|
+
* @see reo:referenceCopy
|
|
150
154
|
*/
|
|
151
155
|
referenceCopy?: string;
|
|
152
156
|
/**
|
|
@@ -156,11 +160,18 @@ export interface Edition {
|
|
|
156
160
|
*/
|
|
157
161
|
versions: Version[];
|
|
158
162
|
}
|
|
163
|
+
/**
|
|
164
|
+
* What an edition states about itself rather than about the copies and
|
|
165
|
+
* versions of the roll: `base`, `title`, `license`, `version`,
|
|
166
|
+
* `creation` and the `roll` it edits.
|
|
167
|
+
* @category Format types
|
|
168
|
+
*/
|
|
159
169
|
export type EditionMetadata = Pick<Edition, 'base' | 'title' | 'license' | 'version' | 'creation' | 'roll'>;
|
|
160
170
|
/**
|
|
161
171
|
* The copy whose millimetres are the edition's axis: the one it names,
|
|
162
172
|
* or where it names none or one it no longer has, the first copy with
|
|
163
173
|
* features that is not aligned, which is how an edition stood before it
|
|
164
174
|
* named one.
|
|
175
|
+
* @category Lookups
|
|
165
176
|
*/
|
|
166
177
|
export declare const referenceCopyOf: (edition: Pick<Edition, 'copies' | 'referenceCopy'>) => RollCopy | undefined;
|
package/lib/model/Edition.js
CHANGED
|
@@ -4,6 +4,7 @@ import { featuresOf } from "./RollCopy.js";
|
|
|
4
4
|
* or where it names none or one it no longer has, the first copy with
|
|
5
5
|
* features that is not aligned, which is how an edition stood before it
|
|
6
6
|
* named one.
|
|
7
|
+
* @category Lookups
|
|
7
8
|
*/
|
|
8
9
|
export const referenceCopyOf = (edition) => edition.copies.find(copy => copy.id === edition.referenceCopy)
|
|
9
10
|
?? edition.copies.find(copy => !copy.measurements.alignment && featuresOf(copy).length > 0);
|