Changes

Jump to navigation Jump to search
696 bytes added ,  22:39, 9 October 2016
no edit summary
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==
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.
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.
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 supplied as database input in the above dialog.
==Realtime Options=Input Bar=
Via On top of the main window, you can find an input bar. The attached dropdown menu provides three modes: ''Options'Find''' menu, you can change how queries are executed '''XQuery''' and visualized'''Command''':
* '''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.[[CategoryImage:GUIInputBar.png|Input Bar]]
==Querying==The upcoming example queries can all be used with an instance of the <code>factbook</code> database:
===Keyword Search=Find==
The Keyword Search can be executed in In the '''SearchFind''' mode in, the combo box of the main window. This options allows for a simple,keyword-based search input bar can be used to find single elements and texts in the currently opened database.The following syntax is supported:
The following syntax is supported:
{| class="wikitable"
!Query
!Description
|-
|<code>worldcity</code>|Find tags elements named {{Code|city}}, and texts containing this token.|-|<code>=India</code>|Find texts matching the exact string {{Code|worldIndia}}.
|-
|<code>=world~Cing</code>|Find exact matching text nodestexts equal or similar to the token {{Code|Cingdom}}.
|-
|<code>~worldid</code>|Find text nodes similar to attributes named {{Code|worldid}}and attribute values containing this token.
|-
|<code>@world=f0_119</code>|Find attributes and attribute valuesmatching the exact string {{Code|f0_119}}.
|-
|<code>@=world"European Chinese"</code>|Find exact attribute valuestexts containing the phrase {{Code|"European Chinese"}}.
|-
|<code>"united world"//city</code>|Find tags and texts containing Leading slash: Interpret the phrase {{Code|"united world"}}input as XPath expression (see below).
|}
===XPath/XQuery===
Apart from In the basic search facilities'''XQuery''' mode, 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 XPath and XQuery reference, but might point you expressions can be entered in the right directioninput bar.
To execute evaluate the following example queries, : enter them in the XQuery Panel input bar, and press ENTER or click on the START button.:
XPath provides an easy facility to query your documents {| class="wikitable"!Query!Description|-|<code>//country</code>|Return all <code>country</code> elements.|-|<code>//country[name = "Switzerland"]</code>|Return the <code>country</code> element of "Switzerland".|-|<code>for $city in a navigational manner. It is //city<br/>where $city/population > 1000000<br/>order by $city ascending<br/>return $city/name</code>|Return the basic tool names of all node-related operations that you encounter when using XQuery. We will start cities with a trivial example population larger than one million and extend it to our needsorder the results by the name of the city.|}
''' Example: Find Countries '''==Command==
<pre class="brushIn the '''Command''' mode, [[Commands|BaseX Commands]] can be entered and executed. Just try the following examples:xquery">//country</pre>
tells BaseX to look for all * <code>countryINFO</code> elements in the document: Returns system information. The query is introduced by two slashes * <code>//CREATE DB TEST</code>, which trigger the traversal of all document nodes: Creates an empty database named "TEST". The queries {{Code|* <code>LIST<//country}} andd {{Code|/descendantcode>::country}} will return the same resultsLists all databases.
''' Example: Find Cities in Switzerland '''=Text Editor=
The following query uses a '''predicate''' <powerful text editor can be used to write and edit [[XQuery]] code>(simple queries, modules), XML documents, [[...Commands#Basics|Command Scripts]]</code> to filter all <code>country</code> nodes which have a <code>name</code> child, the string value of which is "Switzerland"and any other textual files:
<pre class="brush:xquery">//country[name = "Switzerland"]</pre>* XQuery and command scripts can be '''executed''' by clicking on the green triangle. * XQuery, XML and JavaScript will be '''syntax highlighted'''.* XQuery and XML will automatically '''parsed''' with each key click, and '''errors''' will be highlighted.
To return all cities of the resulting element node, the query can be extended by a trailing <code>//city</code> path:Numerous [[Shortcuts|keyboard shortcuts]] are available to speed up editing and debugging.
<pre class="brush:xquery">//country[name = "Switzerland"]//city</pre>Project View==
===Text Editor===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-clicks on the files. The project directory can be changed by clicking on the button with the three dots <code>...</code> in the upper left corner of the project view panel.
The text editor can be used to type in [[Erroneous XQuery]] expressionsmodules, [[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 clickall queries importing these modules, and errors will be highlighted. Various [[Shortcuts|keyboard shortcuts]] are available to speed up editing and debuggingHighlighting can be disabled in the GUI preferences 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. =Visualizations==
The BaseX GUI offers various visualizations,
</td></tr></table>
==Look and Feels==
<table>
</table>
[[Category=Changelog= ;Version 8.4 * Added:Beginner]]highlighting of erroneous XQuery modules in the project view. ;Version 8.0[[Category:GUI]][[Category* Updated:XQuery]]support for dark look and feels; support for JTatto library
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu