Changes

Jump to navigation Jump to search
1,603 bytes added ,  13:09, 2 July 2020
no edit summary
* The {{Code|.basex}} [[Configuration#Configuration Files|configuration file]] is parsed by every new local BaseX instance. It contains all global options. Local options can be specified at the end of the file after the {{Code|Local Options}} comment:
<pre classsyntaxhighlight lang="brush:perl">
# General Options
DEBUG = false
# Local Options
CHOP = false
</presyntaxhighlight>
* Initial values for global options can also be specified via system properties, which can e.g. be passed on with the [httphttps://docs.oracle.com/javaseen/1.4.2java/docsjavase/tooldocs11/windowstools/java.html#options -D flag] on command line, or using [httphttps://docs.oracle.com/en/java/javase/611/docs/api/java.base/java/lang/System.html#setProperty(java.lang.String,%20javajava.lang.String) System.setProperty()] before creating a BaseX instance. The specified keys need to be prefixed with {{Code|org.basex.}}. An example:
<pre classsyntaxhighlight lang="brush:xqueryperl">
java -Dorg.basex.CHOP=false -cp basex.jar org.basex.BaseX -c"get chop"
CHOP: false
</presyntaxhighlight>
* If using the Mac OS X packaged application then global options can be set within the Info.plist file within the Contents folder of the application package. For example:
<pre classsyntaxhighlight lang="brush:xml">
<key>JVMOptions</key>
<array>
<string>-Dorg.basex.CHOP=false</string>
</array>
</presyntaxhighlight>
* In a [[Web Application]], the default can be adjusted in the {{Code|web.xml}} file as follows:
<pre classsyntaxhighlight lang="brush:xml">
<context-param>
<param-name>org.basex.chop</param-name>
<param-value>false</param-value>
</context-param>
</presyntaxhighlight>
* In XQuery, local options can be set via option declarations and [[XQuery Extensions#Pragmas|pragmas]].
| '''Summary'''
|Specifies how many seconds the results of queries, which have been queued by the [[Jobs Module|asynchronously executed]], will be cached in main memory.
|}
 
===WITHDB===
 
{{Mark|Introduced with Version 9.3.}}
 
{| width='100%'
|-
| width='120' | '''Signature'''
|{{Code|WITHDB}}
|-
| '''Default'''
|{{Code|true}}
|-
| '''Summary'''
|By default, URIs specified in the [[Databases#XML Documents|fn:doc]] and [[Databases#XML Documents|fn:collection]] functions will also be resolved against existing databases. If {{Function|Database|db:open}} is consistently used to access database documents, it is recommendable to disable this option:
* Access to local and external resources will be faster, as the database lookup will be skipped.
* No locks will be created by the two functions (see [[Transaction Management#Limitations|limitations of database locking]] for more details).
|}
|}
==HTTP Services=LOGTRACE===
Most HTTP options are defined in the {{CodeMark|jettyIntroduced with Version 9.xml4:}} and {{Code|web.xml}} configuration files in the <code>[https://github.com/BaseXdb/basex/tree/master/basex-api/src/main/webapp/WEB-INF webapp/WEB-INF]</code> directory. Some additional BaseX-specific options exist that will be set before the web server is started: ===WEBPATH===
{| width='100%'
|-
| width='120' | '''Signature'''
|{{Code|WEBPATH LOGTRACE [pathboolean]}}
|-
| '''Default'''
|<code>[[Configuration#Database Directory{{Code|{hometrue}}/webapp]]</code>
|-
| '''Summary'''
|Points to the directory in which all the If BaseX is running as [[Web Application]] contents are stored, including XQuery, Scripttrace output (generated via {{Code|fn:trace}}, {{Function|Profiling|prof:dump}} and similar functions) if written to the [[RESTXQLogging|database logs]] and configuration files. This If this option is ignored if disabled, trace output will be redirected to standard error, as it is known from the standalone version of BaseX is deployed as [[Web Application#Servlet_Container|web servlet]].
|}
==HTTP Services=RESTXQPATH= Most HTTP options are defined in the {{Code|jetty.xml}} and {{Code|web.xml}} configuration files in the <code>[https://github.com/BaseXdb/basex/tree/master/basex-api/src/main/webapp/WEB-INF webapp/WEB-INF]</code> directory. Some additional BaseX-specific options exist that will be set before the web server is started: ===WEBPATH===
{| width='100%'
|-
| width='120' | '''Signature'''
|{{Code|RESTXQPATH WEBPATH [path]}}
|-
| '''Default'''
|''empty''<code>[[Configuration#Database Directory|{home}/webapp]]</code>
|-
| '''Summary'''
|Points to the directory in which contains all the [[Web Application]] contents are stored, including XQuery, Script, [[RESTXQ]] modules of a and configuration files:* The option is ignored if BaseX is deployed as [[Web Application#Servlet_Container|web applicationservlet]]. Relative paths will * It cannot be resolved against assigned via the {{OptionCode|WEBPATHweb.xml}} directoryfile, as it will be evaluated before the configuration files are parsed.
|}
===PARSERESTXQGZIP=== {{Mark|Introduced with Version 9.3:}}
{| width='100%'
|-
| width='120' | '''Signature'''
|{{Code|PARSERESTXQGZIP [boolean]}}
|-
| '''Default'''
|{{Code|3}}<code>false</code>
|-
| '''Summary'''
|Timeout after which Jetty provides a [https://www.eclipse.org/jetty/documentation/current/gzip-filter.html Gzip handler] for dynamically uncompressing requests and compressing responses. This feature can be enabled if Jetty is started via the RESTXQ directory will [[Web Application|BaseX HTTP Server]]:* The option can also be parsed for changes:enabled on [[Command-Line Options#HTTP Server|command line]] via <code>-g</code>.* If It cannot be assigned via the {{Code|0web.xml}} is specifiedfile, the directory as it will be evaluated before the configuration files are parsed every time a RESTXQ function is called.* A positive value defines the idle time in seconds after which parsing will be enforced. The default value is {{Code|3}}[https: Changes in //github.com/eclipse/jetty.project/blob/7cc552013eb4d05cb603ba0bc85d176c97957cd4/jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHandler.java#L187-L211 same defaults] of the RESTXQ directory web server will be detected after 3 seconds without RESTXQ function callsapplied (support for GET requests, exclusion of binaries, MSIE 6.* Monitoring is completely disabled if a negative value is specified0, etcSee [[RESTXQ#Preliminaries|RESTXQ Preliminaries]] for more details).
|}
===RESTXQERRORSRESTXQPATH=== {{Mark|Introduced with Version 9.2.}}
{| width='100%'
|-
| width='120' | '''Signature'''
|{{Code|RESTXQERRORSRESTXQPATH [path]}}
|-
| '''Default'''
|{{Code|true}}''empty''
|-
| '''Summary'''
|Reports parsing errors in XQuery modules in Points to the RESTXQ directory back to which contains the client[[RESTXQ]] modules of a web application. By default, this option is enabled. On productive systems, it can Relative paths will be disabled in order to suppress errors that should not be seen by resolved against the client{{Option|WEBPATH}} directory.
|}
===RESTPATHPARSERESTXQ===
{| width='100%'
|-
| width='120' | '''Signature'''
|{{Code|RESTPATH [path]PARSERESTXQ}}
|-
| '''Default'''
|''empty''{{Code|3}}
|-
| '''Summary'''
|Points to Timeout after which the RESTXQ directory which contains XQuery files and command scriptswill be parsed for changes:* If {{Code|0}} is specified, which can the directory will be evaluated via parsed every time a RESTXQ function is called.* A positive value defines the [[REST#GET Requests|REST run operation]]. Relative paths idle time in seconds after which parsing will be resolved against the enforced. The default value is {{OptionCode|WEBPATH3}} : Changes in the RESTXQ directorywill be detected after 3 seconds without RESTXQ function calls.* Monitoring is completely disabled if a negative value is specified. See [[RESTXQ#Preliminaries|RESTXQ Preliminaries]] for more details.
|}
===HTTPLOCALRESTXQERRORS===
{| width='100%'
|-
| width='120' | '''Signature'''
|{{Code|HTTPLOCAL [boolean]RESTXQERRORS}}
|-
| '''Default'''
|{{Code|falsetrue}}
|-
| '''Summary'''
|Reports parsing errors in XQuery modules in the RESTXQ directory back to the client. By default, if BaseX this option is run as [[Web Application]]enabled. On productive systems, a database server instance will be started as well. The server it can then be addressed by other BaseX clients disabled in parallel order to suppress errors that should not be seen by the HTTP services.<br/>If the option is set to {{Code|true}}, the database server will be disabledclient.
|}
===STOPPORTRESTPATH===
{| width='100%'
|-
| width='120' | '''Signature'''
|{{Code|RESTPATH [path]}}|-| '''Default'''|''empty''|-| '''Summary'''|Points to the directory which contains XQuery files and command scripts, which can be evaluated via the [[REST#GET Requests|REST run operation]]. Relative paths will be resolved against the {{Option|WEBPATH}} directory.|} ===HTTPLOCAL=== {| width='100%'|-| width='120' | '''Signature'''|{{Code|HTTPLOCAL [boolean]}}|-| '''Default'''|{{Code|false}}|-| '''Summary'''|By default, if BaseX is run as [[Web Application]], the database server instance will be started in addition, which can then be addressed by [[Clients]] via the database port (see {{Option|PORT}}).<br/>If the option is set to {{Code|true}}, no database server will be launched.|} ===STOPPORT=== {| width='100%'|-| width='120' | '''Signature'''|{{Code|STOPPORT [port]}}
|-
| '''Default'''
|-
| '''Summary'''
|Defines a [[Parsers|parser]] for importing new files to the database. Available parsers are {{Code|XML}}, {{Code|JSON}}, {{Code|CSV}}, {{Code|TEXT}}, {{Code|HTML}}, and {{Code|HTMLRAW}}. HTML input will be parsed as normal XML files documents if [[Parsers#HTML_Parser|Tagsoup]] is not found in the classpath.
|}
|-
| '''Summary'''
|Many XML documents include whitespaces that have been added to improve readability. This option controls the [httphttps://www.w3.org/TR/REC-xml/#sec-white-space white-space processing mode] of the XML parser:
* With the default value {{Code|true}}, leading and trailing whitespaces from text nodes will be chopped and all empty text nodes will be discarded.
* The flag should be turned off if a document contains [[Full-Text#Mixed Content|mixed content]].
In the following example document, the whitespaces in the text nodes of the {{Code|text}} element will not be chopped:
<pre classsyntaxhighlight lang="brush:xml">
<xml>
<title>
<text xml:space="preserve">To <b>be</b>, or not to <b>be</b>, that is the question.</text>
</xml>
</presyntaxhighlight>
It is recommendable to additionally assign <code>indent=no</code> to the {{Option|SERIALIZER}} option; otherwise the serialized documents will automatically be indented.
|}
| '''Summary'''
|This option affects the [[Indexes#Performance|construction]] of new value indexes. It controls the number of index build operations that are performed before writing partial index data to disk:
* By default, if the value is set to {{Code|0}}, some heuristics are applied, based on the current memory consumption. Usually, this works fine.
* If explicit garbage collection is disabled when running Java (e.g. via the JVM option {{Code|-XX:+DisableExplicitGC}}), you may need to choose a custom split size.
* You can e. g. start with {{Code|1000000}} (one million) index operations and adjust this value in the next steps.
* The larger the assigned value is, the less splits will take place, and the more main memory will be required.
* By default, if the value is set to {{Code|0}}, some heuristics are applied, based on the current memory consumption. Usually, this works fine. If explicit garbage collection is disabled when running Java (e.g. via the JVM option {{Code|-XX:+DisableExplicitGC}}), you may need to choose a custom split size.
|}
|-
| '''Summary'''
|A new If a text file with stop words is specified, frequently used terms contained in that file will be ignored when a full-text index will drop tokens that are listed in the specified stopword listis created. A stopword list may decrease the size of the full text indexand speed up your queries. See [[Indexes#Full-Text Index|Full-Text Index]] for more details.
|}
| '''Summary'''
|Prints more information on internal query rewritings, optimizations, and performance. By default, this info is shown in the [[GUI#Visualizations|Info View]] in the GUI. It can also be activated on [[Command-Line Options#BaseX Standalone|command line]] via <code>-V</code>.
|}
 
===XQUERY3===
 
{| width='100%'
|-
| width='120' | '''Signature'''
|{{Code|XQUERY3}}
|-
| '''Default'''
|{{Code|true}}
|-
| '''Summary'''
|Enables all [[XQuery 3.0]] features supported by BaseX. If this option is set to {{Code|false}}, the XQuery parser will only accept expressions of the XQuery 1.0 specification.
|}
|-
| '''Summary'''
|Allows queries to both contain updating and non-updating expressions. All updating constraints will be turned off, and nodes to be returned will be copied before they are modified by an updating expression. By default, in compliance with the XQuery Update Facility, this option is set to {{Code|false}}, because the XQuery Update Facility does not allow an updating query to . See [[XQuery Update#Returning Results|return resultsReturning Results]]for more details.
|}
* Commas in values must be duplicated.
* Variables may optionally be introduced with a leading dollar sign.
* If a variable uses a namespace different to the default namespace, it can be specified with the [http://www.jclark.com/xml/xmlns.htm Clark Notation] or [httphttps://www.w3.org/TR/xquery-30/#id-basics Expanded QName Notation].
This option can also be used on [[Command-Line Options#BaseX Standalone|command line]] with the flag <code>-b</code>.
|-
* <code>a=1,,2</code> &nbsp; binds the value {{Code|1,2}} to the variable $a
* <code>{URI}a=x</code> &nbsp; binds the value {{Code|x}} to the variable $a with the namespace {{Code|URI}}.
* In the following [[Commands#Command_Scripts| Command Script]], the value {{Code|hello world!}} is bound to the variable {{Code|$GREETING}}:<pre classsyntaxhighlight lang="brush:xmlxquery">
SET BINDINGS GREETING="hello world!"
XQUERY declare variable $GREETING external; $GREETING
</presyntaxhighlight>
|}
|-
| '''Summary'''
|Specifies how many stack frames of [httphttps://en.wikipedia.org/wiki/Tail_call tail-calls] are allowed on the stack at any time. When this limit is reached, tail-call optimization takes place and some call frames are eliminated. The feature can be turned off by setting the value to {{Code|-1}}.|} ===WITHDB=== {{Mark|Introduced with Version 9.3.}} {| width='100%'|-| width='120' | '''Signature'''|{{Code|WITHDB}}|-| '''Default'''|{{Code|true}}|-| '''Summary'''|By default, resources specified via [[Databases#XML Documents|fn:doc]] and [[Databases#XML Documents|fn:collection]] are looked up both in the database and in the file system. If you always use {{Function|Database|db:open}} to access databases, it is recommendable to disable this option:* No locks will be created for the two functions (see [[Transaction Management#Limitations|limitations of database locking]] for more details).* Access to local and external resources will be faster, as the database lookup will be skipped.
|}
===FULLPLAN===
 
{{Mark|Introduced with Version 9.2:}}
{| width='100%'
;Version 9.3
* Added: {{Option|LOGTRACE}} ;Version 9.3* Added: {{Option|WITHDB}}, {{Option|GZIP}}
;Version 9.2
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu