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

Copy Markdown View Source

Functions for working with DSpace Collections.

Collections are containers for Items in the DSpace hierarchy.

Summary

Functions

Creates a new collection.

Deletes a collection.

Fetches a single collection by UUID.

Fetches the default access conditions for a collection.

Fetches the parent community of a collection.

Finds collections using Discovery search.

Lists all collections from the repository.

Lists items that belong to the collection.

Replaces an existing collection.

Updates an existing collection.

Functions

create(collection, options \\ [])

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

Creates a new collection.

Collections must have a parent (a community or another collection).

Options

  • :parent - UUID of the parent community or collection

delete(uuid, options \\ [])

@spec delete(
  binary(),
  keyword()
) :: DSpace.API.Operation.t()

Deletes a collection.

fetch(uuid, options \\ [])

@spec fetch(
  binary(),
  keyword()
) :: DSpace.API.Operation.t()

Fetches a single collection by UUID.

fetch_default_access_conditions(uuid)

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

Fetches the default access conditions for a collection.

fetch_parent_community(uuid)

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

Fetches the parent community of a collection.

find(options \\ [])

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

Finds collections using Discovery search.

This operation can be streamed.

Parameters

Examples

# Find all collections
iex> Collection.find([])
%DSpace.API.Operation.JSON{path: "/api/discover/search/objects", ...}

# Find all collections with filters
iex> Collection.find(filters: [%{filter: "title", operator: "contains", value: "special"}])
%DSpace.API.Operation.JSON{...}

# Simple collection search with text query
iex> Collection.find(query: "digital archives")
%DSpace.API.Operation.JSON{path: "/api/discover/search/objects", ...}

# Search with additional filters
iex> Collection.find(query: "library", filters: [%{filter: "title", operator: "contains", value: "special"}])
%DSpace.API.Operation.JSON{...}

# Search within a specific community
iex> Collection.find(query: "research", scope: "community-uuid")
%DSpace.API.Operation.JSON{...}

list(options \\ [])

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

Lists all collections from 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)

list_items(uuid, options \\ [])

@spec list_items(
  binary(),
  keyword()
) :: DSpace.API.Operation.t()

Lists items that belong to the collection.

This operation can be streamed.

Options

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

replace(uuid, collection, options \\ [])

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

Replaces an existing collection.

update(uuid, updates, options \\ [])

@spec update(binary(), list(), keyword()) :: DSpace.API.Operation.t()

Updates an existing collection.