Skip to end of metadata
Go to start of metadata

Control Records

Control records are records that begin with a control action keyword. The BEL Script syntax supports the following control actions:

  • SET
  • DEFINE
  • UNSET

SET

The SET action instantiates an object of a given type and assigns specific properties to that object reference. This action is used in the Properties section to associate provenance information with the statements that follow in the Statements section, and in the Statements section to associate annotations with specific BEL Statements. The SET action can also define a new Statement Group.

Usage:

Sets an annotation value, statement group name, or a document level property. Document-level properties must be set before all other annotations and BEL Statements.
Once set, document-level properties cannot be cleared. If the same document-level property is set multiple times, the last value takes precedence.

If a statement group is set, all following statements will be associated with the statement group. If no statement group is set, all statements will be associated with the default (unnamed) statement group.

The annotation will be associated with all BEL Statements after this command unless it is explicitly cleared with the UNSET action. If the annotation is previously set, the SET action changes its value. Use commas (,) to separate multiple values for the same annotation.

Syntax:

SET [DOCUMENT ] name = value | {value, value,...}
SET STATEMENT_GROUP = value

Examples:

SET BodyPart = {"lung", "liver", "kidney"}
 
SET DOCUMENT Version = "1.0"
 
SET DOCUMENT License = "LGPL"
 
SET DOCUMENT Name = "Test Document"
 
SET STATEMENT_GROUP = "PubMed 123456"

DEFINE

The DEFINE action instructs the BEL Script interpreter to define a new object type and associate specific properties to that object type.

This action is used to define new Namespace references and new Annotation Types in the Definitions section of the BEL Script.

Usage:

Define a namespace or annotation in the document. Three value types are supported:

URL

A Uniform Resource Locator that can be used to retrieve a Namespace or Annotation Type definition.

LIST

A comma separated list of possible values, list surrounded by { and } characters. Can only be used with the ANNOTATION keyword.

PATTERN

A regular expression pattern that can be used to constrain the values associated with an Annotation Type. Can only be used with the ANNOTATION keyword


Syntax:

DEFINE [ ANNOTATION | [DEFAULT] NAMESPACE ] name AS [ URL | LIST | PATTERN ] value | { value, values, ...}

Examples:

The following example defines the EGID Namespace value. The Namespace identifier EGID is associated with the Namespace defined using the URL.

DEFINE DEFAULT NAMESPACE EGID AS URL \
	"http://resource.belframework.org/belframework/1.0/ns/entrez-gene-ids-hmr.belns"

This next example defines an Annotation Type named ExposureTime and restricts allowable values to the regular expression.

DEFINE ANNOTATION ExposureTime AS PATTERN "[0-9]+ hours"


This next example defines an Annotation Type named Dosage and restricts allowable values to the predefined set of values.

DEFINE ANNOTATION Dosage AS LIST {"low", "medium", "high"}

UNSET

The UNSET action clears one or more previously SET annotations such that any following BEL Statement does not get annotated with the annotations. If the UNSET action is applied to STATEMENT_GROUP any statements following the UNSET command will be assigned to the default statement group and all annotations associated will be restored to the state prior to the SET STATEMENT_GROUP command.

Usage:

The UNSET action can unset a single previously SET annotation, a list of previously SET annotation types or unset all currently set annotation types. Statements after the UNSET action will not be associated with the annotation unless they are explicitly set again with the SET action.

If the Annotation Type identified in the UNSET action is not defined, an Error will be generated during processing.

If the Annotation Type identified in the UNSET action is not SET, a Warning will be generated during processing.

Syntax:

UNSET [ name | { name, name,...} | ALL ]
 
UNSET STATEMENT_GROUP

Examples:

The following example will UNSET the ExposureTime Annotation Type.

UNSET ExposureTime  

 

This example will UNSET all currently set Annotations.

UNSET ALL does not work as documented. See https://github.com/OpenBEL/openbel-framework/issues/51.
UNSET ALL

 

This example will UNSET the Annotations names rating, quality and species.

UNSET {ExposureTime, Dosage, Species}

 

This example will UNSET the current Statement Group

UNSET STATEMENT_GROUP
  • No labels