CollectionSpace ID (CSID)

A CollectionSpace ID (abbreviated in some contexts as "CSID") is an arbitrary, implementation-independent identifier, used to identify each of the unique resources in a CollectionSpace system.

Generally, any unit or bundle of data in a CollectionSpace system that is capable of being accessed individually, as a resource, from CollectionSpace's Services Layer, will be addressable via its CollectionSpace ID.

Some representative examples of the many types of resources addressable via CSIDs include CollectionObjects, Intakes, Loans, Vocabularies and VocabularyItems.

CollectionSpace IDs are intended to be opaque and portable. That is, they should not have any relation to any identifier used by an underlying storage system or software component in a CollectionSpace system.

Some resources in CollectionSpace may also be identified by Short Identifiers, which tend to be more human readable than CSIDs.

Where Short Identifers are supported, you may use either a CSID or a Short Identifier to refer to a particular resource. In all other contexts in CollectionSpace, only CSIDs may be used as identifiers.

Example

The following are two illustrative examples of CollectionSpace IDs (CSIDs):

f47ac10b-58cc-4372-a567-0e02b2c3d479
ae616ceb-0ea6-462e-b29b

Formats

The two formats currently used for CollectionSpace IDs (CSIDs), generated internally by a CollectionSpace system, are:

  • An instance of a Version 4 Universally Unique Identifier (UUID).

    Version 4 UUIDs are 36-character strings. The following is a regular expression to match valid values of these UUIDs:
([a-z0-9\-]{8}-[a-z0-9\-]{4}-4[a-z0-9\-]{3}-[89ab][a-z0-9\-]{3}-[a-z0-9\-]{12})
  • An alternate instance of a UUID, a 23-character string.

    See CSPACE-2782 for more details regarding this format.

Generating

You can generate Version 4 UUIDs via the following simple Java class; copy the following text and paste it into a file named Guid.java:

import java.util.UUID;
public class Guid {
  public static void main( String args[] ) {
    UUID id = UUID.randomUUID();
    System.out.println( id.toString() );
  }
}

To compile this class from your operating system's command line, assuming Java is installed:

javac Guid.java

To run this class, and generate a new UUID:

java Guid

Alternatively, on Linux and OS X systems, you can generate UUIDs using the uuidgen command. The following command will generate and print a UUID:

$ uuidgen
5c0483d6-60a6-4e4a-a5b9-edd4e50c37b8

See Also