robot icon indicating copy to clipboard operation
robot copied to clipboard

Add `--input-format` option

Open beckyjackson opened this issue 3 years ago • 8 comments

Resolves #1038

  • [x] docs/ have been added/updated
  • [x] tests have been added/updated
  • [x] mvn verify says all tests pass
  • [ ] mvn site says all JavaDocs correct
  • [x] CHANGELOG.md has 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).

beckyjackson avatar Sep 30 '22 17:09 beckyjackson

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.

jamesaoverton avatar Oct 01 '22 14:10 jamesaoverton

@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 :)

cthoyt avatar Oct 01 '22 14:10 cthoyt

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!

jamesaoverton avatar Oct 01 '22 15:10 jamesaoverton

@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 avatar Dec 01 '22 06:12 matentzn

@matentzn I think you're right, but I'm not sure we can add this feature if it is inherently broken.

balhoff avatar Dec 01 '22 16:12 balhoff

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.

matentzn avatar Dec 02 '22 10:12 matentzn

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.

balhoff avatar Dec 09 '22 03:12 balhoff

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.

jamesaoverton avatar Feb 07 '24 19:02 jamesaoverton