Child pages
  • Jython Master Data Scripts
Skip to end of metadata
Go to start of metadata


openBIS defines as "Master data" all metadata configurations needed before the import of the real raw data. Master data includes experiment/sample/data set/property/file types, vocabularies and property assignments.

API Basics

Similarly to the Jython Dropbox API the script can access a global variable named service, which can be used to create transactions.

transaction = service.transaction()

The transactions are a focal API concept offering to create new types (e.g. createNewSampleType, createNewDataSetType) and new property assignments (e.g. assignPropertyType).

The complete Javadoc for the API is available at


The global service variable


The public API of the transaction objects

All classes

Javadocs for the complete API package

Simple example

import ch.systemsx.cisd.openbis.generic.client.jython.api.v1.DataType as DataType

tr = service.transaction()

expType = tr.createNewExperimentType('EXPERIMENT-TYPE')
expType.setDescription('Experiment type description.')

sampleType = tr.createNewSampleType('SAMPLE-TYPE')
sampleType.setDescription('Sample type description.')

dataSetType = tr.createNewDataSetType('DATA-SET-TYPE')
dataSetType.setDescription('Data set type description.')

materialType = tr.createNewMaterialType('MATERIAL-TYPE')
materialType.setDescription('Material type description.')

stringPropertyType = tr.createNewPropertyType('VARCHAR-PROPERTY-TYPE', DataType.VARCHAR)
stringPropertyType.setDescription('Varchar property type description.')

materialPropertyType = tr.createNewPropertyType('MATERIAL-PROPERTY-TYPE', DataType.MATERIAL)
materialPropertyType.setDescription('Material property type description.')

# assigns the newly created property 'MATERIAL-PROPERTY-TYPE'
# as a mandatory property for 'SAMPLE-TYPE'
materialAssignment = tr.assignPropertyType(sampleType, materialPropertyType)

# assigns the newly created property 'VARCHAR-PROPERTY-TYPE'
# as an optional property for 'EXPERIMENT-TYPE' with default value 'FOO_BAR'
stringAssignement = tr.assignPropertyType(expType, stringPropertyType)

Command line tools

Executing master data scripts

Make sure openBIS AS is up and running prior script execution. Go to the openBIS AS installation folder. Assuming your script is /local/ and openBIS AS is started on the URL http://localhost:8888/openbis  execute the command

> cd /local0/openbis/servers/openBIS-server/jetty/bin
> / -s http://localhost:8888/openbis/openbis -f /local/

You will be prompted for username/password before the script execution. Please note that the second 'openbis' is needed in the server address, so that you connect via the API.

Exporting master data

You can export the master data from a running openBIS system as script by running the command

> cd /local0/openbis/servers/openBIS-server/jetty/bin
> / -s http://localhost:8888/openbis/openbis

This command will create a folder exported-master-data-DATE which will contain the exported master data script -

  • No labels