Skip to content

Metadata Management using GoCommands

GoCommands provides features to manage metadata for data objects, collections, resources, and users in the Data Store using the lsmeta, addmeta, and rmmeta commands.

Metadata consists of three components:

  • Name (Attribute): The name of information.
  • Value: The actual data or information.
  • Unit (Optional): Specifies the unit of measurement, if applicable.

List Metadata of Data Objects, Collections, Resources, or Users

gocmd lsmeta [flags] <irods-object>...

iRODS Objects

iROD Object Flag Description
data object or collection -P List metadata of data objects or collections
resource -R List metadata of resources
user -U List metadata of users

Example Usage

  1. List metadata of a data object:

    gocmd lsmeta -P /iplant/home/myUser/file.txt
    

  2. List metadata of multiple data objects:

    gocmd lsmeta -P /iplant/home/myUser/file1.txt /iplant/home/myUser/file2.txt
    

  3. List metadata of a collection:

    gocmd lsmeta -P /iplant/home/myUser/dir
    

  4. List metadata of a resource:

    gocmd lsmeta -R myResc
    

  5. List metadata of a user:

    gocmd lsmeta -U myUser
    

Add Metadata to Data Objects, Collections, Resources, or Users

gocmd addmeta [flags] <irods-object> <metadata-name> <metadata-value> [metadata-unit]

iRODS Objects

iROD Object Flag Description
data object or collection -P Add metadata to a data object or collection
resource -R Add metadata to a resource
user -U Add metadata to a user

Example Usage

  1. Add metadata to a data object:

    gocmd addmeta -P /iplant/home/myUser/file.txt meta_name meta_value
    

  2. Add metadata to a data object with metadata-unit:

    gocmd addmeta -P /iplant/home/myUser/file.txt meta_name meta_value meta_unit
    

  3. Add metadata to a collection:

    gocmd addmeta -P /iplant/home/myUser/dir meta_name meta_value
    

  4. Add metadata to a resource:

    gocmd addmeta -R myResc meta_name meta_value
    

  5. Add metadata to a user:

    gocmd addmeta -U myUser meta_name meta_value
    


Remove Metadata from Data Objects, Collections, Resources, or Users

gocmd rmmeta [flags] <irods-object> <metadata-ID-or-name>

Note: The metadata-ID is a numeric identifier for the metadata. It can be obtained from the output of the lsmeta command.

iRODS Objects

iROD Object Flag Description
data object or collection -P Remove metadata from a data object or collection
resource -R Remove metadata from a resource
user -U Remove metadata from a user

Example Usage

  1. Remove metadata from a data object by name:

    gocmd rmmeta -P /iplant/home/myUser/file.txt meta_name
    

  2. Remove metadata from a data object by ID:

    gocmd rmmeta -P /iplant/home/myUser/file.txt 979206950
    

  3. Remove metadata from a collection:

    gocmd rmmeta -P /iplant/home/myUser/dir meta_name
    

  4. Remove metadata from a resource:

    gocmd rmmeta -R myResc meta_name
    

  5. Remove metadata from a user:

    gocmd rmmeta -U myUser meta_name