Skip to content

Latest commit

 

History

History
107 lines (78 loc) · 3.65 KB

metadatafields.md

File metadata and controls

107 lines (78 loc) · 3.65 KB

Metadata Fields Endpoints

Back to the list of all defined endpoints

Main Endpoint

/api/core/metadatafields

Provide access to the metadata fields defined in the registry (DBMS based). It returns the list of existent metadata fields.

Example: http://dspace7.4science.it/dspace-spring-rest/#/dspace-spring-rest/api/core/metadatafields

Single Metadata Field

/api/core/metadatafields/<:id>

Provide detailed information about a specific metadata field. The JSON response document is as follows

{
  "id": 8,
  "element": "contributor",
  "qualifier": "advisor",
  "scopeNote": "Use primarily for thesis advisor.",
  "type": "metadatafield"
}

Exposed links:

  • schema: the metadata schema to which the item belongs

Linked entities

Schema

/api/core/metadatafields/<:id>/schema

Example: https://dspace7.4science.it/dspace-spring-rest/#https://dspace7.4science.it/dspace-spring-rest/api/core/metadatafields/8/schema

It returns the metadata schema which the metadata field belongs. See the Metadata Schema endpoint for more info](metadataschemas.md#Single Metadata Schema)

Search methods

bySchema

/api/core/metadatafields/search/bySchema?schema=<:prefix>

Example: https://dspace7.4science.it/dspace-spring-rest/#https://dspace7.4science.it/dspace-spring-rest/api/core/metadatafields/search/bySchema?schema=dc

The supported parameters are:

  • (mandatory) schema, the prefix of the metadata schema (i.e. "dc", "dcterms", "eperson, etc.)
  • page, size see pagination

Return codes:

  • 200 OK - if the operation succeed

byFieldName

/api/core/metadatafields/search/byFieldName

This endpoint supports the parameters (any combination of parameters is allowed):

  • schema, an exact match of the prefix of the metadata schema (e.g. "dc", "dcterms", "eperson")
  • element, an exact match of the field's element (e.g. "contributor", "title")
  • qualifier, an exact match of the field's qualifier (e.g. "author", "alternative")
  • query, part of the fully qualified field, should start with the start of the schema, element or qualifier (e.g. "dc.ti", "contributor", "auth", "contributor.ot")
  • exactName, The exact fully qualified field, should use the syntax schema.element.qualifier or schema.element if no qualifier exists (e.g. "dc.title", "dc.contributor.author"). It will only return one value if there's an exact match
  • page, size see pagination

Examples:

  • /api/core/metadatafields/search/byFieldName?schema=dc&query=author
  • /api/core/metadatafields/search/byFieldName?query=id&qualifier=uri

Return codes:

  • 200 OK - if the operation succeed

Creating a Metadata Field

POST /api/core/metadatafields?schemaId=<:schemaId>

To create a metadata field, perform a post with the JSON below when logged in as admin.

{
  "element": "contributor",
  "qualifier": "tester",
  "scopeNote": "An agent which provided illustrations for the resource",
  "type": "metadatafield"
}

Updating a Metadata Field

PUT /api/core/metadatafields/<:id>

Provide updated information about a specific metadata field, when the update is completed the updated object will be returned. The JSON to update can be found below.

{
  "id": 7,
  "element": "coverageUpdated",
  "qualifier": "spatialUpdated",
  "scopeNote": null,
  "type": "metadatafield"
}

Deleting a Metadata Field

DELETE /api/core/metadatafields/<:id>

Delete a metadata field.

  • 204 No content - if the operation succeed
  • 401 Unauthorized - if you are not authenticated
  • 403 Forbidden - if you are not logged in with sufficient permissions
  • 404 Not found - if the metadata field doesn't exist (or was already deleted)