Changes

Jump to navigation Jump to search
1,349 bytes added ,  14:42, 20 July 2022
=Prerequisites=
BaseX 10 requires Java 11 or later to run. Databases created with BaseX 10 the new version are backward compatible and can still be opened with BaseX 9.
=Migrating Applications=
The following modifications might be relevant when migrating existing applications:
* The default ports for web applications have been changed from 8984/8985 to 8080/8081.
* If a new application of BaseX is deployed, the {{Code|admin}} user can only be used after 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}}.
* The conventions for functions in [[Clients]] in other programming languages were revised.
=Storage=
==Whitespaces==
With BaseX 10, all All whitespaces are now preserved when importing XML resources, unless whitespace stripping is enabled.
The notorious {{Code|CHOP}} option was removed to prevent conflicting behavior caused by earlier installations. It was replaced by a new {{CodeOption|STRIPWS}} option, which defaults to {{Code|false}}. In addition, the new default of the [[Serialization|serialization parameter]] {{Code|indent}} is {{Code|no}}.
Please be warned that the new default can throw off existing applications. If you want to restore the old behavior, you should assign the following values in your [[Configuration|.basex configuration file]], or the {{Code|web.xml}} file of your [[Web Application]]:
The [[Commands#Backups|Backup Commands]] and [[Database_Module#Backups|Backup Functions]] were enhanced to back up general data: [[User Management|registered users]], [[Jobs Module#Services|scheduled services]], [[Store Module|key-value stores]].
 
=Commands=
 
The following commands have been revised:
 
* Added: {{Command|GET}}: Retrieves a single XML document.
* Added: {{Command|DIR}}: Lists directories and resources.
* Renamed: {{Code|GET}} → {{Command|SHOW OPTIONS}}
* Renamed: {{Code|STORE}} → {{Command|BINARY PUT}}
* Renamed: {{Code|RETRIEVE}} → {{Command|BINARY GET}}
* Renamed: {{Code|REPLACE}} → {{Command|PUT}}
=XQuery=
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.
With BaseX 10, compilation Compilation has now been split into two separate steps:
# ''Compilation'' of logical, context-independent operations. External values are bound to the query, and deterministic code is rewritten, simplified and pre-evaluated.
}
</syntaxhighlight>
 
==Key-Value Store==
 
A new [[Store Module]] provides functions to organize values in a persistent main-memory key-value store. The store allows you to speed up access to frequently accessed data.
 
; Store data:
 
<syntaxhighlight lang="xquery">
let $email := map:merge(
for $address in db:get('addressbook')//address
return map:entry($address/name, $address/email)
)
return store:put('emails', $email)
</syntaxhighlight>
 
; Retrieve data:
 
<syntaxhighlight lang="xquery">
let $name := 'Richard David James'
return store:get('email')($name)
</syntaxhighlight>
 
The store is persistent: Its contents are written to disk, and retrieved from disk again after a restart.
==Modules==
The 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: {| class="wikitable"|-! Description! BaseX 10! 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}}|-| Module: Process Geo data| ''removed''| Geo Module|-| XQuery jobs| [[Store Job Module]] provides | Jobs Module|-| Return variable bindings of a persistent mainjob| {{Function||job:bindings}}| ''new''|-| Module: Main-memory key-value store for speeding up operations on frequently accessed data.| [[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|}
Some existing query modules have been revised:=Commands=
* [[Database Module]]:** Added: {{Function|Database|db:put-value}}, {{Function|Database|db:get-value}}.** {{Code|db:open}}/{{Code|db:open-id}}/{{Code|db:open-pre}} → {{Function|Database|db:get}}/{{Function|Database|db:get-id}}/{{Function|Database|db:get-pre}}** {{Code|db:replace}} → {{Function|Database|db:put}}: Second and third arguments The following commands have been swapped.** {{Code|dbrevised:store}} → {{Function|Database|db:put-binary}}: Second and third arguments have been swapped.** {{Code|db:retrieve}} → {{Function|Database|db:get-binary}}** {{Code|db:is-raw}}/{{Code|db:is-xml}} → {{Function|Database|db:type}}* [[Fetch Module]]:** {{Code|fetch:xml}} → {{Function|Database|fetch:doc}}** {{Code|fetch:xml-binary}} → {{Function|Database|fetch:binary-doc}}* The Jobs Module has been renamed to [[Job Module]].* The Strings Module has been renamed to [[String Module]].* The ZIP Module and the Geo Module have been removed.
Functions of all modules, excluding the [[File Module]], now consistently resolve relative URI references against the static base URI, {| class="wikitable"|-! Description! BaseX 10! BaseX 9|-| Retrieve single XML document.| {{Command|GET}}| –|-| List directories and not resources.| {{Command|LIST}}| –|-| Add or replace resources.| {{Command|PUT}}| {{Code|REPLACE}}|-| Store binary resource.| {{Command|BINARY PUT}}| {{Code|STORE}}|-| Retrieve binary resource.| {{Command|BINARY GET}}| Old name: {{Code|RETRIEVE}}|-| Returns the current working directoryoption values.| {{Command|SHOW OPTIONS}}| Old name: {{Code|GET}}|}
=HTTP Requests=
<rest:databases xmlns:rest="http://basex.org/rest"/>
<!-- before after -->
<databases xmlns="http://basex.org/rest"/>
</syntaxhighlight>
=Catalogs=
From early on, catalog resolvers had been neglected both in BaseX and Java. This has changed: The new [https://docs.oracle.com/en/java/javase/11/core/xml-catalog-api1.html XML Catalog API] from Java is now universally used to resolve references to external resources. As an alternative, Norman Walsh’s [https://xmlresolver.org/ Enhanced XML Resolver] will be used is utilized if it is found in the classpath.
The option for supplying the XML catalog was renamed from <code>CATFILE</code> to {{Option|CATALOG}}. See [[Catalog Resolver]] for more details.
 
<syntaxhighlight lang="xquery">
-Djavax.xml.catalog.resolve=continue
Q{java:System}setProperty('javax.xml.catalog.resolve', 'continue')
</syntaxhighlight>
=Graphical User Interface=
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu