obographs icon indicating copy to clipboard operation
obographs copied to clipboard

Add a CLI for converting OWL -> JSON

Open julesjacobsen opened this issue 2 years ago • 8 comments

julesjacobsen avatar Apr 20 '22 08:04 julesjacobsen

If it is at all possible than the way back (JSON->OWL) would be very appreciated as well.

matentzn avatar Apr 20 '22 09:04 matentzn

Doesn't ROBOT do this already? (OWL -> JSON)

balhoff avatar Apr 20 '22 12:04 balhoff

Yes, but read above.

Problem is that phenol uses the new obographs which cannot read the old obographs files..

matentzn avatar Apr 20 '22 12:04 matentzn

Ah - I guess we can move forward in ROBOT now that we dropped support for Java 8.

balhoff avatar Apr 20 '22 12:04 balhoff

@julesjacobsen Are there any docs for the CLI? I tried running --help on the .jar, but no luck.

java -jar obographs-core-0.3.0.jar --help
no main manifest attribute, in obographs-core-0.3.0.jar
java -jar obographs-core-0.3.0.jar -help
no main manifest attribute, in obographs-core-0.3.0.jar

joeflack4 avatar Oct 17 '22 20:10 joeflack4

Try using the obographs-cli.jar!

julesjacobsen avatar Oct 19 '22 16:10 julesjacobsen

I'm a bit confused here. I don't understand why phenol is relevant on a question about a CLI for obographs

I think for CLI usage of this library, we should direct people to robot. There is excellent hosted documentation, it is available in the ODK docker, there is a single locus for support.

I think using obographs-cli.jar is great for developers of this library, we can easily test branches and new releases.

But for @joeflack4 there is no advantage to using the native CLI over using ROBOT.

cmungall avatar Oct 19 '22 18:10 cmungall

Good to know. I know this is thus not high priority, but @julesjacobsen FYI, obographs-cli.jar is not in the releases. Ideally I would also ask that the README have a table of params for the CLI too as well; again, not a high priority since there are are other means (e.g. robot).

joeflack4 avatar Oct 19 '22 20:10 joeflack4

@joeflack4 the cli is self-documented:

$ java -jar obographs-cli-0.3.0.jar 
Usage: obographs [-hV] [COMMAND]
OBO Graphs: Developer-friendly graph-oriented ontology in JSON/YAML
  -h, --help      Show this help message and exit.
  -V, --version   Print version information and exit.
Commands:
  convert   converts OWL to obographs JSON
  validate  validates an obograph file
$ java -jar obographs-cli-0.3.0.jar convert
Missing required parameter: 'FILE'
Usage: obographs convert [-f=<format>] [-o=<outDir>] FILE...
converts OWL to obographs JSON
      FILE...              OWL/OBO file(s) to process.
  -f, --format=<format>    Output format for obograph files.
                           The format parameter is optional (defaults to
                             `all`), and is used to specify the output format
                             (s) of converted files.
                           The possible options are:
                            * json - Write to JSON.
                            * yaml - Write to YAML.
                            * all - Write both JSON and YAML.
  -o, --out-dir=<outDir>   Output directory for converted files (defaults to
                             input directory).

julesjacobsen avatar Apr 27 '23 08:04 julesjacobsen

Hey @julesjacobsen. Thanks for letting me know. I haven't used this library directly since my comment. But I just checked, and the obographs-cli-0.3.0.jar is still not in the releases, and I don't see anything about it in the documentation (i.e. GH home page). I am able to download obographs-core-0.3.0.jar which is what I was referring to last time, but that one is not self documented. Either way I think a --help is nice to have. Most importantly, this is probably moot from my perspective at least, since Chris tells me that there's no advantage to using this over robot, so I will continue to do that!

joeflack4 avatar Apr 27 '23 19:04 joeflack4