stuckyb/ontopilot

Standard input and input options on command line interface

Closed this issue · 16 comments

Great if we can have standard in and standard out using the command line interface. Or, having the ability to specify in and out using command line arguments (supporting both would be optimal). This would make it easier to use the pre-reasoner with other tools....

Okay, @jdeck88, I've implemented a basic inferencing pipeline mode for OntoPilot. You can run

$ ontopilot.py inference_pipeline -i INPUT -o OUTPUT

or

$ ontopilot.py ipl -i INPUT -o OUTPUT

where INPUT is the input data file and OUTPUT is the destination path for the reasoned data.

Note that OntoPilot still needs a config file to specify how to do the reasoning. This can either be in the same directory from where you launch OntoPilot, in which case OntoPilot will find it automatically, or you can specify its location via the -c/--config_file option.

The feature's not quite done -- I will next work on adding support for stdin/stdout. Thus, this feature's not yet been merged into the elk_pipeline branch, but you can start experimenting with it in master.

@jdeck88 -- Inference pipeline mode now supports reading from stdin (happens automatically if no input file is provided) and writing to stdout (if no output path is provided), so it should work with shell pipes and i/o redirects.

@jdeck88, the issue with checking configuration files should now be fixed. In fact, I overhauled configuration file handling in general, so that you can even run the inference pipeline mode without any configuration file at all. If you do that, though, you're stuck with the default settings!

@jdeck88 -- One other thing. When you have a chance to test this, could you let me know (or comment on the issue thread) if this feature is working and is good enough to do you what you need? If so, then I'll close the issue. Thanks!

@jdeck88, OntoPilot should only be trying to add imports if you are running one of the make commands (e.g., make ontology). If you run it in "inference pipeline" mode, it shouldn't be doing anything with the imports at all. Can you check how you are running OntoPilot?

Just tested and it works fine for me if I remove imported_ontologies.csv. E.g.:

$ ontopilot.sh -q inference_pipeline -i Incoming/unreasoned_data.ttl

runs without complaint if there is no imports file.

Note that Annie and I just finished the Java-only branch and merged that into master, and the Jython launch script is now in bin/ontopilot.sh.

I just merged master into elk_pipeline, so you should be good to go with that branch now, too.

Excellent! Considering this feature done, then.