Difference between revisions of "Module Library"

From BaseX Documentation
Jump to navigation Jump to search
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
This article is part of the [[XQuery|XQuery Portal]].
 
This article is part of the [[XQuery|XQuery Portal]].
  
In addition to the standard [http://www.w3.org/TR/xpath-functions-30/ XQuery Functions], BaseX comes with some hundred additional functions, which are packaged in various modules.
+
In addition to the standard [https://www.w3.org/TR/xpath-functions-31/ XQuery Functions], BaseX comes with some hundred additional functions, which are packaged in various modules.
  
The namespaces of the following modules are statically known. This means that they need not be (but may be) declared in the query prolog.
+
The namespaces of the built-in modules are statically bound to their prefix. This means that they need not (but may) be declared in the query prolog.
 +
 
 +
=Conventions=
  
 
{| class="wikitable sortable"
 
{| class="wikitable sortable"
Line 87: Line 89:
 
| <code><nowiki>http://basex.org/modules/html</nowiki></code>
 
| <code><nowiki>http://basex.org/modules/html</nowiki></code>
 
|-
 
|-
| [[HTTP Module|HTTP]]
+
| [[HTTP Client Module|HTTP Client]]
 
| Sending HTTP requests, based on the [http://expath.org/spec/http-client EXPath HTTP] module.
 
| Sending HTTP requests, based on the [http://expath.org/spec/http-client EXPath HTTP] module.
 
| <code>http</code>
 
| <code>http</code>
Line 108: Line 110:
 
|-
 
|-
 
| [[JSON Module|JSON]]
 
| [[JSON Module|JSON]]
| Parsing and serializing [http://www.json.org JSON documents].
+
| Parsing and serializing [https://www.json.org JSON documents].
 
| <code>json</code>
 
| <code>json</code>
 
| <code><nowiki>http://basex.org/modules/json</nowiki></code>
 
| <code><nowiki>http://basex.org/modules/json</nowiki></code>
Line 123: Line 125:
 
|-
 
|-
 
| [[Math Module|Math]]
 
| [[Math Module|Math]]
| Mathematical operations, extending the [http://www.w3.org/TR/xpath-functions-30/ W3C Working Draft].
+
| Mathematical operations, extending the [https://www.w3.org/TR/xpath-functions-31/ W3C Working Draft].
 
| <code>math</code>
 
| <code>math</code>
 
| <code><nowiki>http://www.w3.org/2005/xpath-functions/math</nowiki></code>
 
| <code><nowiki>http://www.w3.org/2005/xpath-functions/math</nowiki></code>
Line 168: Line 170:
 
|-
 
|-
 
| [[Update Module|Update]]
 
| [[Update Module|Update]]
| Functions for performing updates. {{Mark|Introduced with Version 9.0}}
+
| Functions for performing updates.
 
| <code>update</code>
 
| <code>update</code>
 
| <code><nowiki>http://basex.org/modules/update</nowiki></code>
 
| <code><nowiki>http://basex.org/modules/update</nowiki></code>
Line 208: Line 210:
 
|}
 
|}
  
Some additional external modules exist, which can be used as follows:
+
The following modules will be available if the {{Code|basex-api}} library is included in the classpath. This will be the case if you start BaseX with one of the startup scripts or links provided by our complete distributions (zip, exe, war).
 
 
* The {{Code|basex-api}} package must be included in the classpath. This is automatically the case if you use one of the complete distributions (zip, exe, war) of BaseX.
 
* The modules must be explicitly imported in the query prolog.
 
  
 
{| class="wikitable sortable"
 
{| class="wikitable sortable"
Line 244: Line 243:
 
| <code>sessions</code>
 
| <code>sessions</code>
 
| <code><nowiki>http://basex.org/modules/sessions</nowiki></code>
 
| <code><nowiki>http://basex.org/modules/sessions</nowiki></code>
 +
|-
 +
| [[WebSocket Module|WebSocket]]
 +
| Functions for handling WebSocket connections.
 +
| <code>ws</code>
 +
| <code><nowiki>http://basex.org/modules/ws</nowiki></code>
 
|}
 
|}

Revision as of 11:39, 14 July 2020

This article is part of the XQuery Portal.

In addition to the standard XQuery Functions, BaseX comes with some hundred additional functions, which are packaged in various modules.

The namespaces of the built-in modules are statically bound to their prefix. This means that they need not (but may) be declared in the query prolog.

Conventions

Module Description Prefix Namespace URI
Admin Functions restricted to admin users. admin http://basex.org/modules/admin
Archive Creating and processing ZIP archives. archive http://basex.org/modules/archive
Array Functions for handling arrays. array http://www.w3.org/2005/xpath-functions/array
Binary Processing binary data. bin http://expath.org/ns/binary
Client Executing commands and queries on remote BaseX servers. client http://basex.org/modules/client
Conversion Converting data (binary, numeric) to other formats. convert http://basex.org/modules/convert
Cryptography Cryptographic functions, based on the EXPath Cryptograhic module. crypto http://expath.org/ns/crypto
CSV Functions for processing CSV input. csv http://basex.org/modules/csv
Database Functions for accessing and updating databases. db http://basex.org/modules/db
Fetch Functions for fetching resources identified by URIs. fetch http://basex.org/modules/fetch
File File handling, based on the latest draft of the EXPath File module. file http://expath.org/ns/file
Full-Text Functions for performing full-text operations. ft http://basex.org/modules/ft
Hashing Cryptographic hash functions. hash http://basex.org/modules/hash
Higher-Order Additional higher-order functions that are not in the standard libraries. hof http://basex.org/modules/hof
HTML Functions for converting HTML input to XML documents. html http://basex.org/modules/html
HTTP Client Sending HTTP requests, based on the EXPath HTTP module. http http://expath.org/ns/http-client
Index Functions for requesting details on database indexes. index http://basex.org/modules/index
Inspection Functions for extracting internal module information. inspect http://basex.org/modules/inspect
Jobs Organization of running commands and queries. jobs http://basex.org/modules/jobs
JSON Parsing and serializing JSON documents. json http://basex.org/modules/json
Lazy Functions for handling lazy items. lazy http://basex.org/modules/lazy
Map Functions for handling maps (key/value pairs). map http://www.w3.org/2005/xpath-functions/map
Math Mathematical operations, extending the W3C Working Draft. math http://www.w3.org/2005/xpath-functions/math
Output Functions for simplifying formatted output. out http://basex.org/modules/out
Process Executing system commands from XQuery. proc http://basex.org/modules/proc
Profiling Functions for profiling code snippets. prof http://basex.org/modules/prof
Random Functions for creating random numbers. random http://basex.org/modules/random
Repository Installing, deleting and listing packages. repo http://basex.org/modules/repo
SQL JDBC bridge to access relational databases. sql http://basex.org/modules/sql
Strings Functions for performing string computations. strings http://basex.org/modules/strings
Unit Unit testing framework. unit http://basex.org/modules/unit
Update Functions for performing updates. update http://basex.org/modules/update
User Creating and administering database users. user http://basex.org/modules/user
Utility Various utility and helper functions. util http://basex.org/modules/util
Validation Validating documents: DTDs, XML Schema, RelaxNG. validate http://basex.org/modules/validate
Web Convenience functions for building web applications. web http://basex.org/modules/web
XQuery Evaluating new XQuery expressions at runtime. xquery http://basex.org/modules/xquery
XSLT Stylesheet transformations, based on Java’s and Saxon’s XSLT processor. xslt http://basex.org/modules/xslt
ZIP ZIP functionality, based on the EXPath ZIP module (soon obsolete). zip http://expath.org/ns/zip

The following modules will be available if the basex-api library is included in the classpath. This will be the case if you start BaseX with one of the startup scripts or links provided by our complete distributions (zip, exe, war).

Module Description Prefix Namespace URI
Geo Functions for processing geospatial data. geo http://expath.org/ns/geo
Request Server-side functions for handling HTTP Request data. request http://exquery.org/ns/request
RESTXQ Helper functions for the RESTXQ API. rest http://exquery.org/ns/restxq
Session Functions for handling server-side HTTP Sessions. session http://basex.org/modules/session
Sessions Functions for managing all server-side HTTP Sessions. sessions http://basex.org/modules/sessions
WebSocket Functions for handling WebSocket connections. ws http://basex.org/modules/ws