linked-rolls 0.70.0 → 0.72.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.
Files changed (143) hide show
  1. package/README.md +106 -5
  2. package/lib/analysis/constraints.d.ts +7 -0
  3. package/lib/analysis/constraints.js +1 -0
  4. package/lib/analysis/ownPaper.d.ts +5 -1
  5. package/lib/analysis/ownPaper.js +5 -1
  6. package/lib/analysis/paper.d.ts +22 -4
  7. package/lib/analysis/paper.js +6 -0
  8. package/lib/analysis/reservations.d.ts +24 -1
  9. package/lib/analysis/reservations.js +15 -1
  10. package/lib/analysis/sigla.d.ts +6 -1
  11. package/lib/analysis/sigla.js +5 -1
  12. package/lib/analysis/stemma.d.ts +6 -1
  13. package/lib/analysis/stemma.js +6 -1
  14. package/lib/analysis/text.d.ts +16 -2
  15. package/lib/analysis/text.js +16 -2
  16. package/lib/analysis/witnesses.d.ts +20 -1
  17. package/lib/analysis/witnesses.js +4 -0
  18. package/lib/collation/Collation.d.ts +47 -8
  19. package/lib/collation/Collation.js +29 -5
  20. package/lib/collation/alignment.d.ts +16 -3
  21. package/lib/collation/alignment.js +15 -3
  22. package/lib/collation/scatter.d.ts +50 -9
  23. package/lib/collation/scatter.js +11 -1
  24. package/lib/collation/statistics.d.ts +39 -9
  25. package/lib/collation/statistics.js +27 -6
  26. package/lib/collation/substitution.d.ts +5 -0
  27. package/lib/collation/substitution.js +4 -0
  28. package/lib/emulation/Emulation.d.ts +16 -1
  29. package/lib/emulation/Emulation.js +10 -0
  30. package/lib/emulation/negotiation.d.ts +1 -0
  31. package/lib/emulation/negotiation.js +1 -0
  32. package/lib/filiation/adoption.d.ts +47 -0
  33. package/lib/filiation/adoption.js +190 -0
  34. package/lib/filiation/changes.d.ts +33 -0
  35. package/lib/filiation/changes.js +38 -0
  36. package/lib/filiation/index.d.ts +12 -0
  37. package/lib/filiation/index.js +12 -0
  38. package/lib/filiation/presence.d.ts +50 -0
  39. package/lib/filiation/presence.js +122 -0
  40. package/lib/filiation/proposal.d.ts +132 -0
  41. package/lib/filiation/proposal.js +376 -0
  42. package/lib/filiation/readings.d.ts +108 -0
  43. package/lib/filiation/readings.js +281 -0
  44. package/lib/filiation/search.d.ts +113 -0
  45. package/lib/filiation/search.js +268 -0
  46. package/lib/filiation/systems.d.ts +21 -0
  47. package/lib/filiation/systems.js +39 -0
  48. package/lib/filiation/trees.d.ts +20 -0
  49. package/lib/filiation/trees.js +69 -0
  50. package/lib/index.d.ts +34 -2
  51. package/lib/index.js +3 -1
  52. package/lib/io/asJsonLd.d.ts +10 -0
  53. package/lib/io/asJsonLd.js +10 -0
  54. package/lib/io/context.d.ts +16 -2
  55. package/lib/io/context.js +16 -2
  56. package/lib/io/importJsonLd.d.ts +1 -0
  57. package/lib/io/importJsonLd.js +1 -0
  58. package/lib/io/migrate.d.ts +8 -0
  59. package/lib/io/migrate.js +8 -0
  60. package/lib/lookup/lookup.d.ts +29 -5
  61. package/lib/lookup/lookup.js +29 -5
  62. package/lib/lookup/paths.d.ts +23 -3
  63. package/lib/lookup/paths.js +17 -3
  64. package/lib/model/Agent.d.ts +28 -2
  65. package/lib/model/Agent.js +15 -1
  66. package/lib/model/Assumption.d.ts +96 -7
  67. package/lib/model/Assumption.js +65 -7
  68. package/lib/model/ConditionState.d.ts +1 -0
  69. package/lib/model/Edit.d.ts +10 -0
  70. package/lib/model/Edit.js +8 -0
  71. package/lib/model/Edition.d.ts +11 -0
  72. package/lib/model/Edition.js +1 -0
  73. package/lib/model/Feature.d.ts +74 -7
  74. package/lib/model/Feature.js +41 -3
  75. package/lib/model/FeatureSource.d.ts +14 -1
  76. package/lib/model/FeatureSource.js +7 -1
  77. package/lib/model/Perforator.d.ts +10 -0
  78. package/lib/model/Perforator.js +1 -0
  79. package/lib/model/Quantity.d.ts +160 -13
  80. package/lib/model/Quantity.js +110 -6
  81. package/lib/model/RollCopy.d.ts +74 -12
  82. package/lib/model/RollCopy.js +53 -10
  83. package/lib/model/Symbol.d.ts +38 -1
  84. package/lib/model/Symbol.js +16 -0
  85. package/lib/model/TrackCalibration.d.ts +10 -2
  86. package/lib/model/TrackCalibration.js +9 -2
  87. package/lib/model/Version.d.ts +24 -4
  88. package/lib/model/Version.js +19 -4
  89. package/lib/model/notes.d.ts +15 -2
  90. package/lib/model/notes.js +9 -2
  91. package/lib/model/procedures.d.ts +5 -1
  92. package/lib/model/procedures.js +5 -1
  93. package/lib/model/vocabulary.d.ts +6 -1
  94. package/lib/model/vocabulary.js +6 -1
  95. package/lib/ops/beliefs.d.ts +23 -1
  96. package/lib/ops/beliefs.js +23 -1
  97. package/lib/ops/collation.d.ts +3 -0
  98. package/lib/ops/collation.js +3 -0
  99. package/lib/ops/commands.d.ts +17 -2
  100. package/lib/ops/commands.js +17 -2
  101. package/lib/ops/copies.d.ts +37 -6
  102. package/lib/ops/copies.js +37 -6
  103. package/lib/ops/draft.d.ts +2 -0
  104. package/lib/ops/draft.js +1 -0
  105. package/lib/ops/edits.d.ts +5 -1
  106. package/lib/ops/edits.js +5 -1
  107. package/lib/ops/features.d.ts +12 -1
  108. package/lib/ops/features.js +7 -0
  109. package/lib/ops/versions.d.ts +15 -3
  110. package/lib/ops/versions.js +15 -3
  111. package/lib/readers/phillipsEroll.d.ts +12 -1
  112. package/lib/readers/phillipsEroll.js +6 -1
  113. package/lib/readers/spencerBar.d.ts +12 -1
  114. package/lib/readers/spencerBar.js +7 -1
  115. package/lib/readers/stanfordAton.d.ts +15 -0
  116. package/lib/readers/stanfordAton.js +9 -0
  117. package/lib/schema.json +10 -0
  118. package/lib/shared/utils.d.ts +12 -0
  119. package/lib/spec/context.json +4 -0
  120. package/lib/systems/ReproducingSystem.d.ts +46 -3
  121. package/lib/systems/TrackerBar.d.ts +45 -4
  122. package/lib/systems/TrackerBar.js +20 -3
  123. package/lib/systems/index.d.ts +9 -2
  124. package/lib/systems/index.js +9 -2
  125. package/lib/systems/velocity.d.ts +1 -0
  126. package/lib/systems/velocity.js +1 -0
  127. package/lib/systems/welte.d.ts +18 -3
  128. package/lib/systems/welte.js +9 -2
  129. package/lib/systems/welteLicensee/bar.d.ts +1 -0
  130. package/lib/systems/welteLicensee/bar.js +1 -0
  131. package/lib/systems/welteLicensee/system.d.ts +18 -0
  132. package/lib/systems/welteLicensee/system.js +17 -0
  133. package/lib/systems/welteT100/bar.d.ts +8 -0
  134. package/lib/systems/welteT100/bar.js +4 -0
  135. package/lib/systems/welteT100/system.d.ts +46 -5
  136. package/lib/systems/welteT100/system.js +29 -3
  137. package/lib/systems/welteT98/bar.d.ts +6 -0
  138. package/lib/systems/welteT98/bar.js +2 -0
  139. package/lib/systems/welteT98/system.d.ts +58 -5
  140. package/lib/systems/welteT98/system.js +42 -3
  141. package/lib/validate.d.ts +16 -0
  142. package/lib/validate.js +15 -0
  143. package/package.json +2 -1
