Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-4107

Represent metadata as a map instead of a list

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 7.0
    • Fix Version/s: 7.0
    • Component/s: REST API v7
    • Labels:
      None
    • Attachments:
      0
    • Comments:
      2
    • Documentation Status:
      Needed

      Description

      Currently, for most of the REST API, metadata values of DSOs are expressed in JSON as an array of objects, where each object has a "key" property, a "value" property, "language", and so on.

      {{{}}
        ...
        "metadata": [
          { "key": "dc.title", "value": "Title 1", "language": "en", ..},

          { "key": "dc.title", "value": "Title 2", "language": "en", ..}

        ]
      {{ }}}

      As recommended in the comments for [PR 2175|https://github.com/DSpace/DSpace/pull/2175], it would be preferable to express the metadata as a map, like this:

      {{ {}}
        ...
        "metadata": {
          "dc.title": [
            { "value": "Title 1", "language": "en", ..},

            { "value": "Title 2", "language": "en", ..}

          ]
      {{  }}}
      {{ }}}

      As noted in the PR 2175 comments, in the future this would allow projections to work on specific metadata and not on an all or nothing basis.

      In the more immediate term, it would bring metadata more in line with how it is modeled in the submission REST API sections/forms, as documented here: https://github.com/DSpace/Rest7Contract/blob/master/workspaceitem-data-metadata.md It would also simplify metadata PATCH operations for DSOs (see DS-3908), and make them more consistent with workspaceitem metadata PATCH requests.

      This work requires changes to the REST Contract, the rest implementation, and the angular UI.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              cwilper Chris Wilper
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: