Changes

Jump to navigation Jump to search
706 bytes added ,  16:55, 4 August 2022
''Draft, yet to be finalized'' -------- After 15 years of continuous development, the first double-digit version of BaseX is about to see sees the light of day soon.
We have taken the version jump as an opportunity to perform some major refactorings of BaseX, both under the hood and on API and XQuery level. Before migrating your projects to the new version, some adjustments may be required, so please read this article carefully.
* The default ports for web applications have been changed from 8984/8985 to 8080/8081.
* If a new application of BaseX is deployed, the The default admin password has been removed. The {{Code|admin}} user can only be used after if a custom password has been assigned, e.g., via the {{Command|PASSWORD}} command.
* The conventions for functions in [[Clients]] in other programming languages were revised.
* The <code>IGNOREHOSTNAME</code> option was dropped and merged with {{Option|IGNORECERT}}.
<syntaxhighlight lang="xquery">
STRIPWS: true
SERIALIZER: indent=noyes
</syntaxhighlight>
 
In the GUI editor, a [[Shortcuts#Editor Shortcuts|shortcut]] and an icon were added to switch result indentation on and off.
In addition, databases may considerably increase in size, as whitespaces used for indenting an XML document will be interpreted and stored as additional text nodes. If your XML resources are structured and have no [[Full-Text#Mixed Content|mixed content]], it is advisable to enable whitespaces stripping when importing them to a database.
==Backups==
The [[Commands#Backups|Backup Commands]] and [[Database_Module#Backups|Backup Functions]] were enhanced to back up general data: [[User Management|registered users]], [[Jobs Job Module#Services|scheduled services]], [[Store Module|key-value stores]].
=XQuery=
==Compilation==
Several The compilation has been split up into multiple steps to improve locking. So far, several internal steps are were already performed when executing a query is executed (see [[XQuery Optimizations#Introduction|XQuery Optimizations]] for more details):
1. # The query is parsed, i.e., the original query string is transformed to an executable tree representation.2. # External values that are passed on by APIs are bound to variables and the query context. External values can be names of databases, or contribute to a name that will be assembled later on be constructed in the query.3. # The query is compiled and evaluated.
The [[Transaction_Management|transaction manager]] gathers the names of the databases that will be accessed by a query. If it is not possible to uniquely identify all databases that may be opened by the query, global locking will be applied, and all databases will be locked. Detection can fail if the names of databases depend on external input. It can also fail if a query is too complex to associate character strings with database operations.
Compilation has The compilation phase now been split into comprises two separate steps:
# ''Compilation'' of logical, context-independent (static) operations. External values are bound to the query, and deterministic code is rewritten, simplified and pre-evaluated.# ''Optimization'' of physical, context-based (dynamic) operations. Addressed databases Databases are opened and checked for available indexes; current date/time is retrieved. The resulting code is further rewritten and optimized.
Lock detection will be performed after the first step, and the code resulting from this step offers much more insight into which specific databases need to be locked. As a result, local locks can be applied to many more queries than before, and many queries can now run in parallel. An example:
==Main-Memory Updates==
XQuery Updates Update provides constructs to [[XQuery Update#Main-Memory Updates|update XML nodes in main memory]]. The data structures for in-memory representations of XML resources have been revised, such that updates can be performed orders of magnitudes faster than before. With BaseX 9.x, the following query runs for 6-7 several minutes, whereas it can now be computed in 3 a few seconds:
<syntaxhighlight lang="xquery">
</syntaxhighlight>
The store is persistent: Contents Its contents are written to disk. If if BaseX is restartedshut down, all contents will be and retrieved from disk againafter a restart.
==Modules==
 
Functions of all modules, excluding the [[File Module]], now consistently resolve relative URI references against the static base URI, and not the current working directory.
Various modules and functions have been revised, added, renamed or removed:
! BaseX 9
|-
| Retrieve XML resources.
| {{Function|Database|db:get}}
| {{Code|db:open}}
|-
| Retrieve nodes with specified pre values.
| {{Function|Database|db:get-pre}}
| {{Code|db:open-pre}}
|-
| Retrieve nodes with specified IDs.
| {{Function|Database|db:get-id}}
| {{Code|db:open-id}}
|-
| Retrieve binary resources.
| {{Function|Database|db:get-binary}}
| {{Code|db:retrieve}}
|-
| Retrieve value resources.
| {{Function|Database|db:get-value}}
| ''new''
|-
| Add or replace resource.
| {{Function|Database|db:put}}, arguments swapped!
| {{Code|db:replace}}
|-
| Add or replace binary resource.
| {{Function|Database|db:put-binary}}, arguments swapped!
| {{Code|db:store}}
|-
| Add or replace value resource.
| {{Function|Database|db:put-value}}
| ''new''
|-
| Get resource type.
| {{Function|Database|db:type}}
| {{Code|db:is-raw}}, {{Code|db:is-xml}}
|-
| Fetch XML document.
| {{Function|Fetch|fetch:doc}}
| {{Code|fetch:xml}}
|-
| Convert binary data to XML.
| {{Function|Fetch|fetch:binary-doc}}
| {{Code|fetch:xml-binary}}
|-
| Main-memory key-value store.| [[Store Module]]: Process Geo data| ''newremoved''|-| Return variable bindings of a job.| {{Function||job:bindings}}| ''new''Geo Module
|-
| XQuery jobs
| Jobs Module
|-
| Return variable bindings of a job| {{Function|Job|job:bindings}}| ''new''|-| Return variable bindings of a job| {{Function|Job|job:remove}}| {{Code|jobs:stop}}|-| Module: Main-memory key-value store| [[Store Module]]| ''new''|-| Module: String computations
| [[String Module]]
| Strings Module
|-
| Format string| {{Function|String|string:format}}| {{Code|out:format}}|-| Return control characters| {{Function|String|string:cr}}, {{Function|String|string:nl}}, {{Function|String|string:tab}}| {{Code|out:cr}}, {{Code|out:nl}}, {{Code|out:tab}}|-| Module: Process ZIP files
| ''removed''
| ZIP Module
|-
| Process Geo data
| ''removed''
| Geo Module
|}
 
Functions of all modules, excluding the [[File Module]], now consistently resolve relative URI references against the static base URI, and not the current working directory.
=Commands=
! BaseX 9
|-
| List directories and resources.| {{Command|DIR}}| ''new''|-| Retrieve single XML document.
| {{Command|GET}}
| ''new''
|-
| List directories and resources.Retrieve binary resource| {{Command|LISTBINARY GET}}| {{Code|RETRIEVE}}
|-
| Add or replace resources.
| {{Command|PUT}}
| {{Code|REPLACE}}
|-
| Store binary resource.
| {{Command|BINARY PUT}}
| {{Code|STORE}}
|-
| Retrieve binary resource.Returns current option values| {{Command|BINARY SHOW OPTIONS}}| {{Code|GET}}| Old name: -| Lists jobs| ''removed''| {{Command|JOBS LIST}}|-| Returns a job result| ''removed''| {{CodeCommand|RETRIEVEJOBS RESULT}}
|-
| Returns the current option values.Stops a job| {{Command|SHOW OPTIONS}}''removed''| Old name: {{CodeCommand|GETJOBS STOP}}
|}
=HTTP Requests=
HTTP requests in BaseX take advantage of are now based on the new [https://openjdk.org/groups/net/httpclient/intro.html Java HTTP Client]. This client provides a better overall performance, uses internal connection pools and follows redirects across different protocols (http, https).
HTTP operations are, among others, performed by:
* <code>fn:doc</code> and <code>fn:collection</code>;
* the {{Command|CREATE DB}} and {{Command|REPO INSTALL}} commands.
 
=[[REST]]=
 
Results in the {{Code|rest}} namespace are now returned unprefixed:
 
<syntaxhighlight lang="xml">
<!-- before -->
<rest:databases xmlns:rest="http://basex.org/rest"/>
 
<!-- after -->
<databases xmlns="http://basex.org/rest"/>
</syntaxhighlight>
 
When listing the resources of a database, {{Code|dir}} elements are returned for resources that are located in subdirectories.
=Catalogs=
The icons were replaced by scalable ones, building upon the [https://openjdk.org/jeps/263 HiDPI graphics support for Windows and Linux].
 
=REST=
 
Results in the {{Code|rest}} namespace are now returned without prefix:
 
<syntaxhighlight lang="xml">
<!-- before -->
<rest:databases xmlns:rest="http://basex.org/rest"/>
 
<!-- now -->
<databases xmlns="http://basex.org/rest"/>
</syntaxhighlight>
 
When listing the resources of a database, {{Code|dir}} elements are returned for resources that are located in subdirectories. See [[REST]] for more details.
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu