opencitations / api

Software for creating REST API
1 stars 1 forks source link

Enhance editor field handling for book chapters and proceedings articles #16

Closed arcangelo7 closed 1 month ago

arcangelo7 commented 1 month ago

We need to improve our handling of the "editor" field in the Meta API, particularly for book chapters and potentially for proceedings articles. Currently, the API returns only the data present in the database without additional processing. However, this approach can lead to missing information for certain types of bibliographic resources.

Current behavior:

Proposed enhancement:

arcangelo7 commented 1 month ago

I we have implemented the enhancement.

The new functionality has been added in the following commit: https://github.com/opencitations/api/commit/654b5cdb797603c0d90d157e3be088509ffd7cc7

Here's how the new implementation works:

  1. For any resource that has a frbr:partOf relationship (i.e., it has a container), we now combine the editors of the resource itself with those of its container.
  2. The combination logic is as follows:

    • If both the resource and its container have editors, we display the sum of both sets of editors.
    • If only the resource has editors, we display those.
    • If only the container has editors, we display the container's editors.
    • If neither has editors, no editors will be displayed.

This enhancement ensures that for book chapters and proceedings articles, where editors are often specified at the book or proceedings level, we now provide more complete metadata through the Meta API.