ROBOT

- - - - - - - - - -
view on github
getting started
common errors
chaining commands
global options
makefile
plugins
- - - - - - - - - -
annotate
collapse
convert
diff
expand
explain
export
export-prefixes
extract
filter
materialize
measure
merge
mirror
python
query
reason
reduce
relax
remove
rename
repair
report
template
unmerge
validate-profile
verify
- - - - - - - - - -
ROBOT is licensed under the
BSD 3-Clause License.
Theme by orderedlist

ROBOT is an OBO Tool

ROBOT is a tool for working with Open Biomedical Ontologies. It can be used as a command-line tool or as a library for any language on the Java Virtual Machine.

Click on the command names in the sidebar for documentation and examples, and visit our JavaDocs for robot-core and robot-command for technical details.

For a “how-to” covering the major commands and features of ROBOT, visit our tutorial located here.

Cite ROBOT

R.C. Jackson, J.P. Balhoff, E. Douglass, N.L. Harris, C.J. Mungall, and J.A. Overton. ROBOT: A tool for automating ontology workflows. BMC Bioinformatics, vol. 20, July 2019.

1. Getting Started

The command-line tool is packaged a Java JAR file and can be run via the robot shell script. Before getting started, make sure you have Java 11 or later installed. Check by entering java -version on the command line.

Mac & Linux

  1. Download the robot.jar file from the latest release.
  2. Save the ROBOT shell script.
    • OR enter curl https://raw.githubusercontent.com/ontodev/robot/master/bin/robot > robot in the same directory as robot.jar to download it from the terminal.
    • Then, make sure the script is executable: sudo chmod u+x [path-to-robot-script] (replace [path-to-robot-script] with your location)
  3. Put both files on your system PATH in the same directory.
    • this could be /usr/local/bin/
    • OR update your PATH to include the new directory. Follow the Solaris/Linux directions for Mac OS, except instead of updating .bashrc, you will need to update your .bash_profile.
  4. Make sure robot is executable by running sudo chmod +x robot from the terminal in the same directory. This will require you to enter you password.
  5. Now you should be able to run ROBOT from a command line:

     robot help
    

Windows

  1. Download the robot.jar file from the latest release.
  2. Save the ROBOT batch script.
    • Make sure this is saved as .bat and not .bat.txt
    • OR in PowerShell, run "java %ROBOT_JAVA_ARGS% -jar %~dp0robot.jar %*" | out-file robot.bat -encoding utf8 in the same directory as robot.jar to create the batch script.
    • Note that the above command requires PowerShell version 6 or later: previous versions will write a Unicode byte order mark (BOM) to the file, which breaks the command.
  3. Put both files on your system PATH in the same directory.
  4. Make sure robot.bat is executable by running icacls robot.bat /grant Users:RX /T from the command prompt in the same directory.
  5. Now you should be able to run ROBOT from a command line:

     robot help
    

Docker

ROBOT is part of the Ontology Development Kit Docker image, and as a stand-alone Docker image.

To use the Docker image, you can install it like this:

docker pull obolibrary/robot

To use the Docker image, you can run:

docker run -v $PWD/:/work -w /work --rm -ti obolibrary/robot robot --version

Or, on Windows:

docker run -v D:/ontology:/work --rm -ti obolibrary/robot robot --version

Where D:/ontology is the directory that contains the ontology or ontologies you want to work on (there is no equivalent for $PWD on Windows when running a command on the command line directly).

2. Using the Library

ROBOT is written in Java, and can be used from any language that runs on the Java Virtual Machine. It’s available on Maven Central and javadoc.io. The code is divided into two parts:

  1. robot-core is a library of operations for working with ontologies (Maven Central, javadoc.io)
  2. robot-command is a command-line interface for using those operations (Maven Central, javadoc.io)

You can also download the standalone robot.jar file from the latest release to include in your projects.

The robot-core library provides a number of Operation classes for working with ontologies. The IOHelper class contains convenient methods for loading and saving ontologies, and for loading sets of term IRIs. Here’s an example of extracting a “core” subset from an ontology:

IOHelper ioHelper = new IOHelper();
OWLOntology full = ioHelper.loadOntology("ontology.owl");
Set<IRI> coreTerms = ioHelper.loadTerms("coreTerms.txt");
OWLOntology core = ExtractOperation.extract(full, coreTerms);
ioHelper.saveOntology(core, "core.owl");

Alternatively:

IOHelper ioHelper = new IOHelper();
ioHelper.saveOntology(
  ExtractOperation.extract(
    ioHelper.loadOntology("ontology.owl"),
    ioHelper.loadTerms("coreTerms.txt"),
    IRI.create("http://example.com")
  ),
  'core.owl'
);