-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Robot header #1154
Robot header #1154
Conversation
My first thought when I see the details of this implementation is that the row numbers in our error messages will be off by one, which will be confusing. |
CHANGELOG.md
Outdated
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
|
|||
## [Unreleased] | |||
|
|||
### Added | |||
-- Added option to input template strings from external file [##1152] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
##1152
should be just #1152
This link needs an expansion at the bottom of the file.
CURIE Label Parent Comment | ||
ID LABEL SC % A rdfs:comment | ||
obo:0000001 animal Any animal in the world. | ||
0000002 canine animal A member of the genus Canis. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this combined file supposed to include this error? The file doesn't seem to be used anywhere, so I would not include it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To answer my own question: Yes, I think this file is included to compare row numbers for errors. So I suggest naming this file animals_template_error.tsv
to match animals_ext_template_error.tsv
.
@@ -158,7 +159,7 @@ public static OWLOntology template( | |||
* Given an OWLOntology, an IOHelper, a map of table names to table contents, and a map of | |||
* template options, use the tables as templates to generate a merged output ontology. | |||
* | |||
* @param inputOntology OWLOntology to use to get existing entities | |||
* @param inputOntology OWLOntology to use to get existing entitfies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be "entities"
@@ -487,6 +492,8 @@ public static OWLOntology template( | |||
int idColumn = idColumns.get(tableName); | |||
int labelColumn = labelColumns.get(tableName); | |||
List<List<String>> rows = tables.get(tableName); | |||
// TODO The starting row has to be controlled by the approach used, ie, internal or external |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this TODO now done? If so the comment should be removed.
@pk-mitre I apologize for taking so long to review this PR. This is a good feature, and we really do appreciate your contribution! The problem is simply that nobody on the core ROBOT team has dedicated hours for this work. I made a few specific suggestions. If you have time to reply or make those changes, it would be appreciated. If you don't have time, let me know and I'll try to find time to finish the PR myself. The only major question I have at this point is: What to do if the template and the ext-template do not match? Eventually someone will add new columns to one and forget to add them to the other, then file a bug report here. I think that that best approach might be to check that the first row of the template and the ext-template are identical. What do you think? Thanks again! |
James: |
@pk-mitre Thank you for your continued work on this PR. I'm sorry that our schedules never seem to be in sync. Do you still plan to follow up on the case of a mismatch between the template and the ext-template? Please let me know either way. Thanks again! |
@jamesaoverton Yes, sorry I was working on a few other things. I will be following up on this mismatch issue and check things in. |
@jamesaoverton Am working through any potential additional error handling. With reference to your suggestion about checking the first row of the template file against the external template,I assume you mean the column count ? Since the first row in the template file is the header information, so it wouldn't be identical with the externalized template strings even in a correct case. For example: Template file: CURIE Label Parent Comment external template file: ID LABEL SC % A rdfs:comment |
@pk-mitre You're right, my request was confused. I'm worried about users changing the column structure of the template without changing the structure of the external template, or the other way around. I'm also worried that it's hard to tell which ROBOT template strings apply to which columns in the external template file. So now I suggest that the external template file has two rows: the first for header strings and the second for ROBOT template strings. ROBOT should then check that the first row of the two files is the same: the headers in the template file match the headers in the external template file. If the first rows of the two files are not exactly the same, ROBOT should quit with an error message. Template file: CURIE Label Parent Comment external template file: CURIE Label Parent Comment |
docs/template.md
Outdated
ROBOT template data read from separate external file | ||
|
||
robot template --template animals_ext_template.tsv \ | ||
--ext-template animals_template.tsv \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's confusing that --template
uses animals_ext_template.tsv
while --ext-template
uses animals_template.tsv
. The names of these files should be swapped.
@@ -49,6 +53,7 @@ public TemplateCommand() { | |||
"A", "include-annotations", true, "if true, include ontology annotations from merge input"); | |||
o.addOption("f", "force", true, "if true, do not exit on error"); | |||
o.addOption("e", "errors", true, "write errors to this path (TSV or CSV)"); | |||
o.addOption("E", "ext-template", true, "external robot template data file"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to call this external-template
without abbreviating the name of the option.
@jamesaoverton I have made the changes for the external template header error checking and also the file name changes to make it clearer as indicated in your comment on the naming. |
Thanks @pk-mitre! I skimmed the changes and they look good. I have a big deadline tomorrow, but I'll plan to finish reviewing on Friday. |
I'm going to merge this and make a new PR with a few changes. Sorry that this one took so long. Thanks for hanging in there and getting it done! |
@jamesaoverton Thanks for the merge, appreciate the work and the time. |
@jamesaoverton Thanks ! Glad it all merged in smoothly. |
@jamesaoverton This one line has to be updated to take into account the changed flag name: |
You're right. I fixed that in dc04a3c. I really wish we had a test to catch that, but I ran into a bunch of problems verifying this, and used up more time than I could afford. |
@jamesaoverton Thanks for all your help on this ticket ! |
Resolves #1152
docs/
have been added/updatedmvn verify
says all tests passmvn site
says all JavaDocs correctCHANGELOG.md
has been updatedAdds option to input template strings via an external file as described in Issue #1152