robot
robot copied to clipboard
Add `--input-format` option
Resolves #1038
- [x]
docs/have been added/updated - [x] tests have been added/updated
- [x]
mvn verifysays all tests pass - [ ]
mvn sitesays all JavaDocs correct - [x]
CHANGELOG.mdhas been updated
Creates a new global --input-format option which accepts one of the valid formats (owl, obo, owx, ofn, omn, ttl, or json) to specify which parser(s) to use when loading the ontology.
I would prefer to add manager to IOHelper instead of as a parameter for loadOntology, but that would require a big refactoring of the IOHelper class and potentially introduce some breaking changes? On the other hand, I don't want to build up a bunch of tech debt and this introduces a bunch more 'loadOntology' overrides. @jamesaoverton what do you think?
Last note - there were two test commands in the docs that were overwriting the example files. I fixed these so that they write to the results folder instead (had to remove an axiom to get the reason test to work).
I think this addresses the use case in the issue. Thanks!
I looked into the suggestion about storing the manager in the IOHelper instance, but our JavaDocs say @return a new ontology object, with a new OWLManager, so I think we can't do that.
@beckyjackson I am very happy you have been able to work on this - from a user perspective this will solve many of my debugging problems. Thank you :)
I created an issue to discuss auto-detection of formats. @beckyjackson Don't feel obligated to dive even deeper into this -- this is already a great start!
@balhoff There is nothing though we can do about it, right? The only thing we can do is document that behaviour on the docs pages and that's that...
@matentzn I think you're right, but I'm not sure we can add this feature if it is inherently broken.
I am not going to fight for this feature. I just want to point out it is inherently broken only in cases where owl:imports are involved.. But yeah, I am not sure if this downside completely invalidates this PR.
I think we might want to go ahead with this if we document the limitation well. I'm running into a problem in another project where I really need to specify the format. It's a huge ontology and running through all the parsers is hitting memory problems.
I don't have any plans for this, so I'm going to convert to Draft. If someone really wants this, feel free to push it forward.