Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

More details on a feature: [UXPROD-3874] and spike story: [MODELINKS-79]

Requirements

Functional Requirements

  1. The API must allow finding all applicable MARC authorities to control the MARC bib record based on the $0 subfield of the bib's fields.
  2. The API must provide only suggestions for links, and must not save any new data, saving will be performed by a user.
  3. The API must allow saving the MARC bib record even if linking a MARC bib field to a MARC authority record was unsuccessful.
  4. The API must allow sending a MARC record for links assignment with already existing links.
  5. The API must allow sending a MARC record for links assignment with not saved links and changes to the bib record.
  6. The API must provide a notification of what fields were successfully linked and what fields that are applicable for linking failed to link.
  7. The API must provide different types of failures for failed fields.

Non-Functional Requirements

  1. Automate linking should take no longer than ~2 seconds

Architecture

An API endpoint will be implemented in mod-quick-marc to provide UI with suggested links for the record. mod-quick-marc will work as a proxy module, that will call the mod-entities-links newly created endpoint. All main linking logic will be implemented in mod-entities-links. mod-search will be used as a search service for finding applicable MARC authorities. mod-source-record-storage will be used for fetching data needed to construct controllable fields in the MARC bib record. All interaction between modules is via HTTP.

...

Code Block
titleComponent Diagram Source
collapsetrue
@startuml
skinparam componentStyle rectangle

[User Interface]


package "Backend" {
  [Okapi] --> [mod-entities-links]
  [mod-entities-links] ..> [Okapi]
  [Okapi] --> [mod-search]
  [mod-search] ..> [Okapi]
  [Okapi] --> [mod-quick-marc]
  [mod-quick-marc] ..> [Okapi]
  [Okapi] --> [mod-source-record-storage]
  [mod-source-record-storage] ..> [Okapi]
}

[User Interface] --> [Okapi]
[Okapi] --> [User Interface]

database "PostgreSql" {
  [entities-links]
  [source-record-storage]
}

database "OpenSearch/ElasticSearch" {
  [authorities]
}

[mod-entities-links] <--> [entities-links]
[mod-source-record-storage] <--> [source-record-storage]
[mod-search] <--> [authorities]

@enduml

Data Flow and Processing

Code Block
languagetext
titlePlantUML diagram codeSequence Diagram Source
collapsetrue
@startuml
title QuickMarc Autolinking 

participant UI as ui
participant "quick-marc" as qm
participant "entities-links" as el
participant "search" as ms
participant "source-record-storage" as rs

autonumber
ui -> qm ++ : request record\nwith links
qm -> qm: convert
qm -> el ++ : request assign links
el -> el : get linking rules
el -> el : extract $0s
el -> ms ++ : search authorities (without count)
ms --> el -- : authorities
el -> rs ++ : get records by external ids
rs --> el -- : source records
el -> el : set links data
el --> qm -- : record with links
qm -> qm -- : convert
qm --> ui : record with links
@enduml
  1. The UI sends a request to the backend API.
  2. mod-quick-marc receives the request and converts the record into an SRS-like format.
  3. mod-quick-marc sends a request to the mod-entities-links API.
  4. mod-entities-links receives the request and fetches linking rules from the database using cache.
  5. From MARC bib fields that are applicable for linking according to linking rules, $0 subfield values are extracted.
  6. $0 values are used for search authorities in mod-search. The current mod-search endpoint also calculates a number of already existing links in the instance index, this should be omitted to speed up the process.
  7. mod-entities-links receives a collection of authority records and prepares a request to the mod-source-record-storage.
  8. mod-entities-links sends a request to the mod-source-record-storage bulk endpoint.
  9. mod-entities-links receives a collection of authority source records.
  10. mod-entities-links analyze results, prepare data for links according to linking rules, and set constructed links into the record.
  11. mod-quick-marc receives the record with links.
  12. mod-quick-marc converts the record into the appropriate format.
  13. UI receives the record with suggested links.

API Design