Zorba (XQuery processor)


Zorba is an open source query processor written in C++, implementing
Zorba is distributed under Apache License, Version 2.0.
The project is mainly supported by the , Oracle, and .

Specifications

Zorba provides the implementation of the following W3C specifications:
Zorba also provides implementations of:
is an open specification that provides semantic for side-effects in XQuery or JSONiq programs.
It also provides a user-friendly syntax for imperative programming within such programs.
The following code snippet is an example of the Scripting syntax. It computes a sequence containing all the Fibonacci numbers that are less than 100.

variable $a as xs:integer := 0;
variable $b as xs:integer := 1;
variable $c as xs:integer := $a + $b;
variable $fibseq as xs:integer* := ;
while
$fibseq

The following is an example of CRUD operations using Scripting, XQuery, and XQuery Update.

variable $stores := doc/stores;


insert node 4NY into $stores;


replace value of node $stores/store/store-number with "5";


delete node $stores/store;


$stores

Data Definition Facility

provides a semantic for persistent artifacts such as collections and indexes in XQuery or JSONiq programs.
For instance, the following code snippets declares a collection named entries and an index on that collection named entry.

module namespace g = "http://www.zorba-xquery.com/guestbook";
import module namespace db = "http://www.zorba-xquery.com/modules/store/static/collections/dml";
declare namespace an = "http://www.zorba-xquery.com/annotations";
declare collection g:entries as element;
declare variable $g:entries := xs:QName;
declare %an:automatic %value-equality index g:entry
on nodes db:collection
by xs:string as xs:string;

Storage

Zorba provides a pluggable store so it can be used on different kind of environments: disk, database, browser.
By default, Zorba is built with a main memory store.
implements a store on top of MongoDB.
The project has built a browser plugin for Zorba and leverages the DOM as its store.

APIs

Zorba is usable through : C++, C, XQJ / Java, PHP, Python, C#, Ruby, and even .
Zorba is also available as a .
is an XQuery plugin for the Eclipse. It fully supports Zorba API and syntax.

Modules

Zorba provides more than 70 XQuery modules for building applications. Some of these modules are: