Skip to content

Centralise the publication's object metadata structure #11557

@touhidurabir

Description

@touhidurabir

Description:
With the #1550 , it's now possible to have plugins that can offer keyword from certain vocab list . This will add few more extra information in the controlled_vocab_entry_settings table such as source, identifier . However this also add 2 different vocab structure in the publication object .

basically in the publication object , the metadata say keywords are presented as

[
    "en" => [
      "Sociology",
      "Chemical sciences",
      "vocab-test-101",
    ],
  ]

The above structure what is expected when trying to retrieve the keywords from publication object as $publication->getData('keywords')

But then to have more meta information , we are expecting data structure like

    [
      "name" => "Sociology",
      "identifier" => "5.3",
      "source" => "Frascati",
    ],
    [
      "name" => "Chemical sciences",
      "identifier" => "1.4",
      "source" => "Frascati",
    ],
    [
      "name" => "vocab-test-101",
    ],
  ]

through the publication object, it's not possible to get that structure but need to use method as Repo::controlledVocav()->getBySymbolic(...) and se the last param $asEntryData to true .

However this cause major issue with component rendering to edit publication/submission/metadata as this structure with extra information is missing in the publication object , it cause the extra meta information missing in vue component which lead to silently loosing existing extra meta information . More details of this case at #11481 .

As part of fix for #11481 , we have applied the rehydrate approach only in those scenario when we need to make sure these extra meta information do persist before editing/updating , more details at #11481 (comment) . This approach is ok but still there is now 2 different data structure of metadata which leads to major technical debt in 3.5/main branch .

Solution:
The best solution should be to centralise to one certain metadata structure for publication object and to the structure of

    [
      "name" => "Sociology",
      "identifier" => "5.3",
      "source" => "Frascati",
    ],
    [
      "name" => "Chemical sciences",
      "identifier" => "1.4",
      "source" => "Frascati",
    ],
    [
      "name" => "vocab-test-101",
    ],
  ]

without making a breaking change to $publication->getData('keywords') which return back as

[
    "en" => [
      "Sociology",
      "Chemical sciences",
      "vocab-test-101",
    ],
  ]

the reason is to try to preserve the data structure of $publication->getData('keywords') (if that is possible) so that not to update the use of getData('keywords') all over the apps and many depending plugins/themes .

However this will cause breaking change to API response such as publication/{publicationId} .

What application are you using?
OJS, OMP or OPS version 3.5.0-0 and main

Additional information
Related issues :

  1. Allow a journal to define a limited set of allowed keywords and reviewer interests #1550
  2. Keywords Vocabulary, not persisting source&identifier on submission wizard reload #11481

Metadata

Metadata

Labels

Enhancement:3:MajorA new feature or improvement that will take a month or more to complete.

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions