Versions Compared

Key

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

...

  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

mod-quick-marc

POST /records-editor/links/suggestion

This endpoint will be used to find and provide UI with valid links for a record. The request will include a JSON payload with the record data:

Code Block
{
  "marcFormat": "BIBLIOGRAPHIC",
  "leader": "01587ccm a2200361   4500",
  "fields": [
    {
      "tag": "001",
      "content": "393893"
    },
    {
      "tag": "100",
      "content": "$a 393893 $b test $0 n1234567890 $9 312da284-a8fd-4c84-ae90-927539d6df93",
      "indicators": [
        "1",
        "2"
      ],
      "link": {
        "authorityId": "312da284-a8fd-4c84-ae90-927539d6df93",
        "authorityNaturalId": "n1234567890",
        "linkingRuleId": 1,
        "status": "ACTUAL"
      }
    },
    {
      "tag": "100",
      "content": "$a 393893 $b test $0 n1234567890 $9 312da284-a8fd-4c84-ae90-927539d6df93",
      "indicators": [
        "1",
        "2"
      ],
      "link": {
        "authorityId": "312da284-a8fd-4c84-ae90-927539d6df93",
        "authorityNaturalId": "n1234567890",
        "linkingRuleId": 1,
        "status": "ERROR"
      }
    },
    {
      "tag": "600",
      "content": "$a 393893 $b test",
      "indicators": [
        "1",
        "2"
      ]
    }
  ]
}

The response will include suggested links with the status "NEW"; fixed data and status "ACTUAL" for links, that had the status "ERROR"; links with the status "ERROR" and cause type for fields where a link can't be assigned.

Code Block
{
  "marcFormat": "BIBLIOGRAPHIC",
  "leader": "01587ccm a2200361   4500",
  "fields": [
    {
      "tag": "001",
      "content": "393893"
    },
    {
      "tag": "100",
      "content": "$a 393893 $b test $0 n1234567890 $9 312da284-a8fd-4c84-ae90-927539d6df93",
      "indicators": [
        "1",
        "2"
      ],
      "link": {
        "authorityId": "312da284-a8fd-4c84-ae90-927539d6df93",
        "authorityNaturalId": "n1234567890",
        "linkingRuleId": 1,
        "status": "ACTUAL"
      }
    },
    {
      "tag": "100",
      "content": "$a 393893 $b updated $0 n1234567890 $9 312da284-a8fd-4c84-ae90-927539d6df93",
      "indicators": [
        "1",
        "2"
      ],
      "link": {
        "authorityId": "312da284-a8fd-4c84-ae90-927539d6df93",
        "authorityNaturalId": "n1234567890",
        "linkingRuleId": 1,
        "status": "NEW"
      }
    },
    {
      "tag": "600",
      "content": "$a 393893 $b test",
      "indicators": [
        "1",
        "2"
      ],
      "link": {
        "status": "ERROR",
        "errorCauseType": "1001"
      }
    }
  ]
}