Participants: | |
---|---|
Solution Architect | |
Product Owner | |
Java Lead |
Goal and requirements
Provide a solution for verify that the 004 value is an Instance record's HRID in the database
Requirements
- Ensure a MARC holdings record always has a 004 value AND only one such value
- Ensure that the 004 value is an Instance record's HRID
- Ensure the 004 value does not contain a subfield delimiter
- Cannot have multiple 004 values on a MARC Holdings record
- Ensure if an invalid 004 value is set in the MARC Holdings record then return an error message and do not allow the record to be created/saved to SRS
- Ensure that a valid 004 value links an Instance record to the MARC Holdings record as shown in the above screenshots
Example
- A Holdings record represents the location where one will find a title (referred to in FOLIO as an instance)
- Example: Book Title Harry Potter is held at the Main Library - Dekin Wing
- Harry Potter is a FOLIO instance record
- Main Library - Dekin Wing is a Holdings record in FOLIO
- Example: Book Title Harry Potter is held at the Main Library - Dekin Wing
- Every MARC Holdings record must have only one 004 value
- The 004 value is the Instance record HRID value that the Holdings record is linked
- Having a valid Instance record HRID in the 004 field is the only way that a user can view the Holdings record on FOLIO (see below examples)
- Without a valid Instance record HRID, the Holdings record is not discoverable via FOLIO and it is a meaningless record if an instance is not linked
Create MARC bib record
First of all, we should create marc bib record. To initiate records parsing one should send POST request containing RawRecordsDto, which contains raw records list ("initialRecords" field) to /change-manager/jobExecutions/{jobExecutionId}/records The list of records can contain records in different formats ("MARC_RAW", "MARC_JSON", "MARC_XML").
{jobExecutionId} - JobExecution id, which can be retrieved from response of previous request.
Post request on creation MARC bib
example of rawRecordsDto.json to parse marc records in json format:
- Or you can download via UI with 1record.mrc
Create MARC Holdings record with valid 004 field
During creation Marc Holdings with 004, will be executed verification in the SRM module, which will call request with parameter 004 field into SRS. If the 004 value is the Instance record HRID value that the Holdings record is linked and this record is located in database - we should successfully save Marc Holdings record without any error.
Example of Marc Holding raw record:
During testing on the rancher, MARC Holdings with VALID 004 field by uploading the file - one marc holdings.mrc As result we found record from SRS and MARC Holdings will be saved correctly:
Create MARC Holdings record without/with invalid 004 field
During creation Marc Holdings with 004, will be executed verification in the SRM module, which will call request with parameter 004 field into SRS. If the 004 value is the Instance record HRID value that the Holdings record is NOT linked and this record is NOT located in database - we will not save Marc Holdings record and receive error.
Example of Marc Holding raw record:
During testing on the rancher, file CornellFOLIOExemplars_Holdings.mrc use to load MARC Holdings and the 004 field has an HRID that does not exist in the database. As result we can see error in console:
When we import MARC Holdings with available and not available MARC Bib ids, so we receive the next log:
Module changes
SRM
Change logic for ChangeEngineServiceImpl by adding SRS client for retrieving record by 001 field from MARC bib.
- Write tests for cover new logic.
SRS
- Implement new endpoint for retrieving invalid marc bib ids
- Create separate endpoint for searching invalid marc bib
- Create new DTO for response
- Extend raml file by new endpoint
- Create service and dao layer
- Write tests for new functionality
Query for receiving invalid marc bib ids from database
Query for receiving invalid marc bib idsSELECT marc.hrid FROM (SELECT unnest(ARRAY['222222222222','in00000000313','111111111111','in00000000316']) as hrid) as marc LEFT JOIN diku_mod_source_record_storage.records_lb lb ON (lb.instance_hrid = marc.hrid and lb.record_type = 'MARC_BIB') WHERE lb.instance_hrid IS NULL
Testing process
Changes should be tested on the rancher environment.
- File to load MARC Holdings with invalid 004 field. The MARC bib HRIDs doesn't exists in database: CornellFOLIOExemplars_Holdings.mrc
- File to load MARC Holdings with valid 004 field. The MARC bib has been created before MARC Holdings: one marc holdings.mrc
Problems
The main problem during investigation is:
- When we load MARC Bib with 001 field, for example: 366832. After MARC Bib will be loaded, 001 field will be moved to 035, and 001 will be replaced by new generation HRID, for example: in00000012415. Then MARC Holdings will loaded with 004 field 366832. In this case, proposed approach will find in the SRS by 366832 value and MARC bib will be not find (because MARC Bib will saved by new HRID: in00000012415). As result MARC Holdings is not loaded.
Questions
Question | Answer |
---|---|
Which status do we need to return after data import was imported MARC Holdings with invalid 004 field? Complete with errors? Failed? | From Khalilah: Failed |
If file MARC Holdings partially consists of valid and invalid 004 field. For example: we have file with 3 records, on of them is correct, other - not. Will we save only one record? And which kind of status will be? Complete with errors? Failed? | From Khalilah: Completed with errors |
Data import must support a similar requirement today. Data import supports the ability to create/update Holdings record with the source = FOLIO. We need to find out what is being done that links a Holdings record to an Instance record and/or MARC bib record currently. Any validation in place? |