@@ -10,17 +10,40 @@ import { NestedFeature } from "../model/Feature.js";
10
10
  import { AnySymbol } from "../model/Symbol.js";
11
11
  import { Version } from "../model/Version.js";
12
12
  import { Modification, ProductionEvent, RollCopy } from "../model/RollCopy.js";
13
+ /**
14
+ * The version with the id, where the edition holds one.
15
+ * @category Lookups
16
+ */
13
17
  export declare const versionIn: (edition: Pick<Edition, 'versions'>, id: string) => Readonly<Version> | undefined;
18
+ /**
19
+ * The copy with the id, where the edition holds one.
20
+ * @category Lookups
21
+ */
14
22
  export declare const copyIn: (edition: Pick<Edition, 'copies'>, id: string) => Readonly<RollCopy> | undefined;
15
- /** A symbol any version inserts. */
23
+ /**
24
+ * A symbol any version inserts.
25
+ * @category Lookups
26
+ */
16
27
  export declare const symbolIn: (edition: Pick<Edition, 'versions'>, id: string) => Readonly<AnySymbol> | undefined;
17
- /** The symbols under the ids, leaving out an id that names none. */
28
+ /**
29
+ * The symbols under the ids, leaving out an id that names none.
30
+ * @category Lookups
31
+ */
18
32
  export declare const symbolsIn: (edition: Pick<Edition, 'versions'>, ids: readonly string[]) => Readonly<AnySymbol>[];
