Writing a new Query

To write a new query in Barista you must create a text file inside one of an Eclipse project. Query files must have as file extension .soul.

After having created the query file, double-clicking on it will  open it on the default Query Editor. The Query Editor is divided in three sections: Query Configuration, Query and Prepare.

Query Configuration: In this pane you can select on which project the query will be executed, using which library, and with which evaluator. By default the project points to the project in which the query file is located, the library is JavaEclipse, and the Evaluator is the default Evaluator. Note that query configuration parameters are not saved between sessions.

You can also select whether the results of running the query will be shown on a new Query Window, or whether the same window will be recycled.

Query: this part contains the query to run. The editor provides a number of convinence services:

  • Syntax highligthing
  • Context help for clauses: Hovering with the mouse over a clause will show the definition(s) for that clause.
  • Syntax error notification: syntax errors in the query are marked on the left hand side of the editor. Syntax errors are marked only after preparing a query.
  • Auto-completion for clauses: This is invoked through the default Eclipse trigger combination (Ctrl+Space, Cmd+Space, etc)
editorFeatures_2.png

Prepare query: This button prepares the query for execution. After clicking it, a (new) Query Result view will open.

 

Having written and preparing a query, it is possible to run and inspect the results of the query.