Difference between revisions of "Graphical User Interface"

From BaseX Documentation
Jump to navigation Jump to search
Line 2: Line 2:
 
The BaseX homepage gives you a [http://basex.org/products/gui visual impression] of the graphical user interface (GUI) of BaseX, and an [http://www.youtube.com/watch?v=xILHKGPGaJ4&hd=1 introductory video] is available, which presents some of its interactive features.
 
The BaseX homepage gives you a [http://basex.org/products/gui visual impression] of the graphical user interface (GUI) of BaseX, and an [http://www.youtube.com/watch?v=xILHKGPGaJ4&hd=1 introductory video] is available, which presents some of its interactive features.
  
==Startup==
+
=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 <code>basexgui</code> script. Beside that, some more [[Startup#BaseX GUI|startup options]] are available.
 
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 <code>basexgui</code> script. Beside that, some more [[Startup#BaseX GUI|startup options]] are available.
  
==Create Database==
+
=Create Database=
  
 
Select ''Database'' → ''New'' and browse to an XML document of your choice. As an example, you can start with the {{Code|factbook.xml}} document, which contains statistical information on the worlds' countries. It is included in our official releases and can also be [http://files.basex.org/xml/factbook.xml downloaded] (1.3 MB). If you type nothing in the input field, an empty database will be created. Next, choose the ''OK'' button, and BaseX will create a database that you can visually explore and query.
 
Select ''Database'' → ''New'' and browse to an XML document of your choice. As an example, you can start with the {{Code|factbook.xml}} document, which contains statistical information on the worlds' countries. It is included in our official releases and can also be [http://files.basex.org/xml/factbook.xml downloaded] (1.3 MB). If you type nothing in the input field, an empty database will be created. Next, choose the ''OK'' button, and BaseX will create a database that you can visually explore and query.
Line 12: Line 12:
 
If no XML document is available, the [[#Text Editor|Text Editor]] can also be used to create an initial XML document. After saving the entered XML document to harddisk, it can be specified in the above dialog.
 
If no XML document is available, the [[#Text Editor|Text Editor]] can also be used to create an initial XML document. After saving the entered XML document to harddisk, it can be specified in the above dialog.
  
==Realtime Options==
+
=Realtime Options=
  
 
Via the ''Options'' menu, you can change how queries are executed and visualized:
 
Via the ''Options'' menu, you can change how queries are executed and visualized:
Line 20: Line 20:
 
[[Category:GUI]]
 
[[Category:GUI]]
  
==Querying==
+
=Querying=
  
===Keyword Search===
+
==Keyword Search==
  
 
The Keyword Search can be executed in the '''Search''' mode in
 
The Keyword Search can be executed in the '''Search''' mode in
Line 52: Line 52:
 
|}
 
|}
  
===XPath/XQuery===
+
==XPath/XQuery==
  
 
Apart from the basic search facilities, BaseX offers far more sophisticated processing options to query your documents. Below are some examples you might give a try. This guide is far from being a comprehensive XQuery reference, but might point you in the right direction.
 
Apart from the basic search facilities, BaseX offers far more sophisticated processing options to query your documents. Below are some examples you might give a try. This guide is far from being a comprehensive XQuery reference, but might point you in the right direction.
Line 76: Line 76:
 
<pre class="brush:xquery">//country[name = "Switzerland"]//city</pre>
 
<pre class="brush:xquery">//country[name = "Switzerland"]//city</pre>
  
===Text Editor===
+
==Text Editor==
  
 
The text editor can be used to type in [[XQuery]] expressions, [[Commands#Basics|Command Scripts]], XML documents, or any other text files. Query files and XML documents can be started by clicking on the green triangle. They will automatically parsed with each key click, and errors will be highlighted. Various [[Shortcuts|keyboard shortcuts]] are available to speed up editing and debugging.
 
The text editor can be used to type in [[XQuery]] expressions, [[Commands#Basics|Command Scripts]], XML documents, or any other text files. Query files and XML documents can be started by clicking on the green triangle. They will automatically parsed with each key click, and errors will be highlighted. Various [[Shortcuts|keyboard shortcuts]] are available to speed up editing and debugging.
  
==Visualizations==
+
=Visualizations=
  
 
The BaseX GUI offers various visualizations,
 
The BaseX GUI offers various visualizations,
Line 127: Line 127:
 
</td></tr></table>
 
</td></tr></table>
  
==Look and Feels==
+
=Look and Feels=
  
 
<table>
 
<table>

Revision as of 18:19, 27 March 2015

This page is part of the Getting Started Section. The BaseX homepage gives you a visual impression of the graphical user interface (GUI) of BaseX, and an introductory video is available, which presents some of its interactive features.

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.

Create Database

Select DatabaseNew and browse to an XML document of your choice. As an example, you can start with the factbook.xml document, which contains statistical information on the worlds' countries. It is included in our official releases 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 BaseX will create a database that you can visually explore and query.

If no XML document is available, the Text Editor can also be used to create an initial XML document. After saving the entered XML document to harddisk, it can be specified in the above dialog.

Realtime Options

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

  • Realtime Execution: If realtime execution is enabled, your searches and queries will be executed with each key click and the results will be instantly shown.
  • Realtime Filtering: If enabled, all visualizations will be limited to the actual results in realtime. If this feature is disabled, the query results are highlighted in the visualizations and can be explicitly filtered with the 'Filter' button.

Querying

Keyword Search

The Keyword Search can be executed in the Search mode in the combo box of the main window. This options allows for a simple, keyword-based search in the opened database.

The following syntax is supported:

Query Description
world Find tags and texts containing world
=world Find exact matching text nodes
~world Find text nodes similar to world
@world Find attributes and attribute values
@=world Find exact attribute values
"united world" Find tags and texts containing the phrase "united world"

XPath/XQuery

Apart from the basic search facilities, BaseX offers far more sophisticated processing options to query your documents. Below are some examples you might give a try. This guide is far from being a comprehensive XQuery reference, but might point you in the right direction.

To execute the following queries, enter them in the XQuery Panel and press ENTER or click on the START button.

XPath provides an easy facility to query your documents in a navigational manner. It is the basic tool of all node-related operations that you encounter when using XQuery. We will start with a trivial example and extend it to our needs.

Example: Find Countries

//country

tells BaseX to look for all country elements in the document. The query is introduced by two slashes //, which trigger the traversal of all document nodes. The queries //country andd /descendant::country will return the same results.

Example: Find Cities in Switzerland

The following query uses a predicate [...] to filter all country nodes which have a name child, the string value of which is "Switzerland":

//country[name = "Switzerland"]

To return all cities of the resulting element node, the query can be extended by a trailing //city path:

//country[name = "Switzerland"]//city

Text Editor

The text editor can be used to type in XQuery expressions, Command Scripts, XML documents, or any other text files. Query files and XML documents can be started by clicking on the green triangle. They will automatically parsed with each key click, and errors will be highlighted. Various keyboard shortcuts are available to speed up editing and debugging.

Visualizations

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

Text View

Result

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

Map

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

Tree

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

Folder

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

Plot

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

Table

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

Explorer

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

Info

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

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

Changelog

Version 8.0
  • Updated: support for dark look and feels; support for JTatto library