linked-rolls 0.68.0 → 0.69.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/lookup/paths.d.ts +2 -0
- package/lib/lookup/paths.js +2 -0
- package/lib/model/Edition.d.ts +13 -2
- package/lib/schema.json +9 -1
- package/lib/spec/context.json +1 -0
- package/package.json +1 -1
package/lib/lookup/paths.d.ts
CHANGED
|
@@ -7,5 +7,7 @@ export type Path = (string | number)[];
|
|
|
7
7
|
export declare const getAt: <T>(path: Path, obj: unknown) => T | undefined;
|
|
8
8
|
/** Where the entity with the id stands in the edition, or nothing where it holds none. */
|
|
9
9
|
export declare const pathIn: (edition: Edition, id: string) => Path | undefined;
|
|
10
|
+
/** Every id the edition gives an entity of its own, references left out. */
|
|
11
|
+
export declare const idsIn: (edition: Edition) => Iterable<string>;
|
|
10
12
|
/** Where the edition references the id. */
|
|
11
13
|
export declare const linksTo: (edition: Edition, id: string) => Path[];
|
package/lib/lookup/paths.js
CHANGED
|
@@ -74,5 +74,7 @@ export const pathIn = (edition, id) => {
|
|
|
74
74
|
const trail = placesIn(edition).paths.get(id);
|
|
75
75
|
return trail === undefined ? undefined : laidOut(trail);
|
|
76
76
|
};
|
|
77
|
+
/** Every id the edition gives an entity of its own, references left out. */
|
|
78
|
+
export const idsIn = (edition) => placesIn(edition).paths.keys();
|
|
77
79
|
/** Where the edition references the id. */
|
|
78
80
|
export const linksTo = (edition, id) => (placesIn(edition).links.get(id) ?? []).map(laidOut);
|
package/lib/model/Edition.d.ts
CHANGED
|
@@ -21,7 +21,8 @@ export interface EditionCreation {
|
|
|
21
21
|
*/
|
|
22
22
|
publisher: Person;
|
|
23
23
|
/**
|
|
24
|
-
* The date on which the edition was published
|
|
24
|
+
* The date on which the edition was published: where it states a
|
|
25
|
+
* version, the date of that version.
|
|
25
26
|
* @format date
|
|
26
27
|
* @see dcterms:date
|
|
27
28
|
*/
|
|
@@ -116,6 +117,16 @@ export interface Edition {
|
|
|
116
117
|
* @example "https://creativecommons.org/licenses/by/4.0/"
|
|
117
118
|
*/
|
|
118
119
|
license: string;
|
|
120
|
+
/**
|
|
121
|
+
* The version of the edition, which a citation names together with
|
|
122
|
+
* the publication date. The editor raises it for each release and
|
|
123
|
+
* sets the publication date with it, so that what a reader cited can
|
|
124
|
+
* be told from what has changed since. An edition published before
|
|
125
|
+
* this field existed states none.
|
|
126
|
+
* @see owl:versionInfo
|
|
127
|
+
* @example "1.0"
|
|
128
|
+
*/
|
|
129
|
+
version?: string;
|
|
119
130
|
/**
|
|
120
131
|
* The roll which is edited in this edition.
|
|
121
132
|
* @see lrmoo:R3i realises
|
|
@@ -145,7 +156,7 @@ export interface Edition {
|
|
|
145
156
|
*/
|
|
146
157
|
versions: Version[];
|
|
147
158
|
}
|
|
148
|
-
export type EditionMetadata = Pick<Edition, 'base' | 'title' | 'license' | 'creation' | 'roll'>;
|
|
159
|
+
export type EditionMetadata = Pick<Edition, 'base' | 'title' | 'license' | 'version' | 'creation' | 'roll'>;
|
|
149
160
|
/**
|
|
150
161
|
* The copy whose millimetres are the edition's axis: the one it names,
|
|
151
162
|
* or where it names none or one it no longer has, the first copy with
|
package/lib/schema.json
CHANGED
|
@@ -617,6 +617,14 @@
|
|
|
617
617
|
"type": "string",
|
|
618
618
|
"ontology": "dcterms:title"
|
|
619
619
|
},
|
|
620
|
+
"version": {
|
|
621
|
+
"description": "The version of the edition, which a citation names together with the publication date. The editor raises it for each release and sets the publication date with it, so that what a reader cited can be told from what has changed since. An edition published before this field existed states none.",
|
|
622
|
+
"examples": [
|
|
623
|
+
"1.0"
|
|
624
|
+
],
|
|
625
|
+
"type": "string",
|
|
626
|
+
"ontology": "owl:versionInfo"
|
|
627
|
+
},
|
|
620
628
|
"versions": {
|
|
621
629
|
"description": "The different versions of the roll on which this edition is based.",
|
|
622
630
|
"items": {
|
|
@@ -649,7 +657,7 @@
|
|
|
649
657
|
"ontology": "crm:P14 carried out by"
|
|
650
658
|
},
|
|
651
659
|
"publicationDate": {
|
|
652
|
-
"description": "The date on which the edition was published.",
|
|
660
|
+
"description": "The date on which the edition was published: where it states a version, the date of that version.",
|
|
653
661
|
"format": "date",
|
|
654
662
|
"type": "string",
|
|
655
663
|
"ontology": "dcterms:date"
|
package/lib/spec/context.json
CHANGED
package/package.json
CHANGED