Send an 'Instance creation' message to mod-inventory

Description

This task is for implementation of Linked Data counterpart of outbound connection to the Inventory/SRS.

Generally speaking we need to satisfy mod-inventory consumer expectations from , namely:

1) Kafka message contract:

  • topic naming pattern: {env}.{tenant}.linked-data.instance-ingress

  • topic pattern and DTO are defined in and also could be taken from mod-inventory source code after merging;

2) Each marc-bib json should contain 3 required fields:

  • Leader - already the case, it’s always presented;

  • Title (marc 245) - not implemented as always presented (validation to be added to BE API, returning 400 response in case no title provided during Instance create/update)

  • ControlField 008 - not implemented as always presented (sending 008 with spaces is enough)

3) Each Kafka message should be provided with required data:

  • eventType(CREATE_INSTANCE here)

  • InstanceIngressPayload.tenantId

  • InstanceIngressPayload.sourceType (LINKED_DATA here)

  • InstanceIngressPayload.sourceRecordIdentifier (random UUID to be used as Inventory ID)

  • InstanceIngressPayload.sourceRecordObject (marc-bib json)

  • InstanceIngressPayload.additionalProperties should contain linkedDataId key with our resource ID value

  • Kafka header x-okapi-url

  • Kafka header x-okapi-token

 

Testing scope:

  1. Create an instance in linked-data-editor.

  2. Wait for about 10 seconds.

  3. Search for the instance in Inventory application and ensure that the newly created Instance appear in the Inventory with source = LINKED_DATA

  4. Ensure that the following properties of Graph resource are appearing in the corresponding instance created in Inventory

Graph property

Property name in Inventory Instance

Instance - Title

Resource tile

Index title

Instance - Statement of responsibility

Suffixed to Resource title

Work - LC Classification

Classification - LC

Work - Dewey Classification

Classification - Dewey

Work - Content type

Resource type term

Environment

None

Potential Workaround

None

Attachments

12

Checklist

hide

Activity

Show:

Tetiana KovalchukJune 27, 2024 at 12:25 PM

Tested on qld env

Build version: #488

Test cases and evidences attached.

Pavel BobylevJune 26, 2024 at 9:41 AM
Edited

HI , have checked points you’ve posted earlier:

  1. Language. In case there is no language we send spaces in 008 field positions 35-37, which is expected. Then Inventory / data-import mapping engine converts it to first language among languages list. We could consider it as a bug on data-import mapping engine side, but for them, I guess, it’s probably not a problem as language is always presented in reality.

  2. Classification LC = Library of congress classification, sounds logical. Nothing to worry about as for me.

  3. Index title is Inventory specific field with some special logic described in the mapping rules here: marc_bib_rules.json. Most probably we don’t have to check mapping rules and result, it’s data-import mapping engine responsibility.

  4. System control number. There is actually our LD resource ID with ‘(ld)’ prefix, as it was required in design mentioned in MODINV-986 kb page . So it is expected I suppose. But probably we want another (or even new) ID type to be used here.

  5. Resource (content) type. It’s forced in marc_bib_rules.json to ignore repeated fields here, taking first one only. So it’s currently expected behavior of data-import mapping engine.

  6. Only one resource title - yes, it’s expected according to

The statements above is only my understanding, and only point 6 is proved. So let’s ask to double check points 1-5.

Tetiana KovalchukJune 25, 2024 at 8:43 AM
Edited

Hi , can you please look at the scenario when language is not indicated while resource creation in LDE however it is set with a first value in Inventory? Thanks.

  1. Classification is set as LC when ‘Library of congress classification’ selected (as far as I understand this is expected according to Excel file)

  1. Truncated value is being set into “Index title” field

  2. System control number is auto-added

  3. “Content type” does not show repeating values in Inventory

  4. Resource title shows one value (is it expected?)

Done

Details

Assignee

Reporter

Labels

Priority

Story Points

Sprint

Development Team

Citation

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created June 7, 2024 at 1:53 PM
Updated September 3, 2024 at 1:26 PM
Resolved July 5, 2024 at 12:57 PM
TestRail: Cases
TestRail: Runs