geneontology / obographs

Basic and Advanced OBO Graphs: specification and reference implementation
64 stars 12 forks source link

Add a CLI for converting OWL -> JSON #80

Closed julesjacobsen closed 1 year ago

matentzn commented 2 years ago

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

balhoff commented 2 years ago

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

matentzn commented 2 years ago

Yes, but read above.

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

balhoff commented 2 years ago

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

joeflack4 commented 2 years ago

@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
julesjacobsen commented 2 years ago

Try using the obographs-cli.jar!

cmungall commented 2 years ago

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.

joeflack4 commented 2 years ago

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).

julesjacobsen commented 1 year ago

@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).
joeflack4 commented 1 year ago

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!