Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider making the --output argument more universal (particularly robot export & query) #1222

Open
allenbaron opened this issue Nov 8, 2024 · 3 comments

Comments

@allenbaron
Copy link
Contributor

Would it be possible to add --output / -o as an argument to robot export as an alias for the --export argument. Most of the other robot commands (report, extract, etc.) use --output so I invariably try it for robot export and forget that it is not there until I get the error (and then have to look it up).

A similar thing happens when I use robot query with the --query argument. I often specify the output path with the -o argument but it is only an accepted input in connection with the --update argument. It is unusual to me that the --query argument takes two strings, the path to the query and the path for the output.

It seems maybe originally the -o option was meant to apply only for ontology output files? The use of -o in robot report does break that pattern though. I imagine it would be possible to implement these changes without altering the current behavior of the functions. robot query would probably be the hardest to fix.

I would offer a fix myself but don't have the bandwidth at this time (and basically no experience with java). This does not need to be high priority since it is primarily an inconvenience.

Thanks!

@balhoff
Copy link
Contributor

balhoff commented Nov 8, 2024

@allenbaron I've also been tripped up sometimes by --query taking two arguments, but finally realized it's because you can specify any number of queries on the same command line, each with their own output. It's quite a bit more efficient this way vs. chaining multiple query commands. Maybe robot could be extra smart and pass along the internal triplestore it creates, in addition to the ontology, when query commands are chained.

@allenbaron
Copy link
Contributor Author

@balhoff Oh man. I had no idea. That is definitely more efficient for running multiple queries. I knew you could do multiple updates because it's described in the documentation but I hadn't seen anything about multiple --query statements with multiple outputs. That does make sense. I guess that does complicate things a bit more for robot query.

I wonder if the documentation page should be updated to reflect this ability? I'm looking again and can't seem to find anything about it.

@jamesaoverton
Copy link
Member

I reread the first part of the query doc, and I agree that it's not clear that you can use --query SPARQL RESULT multiple times. A PR to improve https://github.com/ontodev/robot/blob/master/docs/query.md would be appreciated.

allenbaron added a commit to DiseaseOntology/DO.utils that referenced this issue Dec 12, 2024
Learned that this may be unnecessary... probably better to
update robot_query() so it's psuedo-vectorized.

See ontodev/robot#1222
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants