Zorba (XQuery processor)

Last updated

Zorba is an open source query processor written in C++, [1] implementing

Contents

Zorba is distributed under Apache License, Version 2.0. The project is mainly supported by the FLWOR Foundation, Oracle, and 28msec.

Specifications

Zorba provides the implementation of the following W3C specifications:

Zorba also provides implementations of:

Scripting

Scripting Extension 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.

(: this is a variable declaration statement :)variable$aasxs:integer:=0;variable$basxs:integer:=1;variable$casxs:integer:=$a+$b;variable$fibseqasxs:integer*:=($a,$b);while($clt100){(: this is a variable assignment statement :)$fibseq:=($fibseq,$c);$a:=$b;$b:=$c;$c:=$a+$b;}$fibseq

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

variable$stores:=doc("stores.xml")/stores;
(: Create :)insertnode<store><store-number>4</store-number><state>NY</state></store> into $stores;
(: Update :)replacevalueofnode$stores/store[state="NY"]/store-numberwith"5";
(: Delete :)deletenode$stores/store[state!="NY"];
(: Read :)$stores

Data Definition Facility

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.

modulenamespaceg="http://www.zorba-xquery.com/guestbook";importmodulenamespacedb="http://www.zorba-xquery.com/modules/store/static/collections/dml";declarenamespacean="http://www.zorba-xquery.com/annotations";(: Declares a collection named entries :)declarecollectiong:entriesaselement(entry);(: Declares a variable that points to the g:entries collection :)declarevariable$g:entries:=xs:QName('g:entries');(: Declares an index named entry on top of the entries collection :)declare%an:automatic%value-equalityindexg:entryonnodesdb:collection(xs:QName('g:entries'))byxs:string(@id)asxs: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. 28msec implements a store on top of MongoDB. The XQuery in the Browser project has built a browser plugin for Zorba and leverages the DOM as its store.

APIs

Zorba is usable through different host languages: C++, C, XQJ / Java, PHP, Python, C#, Ruby, and even XQuery/JSONiq.

Zorba is also available as a command-line tool.

XQDT is an XQuery plugin for the Eclipse (IDE). It fully supports Zorba API and syntax.

Modules

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

Related Research Articles

A Uniform Resource Identifier (URI) is a unique sequence of characters that identifies a logical or physical resource used by web technologies. URIs may be used to identify anything, including real-world objects, such as people and places, concepts, or information resources such as web pages and books. Some URIs provide a means of locating and retrieving information resources on a network ; these are Uniform Resource Locators (URLs). A URL provides the location of the resource. A URI identifies the resource by name at the specified location or URL. Other URIs provide only a unique name, without a means of locating or retrieving the resource or information about it; these are Uniform Resource Names (URNs). The web technologies that use URIs are not limited to web browsers. URIs are used to identify anything described using the Resource Description Framework (RDF), for example, concepts that are part of an ontology defined using the Web Ontology Language (OWL), and people who are described using the Friend of a Friend vocabulary would each have an individual URI.

<span class="mw-page-title-main">XML</span> Markup language by the W3C for encoding of data

Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing arbitrary data. It defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. The World Wide Web Consortium's XML 1.0 Specification of 1998 and several other related specifications—all of them free open standards—define XML.

In computing, the term Extensible Stylesheet Language (XSL) is used to refer to a family of languages used to transform and render XML documents.

XSLT is a language originally designed for transforming XML documents into other XML documents, or other formats such as HTML for web pages, plain text or XSL Formatting Objects, which may subsequently be converted to other formats, such as PDF, PostScript and PNG. Support for JSON and plain-text transformation was added in later updates to the XSLT 1.0 specification.

Saxon is an XSLT and XQuery processor created by Michael Kay and now developed and maintained by his company, Saxonica. There are open-source and also closed-source commercial versions. Versions exist for Java, JavaScript and .NET.

XPath 2.0 is a version of the XPath language defined by the World Wide Web Consortium, W3C. It became a recommendation on 23 January 2007. As a W3C Recommendation it was superseded by XPath 3.0 on 10 April 2014.

