Configure metadata

Metadata is data that describes other data. "Meta" here means "an underlying definition or description". Metadata summarizes basic information about your data, which can make finding and working with your data easier.

Every item in a LIBSAFE Go data container has a unique item identifier and, by using this unique identifier, the platform is capable of associating metadata to it.

Metadata can be used for searching (even using complex queries) or to be exported or consumed by other systems. See Search and Queries for more details.

Metadata can be associated to the objects:

  • Manually, using the LIBSAFE Go Management Interface (for a single item or in bulk),

  • Loaded from a CSV, XML or JSON file,

  • Using the LIBSAFE Go API,

  • Using the LIBSAFE Go Lambda Functions (you can define code functions that will do rich and advanced extraction and processing to your metadata).

There are some metadata types like the file name, associated events or the container an item is in, that the platform is creating and maintaining for you, while there are metadata types that you can easily add to your objects using multiple methods.

All metadata in LIBSAFE Go is indexed and searchable.

Metadata fields that you would like to have assigned to your items are called Descriptors in LIBSAFE Go.

Descriptors are grouped into Metadata Schemas. For instance, when two departments with different metadata needs share a single LIBSAFE Go instance, each department can create its own schema. Eg: the Physics lab will have "Experiment ID", "Date" and "Creator" in their "Physics" metadata schema while the Biology department will have "Specimen name" and "Date" as their metadata schema. When the schema is assigned to a data container, they can use their own fields to describe the content they place in it.

Each Descriptor has a:

  • Name: That is shown in the Management Interface and helps users to easily identify them.

  • Description: That is shown in the Management Interface and helps users to understand context or instructions on how to fill certain descriptors.

  • IECode (Import/export code): That is used as a field identifier for the API and Functions, as a friendly name for the Descriptor.

  • Data type: is the type of data the field accepts:

    • String,

    • Multi-line string,

    • Date,

    • Linked field (includes a link to another item or to any HTTP external resource)

    • or Value list (enumerated list of possible values).

  • Category: Descriptors can be grouped visually in the Management Interface. Category defines this grouping, e.g. create a "Descriptive" category and create "Title " and "Author" inside. Create a "Rights" category and create the "Usage rights description" and "License" inside.

Field types are not yet validated when using the API (e.g. introducing a value for a Value list type descriptor that is not in the list of possible values). It is the user's responsibility to use them properly.

Using the web interface

To create a metadata schema:

1.- Go to Configuration and then to Object metadata

  1. In the submenu, select Categories first and use the Add Category button to create a category. You will need to have at least one for the next step.

  2. Go to Configuration and then to Object metadata (again), but this time select Metadata instead.

  3. Create a new schema using Add Schema. Give it a meaningful name related to the content you are going to use or the type of metadata that it will contain, e.g. "High energy experiments" or "Dublin Core".

  4. Select the option Show Descriptors for the one you have created.

  5. A new button Add Descriptor will appear to create your new descriptor. Select it.

  6. Fill in the form with the definition for the descriptor (see above for a description of each field in the descriptor):

  7. Name.

  8. Description.

  9. IECode (Import/export code).

  10. Data type:

    • String,

    • Multi-line string,

    • Date,

    • Linked field (includes a link to another item or to any HTTP external resource)

    • or Value list (enumerated list of possible values).

  11. Category: Select the category you created previously.

Select OK to save your new descriptor.

  1. Continue creating the descriptors you need.

Now, when you create a new container, LIBSAFE Go will ask you what is the declared metadata schema you want to use:

If you add an item to your container, you can right-click it, go to the Metadata tab, and you will find all descriptors you have created:

Using the API

API examples here are shown just for illustrative purposes. Check the LIBSAFE Go API documentation for additional information and all available methods.

To create a metadata schema using the API:

  1. Sign in to the LIBSAFE Go Management Interface

  2. Obtain your LIBSAFE Go API key selecting your name and then Access Methods:

  1. Use the following method to create the new metadata schema:

    curl 
    --request POST \    
    --url "$your_platform_url/api/containers/metadata/schema" \    
    --header 'Content-Type: application/json' \    
    --header "authorization: Bearer $your_platform_api_key" \    
    --data '{      "name": "New metadata schema",      "description": "Schema description"    }'

LIBSAFE Go answers you with the identifier of the created schema:

Alternatively, if you already created the schema, it is possible to get a list of them using:

curl 
--request GET \      
--url "$your_platform_url/api/containers/metadata/schema" \      
--header 'Content-Type: application/json' \      
--header "authorization: Bearer $your_platform_api_key" \
  1. Metadata fields are grouped into categories (to group them visually when using the Management Interface). As every metadata field needs to belong to one category, we need to create them in advance using the following method:

curl 
--request POST \      
--url "$your_platform_url/api/containers/metadata/category" \      
--header 'Content-Type: application/json' \      
--header "authorization: Bearer $your_platform_api_key" \      
--data '{        "name": "New metadata category",        "collapse": "no"      }'

LIBSAFE Go answers with the category id:

Alternatively, if you already created the category, it is possible to get a list of them using:

curl 
--request GET \      
--url "$your_platform_url/api/containers/metadata/category" \      
--header 'Content-Type: application/json' \      
--header "authorization: Bearer $your_platform_api_key" \
  1. Now, using the schema identifier and the metadata category identifier, you can create the item metadata field:

curl 
--request POST \     
--url "$your_platform_url/api/containers/metadata/schema/5/descriptor" \     
--header 'Content-Type: application/json' \     
--header "authorization: Bearer $your_platform_api_key" \     
--data '{"name": "New descriptor", "description": "Additional description for this field","iecode": "new_descriptor","container_metadata_category_id": 4,"data_type": "STRING"}'

The data_type parameter indicates the type of value the field contains, and possible values for it are:

  • STRING

  • LONGSTRING (for a multi-line text box)

  • NUMBER

  • DATE (in YYYY-MM-DD format)

  • BOOL (true or false)

  • LINK_FIELDS (a link to other system file)

  • ENUM (the management interface offers a selection for the possible values for the field. (The API DOES NOT ENFORCE OR VALIDATE THEM).

For using the ENUM, you should include an additional parameter in the query with the possible values using "enum_values": [ "Value 1", "Value 2" ]

Last updated