19
- /** A feature or a patch on any copy, one a patch bears included. */
33
+ /**
34
+ * A feature or a patch on any copy, one a patch bears included.
35
+ * @category Lookups
36
+ */
20
37
  export declare const featureIn: (edition: Pick<Edition, 'copies'>, id: string) => Readonly<NestedFeature> | undefined;
21
- /** The features and patches under the ids, leaving out an id that names none. */
38
+ /**
39
+ * The features and patches under the ids, leaving out an id that names none.
40
+ * @category Lookups
41
+ */
22
42
  export declare const featuresIn: (edition: Pick<Edition, 'copies'>, ids: readonly string[]) => Readonly<NestedFeature>[];
23
- /** The copy a feature sits on, a patch and everything it bears included. */
43
+ /**
44
+ * The copy a feature sits on, a patch and everything it bears included.
45
+ * @category Lookups
46
+ */
24
47
  export declare const copyOfFeature: (edition: Pick<Edition, 'copies'>, featureId: string) => Readonly<RollCopy> | undefined;
25
48
  /**
26
49
  * The act a copy states a feature in: the production event that
@@ -28,5 +51,6 @@ export declare const copyOfFeature: (edition: Pick<Edition, 'copies'>, featureId
28
51
  * a patch bears came onto the copy with the patch, so the act is
29
52
  * the one that glued the patch on. Two features stand in one act
30
53
  * where this returns the very same object.
54
+ * @category Lookups
31
55
  */
32
56
  export declare const actOf: (edition: Pick<Edition, 'copies'>, featureId: string) => Readonly<ProductionEvent | Modification> | undefined;