eXist-db is an open source software project for NoSQL databases built on XML technology. It is classified as both a NoSQL document-oriented database system and a native XML database. Unlike most relational database management systems (RDBMS) and NoSQL databases, eXist-db provides XQuery and XSLT as its query and application programming languages.

The identity transform is a data transformation that copies the source data into the destination data without change.

The programming language XQuery defines FLWOR as an expression that supports iteration and binding of variables to intermediate results. FLWOR is an acronym: FOR, LET, WHERE, ORDER BY, RETURN. FLWOR is loosely analogous to SQL's SELECT-FROM-WHERE and can be used to provide join-like functionality to XML documents.

XML documents have a hierarchical structure and can conceptually be interpreted as a tree structure, called an XML tree.

<span class="mw-page-title-main">RDFLib</span> Python library to serialize, parse and process RDF data

RDFLib is a Python library for working with RDF, a simple yet powerful language for representing information. This library contains parsers/serializers for almost all of the known RDF serializations, such as RDF/XML, Turtle, N-Triples, & JSON-LD, many of which are now supported in their updated form. The library also contains both in-memory and persistent Graph back-ends for storing RDF information and numerous convenience functions for declaring graph namespaces, lodging SPARQL queries and so on. It is in continuous development with the most recent stable release, rdflib 6.1.1 having been released on 20 December 2021. It was originally created by Daniel Krech with the first release in November, 2002.

XPath is an expression language designed to support the query or transformation of XML documents. It was defined by the World Wide Web Consortium (W3C) in 1999, and can be used to compute values from the content of an XML document. Support for XPath exists in applications that support XML, such as web browsers, and many programming languages.

In software development XRX is a web application architecture based on XForms, REST and XQuery. XRX applications store data on both the web client and on the web server in XML format and do not require a translation between data formats. XRX is considered a simple and elegant application architecture due to the minimal number of translations needed to transport data between client and server systems. The XRX architecture is also tightly coupled to W3C standards to ensure XRX applications will be robust in the future. Because XRX applications leverage modern declarative languages on the client and functional languages on the server they are designed to empower non-developers who are not familiar with traditional imperative languages such as JavaScript, Java or .Net.

XQuery is a query and functional programming language that queries and transforms collections of structured and unstructured data, usually in the form of XML, text and with vendor-specific extensions for other data formats. The language is developed by the XML Query working group of the W3C. The work is closely coordinated with the development of XSLT by the XSL Working Group; the two groups share responsibility for XPath, which is a subset of XQuery.

EMML, or Enterprise Mashup Markup Language, is an XML markup language for creating enterprise mashups, which are software applications that consume and mash data from variety of sources, often performing logical or mathematical operations as well as presenting data.

<span class="mw-page-title-main">XQuery API for Java</span> Application programming interface

XQuery API for Java (XQJ) refers to the common Java API for the W3C XQuery 1.0 specification.

<span class="mw-page-title-main">BaseX</span> XML database management and query system

BaseX is a native and light-weight XML database management system and XQuery processor, developed as a community project on GitHub. It is specialized in storing, querying, and visualizing large XML documents and collections. BaseX is platform-independent and distributed under the BSD-3-Clause license.

<span class="mw-page-title-main">XML transformation language</span> Type of programming language

An XML transformation language is a programming language designed specifically to transform an input XML document into an output document which satisfies some specific goal.

JSONiq is a query and functional programming language that is designed to declaratively query and transform collections of hierarchical and heterogeneous data in format of JSON, XML, as well as unstructured, textual data.

XPath 3 is the latest version of the XML Path Language, a query language for selecting nodes in XML documents. It supersedes XPath 1.0 and XPath 2.0.

References

  1. Changqing, Li; Wang, Ling, Tok (2010-02-28). Advanced Applications and Structures in XML Processing: Label Streams, Semantics Utilization and Data Query Technologies: Label Streams, Semantics Utilization and Data Query Technologies. IGI Global. p. 40. ISBN   978-1-61520-728-2.{{cite book}}: CS1 maint: multiple names: authors list (link)