rename command allows you to rename entity IRIs in an ontology in two ways:
Renames full IRIs (e.g.
http://foo.bar/BFO_1234567) in a file specified by
robot rename --input test.owl \ --mappings full-rename.tsv \ --add-prefix "fb: http://foo.bar/" --output results/full-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 entites (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
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.