Graphical User Interface

From BaseX Documentation

(Redirected from GUI)
Jump to: navigation, search

This page is part of the Getting Started Section.


[edit] Startup

First of all, launch a GUI instance of BaseX. Depending on your operating system, double-click on the BaseX GUI start icon or run the basexgui script. Beside that, some more startup options are available.

Select DatabaseNew and browse to an XML document of your choice. You can start with the factbook.xml document, which contains statistical information on the worlds' countries. It is included in our full releases (in the etc directory) and can also be downloaded (1.3 MB). If you type nothing in the input field, an empty database will be created. Next, choose the OK button, and the database will be created.

If no XML document is available, the Text Editor can be used to create and edit XML documents. After saving the document to disk, it can be supplied as input for the creation of the database.

[edit] Text Editor

The built-in text editor is a powerful tool for writing XQuery scripts and modules, and for developing full RESTXQ applications. It can also be used to edit XML documents, Command Scripts, and any other text files:

Numerous keyboard shortcuts are available to speed up editing and debugging.

Introduced with Version 9.1: If you right-click on an XML document in the Project View, the selected file will be parsed and bound to the context item:


[edit] Project View

The Project View is attached to the editor panel. It displays all files of the current project directory in a tree structure. Files can be renamed and deleted by right-clicking on the files. The project directory can be changed as well; the most recent directories will be kept in the history.

All XQuery files in the project directory will be parsed in the background. Buggy XQuery modules, and files importing these modules, will be marked red. With the text fields on top, you can interactively search for file names and contents.

[edit] Input Bar

On top of the main window, you can find an input bar. The attached dropdown menu provides three modes: Find, XQuery and Command:

Input Bar

The upcoming example queries can all be used with an instance of the factbook database:

[edit] Find

In the Find mode, the input bar can be used to find single elements and texts in the currently opened database. The following syntax is supported:

Query Description
city Find elements named city, and texts containing this token.
=India Find texts matching the exact string India.
~Cing Find texts equal or similar to the token Cingdom.
id Find attributes named id and attribute values containing this token.
@=f0_119 Find attribute values matching the exact string f0_119.
"European Chinese" Find texts containing the phrase "European Chinese".
//city Leading slash: Interpret the input as XPath expression (see below).

[edit] XQuery

In the XQuery mode, XPath and XQuery expressions can be entered in the input bar.

To evaluate the following example queries: enter them in the input bar, and press ENTER or click on the START button:

Query Description
//country Return all country elements.
//country[name = "Switzerland"] Return the country element of "Switzerland".
for $city in //city
where $city/population > 1000000
order by $city ascending
return $city/name
Return the names of all cities with a population larger than one million and order the results by the name of the city.

[edit] Command

In the Command mode, BaseX Commands can be entered and executed. Just try the following examples:

[edit] Realtime Options

Via the Options menu, you can change how queries are executed and visualized:

[edit] Visualizations

The BaseX GUI offers various visualizations, which help you to explore your XML data instances from different perspectives:

Text View


Displays query results and other textual output. Query results can be saved in a file.
Map View


Displays all data in a TreeMap. All nodes of the XML document are represented as rectangles, filling the complete area. You can choose different layout algorithms in the Menu OptionsMap Layout.
Tree View


Displays all XML nodes in a top down tree with edges and nodes. You can change some settings of the Tree in the Menu OptionsTree Options.
Folder View


Displays all nodes in an Explorer-like folder view. Nodes can be expanded or closed by clicking on the arrows.
Scatterplot View


Displays all nodes in a scatterplot, which is particularly helpful if you want to explore analyze your data. Three drop down menus allow custom axis assignments.
The Table View


Comes in handy if your data is highly regular. It displays all nodes in a table with rows and columns. Different assignments can be chosen by clicking on the arrow in the right upper corner.
Explorer View


Can be used to explore the contents of your database via drop-down menus, search fields and double sliders.
Info View


Helpful for analyzing the query plans of your XQuery expressions. It also displays information on the compilation and evaluation of queries.

[edit] Look and Feels

By default, the Look and Feel of your operating system will be used in the GUI. In the Preferences dialog, you can choose among some more window themes.

The JTattoo library offers some more look and feels. If you download and copy the JTattoo jar file into the lib directory provided by the ZIP and EXE distribution of BaseX, 13 additional looks and feels will get available.

Default Look & Feel
HiFi Look & Feel

[edit] Changelog

Version 9.1
Version 8.4
Version 8.0
Personal tools