linked-rolls 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Agent.d.ts +19 -2
- package/lib/Agent.js +10 -1
- package/lib/Edition.d.ts +8 -1
- package/lib/migrate.js +5 -1
- package/lib/schema.json +65 -6
- package/lib/spec/context.json +1 -0
- package/package.json +1 -1
package/lib/Agent.d.ts
CHANGED
|
@@ -16,11 +16,17 @@ export interface Named {
|
|
|
16
16
|
*/
|
|
17
17
|
sameAs: string[];
|
|
18
18
|
}
|
|
19
|
-
export declare const
|
|
19
|
+
export declare const editorialRoles: readonly ["editor", "transcription", "collation", "encoding", "commentary", "proofreading"];
|
|
20
|
+
/**
|
|
21
|
+
* The part an editor took in the editorial work.
|
|
22
|
+
*/
|
|
23
|
+
export type EditorialRole = typeof editorialRoles[number];
|
|
24
|
+
declare const nonEditorialRoles: readonly ["pianist", "publisher"];
|
|
20
25
|
/**
|
|
21
26
|
* The role an agent plays in the context of the edition.
|
|
22
27
|
*/
|
|
23
|
-
export type AgentRole = typeof
|
|
28
|
+
export type AgentRole = EditorialRole | typeof nonEditorialRoles[number];
|
|
29
|
+
export declare const agentRoles: readonly AgentRole[];
|
|
24
30
|
/**
|
|
25
31
|
* A person or a group: a pianist, an editor, a publisher,
|
|
26
32
|
* a manufacturer, a library.
|
|
@@ -37,6 +43,16 @@ export interface Agent extends Named, Partial<WithId> {
|
|
|
37
43
|
* An agent that is a person.
|
|
38
44
|
*/
|
|
39
45
|
export type Person = Agent;
|
|
46
|
+
/**
|
|
47
|
+
* A person who took part in preparing the edition.
|
|
48
|
+
*/
|
|
49
|
+
export interface Editor extends Person {
|
|
50
|
+
/**
|
|
51
|
+
* The part this person took in the editorial work.
|
|
52
|
+
* @see crm:P2 has type
|
|
53
|
+
*/
|
|
54
|
+
role: EditorialRole;
|
|
55
|
+
}
|
|
40
56
|
export type WithActor = {
|
|
41
57
|
/**
|
|
42
58
|
* The person who carried out this activity.
|
|
@@ -57,3 +73,4 @@ export interface Place extends Named {
|
|
|
57
73
|
*/
|
|
58
74
|
export interface Concept extends Named, Partial<WithId> {
|
|
59
75
|
}
|
|
76
|
+
export {};
|
package/lib/Agent.js
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const editorialRoles = [
|
|
2
|
+
'editor',
|
|
3
|
+
'transcription',
|
|
4
|
+
'collation',
|
|
5
|
+
'encoding',
|
|
6
|
+
'commentary',
|
|
7
|
+
'proofreading'
|
|
8
|
+
];
|
|
9
|
+
const nonEditorialRoles = ['pianist', 'publisher'];
|
|
10
|
+
export const agentRoles = [...nonEditorialRoles, ...editorialRoles];
|
package/lib/Edition.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { RollCopy } from "./RollCopy";
|
|
|
2
2
|
import { Version } from "./Version";
|
|
3
3
|
import { CollationTolerance } from "./Collation";
|
|
4
4
|
import { DateAssignment, ObjectAssumption } from "./Assumption";
|
|
5
|
-
import { Concept, Person, Place } from "./Agent";
|
|
5
|
+
import { Concept, Editor, Person, Place } from "./Agent";
|
|
6
6
|
import { RollTempo } from "./ReproducingSystem";
|
|
7
7
|
/**
|
|
8
8
|
* This type describes the creation of an edition,
|
|
@@ -10,6 +10,13 @@ import { RollTempo } from "./ReproducingSystem";
|
|
|
10
10
|
* @see lrmoo:F28 Expression Creation
|
|
11
11
|
*/
|
|
12
12
|
export interface EditionCreation {
|
|
13
|
+
/**
|
|
14
|
+
* The persons who prepared the edition, each with the part
|
|
15
|
+
* they took in the editorial work. An edition written before
|
|
16
|
+
* this field existed carries none.
|
|
17
|
+
* @see crm:P14 carried out by
|
|
18
|
+
*/
|
|
19
|
+
editors?: Editor[];
|
|
13
20
|
/**
|
|
14
21
|
* The person or institution responsible for publishing the edition.
|
|
15
22
|
* @see crm:P14 carried out by
|
package/lib/migrate.js
CHANGED
|
@@ -75,4 +75,8 @@ const withRollSystem = (edition) => {
|
|
|
75
75
|
const system = { '@id': id, ...concept, ...(stated && { name: stated }) };
|
|
76
76
|
return { ...edition, roll: { ...edition.roll, system } };
|
|
77
77
|
};
|
|
78
|
-
|
|
78
|
+
/** An edition written before the editors were carried names none. */
|
|
79
|
+
const withEditors = (edition) => !edition.creation || edition.creation.editors
|
|
80
|
+
? edition
|
|
81
|
+
: { ...edition, creation: { ...edition.creation, editors: [] } };
|
|
82
|
+
export const migrate = (edition) => walk(withRollSystem(withEditors(edition)));
|
package/lib/schema.json
CHANGED
|
@@ -39,13 +39,20 @@
|
|
|
39
39
|
"type": "object"
|
|
40
40
|
},
|
|
41
41
|
"AgentRole": {
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
"anyOf": [
|
|
43
|
+
{
|
|
44
|
+
"$ref": "#/definitions/EditorialRole"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"const": "pianist",
|
|
48
|
+
"type": "string"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"const": "publisher",
|
|
52
|
+
"type": "string"
|
|
53
|
+
}
|
|
47
54
|
],
|
|
48
|
-
"
|
|
55
|
+
"description": "The role an agent plays in the context of the edition."
|
|
49
56
|
},
|
|
50
57
|
"AnyArgumentation": {
|
|
51
58
|
"anyOf": [
|
|
@@ -406,6 +413,13 @@
|
|
|
406
413
|
"$ref": "#/definitions/CollationTolerance",
|
|
407
414
|
"description": "The tolerance parameters used when collating (aligning) the different roll copies for this edition. Not exported to RDF."
|
|
408
415
|
},
|
|
416
|
+
"editors": {
|
|
417
|
+
"description": "The persons who prepared the edition, each with the part they took in the editorial work. An edition written before this field existed carries none. [ontology: crm:P14 carried out by]",
|
|
418
|
+
"items": {
|
|
419
|
+
"$ref": "#/definitions/Editor"
|
|
420
|
+
},
|
|
421
|
+
"type": "array"
|
|
422
|
+
},
|
|
409
423
|
"publicationDate": {
|
|
410
424
|
"description": "The date on which the edition was published. [ontology: dcterms:date]",
|
|
411
425
|
"format": "date",
|
|
@@ -422,6 +436,51 @@
|
|
|
422
436
|
],
|
|
423
437
|
"type": "object"
|
|
424
438
|
},
|
|
439
|
+
"Editor": {
|
|
440
|
+
"description": "A person who took part in preparing the edition.",
|
|
441
|
+
"properties": {
|
|
442
|
+
"name": {
|
|
443
|
+
"description": "The name, e.g. \"Grünfeld, Alfred\", \"Wien\", \"M. Welte & Söhne\". [ontology: rdfs:label]",
|
|
444
|
+
"type": "string"
|
|
445
|
+
},
|
|
446
|
+
"role": {
|
|
447
|
+
"$ref": "#/definitions/EditorialRole",
|
|
448
|
+
"description": "The part this person took in the editorial work. [ontology: crm:P2 has type]"
|
|
449
|
+
},
|
|
450
|
+
"sameAs": {
|
|
451
|
+
"description": "Authority records for the same thing: GND, Wikidata, geonames or similar. [ontology: owl:sameAs]",
|
|
452
|
+
"examples": [
|
|
453
|
+
"https://d-nb.info/gnd/116888652"
|
|
454
|
+
],
|
|
455
|
+
"items": {
|
|
456
|
+
"type": "string"
|
|
457
|
+
},
|
|
458
|
+
"type": "array"
|
|
459
|
+
},
|
|
460
|
+
"@id": {
|
|
461
|
+
"description": "A unique identifier for this object.",
|
|
462
|
+
"type": "string"
|
|
463
|
+
}
|
|
464
|
+
},
|
|
465
|
+
"required": [
|
|
466
|
+
"name",
|
|
467
|
+
"role",
|
|
468
|
+
"sameAs"
|
|
469
|
+
],
|
|
470
|
+
"type": "object"
|
|
471
|
+
},
|
|
472
|
+
"EditorialRole": {
|
|
473
|
+
"description": "The part an editor took in the editorial work.",
|
|
474
|
+
"enum": [
|
|
475
|
+
"editor",
|
|
476
|
+
"transcription",
|
|
477
|
+
"collation",
|
|
478
|
+
"encoding",
|
|
479
|
+
"commentary",
|
|
480
|
+
"proofreading"
|
|
481
|
+
],
|
|
482
|
+
"type": "string"
|
|
483
|
+
},
|
|
425
484
|
"Expression": {
|
|
426
485
|
"description": "An expression symbol, representing a perforation on the roll that governs dynamics, pedaling, or mechanical functions of the reproducing piano. Each expression has a scope (bass or treble) and a specific expression type. [ontology: reo:Expression]",
|
|
427
486
|
"properties": {
|
package/lib/spec/context.json
CHANGED
package/package.json
CHANGED