diff --git a/importer/src/openLibrary/producer/parser.ts b/importer/src/openLibrary/producer/parser.ts index aa24e69..c10dc1b 100644 --- a/importer/src/openLibrary/producer/parser.ts +++ b/importer/src/openLibrary/producer/parser.ts @@ -80,7 +80,7 @@ function processWork(json: any) { links: [], relationships: [] }, - source: 'OpenLibrary' + externalSource: 'OpenLibrary' }; // Set up aliases @@ -125,7 +125,7 @@ function processWork(json: any) { typeId: identifiers.openLibraryWorkId, value: openLibraryWorkId }); - work.originId = openLibraryWorkId; + work.externalIdentifier = openLibraryWorkId; } if (!isNotDefined(json.authors) && (json.authors instanceof Array)) { @@ -196,7 +196,7 @@ function processAuthor(json) { originId: [], relationships: [] }, - source: 'OpenLibrary' + externalSource: 'OpenLibrary' }; // Set up aliases @@ -267,7 +267,7 @@ function processAuthor(json) { const openLibraryAuthorId = json.key.split('/')[2]; // No identifier for OL author exists, so only setting up origin Id - author.originId = openLibraryAuthorId; + author.externalIdentifier = openLibraryAuthorId; author.metadata.identifiers.push({ typeId: identifiers.openLibraryAuthorId, diff --git a/importer/src/openLibrary/producer/producer.ts b/importer/src/openLibrary/producer/producer.ts index 3303fdf..c4668de 100644 --- a/importer/src/openLibrary/producer/producer.ts +++ b/importer/src/openLibrary/producer/producer.ts @@ -51,7 +51,7 @@ function readLine({base, id, queue}: {id: number; base: string; queue: ImportQue // ➜ JSON - the complete record in JSON format const record = line.split('\t'); - const source = 'OpenLibrary'; + const externalSource = 'OpenLibrary'; const json = JSON.parse(record[4]); const OLType = record[0].split('/')[2] as OLEntityType; const entityType = mapEntityType(OLType); @@ -68,8 +68,8 @@ function readLine({base, id, queue}: {id: number; base: string; queue: ImportQue data, entityType, lastEdited: lastEdited || data.lastEdited, - originId: originId || data.originId, - source + externalIdentifier: originId || data.externalIdentifier, + externalSource }; const success = queue.push(entity); diff --git a/importer/src/queue.ts b/importer/src/queue.ts index 5a1fe39..bd89c9f 100644 --- a/importer/src/queue.ts +++ b/importer/src/queue.ts @@ -30,7 +30,7 @@ import {delay} from './helpers/utils.ts'; */ export function queuedEntityRepresentation(entity: QueuedEntity): string { const defaultAlias = entity.data?.alias?.find((alias) => alias.default) ?? entity.data?.alias?.[0]; - return `'${defaultAlias?.name ?? '[unknown]'}' (${entity.entityType} ${entity.originId ?? '[unknown ID]'})`; + return `'${defaultAlias?.name ?? '[unknown]'}' (${entity.entityType} ${entity.externalIdentifier ?? '[unknown ID]'})`; } diff --git a/importer/testdata/author.json b/importer/testdata/author.json index ce713b1..712b1b6 100644 --- a/importer/testdata/author.json +++ b/importer/testdata/author.json @@ -41,10 +41,10 @@ }], "relationships": [] }, - "source": "Testdata" + "externalSource": "Testdata" }, "entityType": "Author", "lastEdited": "2024-07-25", - "originId": "A1234", - "source": "Testdata" + "externalIdentifier": "A1234", + "externalSource": "Testdata" } diff --git a/importer/testdata/author.ts b/importer/testdata/author.ts index f1ca9d4..1982cb0 100644 --- a/importer/testdata/author.ts +++ b/importer/testdata/author.ts @@ -43,10 +43,10 @@ export const entity: QueuedEntity = { }], "relationships": [] }, - "source": "Testdata" + "externalSource": "Testdata" }, "entityType": "Author", "lastEdited": "2024-07-25", - "originId": "A1234", // change this to import another dummy entity - "source": "Testdata" + "externalIdentifier": "A1234", // change this to import another dummy entity + "externalSource": "Testdata" }; diff --git a/importer/testdata/edition.json b/importer/testdata/edition.json index 91827e3..9db2064 100644 --- a/importer/testdata/edition.json +++ b/importer/testdata/edition.json @@ -7,8 +7,7 @@ "default": true, "primary": true }], - "disambiguation": "import test", - "editionGroupBbid": "PLEASE-FILL-WITH-VALID-BBID", + "disambiguation": "import test, without edition group", "formatId": 2, "statusId": 1, "releaseEvents": [{"date": "2024-04-23"}], @@ -27,10 +26,10 @@ }], "relationships": [] }, - "source": "Testdata" + "externalSource": "Testdata" }, "entityType": "Edition", "lastEdited": "2024-07-24", - "originId": "E123", - "source": "Testdata" + "externalIdentifier": "E123", + "externalSource": "Testdata" } diff --git a/importer/testdata/edition.ts b/importer/testdata/edition.ts index 0ca4ed3..1c6e435 100644 --- a/importer/testdata/edition.ts +++ b/importer/testdata/edition.ts @@ -10,7 +10,7 @@ export const entity: QueuedEntity = { "primary": true }], "disambiguation": "import test", - "editionGroupBbid": "PLEASE-FILL-WITH-VALID-BBID", // has to exist + // "editionGroupBbid": "PLEASE-FILL-WITH-VALID-BBID", "formatId": 2, // Hardcover "statusId": 1, // Official "releaseEvents": [{"date": "2024-04-23"}], @@ -29,10 +29,10 @@ export const entity: QueuedEntity = { }], "relationships": [] }, - "source": "Testdata" + "externalSource": "Testdata" }, "entityType": "Edition", "lastEdited": "2024-07-24", - "originId": "E123", // change this to import another dummy entity - "source": "Testdata" + "externalIdentifier": "E123", // change this to import another dummy entity + "externalSource": "Testdata" }; diff --git a/importer/testdata/edition_group.json b/importer/testdata/edition_group.json index 564b213..15aa0b5 100644 --- a/importer/testdata/edition_group.json +++ b/importer/testdata/edition_group.json @@ -18,10 +18,10 @@ }], "relationships": [] }, - "source": "Testdata" + "externalSource": "Testdata" }, "entityType": "EditionGroup", "lastEdited": "2024-07-22", - "originId": "G123", - "source": "Testdata" + "externalIdentifier": "G123", + "externalSource": "Testdata" } diff --git a/importer/testdata/edition_group.ts b/importer/testdata/edition_group.ts index 1186671..c65daff 100644 --- a/importer/testdata/edition_group.ts +++ b/importer/testdata/edition_group.ts @@ -20,10 +20,10 @@ export const entity: QueuedEntity = { }], "relationships": [] }, - "source": "Testdata" + "externalSource": "Testdata" }, "entityType": "EditionGroup", "lastEdited": "2024-07-22", - "originId": "G123", // change this to import another dummy entity - "source": "Testdata" + "externalIdentifier": "G123", // change this to import another dummy entity + "externalSource": "Testdata" }; diff --git a/importer/testdata/publisher.json b/importer/testdata/publisher.json index 0b77dd8..e5759c3 100644 --- a/importer/testdata/publisher.json +++ b/importer/testdata/publisher.json @@ -21,10 +21,10 @@ }], "relationships": [] }, - "source": "Testdata" + "externalSource": "Testdata" }, "entityType": "Publisher", "lastEdited": "2024-07-24", - "originId": "P123", - "source": "Testdata" + "externalIdentifier": "P123", + "externalSource": "Testdata" } diff --git a/importer/testdata/publisher.ts b/importer/testdata/publisher.ts index d514709..2280b07 100644 --- a/importer/testdata/publisher.ts +++ b/importer/testdata/publisher.ts @@ -23,10 +23,10 @@ export const entity: QueuedEntity = { }], "relationships": [] }, - "source": "Testdata" + "externalSource": "Testdata" }, "entityType": "Publisher", "lastEdited": "2024-07-24", - "originId": "P123", // change this to import another dummy entity - "source": "Testdata" + "externalIdentifier": "P123", // change this to import another dummy entity + "externalSource": "Testdata" }; diff --git a/importer/testdata/series.json b/importer/testdata/series.json index edf4905..34af281 100644 --- a/importer/testdata/series.json +++ b/importer/testdata/series.json @@ -19,10 +19,10 @@ }], "relationships": [] }, - "source": "Testdata" + "externalSource": "Testdata" }, "entityType": "Series", "lastEdited": "2024-07-24", - "originId": "S123", - "source": "Testdata" + "externalIdentifier": "S123", + "externalSource": "Testdata" } diff --git a/importer/testdata/series.ts b/importer/testdata/series.ts index 2c34c77..818cf49 100644 --- a/importer/testdata/series.ts +++ b/importer/testdata/series.ts @@ -21,10 +21,10 @@ export const entity: QueuedEntity = { }], "relationships": [] }, - "source": "Testdata" + "externalSource": "Testdata" }, "entityType": "Series", "lastEdited": "2024-07-24", - "originId": "S123", // change this to import another dummy entity - "source": "Testdata" + "externalIdentifier": "S123", // change this to import another dummy entity + "externalSource": "Testdata" }; diff --git a/importer/testdata/work.json b/importer/testdata/work.json index cf60e49..f6ef26b 100644 --- a/importer/testdata/work.json +++ b/importer/testdata/work.json @@ -18,10 +18,10 @@ }], "relationships": [] }, - "source": "Testdata" + "externalSource": "Testdata" }, "entityType": "Work", "lastEdited": "2024-07-17", - "originId": "W123", - "source": "Testdata" + "externalIdentifier": "W123", + "externalSource": "Testdata" } diff --git a/importer/testdata/work.ts b/importer/testdata/work.ts index 3b3db7a..8b5bb2c 100644 --- a/importer/testdata/work.ts +++ b/importer/testdata/work.ts @@ -20,10 +20,10 @@ export const entity: QueuedEntity = { }], "relationships": [] }, - "source": "Testdata" + "externalSource": "Testdata" }, "entityType": "Work", "lastEdited": "2024-07-17", - "originId": "W123", // change this to import another dummy entity - "source": "Testdata" + "externalIdentifier": "W123", // change this to import another dummy entity + "externalSource": "Testdata" };