@@ -10,17 +10,40 @@ const symbolsById = perState((edition) => byIdIn(edition.versions.flatMap(insert
10
10
  const featuresOnCopies = (edition) => edition.copies.flatMap(copy => featuresOf(copy).flatMap(withBorneFeatures).map(feature => ({ feature, copy })));
11
11
  const featuresById = perState((edition) => new Map(featuresOnCopies(edition).map(({ feature }) => [feature.id, feature])));
12
12
  const copiesByFeature = perState((edition) => new Map(featuresOnCopies(edition).map(({ feature, copy }) => [feature.id, copy])));
13
+ /**
14
+ * The version with the id, where the edition holds one.
15
+ * @category Lookups
16
+ */
13
17
  export const versionIn = (edition, id) => versionsById(edition).get(id);
18
+ /**
19
+ * The copy with the id, where the edition holds one.
20
+ * @category Lookups
21
+ */
14
22
  export const copyIn = (edition, id) => copiesById(edition).get(id);
15
- /** A symbol any version inserts. */
23
+ /**
24
+ * A symbol any version inserts.
25
+ * @category Lookups
26
+ */
16
27
  export const symbolIn = (edition, id) => symbolsById(edition).get(id);
17
- /** The symbols under the ids, leaving out an id that names none. */
28
+ /**
29
+ * The symbols under the ids, leaving out an id that names none.
30
+ * @category Lookups
31
+ */
18
32
  export const symbolsIn = (edition, ids) => ids.flatMap(id => symbolIn(edition, id) ?? []);
19
- /** A feature or a patch on any copy, one a patch bears included. */
33
+ /**
34
+ * A feature or a patch on any copy, one a patch bears included.
35
+ * @category Lookups
36
+ */
20
37
  export const featureIn = (edition, id) => featuresById(edition).get(id);
21
- /** The features and patches under the ids, leaving out an id that names none. */
38
+ /**
39
+ * The features and patches under the ids, leaving out an id that names none.
40
+ * @category Lookups
41
+ */
22
42
  export const featuresIn = (edition, ids) => ids.flatMap(id => featureIn(edition, id) ?? []);
23
- /** The copy a feature sits on, a patch and everything it bears included. */
43
+ /**
44
+ * The copy a feature sits on, a patch and everything it bears included.
45
+ * @category Lookups
46
+ */
24
47
  export const copyOfFeature = (edition, featureId) => copiesByFeature(edition).get(featureId);
25
48
  /**
26
49
  * The act a copy states a feature in: the production event that
@@ -28,6 +51,7 @@ export const copyOfFeature = (edition, featureId) => copiesByFeature(edition).ge
28
51
  * a patch bears came onto the copy with the patch, so the act is
29
52
  * the one that glued the patch on. Two features stand in one act
30
53
  * where this returns the very same object.
54
+ * @category Lookups
31
55
  */
32
56
  export const actOf = (edition, featureId) => {
33
57
  const copy = copyOfFeature(edition, featureId);
@@ -3,11 +3,31 @@
3
3
  * paths an operation can follow into a draft of it.
4
4
  */
5
5
  import { Edition } from "../model/Edition.js";
6
+ /**
7
+ * Where something stands in an edition: the keys and indices that lead
8
+ * to it, as `pathIn` gives them and the operations on beliefs take
9
+ * them.
10
+ * @category Lookups
11
+ */
6
12
  export type Path = (string | number)[];
13
+ /**
14
+ * What stands at the path in an edition or a draft of one, or nothing
15
+ * where the path leads nowhere.
16
+ * @category Lookups
17
+ */
7
18
  export declare const getAt: <T>(path: Path, obj: unknown) => T | undefined;
8
- /** Where the entity with the id stands in the edition, or nothing where it holds none. */
19
+ /**
20
+ * Where the entity with the id stands in the edition, or nothing where it holds none.
21
+ * @category Lookups
22
+ */
9
23
  export declare const pathIn: (edition: Edition, id: string) => Path | undefined;
10
- /** Every id the edition gives an entity of its own, references left out. */
24
+ /**
25
+ * Every id the edition gives an entity of its own, references left out.
26
+ * @category Lookups
27
+ */
11
28
  export declare const idsIn: (edition: Edition) => Iterable<string>;
12
- /** Where the edition references the id. */
29
+ /**
30
+ * Where the edition references the id.
31
+ * @category Lookups
32
+ */
13
33
  export declare const linksTo: (edition: Edition, id: string) => Path[];
@@ -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
- /** Where the entity with the id stands in the edition, or nothing where it holds none. */
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
- /** Every id the edition gives an entity of its own, references left out. */
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
- /** Where the edition references the id. */
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);
@@ -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
- declare const nonEditorialRoles: readonly ['pianist', 'publisher'];
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 {};
@@ -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
- const nonEditorialRoles = ['pianist', 'publisher'];
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
- /** The certainty a statement is held with. One that carries no belief is stated plainly, and so held true. */
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
- /** A date the edition states: the day the event falls within. */
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
- /** A date the edition can only bound from below, as in "not before 1924". */
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
- /** A date the edition can only bound from above. */
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
- /** The day the event falls within, where the edition states one. */
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
- /** The earliest the event can have happened, as far as the edition states it. */
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
- /** The latest the event can have happened, as far as the edition states it. */
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 {};
@@ -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
- /** The certainty a statement is held with. One that carries no belief is stated plainly, and so held true. */
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
- /** A date the edition states: the day the event falls within. */
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
- /** A date the edition can only bound from below, as in "not before 1924". */
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
- /** A date the edition can only bound from above. */
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
- /** The day the event falls within, where the edition states one. */
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
- /** The earliest the event can have happened, as far as the edition states it. */
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
- /** The latest the event can have happened, as far as the edition states it. */
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;
@@ -3,6 +3,7 @@
3
3
  * of a feature on the roll (e.g. a damaged
4
4
  * or unsuccessful perforation).
5
5
  * @see crm:E3 Condition State
6
+ * @category Format types
6
7
  */
7
8
  export interface ConditionState<T extends string> {
8
9
  /**