rename command allows you to rename entity IRIs in an ontology in two ways:
Renames full IRIs (e.g.
robot rename --input test.owl \ --add-prefix "fb: http://foo.bar/" \ --mapping obo:BFO_0000051 fb:BFO_1234567 \ --output results/rename.owl
If you have multiple terms you’d like to rename, you can do so by providing a mappings file (see Mappings Files):
robot rename --input test.owl \ --add-prefix "fb: http://foo.bar/" \ --mappings full-rename.tsv \ --output results/full-rename.owl
This process fails if where there are entities in the mapping file that are not in the ontology. To avoid failure you can
add the option
robot rename --input test.owl \ --mappings missing-rename.tsv \ --add-prefix "fb: http://foo.bar/" \ --allow-missing-entities true \ --output results/missing-rename.owl
If two or more old IRIs are mapped to the same new IRI, these two entities will be merged. By default, ROBOT will throw an error if this happens. This behavior can be overridden by including
Renames the base IRIs of all matching entities (e.g. change the prefix
http://foo.bar/), based on mappings in a file specified by
robot rename --input test.owl \ --prefix-mappings partial-rename.tsv \ --add-prefix "fb: http://foo.bar/" \ --output results/partial-rename.owl
More information on the
--add-prefix option can be found in Global Options.
The mappings for renaming should be specified with the
--mappings (for full renames) or
--prefix-mappings (for renaming prefixes) option. These should be either comma- or tab-separated tables. Each row should have exactly two columns: on the left, the IRI to replace, and on the right, the IRI to replace it with.
For a full rename (you can use prefixes as long as they are defined by the defaults,
Old IRI New IRI obo:BFO_0000051 fb:BFO_1234567
If you also want to update the
rdfs:label of the term you replaced, you can add a third column with the new label value (note that this removes all old label annotations):
Old IRI New IRI New Label obo:BFO_0000051 fb:BFO_1234567 foo bar
For a prefix rename:
Old Base New Base http://purl.obolibrary.org/obo/ http://foo.bar/
rename command expects the first line to contain headers.
Each row of the mapping file must have two columns: first, the old IRI, second, the new IRI. These must be separated by either a comma or a tab, depending on the file format.
This error occurs when two rows have the same ‘old IRI’ value. This will cause two rename operations to occur for the same IRI, resulting in unexpected values. Make sure each ‘old IRI’ is only entered in the mappings once.
This error occurs when two rows have the same ‘new IRI’ value. This will cause a merge of the two old IRIs into the new IRI. If this is the intended behavior, use
The mappings file must be comma-separated (ending in
.csv) or tab-separated (ending in
For a ‘full’ IRI replacement, the ‘old IRI’ must exist in the ontology. If not, nothing can be replaced and this error will be thrown.
This error occurs when the file provided for the
--prefix-mappings option does not exist. Check the path and try again.
This error occurs when a
--prefix-mappings file is not provided.
ROBOT could not generate the requested new IRI. This is often caused by a missing prefix declaration.