Hi Steven,

Just another small tip for this:
 
I would say that for my use cases, a few extra clicks is less trouble than managing temporary edits to files and reverting them back again.

In the BaseX GUI you can make changes on the fly in the Editor window and click the Run query button, then just close the XQ file without saving. You don't need to save the file, run it, then revert your changes and save again.

-Tamara

On Thu, Apr 7, 2022 at 1:20 PM Majewski, Steven Dennis (sdm7g) <sdm7g@virginia.edu> wrote:

Reading the docs closer https://docs.basex.org/wiki/Graphical_User_Interface#Editor 
It looks like the best shortcut would be saving the results to an .xml file, and using the feature of right clicking on the file to bind to ‘.’ , however that doesn’t appear to work as described. 

I get a shorter menu of options that what’s shown in that doc: 

Open
Open Externally
Run Tests      (greyed out and inactive) 
Refresh 
Copy Path

No “set as context” option.

I’m running BaseX 9.7 on a Mac. 
Is this difference from the docs due to a Mac / PC difference, or has this capability changed and the docs not updated? 


I’ve also realized, after thinking about some more use cases, that due to the fact that results could be things other than nodes, like maps or arrays, or could be serialized differently, that there may be more issues than I had initially thought with simply binding results to context. 

I would say that for my use cases, a few extra clicks is less trouble than managing temporary edits to files and reverting them back again. 

— Steve M.


On Apr 7, 2022, at 1:25 PM, Tamara Marnell <tmarnell@orbiscascade.org> wrote:

Hi Steven,

To save a few clicks, you can create a new database directly from your results in XQuery, without saving them to a file first. Instead of returning the results outright, assign them to a variable to pass as the input to db:create() in the return, with a made-up file name for the path.

let $results := <results>{
  [Your original return in here]
}</results>
return db:create('my_results_db', $results, 'my_results.xml')

Then you can run further queries using db:open('my_results_db')/results, and DROP my_results_db in the command input bar when you don't need it anymore.

This isn't to say a new feature isn't a good idea, just that there's a way you can streamline your workflow before that feature exists!

-Tamara



On Thu, Apr 7, 2022 at 9:49 AM Majewski, Steven Dennis (sdm7g) <sdm7g@virginia.edu> wrote:

It would be handy if there was a way to bind results to current context for additional inspection/investigation/query of results. Currently, it seems, you would have to save results to a file and then create database from that file to make an additional query on results.
That binding would be available from editor or input bar.

Or perhaps alternatively, it could include an option to base visualizations on results instead of open database — although I’m guessing the former would be easier to implement than the latter.

— Steve Majewski



--

Tamara Marnell
Program Manager, Systems
Orbis Cascade Alliance (orbiscascade.org)
Pronouns: she/her/hers



--

Tamara Marnell
Program Manager, Systems
Orbis Cascade Alliance (orbiscascade.org)
Pronouns: she/her/hers