Product SiteDocumentation Site

JSONiq Extension to XQuery 1.0

Specification

XML and JSON: A Language To Rule Them All

Edition 1.0.4

Daniela Florescu

Till Westmann

Edited by

Ghislain Fourny

ETH Zurich

Abstract
The JSONiq extension to XQuery allows processing XML and JSON natively and with a single language. This extension is based on the same data model as the core JSONiq and is based on the same logical concepts. Because of the complexity of the XQuery grammar, the JSONiq extension to XQuery has a less pleasant syntax that the JSONiq core.

1. Status
2. Introduction
3. JSONiq Data Model
3.1. Simple Datatypes
3.2. JSON Items
3.3. Objects
3.4. Arrays
3.5. ItemTypes for JSONiq Items
4. Construction of JSON values
4.1. Array Constructors
4.2. Object Constructors
4.3. Strings
4.4. Numbers
4.5. Booleans
4.6. Null
4.7. Boolean and null literals
5. Navigation in JSON content
5.1. Object lookup
5.2. Object key listing
5.3. Array lookup
5.4. Array unboxing
6. Builtin functions and operators
6.1. fn:boolean (aka Effective Boolean Value)
6.2. fn:collection
6.3. fn:data (aka Atomization)
6.4. fn:string (aka string value)
6.5. fn:trace
6.6. jn:decode-from-roundtrip
6.7. jn:encode-for-roundtrip
6.8. jn:json-doc
6.9. jn:keys
6.10. jn:members
6.11. jn:null
6.12. jn:parse-json
6.13. jn:size
6.14. Changes to cast semantics
6.15. Changes to arithmetic operation semantics
6.16. Changes to value comparison semantics
6.17. Changes to general comparison semantics
7. JSON updates
7.1. JSON udpate primitives
7.2. Update syntax: new updating expressions
7.2.1. Deleting expressions
7.2.2. Inserting expressions
7.2.3. Renaming expressions
7.2.4. Replacing expressions
7.2.5. Appending expressions
8. Function library
8.1. libjn:accumulate
8.2. libjn:descendant-arrays
8.3. libjn:descendant-objects
8.4. libjn:descendant-pairs
8.5. libjn:flatten
8.6. libjn:intersect
8.7. libjn:project
8.8. libjn:remove-keys
8.9. libjn:values
9. Combining XML and JSON
10. JSON Serialization
10.1. New serialization parameters
10.2. Changes to sequence normalization
10.3. The JSON output method
10.3.1. Serialization of a sequence of items
10.3.2. Serialization of individual JSON values
10.3.3. Influence of other serialization parameters upon the JSON output method
10.4. The JSON-XML-hybrid output method
10.5. Changes to ther other output methods
11. Error codes
12. Grammar Summary
13. Implementation in Zorba
A. Revision History
Index