go to
> basexgui(1)
> basexserver(1)
> basexclient(1)
Homepage > Man Pages > Category > General Commands
Homepage > Man Pages > Name > B


man page of basex

basex: XML database system and XPath/XQuery processor (command line mode)

basex - XML database system and XPath/XQuery processor (command line mode)
basex [-bdiosuvVwz] [-cq] [file]


basex is a fast and powerful, yet light-weight and platform independent XML database system and XPath/XQuery processor.


[file] Execute the specified XQuery file. -b<pars> Bind external variables to XQuery expression. Flag may be specified multiple times; key/value pairs are separated by equality signs (=) (-bv=example -q"declare variable $v external; $v") -c<cmd> Launch database commands and skip interactive mode. The flag should be placed last, as all remaining characters are interpreted as commands. Several commands can be separated by semicolons. -d Turn on debugging (to standard error). -i<input> Open a database or XML document specified by the argument. The opened input may be further processed by an XQuery expression. -o<file> Command and query output is written to the specified file. -q<expr> Execute the specified string as XQuery expression. The flag should be placed last, as all remaining characters are interpreted as XQuery. -s<pars> Specify parameters for serializing XQuery results; see SERIALIZATION for more details. This flag may be specified multiple times; key/value pairs are separated by equality signs (=) -u Modify original files after evaluating XQuery Update expressions -v Process information is written to standard output -V Detailed query information is written to standard output, including compilation and profiling steps. -w By default, whitespaces around text nodes are chopped when a database is created. The flag specifies to suppress chopping. -z Skip the serialization of XQuery results (may be useful for analyzing query plans)


A list of supported Database commands can be obtained from $ basex -c help or by browsing //docs.basex.org/wiki/Commands ADD (AS [name]) (TO [target]) [input] Add document to database. ALTER [USER|DATABASE] [...] Alter user password or database name. BACKUP [name] Backup database. CLOSE Close current database. COPY [name] [newname] Copy database. CREATE [DATABASE|FS|INDEX|USER] [...] Create database, index or user. CS [query] Evaluate XQuery and set result as new context set. DELETE [name] Delete documents from database. DROP [DATABASE|INDEX|USER] [...] Drop database, index or user. EXIT Exit application. EXPORT [path] Export database to XML. FIND [query] Evaluate a keyword query. GET [option] Show global option. GRANT [NONE|READ|WRITE|CREATE|ADMIN] (ON [db]) TO [user] Grant user permissions. HELP ([command]) Get help on BaseX commands. INFO ([DATABASE|INDEX|STORAGE]) Show information on current database. KILL [name] Kill user sessions. LIST ([path]) List databases or documents in database. OPEN [path] Open database. OPTIMIZE (ALL) Optimize the database. PASSWORD ([password]) Change password. RESTORE [name] Restore database. RUN [path] Evaluate file as XQuery. SET [option] ([value]) Set global options. SHOW [DATABASES|SESSIONS|USERS|BACKUPS] Show server information. XQUERY [query] Evaluate XQuery.


Serialization parameters define how XQuery items and XML nodes are textually output, i.e., serialized. They have been formalized in a W3C XQuery Serialization 3.0 document available at //www.w3.org/TR/xslt-xquery-serialization-30 In BaseX, they can be specified in several ways: o by using the -s flag of the BaseX command-line clients, o by setting the SERIALIZER option before running a query, o by setting the EXPORTER option before exporting a database, o by setting them via the Output Parameter of the JAX-RX API, o by including them in the prolog of the XQuery expression (since XQuery 3.0), or o by specifying them in the XQuery function file:write(). An extensive documentation of all serialization parameters is to be found on: //docs.basex.org/wiki/Serialization An example would be: method=xml,encoding=CP1252
o XQuery evaluation (no database, no interaction, script mode): $ basex -q 19+23 42 $ basex -q "<answer>{ 23+19 }</answer>" <answer>42</answer> o Import an XML file into database, output its content (query its root) and be verbose: $ basex -Vc "CREATE DB input /usr/share/doc/basex/examples/input.xml; XQUERY /" Database 'input' created in 53.64 ms. <html> <!-- Header --> <head id="0"> <title>XML</title> </head> <!-- Body --> <body id="1" bgcolor="#FFFFFF" text="#000000" link="#0000CC"> <h1>Databases & XML</h1> <div align="right"> <b>Assignments</b> <ul> <li>Exercise 1</li> <li>Exercise 2</li> </ul> </div> </body> <?pi bogus?> </html> Query: / Compiling: Result: root() Parsing: 0.19 ms Compiling: 9.27 ms Evaluating: 0.33 ms Printing: 3.08 ms Total Time: 12.88 ms Results: 1 Item Updated: 0 Items Printed: 375 Bytes Memory: 5834 KB Query executed in 13.25 ms. o XPath evaluation (with existing database): $ basex -c "OPEN input; XQUERY //li[1]" <li>Exercise 1</li> o Retrieve XML from the web and perform XPath query: $ basex -q "doc('https://svn.uni-konstanz.de/dbis/basex/tags/6.5/basex/etc/xml/input.xml')//li" <li>Exercise 1</li> <li>Exercise 2</li> o W3C XQuery Full-Text (make use of full-text index and perform fuzzy query with a typing error): $ basex BaseX 6.5 [Standalone] Try "help" to get more information. > SET FTINDEX on Full-Text Index: ON > CREATE DB input /usr/share/doc/basex/examples/input.xml/input.xml Database 'input' created in 94.42 ms. > XQUERY //b[text() contains text 'Asisgnment' using fuzzy] <b>Assignments</b> Query executed in 8.37 ms. o Update the database and show result: > XQUERY delete node //ul Query executed in 2.79 ms. > XQUERY replace value of node //b with 'Debian rules' Query executed in 2.94 ms. > XQUERY //div <div align="right"> <b>Debian rules</b> </div> Query executed in 1.01 ms.
basexgui(1), basexserver(1), basexclient(1) ~/.basex BaseX (standalone and server) properties ~/.basexgui BaseX additional GUI properties ~/.basexperm user name, passwords, and permissions ~/BaseXData Default database directory ~/BaseXData/.logs Server logs BaseX Documentation Wiki: //docs.basex.org


BaseX started as a research project of the Database and Information Systems Group (DBIS) at the University of Konstanz in 2005 and soon turned into a feature-rich open source XML database and XPath/XQuery processor.


New (3-clause) BSD License


BaseX is developed by a bunch of people called 'The BaseX Team' <//basex.org/about-us/> led by Christian Gruen <cg@basex.org>. The man page was written by Alexander Holupirek <alex@holupirek.de> while packaging BaseX for Debian GNU/Linux. 13 May 2011 BASEX(1)

Copyright © 2011–2018 by topics-of-interest.com . All rights reserved. Hosted by all-inkl.
Contact · Imprint · Privacy

Page generated in 29.87ms.

Ausf├╝hrliches AWeber Review | elternfragen.net | brieftaubenversteigerung.com