Product SiteDocumentation Site

1.2. Why JSONiq?

NoSQL has a very broad meaning and, while the general principles are similar between data stores, each data stores has a specific format for the values (or trees) and a query language tailored for the data store.
JSONiq was developed with the idea that many data stores share the same design principles (e.g., collections of trees) so that it should be possibly to query them in a unified and portable way.
JSONiq is a query and processing language specifically designed for the popular JSON data model. The main ideas behind JSONiq are based on lessons learned in more than 30 years of relational query systems and more than 15 years of experience with designing and implementing query languages for semi-structured data like XML and RDF.
The main source of inspiration behind JSONiq is XQuery, which has been proven so far a successful and productive query language for semi-structured data (in particular XML). JSONiq borrowed a large numbers of ideas from XQuery like the structure and semantics of a FLWOR construct, the functional aspect of the language, the semantics of comparisons in the face of data heterogeneity, the declarative, snapshot-based updates. However, unlike XQuery, JSON is not concerned with the peculiarities of XML like mixed content, ordered children, the confusion between attributes and elements, the complexities of namespaces and QNames, or the complexities of XML Schema, and so on.
The power of the XQuery's FLWOR construct and the functional aspect combined with the simplicity of the JSON data model results in a clean, sleek, and easy to understand data processing language. As a matter of fact, JSONiq is a language that can do more than queries: it can describe powerful data processing programs from transformations, selections, joins of heterogeneous data sets, data enrichment, information extraction, information cleaning, and so on.
Technically, the main characteristics of JSONiq (and XQuery) are the following: