Skip to content

Add rename command#419

Merged
jamesaoverton merged 11 commits intoontodev:masterfrom
beckyjackson:rename
Mar 4, 2019
Merged

Add rename command#419
jamesaoverton merged 11 commits intoontodev:masterfrom
beckyjackson:rename

Conversation

@beckyjackson
Copy link
Contributor

@beckyjackson beckyjackson commented Dec 28, 2018

See #293

usage: robot rename --input <file> --mapping <file> --output <file>
 -A,--add-prefix <arg>      add a new prefix to ontology file header
    --catalog <arg>         use catalog from provided file
 -f,--full <arg>            table of mappings for renaming
 -h,--help                  print usage information
 -i,--input <arg>           load ontology from a file
 -I,--input-iri <arg>       load ontology from an IRI
 -noprefixes                do not use default prefixes
 -o,--output <arg>          save ontology to a file
 -p,--prefix <arg>          add a prefix 'foo: http://bar'
 -P,--prefixes <arg>        use prefixes from JSON-LD file
 -r,--partial <arg>         table of partial mappings for renaming
 -V,--version               print version information
 -v,--verbose               increased logging
 -vv,--very-verbose         high logging
 -vvv,--very-very-verbose   maximum logging, including stack traces
 -x,--xml-entities          use entity substitution with ontology XML
                            output

The --add-prefix option makes sure that the prefix appears in the final output file, which does not happen if you just use --prefix.

Right now, the --full and --partial files expect a header - should this be assumed? Or should we do no headers?

@beckyjackson beckyjackson changed the title WIP: Add rename command Add rename command Feb 4, 2019
@jamesaoverton
Copy link
Member

Hey everyone. We think this one is ready to go. Please try it out and give us some feedback.

Copy link
Member

@jamesaoverton jamesaoverton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like one change, please.

+ "This will rename two separate entities to have the same IRI, resulting in a merge."
+ "\nDo you wish to continue? [y/N]",
lineNum, mappingsFile.getPath(), nextLine[1]));
String cont = s.nextLine();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I given this some thought, and I've decided that promtping for user input is a bad idea. ROBOT is meant to be used for automation. None of our other commands are interactive. make will get stuck forever if it hits this warning, which will surprise and annoy our users.

I think the better alternatives are:

  1. just log a warning
  2. add a --fail-on-duplicates true/false option

o.addOption("m", "mappings", true, "table of mappings for renaming");
o.addOption("r", "prefix-mappings", true, "table of prefix mappings for renaming");
o.addOption("A", "add-prefix", true, "add a new prefix to ontology file header");
o.addOption("f", "allow-duplicates", true, "allow two or more terms to be renamed to the same full IRI");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--allow-duplicates is a better name, but now “f” is not a good short name. Maybe “a” or “d”, or no short name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants