Product SiteDocumentation Site

JSONiq 0.1

Introduction to JSONiq

The SQL of NoSQL

Edition 0

Ghislain Fourny


Abstract
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. As a result, JSONiq is an expressive and highly optimizable language to query and update any kind of JSONiq store or resource. It enables developers to leverage the same productive high-level language across a variety of NoSQL products. This book gives a complete introduction to the JSONiq language. It does so by giving examples for all types of expressions and functions. Those examples can be immediately used because they work standalone, which allows the interested reader to start diving into the language.

1. Introduction
1.1. NoSQL - Why Are Relational Databases Not Good Enough?
1.2. Why JSONiq?
1.3. How to Run the Queries in This Book?
1.4. Acknowledgements
I. JSON and the JSONiq Data Model
2. The JSON Syntax
2.1. JSON Strings
2.2. JSON Numbers
2.3. JSON Booleans
2.4. JSON Null
2.5. JSON Objects
3. The JSONiq Data Model
3.1. JSONiq Values: Items and Sequences
3.2. Objects
3.3. Arrays
3.4. Atomics
4. The JSONiq Type System
4.1. Item Types
4.1.1. Atomic Types
4.1.2. JSON Item Types : Object Types and Array Types
4.1.3. The Most General Item Type.
4.2. Sequence Types
II. Construction of Items and JSON Navigation
5. Construction of Items
5.1. Atomic Literals
5.1.1. String Literals
5.1.2. Number Literals.
5.1.3. Boolean and Null Literals
5.2. Object Constructors
5.3. Array Constructors
5.4. Composing Constructors
6. Collections
6.1. Collections Used Throughout This Book
7. JSON Navigation
7.1. Object Navigation
7.2. Array Unboxing
7.3. Sequence Filtering
7.4. Array Navigation
III. JSONiq Expressions
8. Basic Operations
8.1. Construction of Sequences
8.1.1. Comma Operator
8.1.2. Range Operator
8.2. Parenthesized Expressions
8.3. Arithmetics
8.4. String Concatenation
8.5. Comparison
8.6. Empty Sequence Behavior
8.7. Logic
8.7.1. Propositional Logic
8.7.2. First-Order Logic (Quantified Variables)
8.8. Builtin Functions
9. Control Flow Expressions
9.1. Conditional Expressions
9.2. Switch expressions
9.3. Try-Catch expressions
10. FLWOR Expressions
10.1. Variables
10.2. For Clauses
10.3. Where Clauses
10.4. Order Clauses
10.5. Group Clauses
10.6. Let Clauses
10.7. Count Clauses
10.8. Map Operator
10.9. Composing FLWOR Expressions
10.10. Ordered and Unordered Expressions
11. Expressions Dealing with Types
11.1. Instance-of Expressions
11.2. Treat Expressions
11.3. Castable Expressions
11.4. Cast Expressions
11.5. Typeswitch Expressions
IV. Prolog, Modules and Functions
12. Prologs
12.1. Setters.
12.1.1. Default Ordering Mode
12.1.2. Default Ordering Behaviour for Empty Sequences
12.1.3. Default Decimal Format
12.2. Namespaces
12.3. Global Variables
12.4. User-Defined Functions
13. Modules
14. Function Library
V. Advanced Notes
15. Errors
16. Equality vs. Identity
17. Sequences vs. Arrays
18. Null vs. Empty Sequence
19. Reference