stuckyb / ontopilot

15 stars 2 forks source link

Standard input and input options on command line interface #62

Closed jdeck88 closed 7 years ago

jdeck88 commented 7 years ago

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

stuckyb commented 7 years ago

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 commented 7 years ago

Ok, cool! it worked.

It complained about not having the [Ontology] section of the configuration file and that it couldn't find the ontology_file designation, so i put one in there to get it to be quiet, like:

[Ontology] ontology_file = Outgoing/dummy_file_that_is_never_written.owl

If we specify an output file on the command line we should not require that section.

Will the elk_pipeline branch merge into master at some point?

On Thu, Apr 20, 2017 at 12:53 PM, stuckyb notifications@github.com wrote:

Okay, @jdeck88 https://github.com/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.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/stuckyb/ontopilot/issues/62#issuecomment-295880346, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGdxX3oZRk31YIQeqSz8v83GKY7tvIgks5rx7e5gaJpZM4MtHdC .

-- John Deck (541) 914-4739

stuckyb commented 7 years ago

Good point, John. I'll work on improving configuration file checking.

Yes, I do want to merge the elk_pipeline branch at some point. The tricky thing is that it has the custom (i.e., hacked) version of ELK, and I don't want to merge that into the master branch. I'll get that sorted out as soon as I have some time. What I'll probably do is merge all of the new OntoPilot features (in particular, the DL over EL reasoning implementation) and leave the custom ELK in its own branch for now.

On 04/20/2017 06:58 PM, John Deck wrote:

Ok, cool! it worked.

It complained about not having the [Ontology] section of the configuration file and that it couldn't find the ontology_file designation, so i put one in there to get it to be quiet, like:

[Ontology] ontology_file = Outgoing/dummy_file_that_is_never_written.owl

If we specify an output file on the command line we should not require that section.

Will the elk_pipeline branch merge into master at some point?

On Thu, Apr 20, 2017 at 12:53 PM, stuckyb notifications@github.com wrote:

Okay, @jdeck88 https://github.com/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.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/stuckyb/ontopilot/issues/62#issuecomment-295880346, or mute the thread

https://github.com/notifications/unsubscribe-auth/ABGdxX3oZRk31YIQeqSz8v83GKY7tvIgks5rx7e5gaJpZM4MtHdC .

-- John Deck (541) 914-4739

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/stuckyb/ontopilot/issues/62#issuecomment-295955009, or mute the thread https://github.com/notifications/unsubscribe-auth/ADKD7_epy3PhrzAoXFtFOEm_woDNBc5Oks5rx-McgaJpZM4MtHdC.

stuckyb commented 7 years ago

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

awesome... i'll try this out.

On Fri, Apr 21, 2017 at 9:05 AM, stuckyb notifications@github.com wrote:

@jdeck88 https://github.com/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.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/stuckyb/ontopilot/issues/62#issuecomment-296232659, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGdxQEisLaO0Sly2WmljMi1UAkm2fN7ks5ryNPOgaJpZM4MtHdC .

-- John Deck (541) 914-4739

stuckyb commented 7 years ago

@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!

stuckyb commented 7 years ago

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

This looks good Brian. The features we discussed are working. One last thing that i noticed when playing around with this which i didn't think about earlier...

i've added an import statement to the unreasoned data files. Seeing that the import statement is in the data itself it seems redundant to import the ontology again in the configuration file. if i remove the import related statements from the configuration file, it goes back to the default location and complains with:

The top-level imports source file could not be found: /Users/jdeck/IdeaProjects/pheno_paper/bin/src/imports/imported_ontologies.csv.

However, i'd rather that it simply look instead in the input datafile for the imported ontology and not have to specify the import file at all. Maybe, a "no import" flag??

John

On Sat, Apr 22, 2017 at 12:30 PM, stuckyb notifications@github.com wrote:

@jdeck88 https://github.com/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!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/stuckyb/ontopilot/issues/62#issuecomment-296396057, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGdxWl719FhMbtyEBwmujXWi69ik0f0ks5rylVigaJpZM4MtHdC .

-- John Deck (541) 914-4739

stuckyb commented 7 years ago

@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?

jdeck88 commented 7 years ago

Ah--- ok, yes. i had it pointed to the master branch for checking the command-syntax... is this now all implemented in the elk_pipeline branch?

On Sat, Apr 22, 2017 at 5:47 PM, stuckyb notifications@github.com wrote:

@jdeck88 https://github.com/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?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/stuckyb/ontopilot/issues/62#issuecomment-296411380, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGdxb37iIbuOer1Iw5AQywrb6jkVDyyks5ryp-RgaJpZM4MtHdC .

-- John Deck (541) 914-4739

jdeck88 commented 7 years ago

ah, and i do see you mentioned this was running in the inference pipeline earlier... i'll test against that...

On Sat, Apr 22, 2017 at 5:57 PM, John Deck jdeck88@gmail.com wrote:

Ah--- ok, yes. i had it pointed to the master branch for checking the command-syntax... is this now all implemented in the elk_pipeline branch?

On Sat, Apr 22, 2017 at 5:47 PM, stuckyb notifications@github.com wrote:

@jdeck88 https://github.com/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?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/stuckyb/ontopilot/issues/62#issuecomment-296411380, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGdxb37iIbuOer1Iw5AQywrb6jkVDyyks5ryp-RgaJpZM4MtHdC .

-- John Deck (541) 914-4739

-- John Deck (541) 914-4739

jdeck88 commented 7 years ago

so, i don't see those arguments available in the elk_pipeline branch so looks like you haven't updated those features there yet.

and, i did have it in inference_pipeline mode using master.

did you try testing on your side by removing " bin/src/imports/imported_ontologies.csv"?

John

On Sat, Apr 22, 2017 at 5:58 PM, John Deck jdeck88@gmail.com wrote:

ah, and i do see you mentioned this was running in the inference pipeline earlier... i'll test against that...

On Sat, Apr 22, 2017 at 5:57 PM, John Deck jdeck88@gmail.com wrote:

Ah--- ok, yes. i had it pointed to the master branch for checking the command-syntax... is this now all implemented in the elk_pipeline branch?

On Sat, Apr 22, 2017 at 5:47 PM, stuckyb notifications@github.com wrote:

@jdeck88 https://github.com/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?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/stuckyb/ontopilot/issues/62#issuecomment-296411380, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGdxb37iIbuOer1Iw5AQywrb6jkVDyyks5ryp-RgaJpZM4MtHdC .

-- John Deck (541) 914-4739

-- John Deck (541) 914-4739

-- John Deck (541) 914-4739

stuckyb commented 7 years ago

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.

stuckyb commented 7 years ago

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

jdeck88 commented 7 years ago

ok, i tested it all out again this morning and working for me now... thanks!

On Sat, Apr 22, 2017 at 7:37 PM, stuckyb notifications@github.com wrote:

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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/stuckyb/ontopilot/issues/62#issuecomment-296415264, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGdxVVXCCGougkZfFnwZTIPHAIdL6NJks5ryrl7gaJpZM4MtHdC .

-- John Deck (541) 914-4739

stuckyb commented 7 years ago

Excellent! Considering this feature done, then.