Product SiteDocumentation Site

JSONiq - the SQL of NoSQL 1.0

JSONiq

The complete reference

Edition 1.0.12

Daniela Florescu

Till Westmann

Edited by

Ghislain Fourny

ETH Zurich

Abstract
This document provides a complete reference of the core of JSONiq, the JSON query language.

1. Introduction
1.1. Why JSONiq?
1.2. Structure of a JSONiq program.
2. JSON and the JSONiq data model
2.1. JSON
2.2. JSONiq values
2.3. Objects
2.4. Arrays
2.5. Atomics
3. Collections
4. JSONiq types
4.1. Item types
4.1.1. Atomics
4.1.2. JSON items
4.1.3. The most general item type.
4.2. Sequence types
5. Expressions
5.1. Construction of items
5.1.1. Atomic literals
5.1.2. Object constructors
5.1.3. Array constructors
5.1.4. Composing constructors
5.2. Basic operations
5.2.1. Construction of sequences
5.2.2. Parenthesized expression
5.2.3. Arithmetics
5.2.4. String concatenation
5.2.5. Comparison
5.2.6. Logics
5.3. Function Calls
5.4. Selectors
5.4.1. Object field selector
5.4.2. Array member selector
5.4.3. Sequence predicates
5.5. Control flow expressions
5.5.1. Conditional expressions
5.5.2. Switch expressions
5.5.3. Try-catch expressions
5.6. FLWOR expressions
5.6.1. For clauses
5.6.2. Where clauses
5.6.3. Order clauses
5.6.4. Group clauses
5.6.5. Let clauses
5.6.6. Count clauses
5.6.7. Map operator
5.6.8. Composing FLWOR expressions
5.6.9. Ordered and Unordered expressions
5.7. Expressions dealing with types
5.7.1. Instance-of expressions
5.7.2. Treat expressions
5.7.3. Castable expressions
5.7.4. Cast expressions
5.7.5. Typeswitch expressions
6. Prologs
6.1. Setters.
6.1.1. Default collation
6.1.2. Default ordering mode
6.1.3. Default ordering behaviour for empty sequences
6.1.4. Default decimal format
6.2. Global variables
6.3. Functions
7. Modules
8. Function Library
8.1. JSON specific functions.
8.1.1. keys
8.1.2. members
8.1.3. null
8.1.4. parse-json
8.1.5. size
8.1.6. accumulate
8.1.7. descendant-arrays
8.1.8. descendant-objects
8.1.9. descendant-pairs
8.1.10. flatten
8.1.11. intersect
8.1.12. project
8.1.13. remove-keys
8.1.14. values
8.1.15. encode-for-roundtrip
8.1.16. decode-from-roundtrip
8.2. Functions taken from XQuery
9. Equality and identity
10. Notes
10.1. Sequences vs. Arrays
10.2. Null vs. empty sequence
11. Open Issues
A. Revision History
Index