OMP: insert languages in already published books without unpublishing them

Describe the issue or problem
Hi, we want to use the Workflow>Metadata>Languages field for book languages, but we have the problem to update previous published books.
We are exploring how to do it automatically.
Is it possible to update them using APIs?
Thanks and best regards
Stefano

What application are you using?
OJS 3.3.0.14

Hi @bolelligallevi,

It’s intentionally not trivial to revise the metadata of existing submissions, because that metadata needs to be send downstream to other services, and shouldn’t be “invisibly” changed. So the formal way to do this would be to create a new revision of each book, update the metadata, and re-publish.

(We talked a lot about “minor revisions” and whether/how to accommodate them, and it wasn’t uncontroversial! This is a tricky subject. But in short, when you ask scholars “in theory” whether minor metadata changes are good to support, most insist that revisions are important and should always be taken seriously; but in practice many will want that feature very frequently.)

If you’re sure you want to change/add the data and don’t want to trigger a whole revision process, the best way is probably to work with the database. You’ll need to work with the controlled_vocabs (and related) tables, which are a bit arcane. In short, you associate a language with a publication using…

  • An entry in controlled_vocabs:
    +---------------------+--------------------+------------+----------+
    | controlled_vocab_id | symbolic           | assoc_type | assoc_id |
    +---------------------+--------------------+------------+----------+
    |                  70 | submissionLanguage |    1048588 |       14 |
    +---------------------+--------------------+------------+----------+
    
    The publication ID (a.k.a. the specific version of the submission) is 14 in this example; 1048588 is a hard-coded constant and should stay the same. The controlled_vocab_id column is an auto-assigned ID.
  • An entry in controlled_vocab_entries:
    +---------------------------+---------------------+------+
    | controlled_vocab_entry_id | controlled_vocab_id | seq  |
    +---------------------------+---------------------+------+
    |                        51 |                  70 | 1.00 |
    +---------------------------+---------------------+------+
    
    The controlled_vocab_entry_id column is an auto-assigned ID. The seq is used to order multiple entries (if you have just one language, leave it at 1).
  • An entry in controlled_vocab_entry_settings:
    +-----------------------------------+---------------------------+--------+--------------------+---------------+--------------+
    | controlled_vocab_entry_setting_id | controlled_vocab_entry_id | locale | setting_name       | setting_value | setting_type |
    +-----------------------------------+---------------------------+--------+--------------------+---------------+--------------+
    |                                51 |                        51 | en     | submissionLanguage | English (eng) | string       |
    +-----------------------------------+---------------------------+--------+--------------------+---------------+--------------+
    
    controlled_vocab_entry_setting_id is an auto-assigned ID.

Thanks,
Alec Smecher
Public Knowledge Project Team

This topic was automatically closed after 9 days. New replies are no longer allowed.