ROBOT

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

Filter

The filter command allows you to create a new ontology from a source ontology by copying only the selected axioms. The remove command is the opposite of filter, allowing you to remove selected axioms. filter accepts the same options as remove and processes them in the same order. See remove for details on configuring the options.

By default, filter will include all axioms from the input ontology that contain one or more entities from the specified set. To be more strict and only include axioms in which all entities in the axiom are in the specified set, use --trim false.

Annotations

The filter command also includes a special --select "annotations" option. If this is included, all annotations on filtered terms will be included, regardless of if those properties are in the set of terms or not.

The following command will only return OBI:0000070 with just a label annotation:

robot filter --input obi.owl --term OBI:0000070 --term rdfs:label

Alternatively, if you want OBI:0000070 with all annotations:

robot filter --input obi.owl --term OBI:0000070 --select annotations

Examples

Copy a class (‘organ’) and all its descendants, with all annotations:

robot filter --input uberon_module.owl\
 --term UBERON:0000062\
 --select "annotations self descendants"\
 --output results/filter_class.owl

Copy all of OBI except descendants of ‘assay’ (remove is preferred):

robot filter --input uberon_module.owl\
 --term UBERON:0000062\
 --select annotations\
 --select descendants\
 --select complement\
 --output results/remove_class.owl

Copy a subset of classes based on an annotation property:

robot filter --input foo.owl --select "annotations classes"\
 --select "oboInOwl:inSubset='bar'" --output bar.owl