Skip to end of metadata
Go to start of metadata

This section describes macro commands to retrieve information from metadata and to manipulate metadata. They were introduced with openBEB version 2.8.

Overview

The commands to set and retrieve values are different!

  • !set::metadata::parameters: Sets metadata value
  • !get::variablename::metadata::parameters: retreives metadata values. Note, that the parser waits, until the value is indeed retrieved.

Parameters

Icon

paramters: The parametrs are a SEMICOLON (;)separated list of arguments.

Note, hat both commands wait until the target module executed the get or set command using notifiers. See also the macro parser commands.

The metadata can be handled in the CORE program for the open collection or dataset, respectively. The following levels can be manipulated:

  • User description, e.g., operator name or annotation.
  • Protocol
  • Hierarchical coordinate

For data-sets, following information can be changed additionally:

  • Frame information
  • Embedded information (read-only)

Saving and displaying metadata

Icon

After changing metadata, you must save the metadata files:

metadata::write::{collection or dataset}

To display the changes, you also must update the GUI:

GUI::DisplayProtocol::{collection or dataset}
GUI::DisplayMetadata::{collection or dataset}

Integration in plug-ins

If you develop and want to support macro-integration of the core system (not necessarily target the active collection) you can embed following vi in your module:

COREClasses:CBMetadata:NDNacrointegration

Set values

The general command structure to set metadata values look as follows:

!Set::Metadata::parameters

Make sure, that after metadata manipulations are completed, the metadata are saved!

Retrieve Values

To get values, you must use the !get command! These are parser commands 

!get::variableName::metadata::parameters

The name is the variableName of the variable, the retrieved value is stored.

User description

setOperator

The Operator command changes the operator entry for collection or dataset metadata.

Usage

setOperator;value;{DataSet or Collection}

Example

# This example changes the operator e-mail address and saves the metadata
!set::metadata::setoperator;demo.operator@unibas.ch;collection
metadata::write::collection
#End of macros

getOperator

The Operator command changes the operator entry for collection or dataset metadata.

Usage

getOperator;{DataSet or Collection}

Example

# This example changes the operator e-mail address and saves the metadata
!get::Name::metadata::getOperator;collection
ask::Hello {name}!
#End of macros

 

setAnnotation

The Operator command changes the operator entry for collection or dataset metadata.

Usage

setAnnotation;value;[option];{collection or dataset}

option: optional, default is c

  • r: replaces the annotation. Existing annotations are overwritten
  • c: Concatenates existing annotations and the new annotation.

Example

setRating

Sets the rating (0..5) for the collection or dataset metadata.

Usage

rating;value;{collection or dataset}

value is an integer from 0 to 5. Values outside this range are coerced.

Example

 

 

setAccept?

Accepts or rejects a collection or dataset.

Usage

!set::Metadata::setAccept?;{dataset or collection}[;option]

If no option is provided, the collection or dataset is accepted.

option: 

  • r: dataset or collection is rejected

Example

 

 

Protocol

Three classses of commands are implemented:

  • !get: Retreive a value from the protocol (getfromID; getFromName)
  • !set: Sets a value in the protocol

See also this screen-cast for protocol handling.

getByID

Gets a value from the protocol ID.

Usage

getByID;IDvalue;{Dataset or collection}

  • variablename: Name of the notifier used to request the information and the name of the variable, where the information string is stored.
  • metadata: Identifier, that metadata information is requested (must be handled by the target openBEB module)
  • IDvalue: The protocol ID must be known. The ID is automatically created. Use the administration tool to investigate your protocol.
  • {protocolDataset or protocol}: Selects, if collection or dataset protocol is addressed

Example

getByName

Gets a protocol entry value by parent and item name

Usage

!get::variablename::metadata::getByName;ParentName;ItemName;{Dataset or collection}
  • variablename: Name of the notifier used to request the information and the name of the variable, where the information string is stored.
  • metadata: Identifier, that metadata information is requested (must be handled by the target openBEB module)
  • {protocolDataset or protocol}: Selects, if collection or dataset protocol is addressed

  • ParentName: Name of the parent of the protocol entry
  • ItemName: Name of the vocabulary entry

Example

setByID

Sets a value of a protocol entry by the vocabulary ID.

Usage

!set::metadata::setByID;ID;value;{collection or dataset}
  • parentName: Name of parent entry

  • childName: Name of child entry
  • value: New value for entry

  • {collection or dataset}: Target of entry to change

Example

setByName

Sets a value of a protocol entry according to the parent and child name.

Usage

!set::metadata::setByName::parentName;value;{collection or dataset}
  • ID: Vocabulary ID of entry

  • value: New value for entry

  • {collection or dataset}: Target of entry to change

Example

Hierarchical coordinate system

Commands to set or get coordinate information (setHC and getHC). For more information about the individual fields, please consult the metadata description page.

setHC

Set parameters of the hierarchical coordinate system. General form:

!set::Metadata::setHC;what;value;{dataset or collection}

Following parameters can be set (what)

  • X,Y,Z: Sets the XYZ parameters (in pm, see also scale)
  • Scale: Scale factor
  • ErrorX, ErrorY, ErrorZ: Errors (in pm) 
  • Description: Optional description of coordinate entry (arbitrary string).
  • Rootflag: Sets a flag if coordinate entry is the origin of a hierarchical coordinate tree. Value can be 0 or 1.
  • time: Sets the timestamp. Provide a number in seconds since 1.1.1904. A Double float number (DBL) is automatically converted to Timestamps.
  • ErrorTime: Provide an estimated error of the time stamp in s (DBL).
  • notApplicable: Sets a  to true if coordinate systems are not applicable. Value can be 0 or 1.

getHC

Gets coordinate information.

!get::requestedXCoordinate::metadata::getHC;what;{dataset or collection}

Following parameters can be requested (what)

  • X,Y,Z: Gets the XYZ parameters (in pm, see also scale)
  • Scale: Scale factor
  • ErrorX, ErrorY, ErrorZ: Errors (in pm) 
  • Description: Optional description of coordinate entry (arbitrary string).
  • Rootflag: gets the flag if coordinate entry is the origin of a hierarchical coordinate tree. Value can be 0 or 1.
  • time: Gets the timestamp. Provide a number in seconds since 1.1.1904. a fractional string is returned.
  • ErrorTime: Gets estimated error of the time stamp in s (DBL).
  • notApplicable: Sets a  to true if coordinate systems are not applicable. Value can be 0 or 1.
  • No labels
Write a comment…