Changes

Jump to navigation Jump to search
10,337 bytes added ,  16:24, 25 July 2022
==Startup==This page is part of the [[Getting Started]] Section. BaseX comes with a graphical user interface that offers you great tools for managing, querying and visualizing your data and write complex applications in XQuery.
see the [[=Startup Overview]].=
==First Operations==To get to know BaseX, we advise to run some of the following operations to see how it works andget your first indentations. The graphical user interface can be started as follows:
===Create a database/collection===* If you have installed BaseX on ''Windows'', click on the '''BaseX GUI''' icon.Go to Database/New menu you can choose a folder * Run one of xml files the {{Code|[[Start_Scripts#Linux.2FMac:_basex|basexgui]]}} or a single xml {{Code|[[Start Scripts#Windows: basex.bat|basexgui.bat]]}} scripts.* You can also double-click on the {{Code|BaseX.jar}} file(this way, no libraries will be added).to either create a single xml file database or a collection with a bunch * For developers: type in {{Code|mvn exec:java}} in the main directory of xml filesthe {{Code|basex}} project.
Furthermore there are tabs for parsing, indexes and fullSome additional [[Command-Line_Options#GUI|command-text line options:;Parsing:Here you can change settings for the parser and choose a file for your xml catalog.;Indexes:Here you can choose what indexes to be created with the database: text index, attribute index and path summary ]] are available: as indexes.;Full-Text:Here you can activate the full-text index. Furthermore some more options can be set, like language, wildcards and a stopword list.
===Add/Delete documents===If you have opened a database It is worth mentioning that the standalone client must not be used if you can add perform parallel (Database/Add documents) or delete (Database/Delete documentsconcurrent) read and write operations on an easy wayyour databases.Just go to the designated menu and follow the further stepsSee [[Startup#Concurrent Operations|Concurrent Operations]] for more details.
;Add documents: Choose a file or directory to add to your database. As <code>path</code> you can enter a target path in your database, where: the new documents have to be added.=Introduction=
;Delete documents:Enter At the path top of the documents which BaseX window, the menu bar resides. It houses all important features of the BaseX GUI. Use the ''Database'' menu to [[Graphical_User_Interface#Database Management|create and manage your XML databases]]. The ''Editor'' menu gives you like access to delete, a variety of tools and options for working with files. The ''View'' menu lets you toggle between the info message bars and panels described below. The ''Visualization'' menu offers you a comprehensive set of data representations that will show help you how many documents are effectedto understand your data even better. Use the ''Options'' menu to set your preferences regarding real-time execution, colors, fonts, and packages.
===Manage databases===In Right below the Database/Manage menu bar, you can backupfind the ''Buttons'' bar and just below that the ''Input Bar''. The ''Buttons'' bar offers you a wide range of shortcuts, restoremostly for menu options, rename such as managing databases and displaying views and drop a databasevisualizations, but also for navigating through your data. With the [[Graphical_User_Interface#Input Bar|''Input Bar'']], you can query your data using three different kinds of query syntax.
;Backup[[File:The backupGUI-file is stored in the database directory.:The file is named db_name-timestamp.zip.;Restore:To restore the database the file with the newest timestamp is takenHeader.png|600px]]
===Execute a query===For executing a query there are two ways:The ''Status Bar'' is situated at the bottom of the BaseX window.
;Search mode in the combo box The BaseX [[Graphical_User_Interface#Editor|editor]] consists of the main window:Here you can enter your query ''Project'' view, a file browser with optional input fields for searching files, and the help of the query suggest feature, which will provide you actual ''Editor'' panel with suggestions buttons for path stepscreating, opening, saving, searching, executing and debugging your files.
;Query View[[File:Here you can enter your query with the help of an advanced query editor with syntax highlighting and detailed error feedbackGUI-Editor.png|600px]]
If you are not familiar with XQueryIn addition to that, the ''Result'' view displays the output of queries and database operations and the ''Info'' view shows you can execute an [[Easy Search]]information about database processes and query execution.
[[File:GUI-ResultInfo.png|600px]] To gain further insights into your data, you can choose to display various [[Graphical_User_Interface#Visualizations|visualizations]] such as ''Map'', ''Tree'', ''Folder'', ''Plot'', ''Table'' and ''Explorer''. =Database Management=See  The BaseX GUI is a great place for creating and managing your XML databases. To '''create a new database''', select ''Database'' → ''New'' from the menu and browse to an XML document of your choice. You can start with the {{Code|factbook.xml}} document, which contains statistical information on the worlds' countries. It is included in the {{Code|etc}} directory of our [https://basex.org/download full distributions] (ZIP Package and Windows Installer) or can be downloaded [https://files.basex.org/xml/factbook.xml here] (1.3 MB). In the ''Create Database'' dialog, specify the path to your input file and the name of the new database. If you leave the input file field empty, an empty database will be created. Click the ''OK'' button to create the database. '''Note:''' You can also use the GUI's [[Graphical_User_Interface#Editor|editor]] to create and edit your own XML document. Just specify it as input file for the creation of a new database after saving the document to disk. To '''open, rename, copy or drop a database''', choose ''Database'' → ''Open & Manage...'' from the menu. Select one of the available databases on the left-hand side and click on one of the buttons on the right: ''Open'', ''Rename'', ''Copy'' or ''Drop''. To open a database, you can also double-click on the database name. Opening a database activates three more options in the ''Database'' menu: * The ''Properties'' item gives you access to a variety of database options and information:** Add resources and/or set parsing preferences.** Gain insights into element and attribute names, paths and other meta information.** Create and manage text, attribute, token and full-text indexes. Customize indexes by specifying language, stemming, case-sensitivity and diacritics settings or include a stop word list.* With the ''Export'' item, you can serialize your database into a whole range of different output formats, including XML, JSON and CSV.* The ''Close'' item closes the database. An open database is closed automatically as soon as another database is opened. '''Note:''' You can also access the menu options ''New'', ''Open & Manage'', ''Properties'' and ''Close'' from BaseX's Buttons bar. [[File:GUI-Menu.png|600px]] =EditorThe built-in editor of BaseX is a powerful tool for write XQuery code and [[Commands#Basics|Command Scripts]], editing text documents (XML, JSON, JavaScript, …), and developing [[RESTXQ]] applications: * The editor offers native '''syntax highlighting''' for XQuery, XML, JSON and JavaScript.* XQuery, XML and JSON files will be '''parsed''' in real time and '''errors''' will be highlighted.* XQuery code and command scripts can be '''executed''' (via Ctrl Enter or by clicking on the green triangle). Numerous [[Shortcuts|keyboard shortcuts]] are available to speed up editing and debugging. Some examples: * Ctrl H: Search for the currently selected string in your complete project.* Ctrl .: Jump to the next erroneous code in your project. If you right-click on an XML document in the ''Project'' view, the selected file will be parsed and bound to the context item: [[File:GUI-Context.png|600px]] ==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. If a directory contains a {{Code|.ignore}} file, its files and contents will be ignored. =Input Bar= The ''Input Bar'' is situated on top of the main window. It offers you three different modes to query your XML databases: '''Find''', '''XQuery''' and '''Command'''. [[Image:GUI-Input.png|600px]] The upcoming example queries can all be used with an instance of the <code>factbook</code> database: ==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: {| class="wikitable"!Query!Description|-|<code>city</code>|Find elements named {{Code|city}}, and texts containing this token.|-|<code>=India</code>|Find texts matching the exact string {{Code|India}}.|-|<code>~Cingdom</code>|Find texts equal or similar to the token {{Code|Cingdom}}.|-|<code>@id</code>|Find attributes named {{Code|id}} and attribute values containing this token.|-|<code>@=f0_119</code>|Find attribute values matching the exact string {{Code|f0_119}}.|-|<code>"European Chinese"</code>|Find texts containing the phrase {{Code|"European Chinese"}}.|-|<code>//city</code>|Leading slash: Interpret the input as XPath expression (see below).|} ==XQuery== In the '''XQuery''' mode, XPath and XQuery expressions can be entered in the input bar. To evaluate the following example queries, type them in the input bar and press Enter or click on the ''Run query'' button (green triangle) adjacent to the input bar: {| 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 //city<br/>where $city/population > 1000000<br/>order by $city ascending<br/>return $city/name</code>|Return the names of all cities with a population larger than one million and order the results by the name of the city.|} ==Command== In the '''Command''' mode, BaseX Standalone[[Commands|Commands]]can be entered and executed. Just try the following examples: * <code>INFO</code>: Returns system information.* <code>CREATE DB TEST</code>: Creates an empty database named "TEST".* <code>LIST</code>: Lists all databases. =Visualizations= The BaseX GUI offers various visualizations, which help you to explore your XML data instances from different perspectives: <table cellpadding="0" cellspacing="10"><tr><td valign="top" width="50%">[[BaseX ServerImage:Result.png|thumb|200px]] '''Result''' (''View'' menu):Displays query results and other textual output (e.g., content of the currently open database). Query results can be saved in a file.</td><td valign="top" width="50%">[[Image:InfoView.png|thumb|200px]] '''Info''' (''View'' menu):Helpful for analyzing the query plans of your XQuery expressions. It also displays information on the compilation and evaluation of queries.</td></tr><tr><td valign="top" width="50%">[[Getting Started GuideImage:Map.png|thumb|200px]'''Map''':Displays all data in a [https://en.wikipedia.org/wiki/Treemap TreeMap]. All nodes of the XML document are represented as rectangles, filling the complete area. You can choose different layout algorithms in the Menu ''Options'' → ''Map Layout''.</td><td valign="top" width="50%">[[Image:Tree.png|thumb|200px]] '''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 ''Options'' → ''Tree Options''.</td></tr><tr><td valign="top" width="50%">[[Image:Folder.png|thumb|200px]] '''Folder''':Displays all nodes in an Explorer-like folder view. Nodes can be expanded or closed by clicking on the arrows.</td><td valign="top" width="50%">[[Advanced User PortalImage:Scatterplot.png|thumb|200px]] '''Plot''':Displays all nodes in a scatter plot, which is particularly helpful if you want to explore analyze your data. Three dropdown menus allow custom axis assignments.</td></tr><tr><td valign="top" width="50%">[[CategoryImage:BeginnerTable.png|thumb|200px]] '''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.</td><td valign="top" width="50%">[[CategoryImage:Explorer.png|thumb|200px]] '''Explorer''':Can be used to explore the contents of your database via drop-down menus, search fields and double sliders.</td></tr></table> =Real-time Options= In the ''Options'' menu, you can change how queries are executed and visualized: * '''Real-time Execution''': If real-time execution is enabled, your searches and queries will be executed with each key click and the results will be instantly shown.* '''Real-time Filtering''': If enabled, all visualizations will be limited to the actual results in real-time. If this feature is disabled, the query results are highlighted in the visualizations and can be explicitly filtered with the 'Filter' button. =Look and Feel= <table> <tr> <td valign="top">By default, the Look and Feel of your operating system will be used in the GUI.In the ''Preferences'' dialog, you can choose from additional window themes. The [http://www.jtattoo.net/ScreenShots.html JTattoo library] offers some morelook and feels. If you download and copy the JTattoo jar file into the {{Code|lib}}directory provided by the ZIP and EXE distribution of BaseX,13 additional themes will get available. </td> <td>[[Image:defaultlaf.png|thumb|Default Look & Feel]]</td> <td>[[Image:hifilaf.png|thumb|HiFi Look & Feel]]</td> </tr></table> =Changelog= ;Version 9.3* Updated: Project View: ignore directories with {{Code|.ignore}} file ;Version 9.1* Added: Project View, set XML document as context. ;Version 8.4* Added: highlighting of erroneous XQuery modules in the project view. ;Version 8.0* Updated: support for dark look and feels; support for JTattoo library
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu