DSpace.API.Metadata (dspace_ex v0.1.0-alpha2)

Copy Markdown View Source

Functions for working with metadata schemas and fields.

Summary

Functions

Creates a metadata field under the given schema.

Creates a metadata schema.

Deletes a metadata field.

Deletes a metadata schema.

Fetches a single metadata field by ID.

Fetches a single metadata schema by ID.

Finds metadata fields based on the given options.

Lists metadata fields of the repository.

Lists all metadata schemas of the repository.

Updates a metadata field.

Updates a metadata schema.

Functions

create_field(field, options \\ [])

@spec create_field(
  map(),
  keyword()
) :: DSpace.API.Operation.t()

Creates a metadata field under the given schema.

Executing this operation requires administrator privileges.

create_schema(schema, options \\ [])

@spec create_schema(
  map(),
  keyword()
) :: DSpace.API.Operation.t()

Creates a metadata schema.

delete_field(id)

@spec delete_field(binary()) :: DSpace.API.Operation.t()

Deletes a metadata field.

delete_schema(id)

@spec delete_schema(binary()) :: DSpace.API.Operation.t()

Deletes a metadata schema.

fetch_field(id)

@spec fetch_field(binary()) :: DSpace.API.Operation.t()

Fetches a single metadata field by ID.

fetch_schema(id)

@spec fetch_schema(binary()) :: DSpace.API.Operation.t()

Fetches a single metadata schema by ID.

find_fields(options \\ [])

@spec find_fields(keyword()) :: DSpace.API.Operation.t()

Finds metadata fields based on the given options.

This operation can be streamed.

Options

  • :name - exact fully qualified field (e.g., "dc.title", "dc.contributor.author")
  • :schema - prefix of the metadata schema (e.g., "dc", "eperson")
  • :element - a field's element (e.g., "contributor", "title")
  • :qualifier - a field's qualifier (e.g., "author")
  • :query – search term (e.g., "dc.ti", "contributor", "auth", "contributor.ot")
  • :page - Page number (0-based, defaults to 0)
  • :size - Number of items per page (usually defaults to 20)

list_fields(options \\ [])

@spec list_fields(keyword()) :: DSpace.API.Operation.t()

Lists metadata fields of the repository.

Providing a schema option limits the results to the fields defined by the schema. The API currently doesn't support providing several schemas at once.

This operation can be streamed.

Options

  • :schema - prefix of a metadata schema (e.g., "dc")
  • :page - Page number (0-based, defaults to 0)
  • :size - Number of items per page (usually defaults to 20)

list_schemas(options \\ [])

@spec list_schemas(keyword()) :: DSpace.API.Operation.t()

Lists all metadata schemas of the repository.

This operation can be streamed.

Options

  • :page - Page number (0-based, defaults to 0)
  • :size - Number of items per page (usually defaults to 20)

update_field(id, updates)

@spec update_field(binary(), map()) :: DSpace.API.Operation.t()

Updates a metadata field.

The API only supports updating the scope note of a field.

update_schema(id, updates)

@spec update_schema(binary(), map()) :: DSpace.API.Operation.t()

Updates a metadata schema.