Merge lp:~zorba-coders/zorba/bug-1049508 into lp:zorba

Proposed by Chris Hillery
Status: Merged
Approved by: Chris Hillery
Approved revision: 11060
Merged at revision: 11060
Proposed branch: lp:~zorba-coders/zorba/bug-1049508
Merge into: lp:zorba
Diff against target: 1709 lines (+196/-196)
158 files modified
ChangeLog (+2/-2)
doc/zorba/JSONforXQuery.html (+1/-1)
doc/zorba/XQueryforJSON.html (+1/-1)
doc/zorba/xqdoc/images/modules.svg (+2/-2)
doc/zorba/xqdoc/templates/www.functx.com_index.html (+3/-3)
doc/zorba/xqdoc/templates/www.w3.org_2005_xpath-functions.html (+3/-3)
doc/zorba/xqdoc/templates/www.w3.org_2005_xpath-functions_math.html (+3/-3)
modules/org/jsoniq/www/CMakeLists.txt (+3/-3)
modules/org/jsoniq/www/function-library.xq (+3/-3)
modules/org/jsoniq/www/functions.xq (+6/-6)
modules/org/jsoniq/www/pregenerated/errors.xq (+3/-3)
src/context/static_context.cpp (+2/-2)
src/diagnostics/diagnostic_list_xq.xq (+1/-1)
src/functions/func_jsoniq_functions_impl.cpp (+1/-1)
src/functions/pregenerated/func_jsoniq_functions.cpp (+15/-15)
src/runtime/spec/mappings.xml (+1/-1)
src/store/naive/store.cpp (+1/-1)
src/zorbamisc/ns_consts.h (+1/-1)
test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/encode_01.xml.res (+1/-1)
test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/encode_08.xml.res (+1/-1)
test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/roundtrip_01.xml.res (+1/-1)
test/rbkt/Queries/zorba/jsoniq/arr_append_01.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/arr_delete_02.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/arr_delete_03.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/arr_delete_04.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/arr_delete_05.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/arr_delete_08.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/arr_delete_09.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/arr_insert_01.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/arr_insert_02.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/arr_insert_03.xq (+2/-2)
test/rbkt/Queries/zorba/jsoniq/arr_insert_04.xq (+2/-2)
test/rbkt/Queries/zorba/jsoniq/arr_insert_05.xq (+2/-2)
test/rbkt/Queries/zorba/jsoniq/arr_insert_06.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/arr_insert_06.xq (+2/-2)
test/rbkt/Queries/zorba/jsoniq/arr_replace_01.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/arr_update_01.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/arr_update_02.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/arr_update_02.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/coll_dyn_02.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/data01.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/data02.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/data03.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/data04.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/ebv01.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/ebv02.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/ebv03.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/flatten_01.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jn_accumulate.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jn_descendant_objects.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jn_descendant_pairs.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jn_intersect.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jn_values.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jndy0003-1.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jndy0003-2.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jndy0018-1.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jndy0018-2.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jndy0018-3.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jndy0018-4.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jnty0004-1.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jnty0004-2.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jnty0007-1.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jnty0007-2.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jnty0007-4.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jnty0007-5.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jnty0007-6.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jnty0007-7.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jnty0008-1.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jnty0008-2.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jnty0008-3.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jnty0008-4.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jnty0008-5.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jnty0008-6.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jnty0008-7.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jnty0008-8.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jnup0005.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jnup0006.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jnup0009-1.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jnup0009-2.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jnup0010.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jnup0011-1.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/jnup0011-2.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/member_01.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/member_03.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/names_01.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/names_02.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_constr_03.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_constr_05.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_constr_06.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_constr_10.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_delete_01.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_delete_02.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_delete_03.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_delete_03.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_delete_05.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_delete_05.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_delete_06.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_delete_07.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_delete_08.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_delete_09.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_insert_01.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_insert_02.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_insert_02.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_insert_03.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_insert_04.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_insert_04.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_insert_12.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_insert_15.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_insert_16.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_insert_16.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_rename_01.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_rename_02.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_rename_02.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_rename_03.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_rename_03.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_rename_04.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_rename_05.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_rename_06.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_replace_01.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_replace_02.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_replace_03.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_replace_04.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_replace_05.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_update_01.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/obj_update_02.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/object_03.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/pair-constructor-atomize-array.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/pair-constructor-atomize-object.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/pair_01.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/parse_json-02.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/parse_json-03.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/parse_json-04.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/roundtrip/decode_01.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/roundtrip/decode_03.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/roundtrip/decode_05.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/roundtrip/encode_05.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/roundtrip/encode_06.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/serializer-JNSE0022.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/serializer-jsoniq-disallow-mixed-1.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/serializer-jsoniq-disallow-mixed-2.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/serializer-jsoniq-disallow-mixed-3.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/serializer-jsoniq-disallow-mixed-4.spec (+1/-1)
test/rbkt/Queries/zorba/jsoniq/use_case01.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/use_case01_2.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/use_case02.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/use_case03.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/use_case04.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/use_case06.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/use_case07.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/use_case08.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/use_case09.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/use_case10.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/use_case11.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/value_01.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/values_01.xq (+1/-1)
test/rbkt/Queries/zorba/serialization/cloudscript/extensions3.spec (+1/-1)
test/rbkt/Queries/zorba/serialization/cloudscript/multiple1.spec (+1/-1)
test/rbkt/Queries/zorba/xqdoc/moduleDocumentation.xq (+1/-1)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug-1049508
Reviewer Review Type Date Requested Status
Matthias Brantner Approve
Chris Hillery Approve
Review via email: mp+126266@code.launchpad.net

Commit message

Change all namespaces from http://www.jsoniq.org/ to http://jsoniq.org, to match specification.

To post a comment you must log in.
Revision history for this message
Chris Hillery (ceejatec) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Matthias Brantner (matthias-brantner) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job bug-1049508-2012-09-25T15-08-11.524Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2012-09-24 21:28:44 +0000
3+++ ChangeLog 2012-09-25 15:07:26 +0000
4@@ -8,7 +8,7 @@
5 * Allow prolog variables to be referenced before they are declared (XQuery 3.0 feature)
6 * xml:parse (fragment parsing) now allows for a DOCTYPE declaration at the
7 beginning of the XML document (requested in bug #1016606).
8- * New module http://www.jsoniq.org/modules/function-library with handy JSONiq
9+ * New module http://jsoniq.org/modules/function-library with handy JSONiq
10 functions. jn:object is also supported.
11 * jn:parse-json can parse multiple top-level JSON items. Also, there is jn:parse-json#2 that
12 takes options to parameterize the parsing process (see bug #1047547)
13@@ -68,7 +68,7 @@
14
15 New Features:
16 * Include first-class support for JSON data by implementing the JSONiq spec
17- - see http://www.jsoniq.org/ for more information. This feature is enabled by default.
18+ - see http://jsoniq.org/ for more information. This feature is enabled by default.
19 * Implemented the new EQName syntax (use Q{namespace}local instead of "namespace":local)
20 * New function Item::isSeekable for streamable content (xs:string and xs:base64Binary)
21 * Implemented the latest W3C specification for the group by clause (backwards incompatible)
22
23=== modified file 'doc/zorba/JSONforXQuery.html'
24--- doc/zorba/JSONforXQuery.html 2012-09-17 00:36:37 +0000
25+++ doc/zorba/JSONforXQuery.html 2012-09-25 15:07:26 +0000
26@@ -1,1 +1,1 @@
27-<html><head><title>JSON for XQuery</title><style type="text/css">@import url('https://themes.googleusercontent.com/fonts/css?kit=lhDjYqiy3mZ0x6ROQEUoUw');ol{margin:0;padding:0}.c9{padding-left:0pt;text-align:justify;margin-left:36pt}.c7{list-style-type:disc;margin:0;padding:0}.c19{max-width:468pt;background-color:#ffffff;padding:72pt 72pt 72pt 72pt}.c20{color:inherit;text-decoration:inherit}.c11{text-indent:-13pt;margin-left:77pt}.c2{font-size:36pt;font-weight:bold}.c21{color:#1155cc;text-decoration:underline}.c16{font-weight:bold}.c3{color:#38761d}.c15{text-indent:120pt}.c22{color:#4a86e8}.c17{text-align:center}.c13{margin-left:49.5pt}.c6{text-align:right}.c10{text-indent:156pt}.c0{font-family:"Consolas"}.c12{text-indent:144pt}.c14{text-align:justify}.c8{text-indent:139.5pt}.c5{margin-left:144pt}.c18{font-style:italic}.c4{height:11pt}.c1{direction:ltr}.title{padding-top:24pt;line-height:1.15;text-align:center;color:#4a86e8;font-size:36pt;font-family:"Arial";font-weight:bold;padding-bottom:6pt}.subtitle{padding-top:18pt;line-height:1.15;text-align:left;color:#666666;font-style:italic;font-size:24pt;font-family:"Georgia";padding-bottom:4pt}li{color:#000000;font-size:11pt;font-family:"Arial"}p{color:#000000;font-size:11pt;margin:0;font-family:"Arial"}h1{padding-top:24pt;line-height:1.15;text-align:left;color:#4a86e8;font-size:24pt;font-family:"Arial";font-weight:bold;padding-bottom:6pt}h2{padding-top:18pt;line-height:1.15;text-align:left;color:#ff9900;font-size:18pt;font-family:"Arial";font-weight:bold;padding-bottom:4pt}h3{padding-top:14pt;line-height:1.15;text-align:left;color:#000000;font-size:14pt;font-family:"Arial";font-weight:bold;padding-bottom:4pt}h4{padding-top:12pt;line-height:1.15;text-align:left;color:#000000;font-size:12pt;font-family:"Arial";font-weight:bold;padding-bottom:2pt}h5{padding-top:11pt;line-height:1.15;text-align:left;color:#000000;font-size:11pt;font-family:"Arial";font-weight:bold;padding-bottom:2pt}h6{padding-top:10pt;line-height:1.15;text-align:left;color:#000000;font-size:10pt;font-family:"Arial";font-weight:bold;padding-bottom:2pt}</style></head><body class="c19"><p class="c17 c1"><span class="c2">JSONiq for XQuery users</span></p><p class="c4 c1 c15"><span></span></p><hr><p class="c1 c17"><span>This tutorial introduces the JSONiq language, which declaratively manipulates JSON data.</span></p><p class="c17 c1"><span>Why don&#39;t you go ahead can try the queries of this document on our online demo interface?</span></p><p class="c17 c1"><span>&nbsp;</span><span class="c21 c16"><a class="c20" href="http://www.zorba-xquery.com/html/jsoniq">http://www.zorba-xquery.com/html/jsoniq</a></span></p><hr><p class="c4 c1"><span></span></p><h1 class="c1"><a name="h.f453h84m2u1a"></a><span>JSON</span></h1><p class="c14 c1"><span>As explained on </span><span class="c21"><a class="c20" href="http://www.json.org/">http://www.json.org/</a></span><span>, JSON is a lightweight data-interchange format designed for humans as well as for computers. It supports as values:</span></p><ol class="c7" start="1"><li class="c9 c1"><span>objects (string-to-value map)</span></li><li class="c9 c1"><span>arrays (ordered sequence of values)</span></li><li class="c1 c9"><span>strings</span></li><li class="c9 c1"><span>numbers</span></li><li class="c9 c1"><span>booleans (true, false)</span></li><li class="c9 c1"><span>null</span></li></ol><p class="c4 c1"><span></span></p><p class="c1"><span>JSONiq extends XQuery to query and update JSON data, like XML data.</span></p><h1 class="c1"><a name="h.qtfakecy3fr7"></a><span>Elevator Pitch</span></h1><p class="c14 c1"><span>Here is an appetizer before we start the tutorial from scratch.</span></p><p class="c4 c1"><span></span></p><p class="c1"><span class="c0">let $stores :=</span></p><p class="c1"><span class="c0">[</span></p><p class="c1"><span class="c0">&nbsp; { &quot;store number&quot; : 1, &quot;state&quot; : &quot;MA&quot; },</span></p><p class="c1"><span class="c0">&nbsp; { &quot;store number&quot; : 2, &quot;state&quot; : &quot;MA&quot; },</span></p><p class="c1"><span class="c0">&nbsp; { &quot;store number&quot; : 3, &quot;state&quot; : &quot;CA&quot; },</span></p><p class="c1"><span class="c0">&nbsp; { &quot;store number&quot; : 4, &quot;state&quot; : &quot;CA&quot; }</span></p><p class="c1"><span class="c0">]</span></p><p class="c1"><span class="c0">let $sales := [</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;broiler&quot;, &quot;store number&quot; : 1, &quot;quantity&quot; : 20 &nbsp;},</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;toaster&quot;, &quot;store number&quot; : 2, &quot;quantity&quot; : 100 },</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;toaster&quot;, &quot;store number&quot; : 2, &quot;quantity&quot; : 50 },</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;toaster&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 50 },</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;blender&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 100 },</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;blender&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 150 },</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;socks&quot;, &quot;store number&quot; : 1, &quot;quantity&quot; : 500 },</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;socks&quot;, &quot;store number&quot; : 2, &quot;quantity&quot; : 10 },</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;shirt&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 10 }</span></p><p class="c1"><span class="c0">]</span></p><p class="c1"><span class="c0">let $join :=</span></p><p class="c1"><span class="c0">&nbsp; for $store in jn:members($stores), $sale in jn:members($sales)</span></p><p class="c1"><span class="c0">&nbsp; where $store(&quot;store number&quot;) = $sale(&quot;store number&quot;)</span></p><p class="c1"><span class="c0">&nbsp; return {</span></p><p class="c1"><span class="c0">&nbsp; &nbsp; &quot;nb&quot; : $store(&quot;store number&quot;),</span></p><p class="c1"><span class="c0">&nbsp; &nbsp; &quot;state&quot; : $store(&quot;state&quot;),</span></p><p class="c1"><span class="c0">&nbsp; &nbsp; &quot;sold&quot; : $sale(&quot;product&quot;)</span></p><p class="c1"><span class="c0">&nbsp; }</span></p><p class="c1"><span class="c0">return [$join]</span></p><p class="c5 c1"><span class="c3 c0">[ </span></p><p class="c5 c1"><span class="c3 c0">&nbsp; { &quot;nb&quot; : 1, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;broiler&quot; },</span></p><p class="c5 c1"><span class="c3 c0">&nbsp; { &quot;nb&quot; : 1, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;socks&quot; },</span></p><p class="c5 c1"><span class="c3 c0">&nbsp; { &quot;nb&quot; : 2, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;toaster&quot; },</span></p><p class="c5 c1"><span class="c3 c0">&nbsp; { &quot;nb&quot; : 2, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;toaster&quot; },</span></p><p class="c5 c1"><span class="c3 c0">&nbsp; { &quot;nb&quot; : 2, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;socks&quot; },</span></p><p class="c5 c1"><span class="c3 c0">&nbsp; { &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;toaster&quot; },</span></p><p class="c5 c1"><span class="c3 c0">&nbsp; { &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;blender&quot; },</span></p><p class="c5 c1"><span class="c3 c0">&nbsp; { &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;blender&quot; },</span></p><p class="c5 c1"><span class="c3 c0">&nbsp; { &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;shirt&quot; }</span></p><p class="c5 c1"><span class="c3 c0">&nbsp;]</span></p><p class="c4 c1"><span></span></p><h1 class="c1"><a name="h.yugk1mszt0re"></a><span>And here you go</span></h1><h2 class="c1"><a name="h.39rm37noeh9g"></a><span>JSONiq types</span></h2><p class="c1"><span>JSONiq maps JSON types to the XQuery data model. Numbers are xs:integer, xs:decimal or xs:double, strings are xs:string, true and false are xs:boolean and null is the unique value of a new atomic type jn:null.</span></p><p class="c4 c1"><span></span></p><p class="c1"><span>By default, in JSONiq, for convenience, true, false and null are recognized as literals instead of the classical XQuery path expression semantics (i.e., they would otherwise navigate to XML elements named &quot;true&quot;, &quot;false&quot; or &quot;null&quot;). However, this can be deactivated to use the path expression semantics.</span></p><p class="c4 c1"><span></span></p><p class="c1"><span>JSONiq also introduces new items: objects and arrays. Objects are sets of key/value pairs. Arrays have members which are values. Values are objects, arrays, XML nodes, functions or atomic items. Note that, in particular, Arrays can nest, unlike sequences.</span></p><p class="c4 c1"><span></span></p><p class="c1"><span>The new item types for objects and arrays are object() and array(). json-item() is a supertype of both. structured-item() is a supertype for json-item() and node().</span></p><h2 class="c1"><a name="h.j0wg8654ivtw"></a><span>JSON Constructors</span></h2><p class="c1"><span>JSONiq introduces JSON constructors, in a similar way to XML constructors.</span></p><p class="c4 c1"><span></span></p><p class="c1"><span>You can put any expression in a array. The items in the sequence produced by the expression will become members of the array:</span></p><p class="c4 c1"><span></span></p><p class="c1"><span class="c0">[ 1 to 10 ]</span></p><p class="c6 c1"><span class="c3 c0">[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]</span></p><p class="c6 c4 c1"><span class="c3 c0"></span></p><p class="c1"><span>Or you can dynamically compute an object:</span></p><p class="c4 c1"><span></span></p><p class="c1"><span class="c0">{</span></p><p class="c1"><span class="c0">&nbsp; &quot;Greeting&quot; : let $d := &quot;Mister Spock&quot;</span></p><p class="c1"><span class="c0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return concat(&quot;Hello, &quot;, $d),</span></p><p class="c1"><span class="c0">&nbsp; &quot;Farewell&quot; : string-join((&quot;Live&quot;, &quot;long&quot;, &quot;and&quot;, &quot;prosper&quot;),</span></p><p class="c1"><span class="c0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot; &quot;)</span></p><p class="c1"><span class="c0">}</span></p><p class="c4 c1"><span class="c3 c0"></span></p><p class="c6 c1"><span class="c3 c0">{ &quot;Greeting&quot; : &quot;Hello, Mister Spock&quot;, &quot;Farewell&quot; : &quot;Live long and prosper&quot; }</span></p><p class="c4 c1"><span class="c3"></span></p><p class="c1"><span>You can also dynamically generate singleton objects:</span></p><p class="c4 c1"><span class="c0"></span></p><p class="c1"><span class="c0">{ concat(&quot;Square of &quot;, 2) : 2 * 2 }</span></p><p class="c6 c1"><span class="c3 c0">{ &quot;Square of 2&quot; : 4 }</span></p><p class="c6 c4 c1"><span class="c3 c0"></span></p><p class="c1"><span>and then use the {| |} construct to wrap several of them in a bigger object:</span></p><p class="c4 c1"><span class="c0"></span></p><p class="c1"><span class="c0">{|</span></p><p class="c1"><span class="c0">&nbsp; for $i in 1 to 10</span></p><p class="c1"><span class="c0">&nbsp; return { concat(&quot;Square of &quot;, $i) : $i * $i }</span></p><p class="c1"><span class="c0">|}</span></p><p class="c5 c1"><span class="c3 c0">{</span></p><p class="c5 c1"><span class="c3 c0">&quot;Square of 1&quot; : 1,</span></p><p class="c5 c1"><span class="c3 c0">&quot;Square of 2&quot; : 4,</span></p><p class="c5 c1"><span class="c3 c0">&quot;Square of 3&quot; : 9,</span></p><p class="c1 c5"><span class="c3 c0">&quot;Square of 4&quot; : 16,</span></p><p class="c5 c1"><span class="c3 c0">&quot;Square of 5&quot; : 25,</span></p><p class="c5 c1"><span class="c3 c0">&quot;Square of 6&quot; : 36,</span></p><p class="c5 c1"><span class="c3 c0">&quot;Square of 7&quot; : 49,</span></p><p class="c5 c1"><span class="c3 c0">&quot;Square of 8&quot; : 64,</span></p><p class="c5 c1"><span class="c3 c0">&quot;Square of 9&quot; : 81,</span></p><p class="c5 c1"><span class="c3 c0">&quot;Square of 10&quot; : 100</span></p><p class="c5 c1"><span class="c3 c0">}</span></p><p class="c4 c1"><span></span></p><h2 class="c1"><a name="h.qe57mgdf5ql"></a><span>JSON as a subset of JSONiq</span></h2><p class="c14 c1"><span>As a rule of thumb, a well-formed JSON document is a JSONiq expression as well. This means that you can copy-and-paste a JSON document into a query. The following are JSONiq queries that are &quot;idempotent&quot; (they just output themselves):</span></p><p class="c4 c1"><span></span></p><p class="c1"><span class="c0">{ &quot;pi&quot; : 3.14, &quot;sq2&quot; : 1.4 }</span></p><p class="c6 c1"><span class="c3 c0">{ &quot;pi&quot; : 3.14, &quot;sq2&quot; : 1.4 }</span></p><p class="c1 c4"><span class="c3 c0"></span></p><p class="c1"><span class="c0">[ 2, 3, 5, 7, 11, 13 ]</span></p><p class="c6 c1"><span class="c3 c0">[ 2, 3, 5, 7, 11, 13 ]</span></p><p class="c4 c1"><span class="c0"></span></p><p class="c1"><span class="c0">{</span></p><p class="c1"><span class="c0">&nbsp; &quot;operations&quot; : [</span></p><p class="c1"><span class="c0">&nbsp; &nbsp; { &quot;binary&quot; : [ &quot;and&quot;, &quot;or&quot;] },</span></p><p class="c1"><span class="c0">&nbsp; &nbsp; { &quot;unary&quot; : [&quot;not&quot;] }</span></p><p class="c1"><span class="c0">&nbsp; ],</span></p><p class="c1"><span class="c0">&nbsp; &quot;bits&quot; : [</span></p><p class="c1"><span class="c0">&nbsp; &nbsp; 0, 1</span></p><p class="c1"><span class="c0">&nbsp; ]</span></p><p class="c1"><span class="c0">}</span></p><p class="c12 c1"><span class="c0 c3">{</span></p><p class="c12 c1"><span class="c3 c0">&nbsp; &quot;operations&quot; : [</span></p><p class="c12 c1"><span class="c3 c0">&nbsp; &nbsp; { &quot;binary&quot; : [ &quot;and&quot;, &quot;or&quot; ] },</span></p><p class="c1 c12"><span class="c3 c0">&nbsp; &nbsp; { &quot;unary&quot; : [ &quot;not&quot; ] }</span></p><p class="c12 c1"><span class="c3 c0">&nbsp; ],</span></p><p class="c12 c1"><span class="c3 c0">&nbsp; &quot;bits&quot; : [</span></p><p class="c12 c1"><span class="c3 c0">&nbsp; &nbsp; 0, 1</span></p><p class="c12 c1"><span class="c3 c0">&nbsp; ]</span></p><p class="c12 c1"><span class="c3 c0">}</span></p><p class="c6 c4 c1"><span class="c3 c0"></span></p><p class="c14 c1"><span>This works with objects, arrays (even nested), strings, numbers, booleans, null. </span><span class="c18">The exceptions to this rule (but we are working on it!) are that:</span></p><p class="c14 c1"><span class="c18">(i) empty objects are not recognized</span></p><p class="c14 c1"><span class="c18">(ii) characters escaped with the \ in JSON strings are not recognized, XML character references are recognized instead.</span></p><p class="c4 c1"><span class="c0 c18"></span></p><p class="c14 c1"><span>It also works the other way round: if your query outputs an object or an array, you can directly use it as a JSON document.</span></p><p class="c6 c4 c1"><span class="c3 c0"></span></p><h1 class="c1"><a name="h.dewn8sw3husv"></a><span>JSON Navigation</span></h1><p class="c14 c1"><span>Up to now, you learnt how to compose expressions so as to do some computations and to build objects and arrays. It also works the other way round: if you have some JSON data, you can access it and navigate.</span></p><p class="c10 c4 c1"><span></span></p><p class="c14 c1"><span>All you need to know is: JSONiq views</span></p><ol class="c7" start="1"><li class="c9 c1"><span>an array as an ordered list of values,</span></li><li class="c9 c1"><span>an object as a set of name/value pairs</span></li></ol><h2 class="c14 c1"><a name="h.zcnazhl6374z"></a><span>Objects</span></h2><p class="c14 c1"><span>You can use an object as if it were a function and pass the call an argument of type xs:string. It will return the value associated thereto:</span></p><p class="c10 c4 c1"><span></span></p><p class="c1"><span class="c0">let $person := {</span></p><p class="c1"><span class="c0">&nbsp;&quot;first name&quot; : &quot;Sarah&quot;,</span></p><p class="c1"><span class="c0">&nbsp;&quot;age&quot; : 13,</span></p><p class="c1"><span class="c0">&nbsp;&quot;gender&quot; : &quot;female&quot;,</span></p><p class="c1"><span class="c0">&nbsp;&quot;friends&quot; : [ &quot;Jim&quot;, &quot;Mary&quot;, &quot;Jennifer&quot;]</span></p><p class="c1"><span class="c0">}</span></p><p class="c1"><span class="c0">return $person(&quot;first name&quot;)</span></p><p class="c6 c10 c1"><span class="c3 c0">&quot;Sarah&quot;</span></p><p class="c10 c4 c1"><span class="c3 c0"></span></p><p class="c1"><span>You can also ask for all keys in an object:</span></p><p class="c4 c1"><span></span></p><p class="c1"><span class="c0">let $person := {</span></p><p class="c1"><span class="c0">&nbsp;&quot;name&quot; : &quot;Sarah&quot;,</span></p><p class="c1"><span class="c0">&nbsp;&quot;age&quot; : 13,</span></p><p class="c1"><span class="c0">&nbsp;&quot;gender&quot; : &quot;female&quot;,</span></p><p class="c1"><span class="c0">&nbsp;&quot;friends&quot; : [ &quot;Jim&quot;, &quot;Mary&quot;, &quot;Jennifer&quot;]</span></p><p class="c1"><span class="c0">}</span></p><p class="c1"><span class="c0">return { &quot;keys&quot; : [ jn:keys($person)] }</span></p><p class="c10 c4 c1"><span class="c0"></span></p><p class="c6 c1 c11"><span class="c3 c0">{ &quot;keys&quot; : [ &quot;name&quot;, &quot;age&quot;, &quot;gender&quot;, &quot;friends&quot; ] }</span></p><h2 class="c1"><a name="h.30wafxvenhgy"></a><span>Arrays</span></h2><p class="c14 c1"><span>You can use an array as if it were a function and pass the call an argument of type xs:integer. It will return the entry at that position:</span></p><p class="c10 c4 c1"><span></span></p><p class="c1"><span class="c0">let $friends := [ &quot;Jim&quot;, &quot;Mary&quot;, &quot;Jennifer&quot;]</span></p><p class="c1"><span class="c0">return $friends(2)</span></p><p class="c6 c10 c1"><span class="c3 c0">Mary</span></p><p class="c4 c1"><span class="c3 c0"></span></p><p class="c1"><span>It is also possible to get the size of an array:</span></p><p class="c4 c1 c10"><span></span></p><p class="c1"><span class="c0">let $person := {</span></p><p class="c1"><span class="c0">&nbsp;&quot;name&quot; : &quot;Sarah&quot;,</span></p><p class="c1"><span class="c0">&nbsp;&quot;age&quot; : 13,</span></p><p class="c1"><span class="c0">&nbsp;&quot;gender&quot; : &quot;female&quot;,</span></p><p class="c1"><span class="c0">&nbsp;&quot;friends&quot; : [ &quot;Jim&quot;, &quot;Mary&quot;, &quot;Jennifer&quot;]</span></p><p class="c1"><span class="c0">}</span></p><p class="c1"><span class="c0">return { &quot;how many friends&quot; : jn:size($person(&quot;friends&quot;)) }</span></p><p class="c10 c4 c1"><span class="c0"></span></p><p class="c6 c10 c1"><span class="c3 c0">{ &quot;how many friends&quot; : 3 }</span></p><p class="c10 c4 c1"><span class="c3 c0"></span></p><p class="c1"><span>For convenience, there is a function that returns all elements in an array, as a sequence:</span></p><p class="c10 c4 c1"><span></span></p><p class="c1"><span class="c0">let $person := {</span></p><p class="c1"><span class="c0">&nbsp;&quot;name&quot; : &quot;Sarah&quot;,</span></p><p class="c1"><span class="c0">&nbsp;&quot;age&quot; : 13,</span></p><p class="c1"><span class="c0">&nbsp;&quot;gender&quot; : &quot;female&quot;,</span></p><p class="c1"><span class="c0">&nbsp;&quot;friends&quot; : [ &quot;Jim&quot;, &quot;Mary&quot;, &quot;Jennifer&quot;]</span></p><p class="c1"><span class="c0">}</span></p><p class="c1"><span class="c0">return jn:members($person(&quot;friends&quot;))</span></p><p class="c4 c1"><span class="c0"></span></p><p class="c6 c10 c1"><span class="c3 c0">Jim Mary Jennifer</span></p><h1 class="c1"><a name="h.eb0bxle2oykl"></a><span>Relational Algebra</span></h1><p class="c14 c1"><span>Remember SQL&#39;s SELECT FROM WHERE statements? JSONiq inherits selection, projection and join capability from XQuery FLWOR expressions. In order to traverse an array, jn:members() converts it into a sequence which can then be iterated over by a FLWOR expression.</span></p><p class="c4 c1"><span></span></p><p class="c1"><span class="c0">let $stores :=</span></p><p class="c1"><span class="c0">[</span></p><p class="c1"><span class="c0">&nbsp; { &quot;store number&quot; : 1, &quot;state&quot; : &quot;MA&quot; },</span></p><p class="c1"><span class="c0">&nbsp; { &quot;store number&quot; : 2, &quot;state&quot; : &quot;MA&quot; },</span></p><p class="c1"><span class="c0">&nbsp; { &quot;store number&quot; : 3, &quot;state&quot; : &quot;CA&quot; },</span></p><p class="c1"><span class="c0">&nbsp; { &quot;store number&quot; : 4, &quot;state&quot; : &quot;CA&quot; }</span></p><p class="c1"><span class="c0">]</span></p><p class="c1"><span class="c0">let $sales := [</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;broiler&quot;, &quot;store number&quot; : 1, &quot;quantity&quot; : 20 &nbsp;},</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;toaster&quot;, &quot;store number&quot; : 2, &quot;quantity&quot; : 100 },</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;toaster&quot;, &quot;store number&quot; : 2, &quot;quantity&quot; : 50 },</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;toaster&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 50 },</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;blender&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 100 },</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;blender&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 150 },</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;socks&quot;, &quot;store number&quot; : 1, &quot;quantity&quot; : 500 },</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;socks&quot;, &quot;store number&quot; : 2, &quot;quantity&quot; : 10 },</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;shirt&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 10 }</span></p><p class="c1"><span class="c0">]</span></p><p class="c1"><span class="c0">let $join :=</span></p><p class="c1"><span class="c0">&nbsp; for $store in jn:members($stores), $sale in jn:members($sales)</span></p><p class="c1"><span class="c0">&nbsp; where $store(&quot;store number&quot;) = $sale(&quot;store number&quot;)</span></p><p class="c1"><span class="c0">&nbsp; return {</span></p><p class="c1"><span class="c0">&nbsp; &nbsp; &quot;nb&quot; : $store(&quot;store number&quot;),</span></p><p class="c1"><span class="c0">&nbsp; &nbsp; &quot;state&quot; : $store(&quot;state&quot;),</span></p><p class="c1"><span class="c0">&nbsp; &nbsp; &quot;sold&quot; : $sale(&quot;product&quot;)</span></p><p class="c1"><span class="c0">&nbsp; }</span></p><p class="c1"><span class="c0">return [$join]</span></p><p class="c8 c1"><span class="c3 c0">[ </span></p><p class="c8 c1"><span class="c3 c0">{ &quot;nb&quot; : 1, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;broiler&quot; },</span></p><p class="c8 c1"><span class="c3 c0">{ &quot;nb&quot; : 1, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;socks&quot; },</span></p><p class="c1 c8"><span class="c3 c0">{ &quot;nb&quot; : 2, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;toaster&quot; },</span></p><p class="c8 c1"><span class="c3 c0">{ &quot;nb&quot; : 2, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;toaster&quot; },</span></p><p class="c8 c1"><span class="c3 c0">{ &quot;nb&quot; : 2, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;socks&quot; },</span></p><p class="c8 c1"><span class="c3 c0">{ &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;toaster&quot; },</span></p><p class="c8 c1"><span class="c3 c0">{ &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;blender&quot; },</span></p><p class="c8 c1"><span class="c3 c0">{ &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;blender&quot; },</span></p><p class="c8 c1"><span class="c3 c0">{ &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;shirt&quot; }</span></p><p class="c8 c1"><span class="c3 c0">&nbsp;]</span></p><h1 class="c1"><a name="h.oii6pvliilhi"></a><span>Access external data</span></h1><p class="c1"><span>Our implementation supports collections of (and indices on) JSON objects or arrays:</span></p><p class="c4 c1"><span></span></p><p class="c1"><span class="c0">dml:collection(&quot;my:data&quot;)</span></p><p class="c6 c1"><span class="c3 c0">{ &quot;foo&quot; : &quot;Your&quot; }</span></p><p class="c6 c1"><span class="c3 c0">{ &quot;foo&quot; : &quot;Collection&quot; }</span></p><p class="c6 c1"><span class="c3 c0">{ &quot;foo&quot; : &quot;of&quot; }</span></p><p class="c6 c1"><span class="c3 c0">{ &quot;foo&quot; : &quot;JSON&quot; }</span></p><p class="c6 c1"><span class="c3 c0">{ &quot;foo&quot; : &quot;objects&quot; }</span></p><p class="c4 c1 c6"><span class="c3 c0"></span></p><p class="c1"><span>It is also possible to get JSON content with an HTTP request, or by parsing it from a string. The EXPath http-client module (described in the Zorba documentation) &nbsp;allows you to make HTTP requests, and the jn:parse-json() function allows you to use the body as an object or an array.</span></p><p class="c4 c1"><span class="c3 c0"></span></p><h1 class="c1"><a name="h.fopcxnkoydgt"></a><span>JSON and XML</span></h1><p class="c14 c1"><span>You can use XML and JSON in the same program. An XML node can be a value in an object or array, however, arrays and object may not be children of an XML node - but you can extract atomic values or XML nodes inside objects and arrays to insert them in a new XML node.</span></p><p class="c4 c1"><span></span></p><p class="c1"><span class="c0">let $data := {</span></p><p class="c1"><span class="c0">&nbsp; &quot;color&quot; : &quot;blue&quot;,</span></p><p class="c1"><span class="c0">&nbsp; &quot;closed&quot; : true,</span></p><p class="c1"><span class="c0">&nbsp; &quot;points&quot; : [[10,10], [20,10], [20,20], [10,20]]</span></p><p class="c1"><span class="c0">}</span></p><p class="c1"><span class="c0">let $stroke := attribute stroke { $data(&quot;color&quot;) }</span></p><p class="c1"><span class="c0">let $points := attribute points { jn:flatten($data(&quot;points&quot;)) }</span></p><p class="c1"><span class="c0">return</span></p><p class="c1"><span class="c0">&nbsp; if ($data(&quot;closed&quot;)) then</span></p><p class="c1"><span class="c0">&nbsp; &nbsp; &lt;svg&gt;&lt;polygon&gt;{ $stroke, $points }&lt;/polygon&gt;&lt;/svg&gt;</span></p><p class="c1"><span class="c0">&nbsp; else</span></p><p class="c1"><span class="c0">&nbsp; &nbsp; &lt;svg&gt;&lt;polyline&gt;{ $stroke, $points }&lt;/polyline&gt;&lt;/svg&gt;</span></p><p class="c4 c1"><span class="c0"></span></p><p class="c13 c6 c1"><span class="c3 c0">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span></p><p class="c6 c1 c13"><span class="c3 c0">&lt;svg&gt;&lt;polygon stroke=&quot;blue&quot; points=&quot;10 10 20 10 20 20 10 20&quot;/&gt;&lt;/svg&gt;</span></p><p class="c4 c1"><span></span></p><h1 class="c1"><a name="h.bm3buqmzhtko"></a><span>I want more</span></h1><p class="c1 c14"><span>JSONiq supports JSON updates by extending the XQuery Update Facility specification, so you can declaratively update your JSON data. JSONiq provides new expressions that produce update primitives on JSON items. The list of updates that is eventually output by your program is then applied to your JSON data.</span></p><p class="c4 c1"><span></span></p><p class="c1"><span class="c0">copy $people := {</span></p><p class="c1"><span class="c0">&nbsp;&quot;John&quot; : { &quot;status&quot; : &quot;single&quot; },</span></p><p class="c1"><span class="c0">&nbsp;&quot;Mary&quot; : { &quot;status&quot; : &quot;single&quot; } }</span></p><p class="c1"><span class="c0">modify (replace json value of $people(&quot;John&quot;)(&quot;status&quot;) with &quot;married&quot;,</span></p><p class="c1"><span class="c0">&nbsp; &nbsp; &nbsp; &nbsp; replace json value of $people(&quot;Mary&quot;)(&quot;status&quot;) with &quot;married&quot;)</span></p><p class="c1"><span class="c0">return $people</span></p><p class="c10 c4 c1"><span class="c0"></span></p><p class="c6 c1"><span class="c3 c0">{ &quot;John&quot; : { &quot;status&quot; : &quot;married&quot; }, &quot;Mary&quot; : { &quot;status&quot; : &quot;married&quot; } }</span></p><p class="c4 c1"><span></span></p><p class="c1"><span>JSONiq works with the XQuery 3.0 standard (switch, typeswitch and try-catch expressions, universal/existential quantifiers, path expressions, filtering expressions, functors, mappings, grouping, windowing will work). The Zorba implementation is also compatible with the proprietary Zorba scripting.</span></p><p class="c4 c1"><span></span></p><p class="c14 c1"><span>The complete JSONiq specification is available on </span><span class="c21"><a class="c20" href="http://www.jsoniq.org/">http://www.jsoniq.org/</a></span></p><p class="c4 c1"><span></span></p></body></html>
28\ No newline at end of file
29+<html><head><title>JSON for XQuery</title><style type="text/css">@import url('https://themes.googleusercontent.com/fonts/css?kit=lhDjYqiy3mZ0x6ROQEUoUw');ol{margin:0;padding:0}.c9{padding-left:0pt;text-align:justify;margin-left:36pt}.c7{list-style-type:disc;margin:0;padding:0}.c19{max-width:468pt;background-color:#ffffff;padding:72pt 72pt 72pt 72pt}.c20{color:inherit;text-decoration:inherit}.c11{text-indent:-13pt;margin-left:77pt}.c2{font-size:36pt;font-weight:bold}.c21{color:#1155cc;text-decoration:underline}.c16{font-weight:bold}.c3{color:#38761d}.c15{text-indent:120pt}.c22{color:#4a86e8}.c17{text-align:center}.c13{margin-left:49.5pt}.c6{text-align:right}.c10{text-indent:156pt}.c0{font-family:"Consolas"}.c12{text-indent:144pt}.c14{text-align:justify}.c8{text-indent:139.5pt}.c5{margin-left:144pt}.c18{font-style:italic}.c4{height:11pt}.c1{direction:ltr}.title{padding-top:24pt;line-height:1.15;text-align:center;color:#4a86e8;font-size:36pt;font-family:"Arial";font-weight:bold;padding-bottom:6pt}.subtitle{padding-top:18pt;line-height:1.15;text-align:left;color:#666666;font-style:italic;font-size:24pt;font-family:"Georgia";padding-bottom:4pt}li{color:#000000;font-size:11pt;font-family:"Arial"}p{color:#000000;font-size:11pt;margin:0;font-family:"Arial"}h1{padding-top:24pt;line-height:1.15;text-align:left;color:#4a86e8;font-size:24pt;font-family:"Arial";font-weight:bold;padding-bottom:6pt}h2{padding-top:18pt;line-height:1.15;text-align:left;color:#ff9900;font-size:18pt;font-family:"Arial";font-weight:bold;padding-bottom:4pt}h3{padding-top:14pt;line-height:1.15;text-align:left;color:#000000;font-size:14pt;font-family:"Arial";font-weight:bold;padding-bottom:4pt}h4{padding-top:12pt;line-height:1.15;text-align:left;color:#000000;font-size:12pt;font-family:"Arial";font-weight:bold;padding-bottom:2pt}h5{padding-top:11pt;line-height:1.15;text-align:left;color:#000000;font-size:11pt;font-family:"Arial";font-weight:bold;padding-bottom:2pt}h6{padding-top:10pt;line-height:1.15;text-align:left;color:#000000;font-size:10pt;font-family:"Arial";font-weight:bold;padding-bottom:2pt}</style></head><body class="c19"><p class="c17 c1"><span class="c2">JSONiq for XQuery users</span></p><p class="c4 c1 c15"><span></span></p><hr><p class="c1 c17"><span>This tutorial introduces the JSONiq language, which declaratively manipulates JSON data.</span></p><p class="c17 c1"><span>Why don&#39;t you go ahead can try the queries of this document on our online demo interface?</span></p><p class="c17 c1"><span>&nbsp;</span><span class="c21 c16"><a class="c20" href="http://www.zorba-xquery.com/html/jsoniq">http://www.zorba-xquery.com/html/jsoniq</a></span></p><hr><p class="c4 c1"><span></span></p><h1 class="c1"><a name="h.f453h84m2u1a"></a><span>JSON</span></h1><p class="c14 c1"><span>As explained on </span><span class="c21"><a class="c20" href="http://www.json.org/">http://www.json.org/</a></span><span>, JSON is a lightweight data-interchange format designed for humans as well as for computers. It supports as values:</span></p><ol class="c7" start="1"><li class="c9 c1"><span>objects (string-to-value map)</span></li><li class="c9 c1"><span>arrays (ordered sequence of values)</span></li><li class="c1 c9"><span>strings</span></li><li class="c9 c1"><span>numbers</span></li><li class="c9 c1"><span>booleans (true, false)</span></li><li class="c9 c1"><span>null</span></li></ol><p class="c4 c1"><span></span></p><p class="c1"><span>JSONiq extends XQuery to query and update JSON data, like XML data.</span></p><h1 class="c1"><a name="h.qtfakecy3fr7"></a><span>Elevator Pitch</span></h1><p class="c14 c1"><span>Here is an appetizer before we start the tutorial from scratch.</span></p><p class="c4 c1"><span></span></p><p class="c1"><span class="c0">let $stores :=</span></p><p class="c1"><span class="c0">[</span></p><p class="c1"><span class="c0">&nbsp; { &quot;store number&quot; : 1, &quot;state&quot; : &quot;MA&quot; },</span></p><p class="c1"><span class="c0">&nbsp; { &quot;store number&quot; : 2, &quot;state&quot; : &quot;MA&quot; },</span></p><p class="c1"><span class="c0">&nbsp; { &quot;store number&quot; : 3, &quot;state&quot; : &quot;CA&quot; },</span></p><p class="c1"><span class="c0">&nbsp; { &quot;store number&quot; : 4, &quot;state&quot; : &quot;CA&quot; }</span></p><p class="c1"><span class="c0">]</span></p><p class="c1"><span class="c0">let $sales := [</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;broiler&quot;, &quot;store number&quot; : 1, &quot;quantity&quot; : 20 &nbsp;},</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;toaster&quot;, &quot;store number&quot; : 2, &quot;quantity&quot; : 100 },</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;toaster&quot;, &quot;store number&quot; : 2, &quot;quantity&quot; : 50 },</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;toaster&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 50 },</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;blender&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 100 },</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;blender&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 150 },</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;socks&quot;, &quot;store number&quot; : 1, &quot;quantity&quot; : 500 },</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;socks&quot;, &quot;store number&quot; : 2, &quot;quantity&quot; : 10 },</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;shirt&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 10 }</span></p><p class="c1"><span class="c0">]</span></p><p class="c1"><span class="c0">let $join :=</span></p><p class="c1"><span class="c0">&nbsp; for $store in jn:members($stores), $sale in jn:members($sales)</span></p><p class="c1"><span class="c0">&nbsp; where $store(&quot;store number&quot;) = $sale(&quot;store number&quot;)</span></p><p class="c1"><span class="c0">&nbsp; return {</span></p><p class="c1"><span class="c0">&nbsp; &nbsp; &quot;nb&quot; : $store(&quot;store number&quot;),</span></p><p class="c1"><span class="c0">&nbsp; &nbsp; &quot;state&quot; : $store(&quot;state&quot;),</span></p><p class="c1"><span class="c0">&nbsp; &nbsp; &quot;sold&quot; : $sale(&quot;product&quot;)</span></p><p class="c1"><span class="c0">&nbsp; }</span></p><p class="c1"><span class="c0">return [$join]</span></p><p class="c5 c1"><span class="c3 c0">[ </span></p><p class="c5 c1"><span class="c3 c0">&nbsp; { &quot;nb&quot; : 1, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;broiler&quot; },</span></p><p class="c5 c1"><span class="c3 c0">&nbsp; { &quot;nb&quot; : 1, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;socks&quot; },</span></p><p class="c5 c1"><span class="c3 c0">&nbsp; { &quot;nb&quot; : 2, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;toaster&quot; },</span></p><p class="c5 c1"><span class="c3 c0">&nbsp; { &quot;nb&quot; : 2, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;toaster&quot; },</span></p><p class="c5 c1"><span class="c3 c0">&nbsp; { &quot;nb&quot; : 2, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;socks&quot; },</span></p><p class="c5 c1"><span class="c3 c0">&nbsp; { &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;toaster&quot; },</span></p><p class="c5 c1"><span class="c3 c0">&nbsp; { &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;blender&quot; },</span></p><p class="c5 c1"><span class="c3 c0">&nbsp; { &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;blender&quot; },</span></p><p class="c5 c1"><span class="c3 c0">&nbsp; { &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;shirt&quot; }</span></p><p class="c5 c1"><span class="c3 c0">&nbsp;]</span></p><p class="c4 c1"><span></span></p><h1 class="c1"><a name="h.yugk1mszt0re"></a><span>And here you go</span></h1><h2 class="c1"><a name="h.39rm37noeh9g"></a><span>JSONiq types</span></h2><p class="c1"><span>JSONiq maps JSON types to the XQuery data model. Numbers are xs:integer, xs:decimal or xs:double, strings are xs:string, true and false are xs:boolean and null is the unique value of a new atomic type jn:null.</span></p><p class="c4 c1"><span></span></p><p class="c1"><span>By default, in JSONiq, for convenience, true, false and null are recognized as literals instead of the classical XQuery path expression semantics (i.e., they would otherwise navigate to XML elements named &quot;true&quot;, &quot;false&quot; or &quot;null&quot;). However, this can be deactivated to use the path expression semantics.</span></p><p class="c4 c1"><span></span></p><p class="c1"><span>JSONiq also introduces new items: objects and arrays. Objects are sets of key/value pairs. Arrays have members which are values. Values are objects, arrays, XML nodes, functions or atomic items. Note that, in particular, Arrays can nest, unlike sequences.</span></p><p class="c4 c1"><span></span></p><p class="c1"><span>The new item types for objects and arrays are object() and array(). json-item() is a supertype of both. structured-item() is a supertype for json-item() and node().</span></p><h2 class="c1"><a name="h.j0wg8654ivtw"></a><span>JSON Constructors</span></h2><p class="c1"><span>JSONiq introduces JSON constructors, in a similar way to XML constructors.</span></p><p class="c4 c1"><span></span></p><p class="c1"><span>You can put any expression in a array. The items in the sequence produced by the expression will become members of the array:</span></p><p class="c4 c1"><span></span></p><p class="c1"><span class="c0">[ 1 to 10 ]</span></p><p class="c6 c1"><span class="c3 c0">[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]</span></p><p class="c6 c4 c1"><span class="c3 c0"></span></p><p class="c1"><span>Or you can dynamically compute an object:</span></p><p class="c4 c1"><span></span></p><p class="c1"><span class="c0">{</span></p><p class="c1"><span class="c0">&nbsp; &quot;Greeting&quot; : let $d := &quot;Mister Spock&quot;</span></p><p class="c1"><span class="c0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return concat(&quot;Hello, &quot;, $d),</span></p><p class="c1"><span class="c0">&nbsp; &quot;Farewell&quot; : string-join((&quot;Live&quot;, &quot;long&quot;, &quot;and&quot;, &quot;prosper&quot;),</span></p><p class="c1"><span class="c0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot; &quot;)</span></p><p class="c1"><span class="c0">}</span></p><p class="c4 c1"><span class="c3 c0"></span></p><p class="c6 c1"><span class="c3 c0">{ &quot;Greeting&quot; : &quot;Hello, Mister Spock&quot;, &quot;Farewell&quot; : &quot;Live long and prosper&quot; }</span></p><p class="c4 c1"><span class="c3"></span></p><p class="c1"><span>You can also dynamically generate singleton objects:</span></p><p class="c4 c1"><span class="c0"></span></p><p class="c1"><span class="c0">{ concat(&quot;Square of &quot;, 2) : 2 * 2 }</span></p><p class="c6 c1"><span class="c3 c0">{ &quot;Square of 2&quot; : 4 }</span></p><p class="c6 c4 c1"><span class="c3 c0"></span></p><p class="c1"><span>and then use the {| |} construct to wrap several of them in a bigger object:</span></p><p class="c4 c1"><span class="c0"></span></p><p class="c1"><span class="c0">{|</span></p><p class="c1"><span class="c0">&nbsp; for $i in 1 to 10</span></p><p class="c1"><span class="c0">&nbsp; return { concat(&quot;Square of &quot;, $i) : $i * $i }</span></p><p class="c1"><span class="c0">|}</span></p><p class="c5 c1"><span class="c3 c0">{</span></p><p class="c5 c1"><span class="c3 c0">&quot;Square of 1&quot; : 1,</span></p><p class="c5 c1"><span class="c3 c0">&quot;Square of 2&quot; : 4,</span></p><p class="c5 c1"><span class="c3 c0">&quot;Square of 3&quot; : 9,</span></p><p class="c1 c5"><span class="c3 c0">&quot;Square of 4&quot; : 16,</span></p><p class="c5 c1"><span class="c3 c0">&quot;Square of 5&quot; : 25,</span></p><p class="c5 c1"><span class="c3 c0">&quot;Square of 6&quot; : 36,</span></p><p class="c5 c1"><span class="c3 c0">&quot;Square of 7&quot; : 49,</span></p><p class="c5 c1"><span class="c3 c0">&quot;Square of 8&quot; : 64,</span></p><p class="c5 c1"><span class="c3 c0">&quot;Square of 9&quot; : 81,</span></p><p class="c5 c1"><span class="c3 c0">&quot;Square of 10&quot; : 100</span></p><p class="c5 c1"><span class="c3 c0">}</span></p><p class="c4 c1"><span></span></p><h2 class="c1"><a name="h.qe57mgdf5ql"></a><span>JSON as a subset of JSONiq</span></h2><p class="c14 c1"><span>As a rule of thumb, a well-formed JSON document is a JSONiq expression as well. This means that you can copy-and-paste a JSON document into a query. The following are JSONiq queries that are &quot;idempotent&quot; (they just output themselves):</span></p><p class="c4 c1"><span></span></p><p class="c1"><span class="c0">{ &quot;pi&quot; : 3.14, &quot;sq2&quot; : 1.4 }</span></p><p class="c6 c1"><span class="c3 c0">{ &quot;pi&quot; : 3.14, &quot;sq2&quot; : 1.4 }</span></p><p class="c1 c4"><span class="c3 c0"></span></p><p class="c1"><span class="c0">[ 2, 3, 5, 7, 11, 13 ]</span></p><p class="c6 c1"><span class="c3 c0">[ 2, 3, 5, 7, 11, 13 ]</span></p><p class="c4 c1"><span class="c0"></span></p><p class="c1"><span class="c0">{</span></p><p class="c1"><span class="c0">&nbsp; &quot;operations&quot; : [</span></p><p class="c1"><span class="c0">&nbsp; &nbsp; { &quot;binary&quot; : [ &quot;and&quot;, &quot;or&quot;] },</span></p><p class="c1"><span class="c0">&nbsp; &nbsp; { &quot;unary&quot; : [&quot;not&quot;] }</span></p><p class="c1"><span class="c0">&nbsp; ],</span></p><p class="c1"><span class="c0">&nbsp; &quot;bits&quot; : [</span></p><p class="c1"><span class="c0">&nbsp; &nbsp; 0, 1</span></p><p class="c1"><span class="c0">&nbsp; ]</span></p><p class="c1"><span class="c0">}</span></p><p class="c12 c1"><span class="c0 c3">{</span></p><p class="c12 c1"><span class="c3 c0">&nbsp; &quot;operations&quot; : [</span></p><p class="c12 c1"><span class="c3 c0">&nbsp; &nbsp; { &quot;binary&quot; : [ &quot;and&quot;, &quot;or&quot; ] },</span></p><p class="c1 c12"><span class="c3 c0">&nbsp; &nbsp; { &quot;unary&quot; : [ &quot;not&quot; ] }</span></p><p class="c12 c1"><span class="c3 c0">&nbsp; ],</span></p><p class="c12 c1"><span class="c3 c0">&nbsp; &quot;bits&quot; : [</span></p><p class="c12 c1"><span class="c3 c0">&nbsp; &nbsp; 0, 1</span></p><p class="c12 c1"><span class="c3 c0">&nbsp; ]</span></p><p class="c12 c1"><span class="c3 c0">}</span></p><p class="c6 c4 c1"><span class="c3 c0"></span></p><p class="c14 c1"><span>This works with objects, arrays (even nested), strings, numbers, booleans, null. </span><span class="c18">The exceptions to this rule (but we are working on it!) are that:</span></p><p class="c14 c1"><span class="c18">(i) empty objects are not recognized</span></p><p class="c14 c1"><span class="c18">(ii) characters escaped with the \ in JSON strings are not recognized, XML character references are recognized instead.</span></p><p class="c4 c1"><span class="c0 c18"></span></p><p class="c14 c1"><span>It also works the other way round: if your query outputs an object or an array, you can directly use it as a JSON document.</span></p><p class="c6 c4 c1"><span class="c3 c0"></span></p><h1 class="c1"><a name="h.dewn8sw3husv"></a><span>JSON Navigation</span></h1><p class="c14 c1"><span>Up to now, you learnt how to compose expressions so as to do some computations and to build objects and arrays. It also works the other way round: if you have some JSON data, you can access it and navigate.</span></p><p class="c10 c4 c1"><span></span></p><p class="c14 c1"><span>All you need to know is: JSONiq views</span></p><ol class="c7" start="1"><li class="c9 c1"><span>an array as an ordered list of values,</span></li><li class="c9 c1"><span>an object as a set of name/value pairs</span></li></ol><h2 class="c14 c1"><a name="h.zcnazhl6374z"></a><span>Objects</span></h2><p class="c14 c1"><span>You can use an object as if it were a function and pass the call an argument of type xs:string. It will return the value associated thereto:</span></p><p class="c10 c4 c1"><span></span></p><p class="c1"><span class="c0">let $person := {</span></p><p class="c1"><span class="c0">&nbsp;&quot;first name&quot; : &quot;Sarah&quot;,</span></p><p class="c1"><span class="c0">&nbsp;&quot;age&quot; : 13,</span></p><p class="c1"><span class="c0">&nbsp;&quot;gender&quot; : &quot;female&quot;,</span></p><p class="c1"><span class="c0">&nbsp;&quot;friends&quot; : [ &quot;Jim&quot;, &quot;Mary&quot;, &quot;Jennifer&quot;]</span></p><p class="c1"><span class="c0">}</span></p><p class="c1"><span class="c0">return $person(&quot;first name&quot;)</span></p><p class="c6 c10 c1"><span class="c3 c0">&quot;Sarah&quot;</span></p><p class="c10 c4 c1"><span class="c3 c0"></span></p><p class="c1"><span>You can also ask for all keys in an object:</span></p><p class="c4 c1"><span></span></p><p class="c1"><span class="c0">let $person := {</span></p><p class="c1"><span class="c0">&nbsp;&quot;name&quot; : &quot;Sarah&quot;,</span></p><p class="c1"><span class="c0">&nbsp;&quot;age&quot; : 13,</span></p><p class="c1"><span class="c0">&nbsp;&quot;gender&quot; : &quot;female&quot;,</span></p><p class="c1"><span class="c0">&nbsp;&quot;friends&quot; : [ &quot;Jim&quot;, &quot;Mary&quot;, &quot;Jennifer&quot;]</span></p><p class="c1"><span class="c0">}</span></p><p class="c1"><span class="c0">return { &quot;keys&quot; : [ jn:keys($person)] }</span></p><p class="c10 c4 c1"><span class="c0"></span></p><p class="c6 c1 c11"><span class="c3 c0">{ &quot;keys&quot; : [ &quot;name&quot;, &quot;age&quot;, &quot;gender&quot;, &quot;friends&quot; ] }</span></p><h2 class="c1"><a name="h.30wafxvenhgy"></a><span>Arrays</span></h2><p class="c14 c1"><span>You can use an array as if it were a function and pass the call an argument of type xs:integer. It will return the entry at that position:</span></p><p class="c10 c4 c1"><span></span></p><p class="c1"><span class="c0">let $friends := [ &quot;Jim&quot;, &quot;Mary&quot;, &quot;Jennifer&quot;]</span></p><p class="c1"><span class="c0">return $friends(2)</span></p><p class="c6 c10 c1"><span class="c3 c0">Mary</span></p><p class="c4 c1"><span class="c3 c0"></span></p><p class="c1"><span>It is also possible to get the size of an array:</span></p><p class="c4 c1 c10"><span></span></p><p class="c1"><span class="c0">let $person := {</span></p><p class="c1"><span class="c0">&nbsp;&quot;name&quot; : &quot;Sarah&quot;,</span></p><p class="c1"><span class="c0">&nbsp;&quot;age&quot; : 13,</span></p><p class="c1"><span class="c0">&nbsp;&quot;gender&quot; : &quot;female&quot;,</span></p><p class="c1"><span class="c0">&nbsp;&quot;friends&quot; : [ &quot;Jim&quot;, &quot;Mary&quot;, &quot;Jennifer&quot;]</span></p><p class="c1"><span class="c0">}</span></p><p class="c1"><span class="c0">return { &quot;how many friends&quot; : jn:size($person(&quot;friends&quot;)) }</span></p><p class="c10 c4 c1"><span class="c0"></span></p><p class="c6 c10 c1"><span class="c3 c0">{ &quot;how many friends&quot; : 3 }</span></p><p class="c10 c4 c1"><span class="c3 c0"></span></p><p class="c1"><span>For convenience, there is a function that returns all elements in an array, as a sequence:</span></p><p class="c10 c4 c1"><span></span></p><p class="c1"><span class="c0">let $person := {</span></p><p class="c1"><span class="c0">&nbsp;&quot;name&quot; : &quot;Sarah&quot;,</span></p><p class="c1"><span class="c0">&nbsp;&quot;age&quot; : 13,</span></p><p class="c1"><span class="c0">&nbsp;&quot;gender&quot; : &quot;female&quot;,</span></p><p class="c1"><span class="c0">&nbsp;&quot;friends&quot; : [ &quot;Jim&quot;, &quot;Mary&quot;, &quot;Jennifer&quot;]</span></p><p class="c1"><span class="c0">}</span></p><p class="c1"><span class="c0">return jn:members($person(&quot;friends&quot;))</span></p><p class="c4 c1"><span class="c0"></span></p><p class="c6 c10 c1"><span class="c3 c0">Jim Mary Jennifer</span></p><h1 class="c1"><a name="h.eb0bxle2oykl"></a><span>Relational Algebra</span></h1><p class="c14 c1"><span>Remember SQL&#39;s SELECT FROM WHERE statements? JSONiq inherits selection, projection and join capability from XQuery FLWOR expressions. In order to traverse an array, jn:members() converts it into a sequence which can then be iterated over by a FLWOR expression.</span></p><p class="c4 c1"><span></span></p><p class="c1"><span class="c0">let $stores :=</span></p><p class="c1"><span class="c0">[</span></p><p class="c1"><span class="c0">&nbsp; { &quot;store number&quot; : 1, &quot;state&quot; : &quot;MA&quot; },</span></p><p class="c1"><span class="c0">&nbsp; { &quot;store number&quot; : 2, &quot;state&quot; : &quot;MA&quot; },</span></p><p class="c1"><span class="c0">&nbsp; { &quot;store number&quot; : 3, &quot;state&quot; : &quot;CA&quot; },</span></p><p class="c1"><span class="c0">&nbsp; { &quot;store number&quot; : 4, &quot;state&quot; : &quot;CA&quot; }</span></p><p class="c1"><span class="c0">]</span></p><p class="c1"><span class="c0">let $sales := [</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;broiler&quot;, &quot;store number&quot; : 1, &quot;quantity&quot; : 20 &nbsp;},</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;toaster&quot;, &quot;store number&quot; : 2, &quot;quantity&quot; : 100 },</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;toaster&quot;, &quot;store number&quot; : 2, &quot;quantity&quot; : 50 },</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;toaster&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 50 },</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;blender&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 100 },</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;blender&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 150 },</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;socks&quot;, &quot;store number&quot; : 1, &quot;quantity&quot; : 500 },</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;socks&quot;, &quot;store number&quot; : 2, &quot;quantity&quot; : 10 },</span></p><p class="c1"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;shirt&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 10 }</span></p><p class="c1"><span class="c0">]</span></p><p class="c1"><span class="c0">let $join :=</span></p><p class="c1"><span class="c0">&nbsp; for $store in jn:members($stores), $sale in jn:members($sales)</span></p><p class="c1"><span class="c0">&nbsp; where $store(&quot;store number&quot;) = $sale(&quot;store number&quot;)</span></p><p class="c1"><span class="c0">&nbsp; return {</span></p><p class="c1"><span class="c0">&nbsp; &nbsp; &quot;nb&quot; : $store(&quot;store number&quot;),</span></p><p class="c1"><span class="c0">&nbsp; &nbsp; &quot;state&quot; : $store(&quot;state&quot;),</span></p><p class="c1"><span class="c0">&nbsp; &nbsp; &quot;sold&quot; : $sale(&quot;product&quot;)</span></p><p class="c1"><span class="c0">&nbsp; }</span></p><p class="c1"><span class="c0">return [$join]</span></p><p class="c8 c1"><span class="c3 c0">[ </span></p><p class="c8 c1"><span class="c3 c0">{ &quot;nb&quot; : 1, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;broiler&quot; },</span></p><p class="c8 c1"><span class="c3 c0">{ &quot;nb&quot; : 1, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;socks&quot; },</span></p><p class="c1 c8"><span class="c3 c0">{ &quot;nb&quot; : 2, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;toaster&quot; },</span></p><p class="c8 c1"><span class="c3 c0">{ &quot;nb&quot; : 2, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;toaster&quot; },</span></p><p class="c8 c1"><span class="c3 c0">{ &quot;nb&quot; : 2, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;socks&quot; },</span></p><p class="c8 c1"><span class="c3 c0">{ &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;toaster&quot; },</span></p><p class="c8 c1"><span class="c3 c0">{ &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;blender&quot; },</span></p><p class="c8 c1"><span class="c3 c0">{ &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;blender&quot; },</span></p><p class="c8 c1"><span class="c3 c0">{ &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;shirt&quot; }</span></p><p class="c8 c1"><span class="c3 c0">&nbsp;]</span></p><h1 class="c1"><a name="h.oii6pvliilhi"></a><span>Access external data</span></h1><p class="c1"><span>Our implementation supports collections of (and indices on) JSON objects or arrays:</span></p><p class="c4 c1"><span></span></p><p class="c1"><span class="c0">dml:collection(&quot;my:data&quot;)</span></p><p class="c6 c1"><span class="c3 c0">{ &quot;foo&quot; : &quot;Your&quot; }</span></p><p class="c6 c1"><span class="c3 c0">{ &quot;foo&quot; : &quot;Collection&quot; }</span></p><p class="c6 c1"><span class="c3 c0">{ &quot;foo&quot; : &quot;of&quot; }</span></p><p class="c6 c1"><span class="c3 c0">{ &quot;foo&quot; : &quot;JSON&quot; }</span></p><p class="c6 c1"><span class="c3 c0">{ &quot;foo&quot; : &quot;objects&quot; }</span></p><p class="c4 c1 c6"><span class="c3 c0"></span></p><p class="c1"><span>It is also possible to get JSON content with an HTTP request, or by parsing it from a string. The EXPath http-client module (described in the Zorba documentation) &nbsp;allows you to make HTTP requests, and the jn:parse-json() function allows you to use the body as an object or an array.</span></p><p class="c4 c1"><span class="c3 c0"></span></p><h1 class="c1"><a name="h.fopcxnkoydgt"></a><span>JSON and XML</span></h1><p class="c14 c1"><span>You can use XML and JSON in the same program. An XML node can be a value in an object or array, however, arrays and object may not be children of an XML node - but you can extract atomic values or XML nodes inside objects and arrays to insert them in a new XML node.</span></p><p class="c4 c1"><span></span></p><p class="c1"><span class="c0">let $data := {</span></p><p class="c1"><span class="c0">&nbsp; &quot;color&quot; : &quot;blue&quot;,</span></p><p class="c1"><span class="c0">&nbsp; &quot;closed&quot; : true,</span></p><p class="c1"><span class="c0">&nbsp; &quot;points&quot; : [[10,10], [20,10], [20,20], [10,20]]</span></p><p class="c1"><span class="c0">}</span></p><p class="c1"><span class="c0">let $stroke := attribute stroke { $data(&quot;color&quot;) }</span></p><p class="c1"><span class="c0">let $points := attribute points { jn:flatten($data(&quot;points&quot;)) }</span></p><p class="c1"><span class="c0">return</span></p><p class="c1"><span class="c0">&nbsp; if ($data(&quot;closed&quot;)) then</span></p><p class="c1"><span class="c0">&nbsp; &nbsp; &lt;svg&gt;&lt;polygon&gt;{ $stroke, $points }&lt;/polygon&gt;&lt;/svg&gt;</span></p><p class="c1"><span class="c0">&nbsp; else</span></p><p class="c1"><span class="c0">&nbsp; &nbsp; &lt;svg&gt;&lt;polyline&gt;{ $stroke, $points }&lt;/polyline&gt;&lt;/svg&gt;</span></p><p class="c4 c1"><span class="c0"></span></p><p class="c13 c6 c1"><span class="c3 c0">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span></p><p class="c6 c1 c13"><span class="c3 c0">&lt;svg&gt;&lt;polygon stroke=&quot;blue&quot; points=&quot;10 10 20 10 20 20 10 20&quot;/&gt;&lt;/svg&gt;</span></p><p class="c4 c1"><span></span></p><h1 class="c1"><a name="h.bm3buqmzhtko"></a><span>I want more</span></h1><p class="c1 c14"><span>JSONiq supports JSON updates by extending the XQuery Update Facility specification, so you can declaratively update your JSON data. JSONiq provides new expressions that produce update primitives on JSON items. The list of updates that is eventually output by your program is then applied to your JSON data.</span></p><p class="c4 c1"><span></span></p><p class="c1"><span class="c0">copy $people := {</span></p><p class="c1"><span class="c0">&nbsp;&quot;John&quot; : { &quot;status&quot; : &quot;single&quot; },</span></p><p class="c1"><span class="c0">&nbsp;&quot;Mary&quot; : { &quot;status&quot; : &quot;single&quot; } }</span></p><p class="c1"><span class="c0">modify (replace json value of $people(&quot;John&quot;)(&quot;status&quot;) with &quot;married&quot;,</span></p><p class="c1"><span class="c0">&nbsp; &nbsp; &nbsp; &nbsp; replace json value of $people(&quot;Mary&quot;)(&quot;status&quot;) with &quot;married&quot;)</span></p><p class="c1"><span class="c0">return $people</span></p><p class="c10 c4 c1"><span class="c0"></span></p><p class="c6 c1"><span class="c3 c0">{ &quot;John&quot; : { &quot;status&quot; : &quot;married&quot; }, &quot;Mary&quot; : { &quot;status&quot; : &quot;married&quot; } }</span></p><p class="c4 c1"><span></span></p><p class="c1"><span>JSONiq works with the XQuery 3.0 standard (switch, typeswitch and try-catch expressions, universal/existential quantifiers, path expressions, filtering expressions, functors, mappings, grouping, windowing will work). The Zorba implementation is also compatible with the proprietary Zorba scripting.</span></p><p class="c4 c1"><span></span></p><p class="c14 c1"><span>The complete JSONiq specification is available on </span><span class="c21"><a class="c20" href="http://jsoniq.org/">http://jsoniq.org/</a></span></p><p class="c4 c1"><span></span></p></body></html>
30\ No newline at end of file
31
32=== modified file 'doc/zorba/XQueryforJSON.html'
33--- doc/zorba/XQueryforJSON.html 2012-09-17 00:36:37 +0000
34+++ doc/zorba/XQueryforJSON.html 2012-09-25 15:07:26 +0000
35@@ -1,1 +1,1 @@
36-<html><head><title>XQuery for JSON</title><style type="text/css">@import url('https://themes.googleusercontent.com/fonts/css?kit=lhDjYqiy3mZ0x6ROQEUoUw');ol{margin:0;padding:0}.c1{height:11pt;text-align:right;direction:ltr}.c3{color:#1155cc;text-decoration:underline;font-weight:bold}.c15{list-style-type:disc;margin:0;padding:0}.c16{max-width:468pt;background-color:#ffffff;padding:72pt 72pt 72pt 72pt}.c7{color:#ff0000;font-style:italic}.c19{text-indent:-13.5pt;margin-left:76.5pt}.c2{direction:ltr;margin-left:144pt}.c13{color:inherit;text-decoration:inherit}.c14{padding-left:0pt;margin-left:36pt}.c20{color:#1155cc;text-decoration:underline}.c17{color:#4a86e8}.c6{text-align:center}.c0{font-family:"Consolas"}.c10{font-style:italic}.c4{direction:ltr}.c9{text-align:justify}.c11{text-align:right}.c5{color:#38761d}.c18{color:#ff9900}.c12{font-weight:bold}.c8{height:11pt}.title{padding-top:24pt;line-height:1.15;text-align:center;color:#4a86e8;font-size:36pt;font-family:"Arial";font-weight:bold;padding-bottom:6pt}.subtitle{padding-top:18pt;line-height:1.15;text-align:left;color:#666666;font-style:italic;font-size:24pt;font-family:"Georgia";padding-bottom:4pt}li{color:#000000;font-size:11pt;font-family:"Arial"}p{color:#000000;font-size:11pt;margin:0;font-family:"Arial"}h1{padding-top:24pt;line-height:1.15;text-align:left;color:#4a86e8;font-size:24pt;font-family:"Arial";font-weight:bold;padding-bottom:6pt}h2{padding-top:18pt;line-height:1.15;text-align:left;color:#ff9900;font-size:18pt;font-family:"Arial";font-weight:bold;padding-bottom:4pt}h3{padding-top:14pt;line-height:1.15;text-align:left;color:#000000;font-size:14pt;font-family:"Arial";font-weight:bold;padding-bottom:4pt}h4{padding-top:12pt;line-height:1.15;text-align:left;color:#000000;font-size:12pt;font-family:"Arial";font-weight:bold;padding-bottom:2pt}h5{padding-top:11pt;line-height:1.15;text-align:left;color:#000000;font-size:11pt;font-family:"Arial";font-weight:bold;padding-bottom:2pt}h6{padding-top:10pt;line-height:1.15;text-align:left;color:#000000;font-size:10pt;font-family:"Arial";font-weight:bold;padding-bottom:2pt}</style></head><body class="c16"><p class="c4 title"><a name="h.ngvhp3svo6iy"></a><span>JSONiq for JSON users</span></p><hr><p class="c6 c4"><span>This tutorial introduces the JSONiq language, which declaratively manipulates JSON data.</span></p><p class="c6 c4"><span>Why don&#39;t you go ahead can try the queries of this document on our online demo interface?</span></p><p class="c4 c6"><span>&nbsp;</span><span class="c3"><a class="c13" href="http://www.zorba-xquery.com/html/jsoniq">http://www.zorba-xquery.com/html/jsoniq</a></span></p><hr><p class="c4 c8"><span></span></p><h1 class="c4"><a name="h.f453h84m2u1a"></a><span>JSON</span></h1><p class="c4 c9"><span>As explained on the official Web site </span><span class="c20"><a class="c13" href="http://www.json.org/">http://www.json.org/</a></span><span>, JSON is a lightweight data-interchange format designed for humans as well as for computers. It supports as values:</span></p><ol class="c15" start="1"><li class="c14 c4 c9"><span>objects (string-to-value maps)</span></li><li class="c4 c9 c14"><span>arrays (ordered sequences of values)</span></li><li class="c14 c4 c9"><span>strings</span></li><li class="c14 c4 c9"><span>numbers</span></li><li class="c14 c4 c9"><span>booleans (true, false)</span></li><li class="c14 c4 c9"><span>null</span></li></ol><p class="c4 c8"><span></span></p><p class="c4"><span>JSONiq provides declarative querying and updating capabilities on JSON data.</span></p><h1 class="c4"><a name="h.qtfakecy3fr7"></a><span>Elevator Pitch</span></h1><p class="c4 c9"><span>JSONiq is based on XQuery, which is a W3C standard (like XML and HTML). XQuery is a very powerful declarative language that originally manipulates XML data, but it turns out that it is also a very good fit for manipulating JSON natively.</span></p><p class="c4 c9 c8"><span></span></p><p class="c4 c9"><span>JSONiq, since it extends XQuery, is a very powerful general-purpose declarative programming language. Our experience is that, for the same task, you will probably write about 80% less code compared to imperative languages like JavaScript, Python or Ruby. Additionally, you get the benefits of strong type checking without actually having to write type declarations.</span></p><p class="c4 c9 c8"><span></span></p><p class="c4 c9"><span>Here is an appetizer before we start the tutorial from scratch.</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">let $stores :=</span></p><p class="c4"><span class="c0">[</span></p><p class="c4"><span class="c0">&nbsp; { &quot;store number&quot; : 1, &quot;state&quot; : &quot;MA&quot; },</span></p><p class="c4"><span class="c0">&nbsp; { &quot;store number&quot; : 2, &quot;state&quot; : &quot;MA&quot; },</span></p><p class="c4"><span class="c0">&nbsp; { &quot;store number&quot; : 3, &quot;state&quot; : &quot;CA&quot; },</span></p><p class="c4"><span class="c0">&nbsp; { &quot;store number&quot; : 4, &quot;state&quot; : &quot;CA&quot; }</span></p><p class="c4"><span class="c0">]</span></p><p class="c4"><span class="c0">let $sales := [</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;broiler&quot;, &quot;store number&quot; : 1, &quot;quantity&quot; : 20 &nbsp;},</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;toaster&quot;, &quot;store number&quot; : 2, &quot;quantity&quot; : 100 },</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;toaster&quot;, &quot;store number&quot; : 2, &quot;quantity&quot; : 50 },</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;toaster&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 50 },</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;blender&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 100 },</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;blender&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 150 },</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;socks&quot;, &quot;store number&quot; : 1, &quot;quantity&quot; : 500 },</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;socks&quot;, &quot;store number&quot; : 2, &quot;quantity&quot; : 10 },</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;shirt&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 10 }</span></p><p class="c4"><span class="c0">]</span></p><p class="c4"><span class="c0">let $join :=</span></p><p class="c4"><span class="c0">&nbsp; for $store in jn:members($stores), $sale in jn:members($sales)</span></p><p class="c4"><span class="c0">&nbsp; where $store(&quot;store number&quot;) = $sale(&quot;store number&quot;)</span></p><p class="c4"><span class="c0">&nbsp; return {</span></p><p class="c4"><span class="c0">&nbsp; &nbsp; &quot;nb&quot; : $store(&quot;store number&quot;),</span></p><p class="c4"><span class="c0">&nbsp; &nbsp; &quot;state&quot; : $store(&quot;state&quot;),</span></p><p class="c4"><span class="c0">&nbsp; &nbsp; &quot;sold&quot; : $sale(&quot;product&quot;)</span></p><p class="c4"><span class="c0">&nbsp; }</span></p><p class="c4"><span class="c0">return [$join]</span></p><p class="c2"><span class="c0 c5">[ </span></p><p class="c2"><span class="c0 c5">&nbsp; { &quot;nb&quot; : 1, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;broiler&quot; },</span></p><p class="c2"><span class="c0 c5">&nbsp; { &quot;nb&quot; : 1, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;socks&quot; },</span></p><p class="c2"><span class="c0 c5">&nbsp; { &quot;nb&quot; : 2, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;toaster&quot; },</span></p><p class="c2"><span class="c0 c5">&nbsp; { &quot;nb&quot; : 2, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;toaster&quot; },</span></p><p class="c2"><span class="c0 c5">&nbsp; { &quot;nb&quot; : 2, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;socks&quot; },</span></p><p class="c2"><span class="c0 c5">&nbsp; { &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;toaster&quot; },</span></p><p class="c2"><span class="c0 c5">&nbsp; { &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;blender&quot; },</span></p><p class="c2"><span class="c0 c5">&nbsp; { &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;blender&quot; },</span></p><p class="c2"><span class="c0 c5">&nbsp; { &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;shirt&quot; }</span></p><p class="c2"><span class="c0 c5">&nbsp;]</span></p><p class="c4 c8"><span></span></p><h1 class="c4"><a name="h.yugk1mszt0re"></a><span>And here you go</span></h1><h2 class="c4"><a name="h.4uvhbej4btrt"></a><span>Actually</span><span>, you already knew some JSONiq</span></h2><p class="c4 c9"><span>The first thing you need to know is that, as a rule of thumb, a well-formed JSON document is a JSONiq expression as well.</span></p><p class="c4 c8"><span></span></p><p class="c4 c9"><span>This means that, most of the time, you can copy-and-paste a JSON document into a query. The following are JSONiq queries that are &quot;idempotent&quot; (they just output themselves):</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">{ &quot;pi&quot; : 3.14, &quot;sq2&quot; : 1.4 }</span></p><p class="c4 c11"><span class="c0 c5">{ &quot;pi&quot; : 3.14, &quot;sq2&quot; : 1.4 }</span></p><p class="c4 c8"><span class="c0 c5"></span></p><p class="c4"><span class="c0">[ 2, 3, 5, 7, 11, 13 ]</span></p><p class="c4 c11"><span class="c0 c5">[ 2, 3, 5, 7, 11, 13 ]</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4"><span class="c0">{</span></p><p class="c4"><span class="c0">&nbsp; &quot;operations&quot; : [</span></p><p class="c4"><span class="c0">&nbsp; &nbsp; { &quot;binary&quot; : [ &quot;and&quot;, &quot;or&quot;] },</span></p><p class="c4"><span class="c0">&nbsp; &nbsp; { &quot;unary&quot; : [&quot;not&quot;] }</span></p><p class="c4"><span class="c0">&nbsp; ],</span></p><p class="c4"><span class="c0">&nbsp; &quot;bits&quot; : [</span></p><p class="c4"><span class="c0">&nbsp; &nbsp; 0, 1</span></p><p class="c4"><span class="c0">&nbsp; ]</span></p><p class="c4"><span class="c0">}</span></p><p class="c2"><span class="c0 c5">{</span></p><p class="c2"><span class="c0 c5">&nbsp; &quot;operations&quot; : [</span></p><p class="c2"><span class="c0 c5">&nbsp; &nbsp; { &quot;binary&quot; : [ &quot;and&quot;, &quot;or&quot; ] },</span></p><p class="c2"><span class="c0 c5">&nbsp; &nbsp; { &quot;unary&quot; : [ &quot;not&quot; ] }</span></p><p class="c2"><span class="c0 c5">&nbsp; ],</span></p><p class="c2"><span class="c0 c5">&nbsp; &quot;bits&quot; : [</span></p><p class="c2"><span class="c0 c5">&nbsp; &nbsp; 0, 1</span></p><p class="c2"><span class="c0 c5">&nbsp; ]</span></p><p class="c2"><span class="c0 c5">}</span></p><p class="c1"><span class="c0 c5"></span></p><p class="c4"><span class="c0">[ { &quot;Question&quot; : &quot;Ultimate&quot; }, [&quot;Life&quot;, &quot;the universe&quot;, &quot;and everything&quot;] ]</span></p><p class="c1"><span class="c0"></span></p><p class="c4 c11"><span class="c0 c5">[ { &quot;Question&quot; : &quot;Ultimate&quot; }, [ &quot;Life&quot;, &quot;the universe&quot;, &quot;and everything&quot; ] ]</span></p><p class="c1"><span class="c0"></span></p><p class="c4"><span>This works with objects, arrays (even nested), strings, numbers, booleans, null. </span><span class="c10">The exceptions to this rule (but we are working on it!) are that:</span></p><p class="c4 c9"><span class="c10">(i) empty objects are not recognized and must be written {| |}.</span></p><p class="c4 c9"><span class="c10">(ii) characters escaped with the \ in JSON strings are not recognized (XQuery uses another means of escaping characters).</span></p><p class="c4 c8"><span class="c0 c7"></span></p><p class="c4 c9"><span>It also works the other way round: if your query outputs an object or an array, you can use it as a JSON document.</span></p><p class="c4 c8"><span></span></p><p class="c4 c9"><span>JSONiq is a declarative language. This means that you only need to say </span><span class="c10">what</span><span>&nbsp;you want - the compiler will take care of the </span><span class="c10">how</span><span>. In the above queries, you are basically saying: I want to output this JSON content, and here it is.</span></p><h1 class="c4"><a name="h.1gal1zhyffu4"></a><span>JSONiq basics</span></h1><h2 class="c4"><a name="h.ncbxtez2z3rn"></a><span>The real JSONiq Hello, World!</span></h2><p class="c4"><span>Wondering what a hello world program looks like in JSONiq? Here it is:</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">&quot;Hello, World!&quot;</span></p><p class="c4 c11"><span class="c0 c5">Hello, World!</span></p><p class="c4 c8"><span class="c0 c5"></span></p><p class="c4"><span>Not surprisingly, it outputs the string &quot;Hello, World!&quot;.</span></p><h2 class="c4"><a name="h.ifcjheuaxoqc"></a><span>Numbers and arithmetic operations</span></h2><p class="c4 c9"><span>Okay, so, now, you might be thinking: &quot;What is the use of this language if it just outputs what I put in?&quot; Of course, JSONiq can more than that. And still in a declarative way. Here is how it works with numbers:</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">2 + 2</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4"><span>will output:</span></p><p class="c4 c11"><span class="c0 c5">4</span></p><p class="c4 c8"><span></span></p><p class="c4"><span>whereas</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">(38 + 2) div 2 + 11 * 2</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4"><span>will output</span></p><p class="c4 c11"><span class="c0 c5">42</span></p><p class="c4 c8"><span class="c0 c5"></span></p><p class="c4 c9"><span>(mind the division operator which is the &quot;div&quot; keyword. The slash operator has different semantics).</span></p><p class="c4 c8"><span></span></p><p class="c4"><span>Like JSON, JSONiq works with decimals and doubles:</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">6.022e23 * 42</span></p><p class="c4 c11"><span class="c0 c5">2.52924E25</span></p><h2 class="c4"><a name="h.jmbc6c1fqqwx"></a><span>Logical operations</span></h2><p class="c4 c9"><span>JSONiq supports boolean operations.</span></p><p class="c4 c9 c8"><span></span></p><p class="c4"><span class="c0">true and false</span></p><p class="c4 c11"><span class="c0 c5">false</span></p><p class="c1"><span class="c0 c5"></span></p><p class="c4"><span class="c0">(true or false) and (false or true)</span></p><p class="c4 c11"><span class="c0 c5">true</span></p><p class="c1"><span class="c0 c5"></span></p><p class="c4"><span>The unary not is a function (yes, JSONiq has functions):</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4"><span class="c0">not(true)</span></p><p class="c4 c11"><span class="c0 c5">false</span></p><h2 class="c4"><a name="h.iq1ixg5ywx0r"></a><span>Strings</span></h2><p class="c4"><span>JSONiq is capable of manipulating strings as well, using functions:</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">concat(&quot;Hello &quot;, &quot;Captain &quot;, &quot;Kirk&quot;)</span></p><p class="c4 c11"><span class="c0 c5">Hello Captain Kirk</span></p><p class="c1"><span class="c0 c5"></span></p><p class="c4"><span class="c0">substring(&quot;Mister Spock&quot;, 8, 5)</span></p><p class="c4 c11"><span class="c0 c5">Spock</span></p><p class="c1"><span class="c5"></span></p><p class="c4 c9"><span>JSONiq comes up with a rich string function library out of the box, inherited from its base language. These functions are listed </span><span class="c20"><a class="c13" href="http://www.w3.org/TR/xpath-functions-30/#string-functions">here</a></span><span>&nbsp;(actually, you will find many more for numbers, etc.)</span></p><h2 class="c4"><a name="h.rv6w8p4wenfa"></a><span>Sequences</span></h2><p class="c4"><span>Until now, we have only been working with single values (an object, an array, a number, a string, a boolean). JSONiq supports sequences of values. You can build a sequence using commas:</span></p><p class="c4 c8"><span></span></p><p class="c4"><span>(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)</span></p><p class="c4 c11"><span class="c5">1 2 3 4 5 6 7 8 9 10</span></p><p class="c4 c8"><span class="c5"></span></p><p class="c4"><span class="c0">1, </span><span class="c0">true</span><span class="c0">, 4.2e1, &quot;Life&quot;</span></p><p class="c4 c11"><span class="c0 c5">1 true 42 Life</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4"><span>The &quot;to&quot; operator is very convenient, too:</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4"><span class="c0">(1 to 100)</span></p><p class="c4 c11"><span class="c5">1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20</span></p><p class="c4 c11"><span class="c5">21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40</span></p><p class="c4 c11"><span class="c5">41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60</span></p><p class="c4 c11"><span class="c5">61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80</span></p><p class="c4 c11"><span class="c5">81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100</span></p><p class="c4 c8"><span></span></p><p class="c4"><span>Some functions even work on sequences:</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4"><span class="c0">sum(1 to 100)</span></p><p class="c4 c11"><span class="c0 c5">5050</span></p><p class="c1"><span class="c0 c5"></span></p><p class="c4"><span class="c0">string-join((&quot;These&quot;, &quot;are&quot;, &quot;some&quot;, &quot;words&quot;), &quot;-&quot;)</span></p><p class="c4 c11"><span class="c0 c5">These-are-some-words</span></p><p class="c1"><span class="c0 c5"></span></p><p class="c4"><span class="c0">count(10 to 20)</span></p><p class="c4 c11"><span class="c0 c5">11</span></p><p class="c4 c8"><span class="c0 c5"></span></p><p class="c4"><span class="c0">avg(1 to 100)</span></p><p class="c4 c11"><span class="c0 c5">50.5</span></p><p class="c4 c8"><span class="c5"></span></p><p class="c4"><span>Unlike arrays, sequences are flat. The sequence (3) is identical to the integer 3, and (1, (2, 3)) is identical to (1, 2, 3).</span></p><h1 class="c4"><a name="h.7x2r8sj1zjwe"></a><span>A bit more in depth</span></h1><h2 class="c4"><a name="h.b6c9zq9um8cu"></a><span>Variables</span></h2><p class="c4"><span>You can bind a sequence of values to a (dollar-prefixed) variable, like so:</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">let $x := &quot;Bearing 3 1 4 Mark 5. &quot;</span></p><p class="c4"><span class="c0">return concat($x, &quot;Engage!&quot;)</span></p><p class="c4 c11"><span class="c0 c5">Bearing 3 1 4 Mark 5. Engage!</span></p><p class="c1"><span class="c0 c5"></span></p><p class="c1"><span class="c0"></span></p><p class="c4"><span class="c0">let $x := (&quot;Kirk&quot;, &quot;Picard&quot;, &quot;Sisko&quot;)</span></p><p class="c4"><span class="c0">return string-join($x, &quot; and &quot;)</span></p><p class="c4 c11"><span class="c0 c5">Kirk and Picard and Sisko</span></p><p class="c4 c8"><span class="c0 c5"></span></p><p class="c4"><span>You can bind as many variables as you want:</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">let $x := 1</span></p><p class="c4"><span class="c0">let $y := $x * 2</span></p><p class="c4"><span class="c0">let $z := $y + $x</span></p><p class="c4"><span class="c0">return ($x, $y, $z)</span></p><p class="c4 c11"><span class="c0 c5">1 2 3</span></p><p class="c1"><span class="c0 c5"></span></p><p class="c4"><span>and even reuse the same name to hide formerly declared variables:</span></p><p class="c4"><span class="c0">let $x := 1</span></p><p class="c4"><span class="c0">let $x := $x + 2</span></p><p class="c4"><span class="c0">let $x := $x + 3</span></p><p class="c4"><span class="c0">return $x</span></p><p class="c4 c11"><span class="c0 c5">6</span></p><h2 class="c4"><a name="h.92ak2udyfghp"></a><span>Iteration</span></h2><p class="c4 c9"><span>In a way very similar to let, you can iterate over a sequence of values with the &quot;for&quot; keyword. Instead of binding the entire sequence of the variable, it will bind each value of the sequence in turn to this variable.</span></p><p class="c4 c9 c8"><span></span></p><p class="c4 c9"><span class="c0">for $i in 1 to 10</span></p><p class="c4 c9"><span class="c0">return $i * 2</span></p><p class="c4 c11"><span class="c0 c5">2 4 6 8 10 12 14 16 18 20</span></p><p class="c1"><span class="c0 c5"></span></p><p class="c4"><span>More interestingly, you can combine fors and lets like so:</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4"><span class="c0">let $sequence := 1 to 10</span></p><p class="c4"><span class="c0">for $value in $sequence</span></p><p class="c4"><span class="c0">let $square := $value * 2</span></p><p class="c4"><span class="c0">return $square</span></p><p class="c4 c11"><span class="c0 c5">2 4 6 8 10 12 14 16 18 20</span></p><p class="c1"><span class="c0 c5"></span></p><p class="c4"><span>and even filter out some values:</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4"><span class="c0">let $sequence := 1 to 10</span></p><p class="c4"><span class="c0">for $value in $sequence</span></p><p class="c4"><span class="c0">let $square := $value * 2</span></p><p class="c4"><span class="c0">where $square &lt; 10</span></p><p class="c4"><span class="c0">return $square</span></p><p class="c4 c11"><span class="c0 c5">2 4 6 8</span></p><h2 class="c4"><a name="h.5fcoouj7073u"></a><span>Note that you can only iterate over sequences, not arrays. To iterate over an array, you can obtain the sequence of its values with jn:members([1, 2, 3]).</span></h2><h2 class="c4"><a name="h.zdhx60a5duyu"></a><span>Conditions</span></h2><p class="c4"><span>You can make the output depend on a condition with an if-then-else construct:</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">for $x in 1 to 10</span></p><p class="c4"><span class="c0">return if ($x &lt; 5) then $x</span></p><p class="c4"><span class="c0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else -$x</span></p><p class="c4 c11"><span class="c0 c5">1 2 3 4 -5 -6 -7 -8 -9 -10</span></p><p class="c4 c8"><span></span></p><p class="c4"><span>Note that the else clause is required - however, it can be the empty sequence () which is often when you need if only the then clause is relevant to you.</span></p><h2 class="c4"><a name="h.ccs6lkxiixw4"></a><span>Composability of Expressions</span></h2><p class="c4"><span>Now that you know of a couple of elementary JSONiq expressions, you can combine them in more elaborate expressions. For example, you can put any sequence of values in an array:</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">[ 1 to 10 ]</span></p><p class="c4 c11"><span class="c0 c5">[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]</span></p><p class="c1"><span class="c0 c5"></span></p><p class="c4"><span>Or you can dynamically compute the value of object pairs (or their key):</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">{</span></p><p class="c4"><span class="c0">&nbsp; &quot;Greeting&quot; : (let $d := &quot;Mister Spock&quot;</span></p><p class="c4"><span class="c0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return concat(&quot;Hello, &quot;, $d)),</span></p><p class="c4"><span class="c0">&nbsp; &quot;Farewell&quot; : string-join((&quot;Live&quot;, &quot;long&quot;, &quot;and&quot;, &quot;prosper&quot;),</span></p><p class="c4"><span class="c0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot; &quot;)</span></p><p class="c4"><span class="c0">}</span></p><p class="c4 c8"><span class="c0 c5"></span></p><p class="c4 c11"><span class="c0 c5">{ &quot;Greeting&quot; : &quot;Hello, Mister Spock&quot;, &quot;Farewell&quot; : &quot;Live long and prosper&quot; }</span></p><p class="c4 c8"><span class="c5"></span></p><p class="c4"><span>You can dynamically generate object singletons (with a single pair):</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4"><span class="c0">{ concat(&quot;Integer &quot;, 2) : 2 * 2 }</span></p><p class="c4 c11"><span class="c0 c5">{ &quot;Integer 2&quot; : 4 }</span></p><p class="c1"><span class="c0 c5"></span></p><p class="c4"><span>and then merge lots of them into a new object with the {| |} notation:</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4"><span class="c0">{|</span></p><p class="c4"><span class="c0">&nbsp; for $i in 1 to 10</span></p><p class="c4"><span class="c0">&nbsp; return { concat(&quot;Square of &quot;, $i) : $i * $i }</span></p><p class="c4"><span class="c0">|}</span></p><p class="c2"><span class="c0 c5">{</span></p><p class="c2"><span class="c0 c5">&quot;Square of 1&quot; : 1,</span></p><p class="c2"><span class="c0 c5">&quot;Square of 2&quot; : 4,</span></p><p class="c2"><span class="c0 c5">&quot;Square of 3&quot; : 9,</span></p><p class="c2"><span class="c0 c5">&quot;Square of 4&quot; : 16,</span></p><p class="c2"><span class="c0 c5">&quot;Square of 5&quot; : 25,</span></p><p class="c2"><span class="c0 c5">&quot;Square of 6&quot; : 36,</span></p><p class="c2"><span class="c0 c5">&quot;Square of 7&quot; : 49,</span></p><p class="c2"><span class="c0 c5">&quot;Square of 8&quot; : 64,</span></p><p class="c2"><span class="c0 c5">&quot;Square of 9&quot; : 81,</span></p><p class="c2"><span class="c0 c5">&quot;Square of 10&quot; : 100</span></p><p class="c2"><span class="c0 c5">}</span></p><h1 class="c4"><a name="h.mjv7kyjurri2"></a><span>JSON Navigation</span></h1><p class="c4 c9"><span>Up to now, you have learnt how to compose expressions so as to do some computations and to build objects and arrays. It also works the other way round: if you have some JSON data, you can access it and navigate.</span></p><p class="c4 c9 c8"><span></span></p><p class="c4 c9"><span>All you need to know is: JSONiq views</span></p><ol class="c15" start="1"><li class="c14 c4 c9"><span>an array as an ordered list of values,</span></li><li class="c14 c4 c9"><span>an object as a set of name/value pairs</span></li></ol><h2 class="c4 c9"><a name="h.xosiyb17dh24"></a><span>Objects</span></h2><p class="c4 c9"><span>You can use an object as if it were a function and pass the call an argument of type xs:string. It will return the value associated thereto:</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4"><span class="c0">let $person := {</span></p><p class="c4"><span class="c0">&nbsp; &quot;first name&quot; : &quot;Sarah&quot;,</span></p><p class="c4"><span class="c0">&nbsp; &quot;age&quot; : 13,</span></p><p class="c4"><span class="c0">&nbsp; &quot;gender&quot; : &quot;female&quot;,</span></p><p class="c4"><span class="c0">&nbsp; &quot;friends&quot; : [ &quot;Jim&quot;, &quot;Mary&quot;, &quot;Jennifer&quot;]</span></p><p class="c4"><span class="c0">}</span></p><p class="c4"><span class="c0">return $person(&quot;first name&quot;)</span></p><p class="c4 c11"><span class="c0 c5">&quot;Sarah&quot;</span></p><p class="c1"><span class="c0 c5"></span></p><p class="c4"><span>You can also ask for all keys in an object:</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">let $person := {</span></p><p class="c4"><span class="c0">&nbsp; &quot;name&quot; : &quot;Sarah&quot;,</span></p><p class="c4"><span class="c0">&nbsp; &quot;age&quot; : 13,</span></p><p class="c4"><span class="c0">&nbsp; &quot;gender&quot; : &quot;female&quot;,</span></p><p class="c4"><span class="c0">&nbsp; &quot;friends&quot; : [ &quot;Jim&quot;, &quot;Mary&quot;, &quot;Jennifer&quot;]</span></p><p class="c4"><span class="c0">}</span></p><p class="c4"><span class="c0">return { &quot;keys&quot; : [ jn:keys($person)] }</span></p><p class="c1 c19"><span class="c0 c5"></span></p><p class="c4 c11 c19"><span class="c0 c5">{ &quot;keys&quot; : [ &quot;name&quot;, &quot;age&quot;, &quot;gender&quot;, &quot;friends&quot; ] }</span></p><h2 class="c4"><a name="h.mrf42gizl3y6"></a><span>Arrays</span></h2><p class="c4 c9"><span>You can use an array as if it were a function and pass the call an argument of type xs:integer. It will return the entry at that position:</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4"><span class="c0">let $friends := [ &quot;Jim&quot;, &quot;Mary&quot;, &quot;Jennifer&quot;]</span></p><p class="c4"><span class="c0">return $friends(2)</span></p><p class="c4 c11"><span class="c0 c5">Mary</span></p><p class="c4 c8"><span></span></p><p class="c4"><span>It is also possible to get the size of an array:</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">let $person := {</span></p><p class="c4"><span class="c0">&nbsp; &quot;name&quot; : &quot;Sarah&quot;,</span></p><p class="c4"><span class="c0">&nbsp; &quot;age&quot; : 13,</span></p><p class="c4"><span class="c0">&nbsp; &quot;gender&quot; : &quot;female&quot;,</span></p><p class="c4"><span class="c0">&nbsp; &quot;friends&quot; : [ &quot;Jim&quot;, &quot;Mary&quot;, &quot;Jennifer&quot;]</span></p><p class="c4"><span class="c0">}</span></p><p class="c4"><span class="c0">return { &quot;how many friends&quot; : jn:size($person(&quot;friends&quot;)) }</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4 c11"><span class="c0 c5">{ &quot;how many friends&quot; : 3 }</span></p><p class="c4 c8"><span></span></p><p class="c4"><span>For convenience, there is a function that returns all elements in an array, as a sequence:</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">let $person := {</span></p><p class="c4"><span class="c0">&nbsp; &quot;name&quot; : &quot;Sarah&quot;,</span></p><p class="c4"><span class="c0">&nbsp; &quot;age&quot; : 13,</span></p><p class="c4"><span class="c0">&nbsp; &quot;gender&quot; : &quot;female&quot;,</span></p><p class="c4"><span class="c0">&nbsp; &quot;friends&quot; : [ &quot;Jim&quot;, &quot;Mary&quot;, &quot;Jennifer&quot;]</span></p><p class="c4"><span class="c0">}</span></p><p class="c4"><span class="c0">return jn:members($person(&quot;friends&quot;))</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4 c11"><span class="c0 c5">Jim Mary Jennifer</span></p><p class="c1"><span class="c5"></span></p><h1 class="c4"><a name="h.eb0bxle2oykl"></a><span>Relational Algebra</span></h1><p class="c4 c9"><span>Do you r</span><span>emember SQL&#39;s SELECT FROM WHERE statements? JSONiq inherits selection, projection and join capability from XQuery, too.</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">let $stores :=</span></p><p class="c4"><span class="c0">[</span></p><p class="c4"><span class="c0">&nbsp; { &quot;store number&quot; : 1, &quot;state&quot; : &quot;MA&quot; },</span></p><p class="c4"><span class="c0">&nbsp; { &quot;store number&quot; : 2, &quot;state&quot; : &quot;MA&quot; },</span></p><p class="c4"><span class="c0">&nbsp; { &quot;store number&quot; : 3, &quot;state&quot; : &quot;CA&quot; },</span></p><p class="c4"><span class="c0">&nbsp; { &quot;store number&quot; : 4, &quot;state&quot; : &quot;CA&quot; }</span></p><p class="c4"><span class="c0">]</span></p><p class="c4"><span class="c0">let $sales := [</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;broiler&quot;, &quot;store number&quot; : 1, &quot;quantity&quot; : 20 &nbsp;},</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;toaster&quot;, &quot;store number&quot; : 2, &quot;quantity&quot; : 100 },</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;toaster&quot;, &quot;store number&quot; : 2, &quot;quantity&quot; : 50 },</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;toaster&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 50 },</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;blender&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 100 },</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;blender&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 150 },</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;socks&quot;, &quot;store number&quot; : 1, &quot;quantity&quot; : 500 },</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;socks&quot;, &quot;store number&quot; : 2, &quot;quantity&quot; : 10 },</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;shirt&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 10 }</span></p><p class="c4"><span class="c0">]</span></p><p class="c4"><span class="c0">let $join :=</span></p><p class="c4"><span class="c0">&nbsp; for $store in jn:members($stores), $sale in jn:members($sales)</span></p><p class="c4"><span class="c0">&nbsp; where $store(&quot;store number&quot;) = $sale(&quot;store number&quot;)</span></p><p class="c4"><span class="c0">&nbsp; return {</span></p><p class="c4"><span class="c0">&nbsp; &nbsp; &quot;nb&quot; : $store(&quot;store number&quot;),</span></p><p class="c4"><span class="c0">&nbsp; &nbsp; &quot;state&quot; : $store(&quot;state&quot;),</span></p><p class="c4"><span class="c0">&nbsp; &nbsp; &quot;sold&quot; : $sale(&quot;product&quot;)</span></p><p class="c4"><span class="c0">&nbsp; }</span></p><p class="c4"><span class="c0">return [$join]</span></p><p class="c2"><span class="c0 c5">[ </span></p><p class="c2"><span class="c0 c5">{ &quot;nb&quot; : 1, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;broiler&quot; },</span></p><p class="c2"><span class="c0 c5">{ &quot;nb&quot; : 1, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;socks&quot; },</span></p><p class="c2"><span class="c0 c5">{ &quot;nb&quot; : 2, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;toaster&quot; },</span></p><p class="c2"><span class="c0 c5">{ &quot;nb&quot; : 2, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;toaster&quot; },</span></p><p class="c2"><span class="c0 c5">{ &quot;nb&quot; : 2, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;socks&quot; },</span></p><p class="c2"><span class="c0 c5">{ &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;toaster&quot; },</span></p><p class="c2"><span class="c0 c5">{ &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;blender&quot; },</span></p><p class="c2"><span class="c0 c5">{ &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;blender&quot; },</span></p><p class="c2"><span class="c0 c5">{ &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;shirt&quot; }</span></p><p class="c2"><span class="c0 c5">&nbsp;]</span></p><h1 class="c4"><a name="h.oii6pvliilhi"></a><span>Access external data</span></h1><p class="c4"><span>Our implementation supports collections of (and indices on) JSON objects or arrays:</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">dml:collection(&quot;my:data&quot;)</span></p><p class="c4 c11"><span class="c0 c5">{ &quot;foo&quot; : &quot;Your&quot; }</span></p><p class="c4 c11"><span class="c0 c5">{ &quot;foo&quot; : &quot;Collection&quot; }</span></p><p class="c4 c11"><span class="c0 c5">{ &quot;foo&quot; : &quot;of&quot; }</span></p><p class="c4 c11"><span class="c0 c5">{ &quot;foo&quot; : &quot;JSON&quot; }</span></p><p class="c4 c11"><span class="c0 c5">{ &quot;foo&quot; : &quot;objects&quot; }</span></p><p class="c1"><span class="c0 c5"></span></p><p class="c4"><span>It is also possible to get JSON content with an HTTP request, or by parsing it from a string. The EXPath http-client module (described in the Zorba documentation) &nbsp;allows you to make HTTP requests, and the jn:parse-json() function allows you to use the body as an object or an array.</span></p><h1 class="c4"><a name="h.bm3buqmzhtko"></a><span>I want more</span></h1><p class="c4 c9"><span>JSONiq supports JSON updates. You can declaratively update your JSON data. JSONiq provides updating expressions. The list of updates that is eventually output by your program is then applied to your JSON data.</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">copy $people := {</span></p><p class="c4"><span class="c0">&nbsp; &quot;John&quot; : { &quot;status&quot; : &quot;single&quot; },</span></p><p class="c4"><span class="c0">&nbsp; &quot;Mary&quot; : { &quot;status&quot; : &quot;single&quot; } }</span></p><p class="c4"><span class="c0">modify (replace json value of $people(&quot;John&quot;)(&quot;status&quot;) with &quot;married&quot;,</span></p><p class="c4"><span class="c0">&nbsp; &nbsp; &nbsp; &nbsp; replace json value of $people(&quot;Mary&quot;)(&quot;status&quot;) with &quot;married&quot;)</span></p><p class="c4"><span class="c0">return $people</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4 c11"><span class="c0 c5">{ &quot;John&quot; : { &quot;status&quot; : &quot;married&quot; }, &quot;Mary&quot; : { &quot;status&quot; : &quot;married&quot; } }</span></p><p class="c1"><span class="c0 c5"></span></p><p class="c4 c9"><span>Other updates are insertion into an object or an array, replacement of a value in an object or an array, deletion in an object or an array, renaming an object pair, appending to an array. This is documented on jsoniq.org.</span></p><h2 class="c4"><a name="h.5itcphr8262b"></a><span>Even more</span></h2><p class="c4"><span>JSONiq can do way more that what is presented here. Here are a couple of highlights:</span></p><p class="c4 c9"><span>- JSONiq is a strongly typed language, but is smart enough to not bother you with types when unnecessary. It potentially supports static typing as well to detect errors before you even execute your program.</span></p><p class="c4"><span>- You can define your own functions and modules.</span></p><p class="c4"><span>- JSONiq provides you with loads of available modules shipped with Zorba.</span></p><p class="c4 c9"><span>- JSONiq has tons of further features such as switch, typeswitch and try-catch expressions, universal/existential quantifiers, path expressions, filtering expressions, functors, mappings, grouping, windowing.</span></p><h2 class="c4"><a name="h.j7oh3cyhem38"></a><span>More is not enough</span></h2><p class="c4 c9"><span>- JSONiq supports XML. Yes: you can manipulate JSON and XML with the same language! JSONiq is actually a superset of XQuery, a W3C standard, and extends its data model to support JSON.</span></p><p class="c4 c9"><span>- JSONiq supports scripting. If you need to write a full-fledged, side-effecting Web application, scripting is for you.</span></p><p class="c4 c9 c8"><span></span></p><p class="c4 c9"><span>The complete JSONiq specification is available on </span><span class="c20"><a class="c13" href="http://www.jsoniq.org/">http://www.jsoniq.org/</a></span></p></body></html>
37\ No newline at end of file
38+<html><head><title>XQuery for JSON</title><style type="text/css">@import url('https://themes.googleusercontent.com/fonts/css?kit=lhDjYqiy3mZ0x6ROQEUoUw');ol{margin:0;padding:0}.c1{height:11pt;text-align:right;direction:ltr}.c3{color:#1155cc;text-decoration:underline;font-weight:bold}.c15{list-style-type:disc;margin:0;padding:0}.c16{max-width:468pt;background-color:#ffffff;padding:72pt 72pt 72pt 72pt}.c7{color:#ff0000;font-style:italic}.c19{text-indent:-13.5pt;margin-left:76.5pt}.c2{direction:ltr;margin-left:144pt}.c13{color:inherit;text-decoration:inherit}.c14{padding-left:0pt;margin-left:36pt}.c20{color:#1155cc;text-decoration:underline}.c17{color:#4a86e8}.c6{text-align:center}.c0{font-family:"Consolas"}.c10{font-style:italic}.c4{direction:ltr}.c9{text-align:justify}.c11{text-align:right}.c5{color:#38761d}.c18{color:#ff9900}.c12{font-weight:bold}.c8{height:11pt}.title{padding-top:24pt;line-height:1.15;text-align:center;color:#4a86e8;font-size:36pt;font-family:"Arial";font-weight:bold;padding-bottom:6pt}.subtitle{padding-top:18pt;line-height:1.15;text-align:left;color:#666666;font-style:italic;font-size:24pt;font-family:"Georgia";padding-bottom:4pt}li{color:#000000;font-size:11pt;font-family:"Arial"}p{color:#000000;font-size:11pt;margin:0;font-family:"Arial"}h1{padding-top:24pt;line-height:1.15;text-align:left;color:#4a86e8;font-size:24pt;font-family:"Arial";font-weight:bold;padding-bottom:6pt}h2{padding-top:18pt;line-height:1.15;text-align:left;color:#ff9900;font-size:18pt;font-family:"Arial";font-weight:bold;padding-bottom:4pt}h3{padding-top:14pt;line-height:1.15;text-align:left;color:#000000;font-size:14pt;font-family:"Arial";font-weight:bold;padding-bottom:4pt}h4{padding-top:12pt;line-height:1.15;text-align:left;color:#000000;font-size:12pt;font-family:"Arial";font-weight:bold;padding-bottom:2pt}h5{padding-top:11pt;line-height:1.15;text-align:left;color:#000000;font-size:11pt;font-family:"Arial";font-weight:bold;padding-bottom:2pt}h6{padding-top:10pt;line-height:1.15;text-align:left;color:#000000;font-size:10pt;font-family:"Arial";font-weight:bold;padding-bottom:2pt}</style></head><body class="c16"><p class="c4 title"><a name="h.ngvhp3svo6iy"></a><span>JSONiq for JSON users</span></p><hr><p class="c6 c4"><span>This tutorial introduces the JSONiq language, which declaratively manipulates JSON data.</span></p><p class="c6 c4"><span>Why don&#39;t you go ahead can try the queries of this document on our online demo interface?</span></p><p class="c4 c6"><span>&nbsp;</span><span class="c3"><a class="c13" href="http://www.zorba-xquery.com/html/jsoniq">http://www.zorba-xquery.com/html/jsoniq</a></span></p><hr><p class="c4 c8"><span></span></p><h1 class="c4"><a name="h.f453h84m2u1a"></a><span>JSON</span></h1><p class="c4 c9"><span>As explained on the official Web site </span><span class="c20"><a class="c13" href="http://www.json.org/">http://www.json.org/</a></span><span>, JSON is a lightweight data-interchange format designed for humans as well as for computers. It supports as values:</span></p><ol class="c15" start="1"><li class="c14 c4 c9"><span>objects (string-to-value maps)</span></li><li class="c4 c9 c14"><span>arrays (ordered sequences of values)</span></li><li class="c14 c4 c9"><span>strings</span></li><li class="c14 c4 c9"><span>numbers</span></li><li class="c14 c4 c9"><span>booleans (true, false)</span></li><li class="c14 c4 c9"><span>null</span></li></ol><p class="c4 c8"><span></span></p><p class="c4"><span>JSONiq provides declarative querying and updating capabilities on JSON data.</span></p><h1 class="c4"><a name="h.qtfakecy3fr7"></a><span>Elevator Pitch</span></h1><p class="c4 c9"><span>JSONiq is based on XQuery, which is a W3C standard (like XML and HTML). XQuery is a very powerful declarative language that originally manipulates XML data, but it turns out that it is also a very good fit for manipulating JSON natively.</span></p><p class="c4 c9 c8"><span></span></p><p class="c4 c9"><span>JSONiq, since it extends XQuery, is a very powerful general-purpose declarative programming language. Our experience is that, for the same task, you will probably write about 80% less code compared to imperative languages like JavaScript, Python or Ruby. Additionally, you get the benefits of strong type checking without actually having to write type declarations.</span></p><p class="c4 c9 c8"><span></span></p><p class="c4 c9"><span>Here is an appetizer before we start the tutorial from scratch.</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">let $stores :=</span></p><p class="c4"><span class="c0">[</span></p><p class="c4"><span class="c0">&nbsp; { &quot;store number&quot; : 1, &quot;state&quot; : &quot;MA&quot; },</span></p><p class="c4"><span class="c0">&nbsp; { &quot;store number&quot; : 2, &quot;state&quot; : &quot;MA&quot; },</span></p><p class="c4"><span class="c0">&nbsp; { &quot;store number&quot; : 3, &quot;state&quot; : &quot;CA&quot; },</span></p><p class="c4"><span class="c0">&nbsp; { &quot;store number&quot; : 4, &quot;state&quot; : &quot;CA&quot; }</span></p><p class="c4"><span class="c0">]</span></p><p class="c4"><span class="c0">let $sales := [</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;broiler&quot;, &quot;store number&quot; : 1, &quot;quantity&quot; : 20 &nbsp;},</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;toaster&quot;, &quot;store number&quot; : 2, &quot;quantity&quot; : 100 },</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;toaster&quot;, &quot;store number&quot; : 2, &quot;quantity&quot; : 50 },</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;toaster&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 50 },</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;blender&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 100 },</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;blender&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 150 },</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;socks&quot;, &quot;store number&quot; : 1, &quot;quantity&quot; : 500 },</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;socks&quot;, &quot;store number&quot; : 2, &quot;quantity&quot; : 10 },</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;shirt&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 10 }</span></p><p class="c4"><span class="c0">]</span></p><p class="c4"><span class="c0">let $join :=</span></p><p class="c4"><span class="c0">&nbsp; for $store in jn:members($stores), $sale in jn:members($sales)</span></p><p class="c4"><span class="c0">&nbsp; where $store(&quot;store number&quot;) = $sale(&quot;store number&quot;)</span></p><p class="c4"><span class="c0">&nbsp; return {</span></p><p class="c4"><span class="c0">&nbsp; &nbsp; &quot;nb&quot; : $store(&quot;store number&quot;),</span></p><p class="c4"><span class="c0">&nbsp; &nbsp; &quot;state&quot; : $store(&quot;state&quot;),</span></p><p class="c4"><span class="c0">&nbsp; &nbsp; &quot;sold&quot; : $sale(&quot;product&quot;)</span></p><p class="c4"><span class="c0">&nbsp; }</span></p><p class="c4"><span class="c0">return [$join]</span></p><p class="c2"><span class="c0 c5">[ </span></p><p class="c2"><span class="c0 c5">&nbsp; { &quot;nb&quot; : 1, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;broiler&quot; },</span></p><p class="c2"><span class="c0 c5">&nbsp; { &quot;nb&quot; : 1, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;socks&quot; },</span></p><p class="c2"><span class="c0 c5">&nbsp; { &quot;nb&quot; : 2, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;toaster&quot; },</span></p><p class="c2"><span class="c0 c5">&nbsp; { &quot;nb&quot; : 2, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;toaster&quot; },</span></p><p class="c2"><span class="c0 c5">&nbsp; { &quot;nb&quot; : 2, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;socks&quot; },</span></p><p class="c2"><span class="c0 c5">&nbsp; { &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;toaster&quot; },</span></p><p class="c2"><span class="c0 c5">&nbsp; { &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;blender&quot; },</span></p><p class="c2"><span class="c0 c5">&nbsp; { &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;blender&quot; },</span></p><p class="c2"><span class="c0 c5">&nbsp; { &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;shirt&quot; }</span></p><p class="c2"><span class="c0 c5">&nbsp;]</span></p><p class="c4 c8"><span></span></p><h1 class="c4"><a name="h.yugk1mszt0re"></a><span>And here you go</span></h1><h2 class="c4"><a name="h.4uvhbej4btrt"></a><span>Actually</span><span>, you already knew some JSONiq</span></h2><p class="c4 c9"><span>The first thing you need to know is that, as a rule of thumb, a well-formed JSON document is a JSONiq expression as well.</span></p><p class="c4 c8"><span></span></p><p class="c4 c9"><span>This means that, most of the time, you can copy-and-paste a JSON document into a query. The following are JSONiq queries that are &quot;idempotent&quot; (they just output themselves):</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">{ &quot;pi&quot; : 3.14, &quot;sq2&quot; : 1.4 }</span></p><p class="c4 c11"><span class="c0 c5">{ &quot;pi&quot; : 3.14, &quot;sq2&quot; : 1.4 }</span></p><p class="c4 c8"><span class="c0 c5"></span></p><p class="c4"><span class="c0">[ 2, 3, 5, 7, 11, 13 ]</span></p><p class="c4 c11"><span class="c0 c5">[ 2, 3, 5, 7, 11, 13 ]</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4"><span class="c0">{</span></p><p class="c4"><span class="c0">&nbsp; &quot;operations&quot; : [</span></p><p class="c4"><span class="c0">&nbsp; &nbsp; { &quot;binary&quot; : [ &quot;and&quot;, &quot;or&quot;] },</span></p><p class="c4"><span class="c0">&nbsp; &nbsp; { &quot;unary&quot; : [&quot;not&quot;] }</span></p><p class="c4"><span class="c0">&nbsp; ],</span></p><p class="c4"><span class="c0">&nbsp; &quot;bits&quot; : [</span></p><p class="c4"><span class="c0">&nbsp; &nbsp; 0, 1</span></p><p class="c4"><span class="c0">&nbsp; ]</span></p><p class="c4"><span class="c0">}</span></p><p class="c2"><span class="c0 c5">{</span></p><p class="c2"><span class="c0 c5">&nbsp; &quot;operations&quot; : [</span></p><p class="c2"><span class="c0 c5">&nbsp; &nbsp; { &quot;binary&quot; : [ &quot;and&quot;, &quot;or&quot; ] },</span></p><p class="c2"><span class="c0 c5">&nbsp; &nbsp; { &quot;unary&quot; : [ &quot;not&quot; ] }</span></p><p class="c2"><span class="c0 c5">&nbsp; ],</span></p><p class="c2"><span class="c0 c5">&nbsp; &quot;bits&quot; : [</span></p><p class="c2"><span class="c0 c5">&nbsp; &nbsp; 0, 1</span></p><p class="c2"><span class="c0 c5">&nbsp; ]</span></p><p class="c2"><span class="c0 c5">}</span></p><p class="c1"><span class="c0 c5"></span></p><p class="c4"><span class="c0">[ { &quot;Question&quot; : &quot;Ultimate&quot; }, [&quot;Life&quot;, &quot;the universe&quot;, &quot;and everything&quot;] ]</span></p><p class="c1"><span class="c0"></span></p><p class="c4 c11"><span class="c0 c5">[ { &quot;Question&quot; : &quot;Ultimate&quot; }, [ &quot;Life&quot;, &quot;the universe&quot;, &quot;and everything&quot; ] ]</span></p><p class="c1"><span class="c0"></span></p><p class="c4"><span>This works with objects, arrays (even nested), strings, numbers, booleans, null. </span><span class="c10">The exceptions to this rule (but we are working on it!) are that:</span></p><p class="c4 c9"><span class="c10">(i) empty objects are not recognized and must be written {| |}.</span></p><p class="c4 c9"><span class="c10">(ii) characters escaped with the \ in JSON strings are not recognized (XQuery uses another means of escaping characters).</span></p><p class="c4 c8"><span class="c0 c7"></span></p><p class="c4 c9"><span>It also works the other way round: if your query outputs an object or an array, you can use it as a JSON document.</span></p><p class="c4 c8"><span></span></p><p class="c4 c9"><span>JSONiq is a declarative language. This means that you only need to say </span><span class="c10">what</span><span>&nbsp;you want - the compiler will take care of the </span><span class="c10">how</span><span>. In the above queries, you are basically saying: I want to output this JSON content, and here it is.</span></p><h1 class="c4"><a name="h.1gal1zhyffu4"></a><span>JSONiq basics</span></h1><h2 class="c4"><a name="h.ncbxtez2z3rn"></a><span>The real JSONiq Hello, World!</span></h2><p class="c4"><span>Wondering what a hello world program looks like in JSONiq? Here it is:</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">&quot;Hello, World!&quot;</span></p><p class="c4 c11"><span class="c0 c5">Hello, World!</span></p><p class="c4 c8"><span class="c0 c5"></span></p><p class="c4"><span>Not surprisingly, it outputs the string &quot;Hello, World!&quot;.</span></p><h2 class="c4"><a name="h.ifcjheuaxoqc"></a><span>Numbers and arithmetic operations</span></h2><p class="c4 c9"><span>Okay, so, now, you might be thinking: &quot;What is the use of this language if it just outputs what I put in?&quot; Of course, JSONiq can more than that. And still in a declarative way. Here is how it works with numbers:</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">2 + 2</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4"><span>will output:</span></p><p class="c4 c11"><span class="c0 c5">4</span></p><p class="c4 c8"><span></span></p><p class="c4"><span>whereas</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">(38 + 2) div 2 + 11 * 2</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4"><span>will output</span></p><p class="c4 c11"><span class="c0 c5">42</span></p><p class="c4 c8"><span class="c0 c5"></span></p><p class="c4 c9"><span>(mind the division operator which is the &quot;div&quot; keyword. The slash operator has different semantics).</span></p><p class="c4 c8"><span></span></p><p class="c4"><span>Like JSON, JSONiq works with decimals and doubles:</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">6.022e23 * 42</span></p><p class="c4 c11"><span class="c0 c5">2.52924E25</span></p><h2 class="c4"><a name="h.jmbc6c1fqqwx"></a><span>Logical operations</span></h2><p class="c4 c9"><span>JSONiq supports boolean operations.</span></p><p class="c4 c9 c8"><span></span></p><p class="c4"><span class="c0">true and false</span></p><p class="c4 c11"><span class="c0 c5">false</span></p><p class="c1"><span class="c0 c5"></span></p><p class="c4"><span class="c0">(true or false) and (false or true)</span></p><p class="c4 c11"><span class="c0 c5">true</span></p><p class="c1"><span class="c0 c5"></span></p><p class="c4"><span>The unary not is a function (yes, JSONiq has functions):</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4"><span class="c0">not(true)</span></p><p class="c4 c11"><span class="c0 c5">false</span></p><h2 class="c4"><a name="h.iq1ixg5ywx0r"></a><span>Strings</span></h2><p class="c4"><span>JSONiq is capable of manipulating strings as well, using functions:</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">concat(&quot;Hello &quot;, &quot;Captain &quot;, &quot;Kirk&quot;)</span></p><p class="c4 c11"><span class="c0 c5">Hello Captain Kirk</span></p><p class="c1"><span class="c0 c5"></span></p><p class="c4"><span class="c0">substring(&quot;Mister Spock&quot;, 8, 5)</span></p><p class="c4 c11"><span class="c0 c5">Spock</span></p><p class="c1"><span class="c5"></span></p><p class="c4 c9"><span>JSONiq comes up with a rich string function library out of the box, inherited from its base language. These functions are listed </span><span class="c20"><a class="c13" href="http://www.w3.org/TR/xpath-functions-30/#string-functions">here</a></span><span>&nbsp;(actually, you will find many more for numbers, etc.)</span></p><h2 class="c4"><a name="h.rv6w8p4wenfa"></a><span>Sequences</span></h2><p class="c4"><span>Until now, we have only been working with single values (an object, an array, a number, a string, a boolean). JSONiq supports sequences of values. You can build a sequence using commas:</span></p><p class="c4 c8"><span></span></p><p class="c4"><span>(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)</span></p><p class="c4 c11"><span class="c5">1 2 3 4 5 6 7 8 9 10</span></p><p class="c4 c8"><span class="c5"></span></p><p class="c4"><span class="c0">1, </span><span class="c0">true</span><span class="c0">, 4.2e1, &quot;Life&quot;</span></p><p class="c4 c11"><span class="c0 c5">1 true 42 Life</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4"><span>The &quot;to&quot; operator is very convenient, too:</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4"><span class="c0">(1 to 100)</span></p><p class="c4 c11"><span class="c5">1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20</span></p><p class="c4 c11"><span class="c5">21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40</span></p><p class="c4 c11"><span class="c5">41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60</span></p><p class="c4 c11"><span class="c5">61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80</span></p><p class="c4 c11"><span class="c5">81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100</span></p><p class="c4 c8"><span></span></p><p class="c4"><span>Some functions even work on sequences:</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4"><span class="c0">sum(1 to 100)</span></p><p class="c4 c11"><span class="c0 c5">5050</span></p><p class="c1"><span class="c0 c5"></span></p><p class="c4"><span class="c0">string-join((&quot;These&quot;, &quot;are&quot;, &quot;some&quot;, &quot;words&quot;), &quot;-&quot;)</span></p><p class="c4 c11"><span class="c0 c5">These-are-some-words</span></p><p class="c1"><span class="c0 c5"></span></p><p class="c4"><span class="c0">count(10 to 20)</span></p><p class="c4 c11"><span class="c0 c5">11</span></p><p class="c4 c8"><span class="c0 c5"></span></p><p class="c4"><span class="c0">avg(1 to 100)</span></p><p class="c4 c11"><span class="c0 c5">50.5</span></p><p class="c4 c8"><span class="c5"></span></p><p class="c4"><span>Unlike arrays, sequences are flat. The sequence (3) is identical to the integer 3, and (1, (2, 3)) is identical to (1, 2, 3).</span></p><h1 class="c4"><a name="h.7x2r8sj1zjwe"></a><span>A bit more in depth</span></h1><h2 class="c4"><a name="h.b6c9zq9um8cu"></a><span>Variables</span></h2><p class="c4"><span>You can bind a sequence of values to a (dollar-prefixed) variable, like so:</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">let $x := &quot;Bearing 3 1 4 Mark 5. &quot;</span></p><p class="c4"><span class="c0">return concat($x, &quot;Engage!&quot;)</span></p><p class="c4 c11"><span class="c0 c5">Bearing 3 1 4 Mark 5. Engage!</span></p><p class="c1"><span class="c0 c5"></span></p><p class="c1"><span class="c0"></span></p><p class="c4"><span class="c0">let $x := (&quot;Kirk&quot;, &quot;Picard&quot;, &quot;Sisko&quot;)</span></p><p class="c4"><span class="c0">return string-join($x, &quot; and &quot;)</span></p><p class="c4 c11"><span class="c0 c5">Kirk and Picard and Sisko</span></p><p class="c4 c8"><span class="c0 c5"></span></p><p class="c4"><span>You can bind as many variables as you want:</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">let $x := 1</span></p><p class="c4"><span class="c0">let $y := $x * 2</span></p><p class="c4"><span class="c0">let $z := $y + $x</span></p><p class="c4"><span class="c0">return ($x, $y, $z)</span></p><p class="c4 c11"><span class="c0 c5">1 2 3</span></p><p class="c1"><span class="c0 c5"></span></p><p class="c4"><span>and even reuse the same name to hide formerly declared variables:</span></p><p class="c4"><span class="c0">let $x := 1</span></p><p class="c4"><span class="c0">let $x := $x + 2</span></p><p class="c4"><span class="c0">let $x := $x + 3</span></p><p class="c4"><span class="c0">return $x</span></p><p class="c4 c11"><span class="c0 c5">6</span></p><h2 class="c4"><a name="h.92ak2udyfghp"></a><span>Iteration</span></h2><p class="c4 c9"><span>In a way very similar to let, you can iterate over a sequence of values with the &quot;for&quot; keyword. Instead of binding the entire sequence of the variable, it will bind each value of the sequence in turn to this variable.</span></p><p class="c4 c9 c8"><span></span></p><p class="c4 c9"><span class="c0">for $i in 1 to 10</span></p><p class="c4 c9"><span class="c0">return $i * 2</span></p><p class="c4 c11"><span class="c0 c5">2 4 6 8 10 12 14 16 18 20</span></p><p class="c1"><span class="c0 c5"></span></p><p class="c4"><span>More interestingly, you can combine fors and lets like so:</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4"><span class="c0">let $sequence := 1 to 10</span></p><p class="c4"><span class="c0">for $value in $sequence</span></p><p class="c4"><span class="c0">let $square := $value * 2</span></p><p class="c4"><span class="c0">return $square</span></p><p class="c4 c11"><span class="c0 c5">2 4 6 8 10 12 14 16 18 20</span></p><p class="c1"><span class="c0 c5"></span></p><p class="c4"><span>and even filter out some values:</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4"><span class="c0">let $sequence := 1 to 10</span></p><p class="c4"><span class="c0">for $value in $sequence</span></p><p class="c4"><span class="c0">let $square := $value * 2</span></p><p class="c4"><span class="c0">where $square &lt; 10</span></p><p class="c4"><span class="c0">return $square</span></p><p class="c4 c11"><span class="c0 c5">2 4 6 8</span></p><h2 class="c4"><a name="h.5fcoouj7073u"></a><span>Note that you can only iterate over sequences, not arrays. To iterate over an array, you can obtain the sequence of its values with jn:members([1, 2, 3]).</span></h2><h2 class="c4"><a name="h.zdhx60a5duyu"></a><span>Conditions</span></h2><p class="c4"><span>You can make the output depend on a condition with an if-then-else construct:</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">for $x in 1 to 10</span></p><p class="c4"><span class="c0">return if ($x &lt; 5) then $x</span></p><p class="c4"><span class="c0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else -$x</span></p><p class="c4 c11"><span class="c0 c5">1 2 3 4 -5 -6 -7 -8 -9 -10</span></p><p class="c4 c8"><span></span></p><p class="c4"><span>Note that the else clause is required - however, it can be the empty sequence () which is often when you need if only the then clause is relevant to you.</span></p><h2 class="c4"><a name="h.ccs6lkxiixw4"></a><span>Composability of Expressions</span></h2><p class="c4"><span>Now that you know of a couple of elementary JSONiq expressions, you can combine them in more elaborate expressions. For example, you can put any sequence of values in an array:</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">[ 1 to 10 ]</span></p><p class="c4 c11"><span class="c0 c5">[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]</span></p><p class="c1"><span class="c0 c5"></span></p><p class="c4"><span>Or you can dynamically compute the value of object pairs (or their key):</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">{</span></p><p class="c4"><span class="c0">&nbsp; &quot;Greeting&quot; : (let $d := &quot;Mister Spock&quot;</span></p><p class="c4"><span class="c0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return concat(&quot;Hello, &quot;, $d)),</span></p><p class="c4"><span class="c0">&nbsp; &quot;Farewell&quot; : string-join((&quot;Live&quot;, &quot;long&quot;, &quot;and&quot;, &quot;prosper&quot;),</span></p><p class="c4"><span class="c0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot; &quot;)</span></p><p class="c4"><span class="c0">}</span></p><p class="c4 c8"><span class="c0 c5"></span></p><p class="c4 c11"><span class="c0 c5">{ &quot;Greeting&quot; : &quot;Hello, Mister Spock&quot;, &quot;Farewell&quot; : &quot;Live long and prosper&quot; }</span></p><p class="c4 c8"><span class="c5"></span></p><p class="c4"><span>You can dynamically generate object singletons (with a single pair):</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4"><span class="c0">{ concat(&quot;Integer &quot;, 2) : 2 * 2 }</span></p><p class="c4 c11"><span class="c0 c5">{ &quot;Integer 2&quot; : 4 }</span></p><p class="c1"><span class="c0 c5"></span></p><p class="c4"><span>and then merge lots of them into a new object with the {| |} notation:</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4"><span class="c0">{|</span></p><p class="c4"><span class="c0">&nbsp; for $i in 1 to 10</span></p><p class="c4"><span class="c0">&nbsp; return { concat(&quot;Square of &quot;, $i) : $i * $i }</span></p><p class="c4"><span class="c0">|}</span></p><p class="c2"><span class="c0 c5">{</span></p><p class="c2"><span class="c0 c5">&quot;Square of 1&quot; : 1,</span></p><p class="c2"><span class="c0 c5">&quot;Square of 2&quot; : 4,</span></p><p class="c2"><span class="c0 c5">&quot;Square of 3&quot; : 9,</span></p><p class="c2"><span class="c0 c5">&quot;Square of 4&quot; : 16,</span></p><p class="c2"><span class="c0 c5">&quot;Square of 5&quot; : 25,</span></p><p class="c2"><span class="c0 c5">&quot;Square of 6&quot; : 36,</span></p><p class="c2"><span class="c0 c5">&quot;Square of 7&quot; : 49,</span></p><p class="c2"><span class="c0 c5">&quot;Square of 8&quot; : 64,</span></p><p class="c2"><span class="c0 c5">&quot;Square of 9&quot; : 81,</span></p><p class="c2"><span class="c0 c5">&quot;Square of 10&quot; : 100</span></p><p class="c2"><span class="c0 c5">}</span></p><h1 class="c4"><a name="h.mjv7kyjurri2"></a><span>JSON Navigation</span></h1><p class="c4 c9"><span>Up to now, you have learnt how to compose expressions so as to do some computations and to build objects and arrays. It also works the other way round: if you have some JSON data, you can access it and navigate.</span></p><p class="c4 c9 c8"><span></span></p><p class="c4 c9"><span>All you need to know is: JSONiq views</span></p><ol class="c15" start="1"><li class="c14 c4 c9"><span>an array as an ordered list of values,</span></li><li class="c14 c4 c9"><span>an object as a set of name/value pairs</span></li></ol><h2 class="c4 c9"><a name="h.xosiyb17dh24"></a><span>Objects</span></h2><p class="c4 c9"><span>You can use an object as if it were a function and pass the call an argument of type xs:string. It will return the value associated thereto:</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4"><span class="c0">let $person := {</span></p><p class="c4"><span class="c0">&nbsp; &quot;first name&quot; : &quot;Sarah&quot;,</span></p><p class="c4"><span class="c0">&nbsp; &quot;age&quot; : 13,</span></p><p class="c4"><span class="c0">&nbsp; &quot;gender&quot; : &quot;female&quot;,</span></p><p class="c4"><span class="c0">&nbsp; &quot;friends&quot; : [ &quot;Jim&quot;, &quot;Mary&quot;, &quot;Jennifer&quot;]</span></p><p class="c4"><span class="c0">}</span></p><p class="c4"><span class="c0">return $person(&quot;first name&quot;)</span></p><p class="c4 c11"><span class="c0 c5">&quot;Sarah&quot;</span></p><p class="c1"><span class="c0 c5"></span></p><p class="c4"><span>You can also ask for all keys in an object:</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">let $person := {</span></p><p class="c4"><span class="c0">&nbsp; &quot;name&quot; : &quot;Sarah&quot;,</span></p><p class="c4"><span class="c0">&nbsp; &quot;age&quot; : 13,</span></p><p class="c4"><span class="c0">&nbsp; &quot;gender&quot; : &quot;female&quot;,</span></p><p class="c4"><span class="c0">&nbsp; &quot;friends&quot; : [ &quot;Jim&quot;, &quot;Mary&quot;, &quot;Jennifer&quot;]</span></p><p class="c4"><span class="c0">}</span></p><p class="c4"><span class="c0">return { &quot;keys&quot; : [ jn:keys($person)] }</span></p><p class="c1 c19"><span class="c0 c5"></span></p><p class="c4 c11 c19"><span class="c0 c5">{ &quot;keys&quot; : [ &quot;name&quot;, &quot;age&quot;, &quot;gender&quot;, &quot;friends&quot; ] }</span></p><h2 class="c4"><a name="h.mrf42gizl3y6"></a><span>Arrays</span></h2><p class="c4 c9"><span>You can use an array as if it were a function and pass the call an argument of type xs:integer. It will return the entry at that position:</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4"><span class="c0">let $friends := [ &quot;Jim&quot;, &quot;Mary&quot;, &quot;Jennifer&quot;]</span></p><p class="c4"><span class="c0">return $friends(2)</span></p><p class="c4 c11"><span class="c0 c5">Mary</span></p><p class="c4 c8"><span></span></p><p class="c4"><span>It is also possible to get the size of an array:</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">let $person := {</span></p><p class="c4"><span class="c0">&nbsp; &quot;name&quot; : &quot;Sarah&quot;,</span></p><p class="c4"><span class="c0">&nbsp; &quot;age&quot; : 13,</span></p><p class="c4"><span class="c0">&nbsp; &quot;gender&quot; : &quot;female&quot;,</span></p><p class="c4"><span class="c0">&nbsp; &quot;friends&quot; : [ &quot;Jim&quot;, &quot;Mary&quot;, &quot;Jennifer&quot;]</span></p><p class="c4"><span class="c0">}</span></p><p class="c4"><span class="c0">return { &quot;how many friends&quot; : jn:size($person(&quot;friends&quot;)) }</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4 c11"><span class="c0 c5">{ &quot;how many friends&quot; : 3 }</span></p><p class="c4 c8"><span></span></p><p class="c4"><span>For convenience, there is a function that returns all elements in an array, as a sequence:</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">let $person := {</span></p><p class="c4"><span class="c0">&nbsp; &quot;name&quot; : &quot;Sarah&quot;,</span></p><p class="c4"><span class="c0">&nbsp; &quot;age&quot; : 13,</span></p><p class="c4"><span class="c0">&nbsp; &quot;gender&quot; : &quot;female&quot;,</span></p><p class="c4"><span class="c0">&nbsp; &quot;friends&quot; : [ &quot;Jim&quot;, &quot;Mary&quot;, &quot;Jennifer&quot;]</span></p><p class="c4"><span class="c0">}</span></p><p class="c4"><span class="c0">return jn:members($person(&quot;friends&quot;))</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4 c11"><span class="c0 c5">Jim Mary Jennifer</span></p><p class="c1"><span class="c5"></span></p><h1 class="c4"><a name="h.eb0bxle2oykl"></a><span>Relational Algebra</span></h1><p class="c4 c9"><span>Do you r</span><span>emember SQL&#39;s SELECT FROM WHERE statements? JSONiq inherits selection, projection and join capability from XQuery, too.</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">let $stores :=</span></p><p class="c4"><span class="c0">[</span></p><p class="c4"><span class="c0">&nbsp; { &quot;store number&quot; : 1, &quot;state&quot; : &quot;MA&quot; },</span></p><p class="c4"><span class="c0">&nbsp; { &quot;store number&quot; : 2, &quot;state&quot; : &quot;MA&quot; },</span></p><p class="c4"><span class="c0">&nbsp; { &quot;store number&quot; : 3, &quot;state&quot; : &quot;CA&quot; },</span></p><p class="c4"><span class="c0">&nbsp; { &quot;store number&quot; : 4, &quot;state&quot; : &quot;CA&quot; }</span></p><p class="c4"><span class="c0">]</span></p><p class="c4"><span class="c0">let $sales := [</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;broiler&quot;, &quot;store number&quot; : 1, &quot;quantity&quot; : 20 &nbsp;},</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;toaster&quot;, &quot;store number&quot; : 2, &quot;quantity&quot; : 100 },</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;toaster&quot;, &quot;store number&quot; : 2, &quot;quantity&quot; : 50 },</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;toaster&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 50 },</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;blender&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 100 },</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;blender&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 150 },</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;socks&quot;, &quot;store number&quot; : 1, &quot;quantity&quot; : 500 },</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;socks&quot;, &quot;store number&quot; : 2, &quot;quantity&quot; : 10 },</span></p><p class="c4"><span class="c0">&nbsp; &nbsp;{ &quot;product&quot; : &quot;shirt&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 10 }</span></p><p class="c4"><span class="c0">]</span></p><p class="c4"><span class="c0">let $join :=</span></p><p class="c4"><span class="c0">&nbsp; for $store in jn:members($stores), $sale in jn:members($sales)</span></p><p class="c4"><span class="c0">&nbsp; where $store(&quot;store number&quot;) = $sale(&quot;store number&quot;)</span></p><p class="c4"><span class="c0">&nbsp; return {</span></p><p class="c4"><span class="c0">&nbsp; &nbsp; &quot;nb&quot; : $store(&quot;store number&quot;),</span></p><p class="c4"><span class="c0">&nbsp; &nbsp; &quot;state&quot; : $store(&quot;state&quot;),</span></p><p class="c4"><span class="c0">&nbsp; &nbsp; &quot;sold&quot; : $sale(&quot;product&quot;)</span></p><p class="c4"><span class="c0">&nbsp; }</span></p><p class="c4"><span class="c0">return [$join]</span></p><p class="c2"><span class="c0 c5">[ </span></p><p class="c2"><span class="c0 c5">{ &quot;nb&quot; : 1, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;broiler&quot; },</span></p><p class="c2"><span class="c0 c5">{ &quot;nb&quot; : 1, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;socks&quot; },</span></p><p class="c2"><span class="c0 c5">{ &quot;nb&quot; : 2, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;toaster&quot; },</span></p><p class="c2"><span class="c0 c5">{ &quot;nb&quot; : 2, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;toaster&quot; },</span></p><p class="c2"><span class="c0 c5">{ &quot;nb&quot; : 2, &quot;state&quot; : &quot;MA&quot;, &quot;sold&quot; : &quot;socks&quot; },</span></p><p class="c2"><span class="c0 c5">{ &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;toaster&quot; },</span></p><p class="c2"><span class="c0 c5">{ &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;blender&quot; },</span></p><p class="c2"><span class="c0 c5">{ &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;blender&quot; },</span></p><p class="c2"><span class="c0 c5">{ &quot;nb&quot; : 3, &quot;state&quot; : &quot;CA&quot;, &quot;sold&quot; : &quot;shirt&quot; }</span></p><p class="c2"><span class="c0 c5">&nbsp;]</span></p><h1 class="c4"><a name="h.oii6pvliilhi"></a><span>Access external data</span></h1><p class="c4"><span>Our implementation supports collections of (and indices on) JSON objects or arrays:</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">dml:collection(&quot;my:data&quot;)</span></p><p class="c4 c11"><span class="c0 c5">{ &quot;foo&quot; : &quot;Your&quot; }</span></p><p class="c4 c11"><span class="c0 c5">{ &quot;foo&quot; : &quot;Collection&quot; }</span></p><p class="c4 c11"><span class="c0 c5">{ &quot;foo&quot; : &quot;of&quot; }</span></p><p class="c4 c11"><span class="c0 c5">{ &quot;foo&quot; : &quot;JSON&quot; }</span></p><p class="c4 c11"><span class="c0 c5">{ &quot;foo&quot; : &quot;objects&quot; }</span></p><p class="c1"><span class="c0 c5"></span></p><p class="c4"><span>It is also possible to get JSON content with an HTTP request, or by parsing it from a string. The EXPath http-client module (described in the Zorba documentation) &nbsp;allows you to make HTTP requests, and the jn:parse-json() function allows you to use the body as an object or an array.</span></p><h1 class="c4"><a name="h.bm3buqmzhtko"></a><span>I want more</span></h1><p class="c4 c9"><span>JSONiq supports JSON updates. You can declaratively update your JSON data. JSONiq provides updating expressions. The list of updates that is eventually output by your program is then applied to your JSON data.</span></p><p class="c4 c8"><span></span></p><p class="c4"><span class="c0">copy $people := {</span></p><p class="c4"><span class="c0">&nbsp; &quot;John&quot; : { &quot;status&quot; : &quot;single&quot; },</span></p><p class="c4"><span class="c0">&nbsp; &quot;Mary&quot; : { &quot;status&quot; : &quot;single&quot; } }</span></p><p class="c4"><span class="c0">modify (replace json value of $people(&quot;John&quot;)(&quot;status&quot;) with &quot;married&quot;,</span></p><p class="c4"><span class="c0">&nbsp; &nbsp; &nbsp; &nbsp; replace json value of $people(&quot;Mary&quot;)(&quot;status&quot;) with &quot;married&quot;)</span></p><p class="c4"><span class="c0">return $people</span></p><p class="c4 c8"><span class="c0"></span></p><p class="c4 c11"><span class="c0 c5">{ &quot;John&quot; : { &quot;status&quot; : &quot;married&quot; }, &quot;Mary&quot; : { &quot;status&quot; : &quot;married&quot; } }</span></p><p class="c1"><span class="c0 c5"></span></p><p class="c4 c9"><span>Other updates are insertion into an object or an array, replacement of a value in an object or an array, deletion in an object or an array, renaming an object pair, appending to an array. This is documented on jsoniq.org.</span></p><h2 class="c4"><a name="h.5itcphr8262b"></a><span>Even more</span></h2><p class="c4"><span>JSONiq can do way more that what is presented here. Here are a couple of highlights:</span></p><p class="c4 c9"><span>- JSONiq is a strongly typed language, but is smart enough to not bother you with types when unnecessary. It potentially supports static typing as well to detect errors before you even execute your program.</span></p><p class="c4"><span>- You can define your own functions and modules.</span></p><p class="c4"><span>- JSONiq provides you with loads of available modules shipped with Zorba.</span></p><p class="c4 c9"><span>- JSONiq has tons of further features such as switch, typeswitch and try-catch expressions, universal/existential quantifiers, path expressions, filtering expressions, functors, mappings, grouping, windowing.</span></p><h2 class="c4"><a name="h.j7oh3cyhem38"></a><span>More is not enough</span></h2><p class="c4 c9"><span>- JSONiq supports XML. Yes: you can manipulate JSON and XML with the same language! JSONiq is actually a superset of XQuery, a W3C standard, and extends its data model to support JSON.</span></p><p class="c4 c9"><span>- JSONiq supports scripting. If you need to write a full-fledged, side-effecting Web application, scripting is for you.</span></p><p class="c4 c9 c8"><span></span></p><p class="c4 c9"><span>The complete JSONiq specification is available on </span><span class="c20"><a class="c13" href="http://jsoniq.org/">http://jsoniq.org/</a></span></p></body></html>
39\ No newline at end of file
40
41=== modified file 'doc/zorba/xqdoc/images/modules.svg'
42--- doc/zorba/xqdoc/images/modules.svg 2012-09-17 00:36:37 +0000
43+++ doc/zorba/xqdoc/images/modules.svg 2012-09-25 15:07:26 +0000
44@@ -1286,7 +1286,7 @@
45 </g>
46 <!-- 40 -->
47 <g id="node115" class="node"><title>40</title>
48-<a xlink:href="../www.jsoniq.org_errors.html" xlink:title="(Zorba-core) module uri=http://www.jsoniq.org/errors">
49+<a xlink:href="../jsoniq.org_errors.html" xlink:title="(Zorba-core) module uri=http://jsoniq.org/errors">
50 <ellipse fill="white" stroke="white" cx="5967" cy="-439" rx="31.2965" ry="18"/>
51 <text text-anchor="middle" x="5967" y="-435.3" font-family="Times,serif" font-size="14.00" fill="red">errors</text>
52 </a>
53@@ -1374,7 +1374,7 @@
54 </g>
55 <!-- 39&#45;&gt;12 -->
56 <g id="edge103" class="edge"><title>39-&gt;12</title>
57-<a xlink:title="FROM: http://www.jsoniq.org/functions, TO: http://www.zorba-xquery.com/modules/schema">
58+<a xlink:title="FROM: http://jsoniq.org/functions, TO: http://www.zorba-xquery.com/modules/schema">
59 <path fill="none" stroke="black" d="M1744,-267.807C1744,-248.114 1744,-215.583 1744,-192.39"/>
60 <polygon fill="black" stroke="black" points="1747.5,-192.161 1744,-182.161 1740.5,-192.161 1747.5,-192.161"/>
61 </a>
62
63=== modified file 'doc/zorba/xqdoc/templates/www.functx.com_index.html'
64--- doc/zorba/xqdoc/templates/www.functx.com_index.html 2012-09-17 00:36:37 +0000
65+++ doc/zorba/xqdoc/templates/www.functx.com_index.html 2012-09-25 15:07:26 +0000
66@@ -762,7 +762,7 @@
67 <span>error</span>
68 <ul>
69 <li>
70- <a href="www.jsoniq.org_errors.html" title="http://www.jsoniq.org/errors">errors</a>
71+ <a href="jsoniq.org_errors.html" title="http://jsoniq.org/errors">errors</a>
72 <sup>
73 <img src="images/ZCsmall.gif" alt="ZC" title="This module is part of Zorba core." />
74 </sup>
75@@ -801,10 +801,10 @@
76 </ul>
77 </li>
78 <li>
79- <span>www.jsoniq.org</span>
80+ <span>jsoniq.org</span>
81 <ul>
82 <li>
83- <a href="www.jsoniq.org_functions.html" title="http://www.jsoniq.org/functions">functions</a>
84+ <a href="jsoniq.org_functions.html" title="http://jsoniq.org/functions">functions</a>
85 <sup>
86 <a href="http://www.w3.org/TR/xquery-30/#dt-external-function" target="_blank" title="There are external functions (either private or public) declared in this module.">(E)</a>
87 </sup>
88
89=== modified file 'doc/zorba/xqdoc/templates/www.w3.org_2005_xpath-functions.html'
90--- doc/zorba/xqdoc/templates/www.w3.org_2005_xpath-functions.html 2012-09-17 00:36:37 +0000
91+++ doc/zorba/xqdoc/templates/www.w3.org_2005_xpath-functions.html 2012-09-25 15:07:26 +0000
92@@ -762,7 +762,7 @@
93 <span>error</span>
94 <ul>
95 <li>
96- <a href="www.jsoniq.org_errors.html" title="http://www.jsoniq.org/errors">errors</a>
97+ <a href="jsoniq.org_errors.html" title="http://jsoniq.org/errors">errors</a>
98 <sup>
99 <img src="images/ZCsmall.gif" alt="ZC" title="This module is part of Zorba core." />
100 </sup>
101@@ -801,10 +801,10 @@
102 </ul>
103 </li>
104 <li>
105- <span>www.jsoniq.org</span>
106+ <span>jsoniq.org</span>
107 <ul>
108 <li>
109- <a href="www.jsoniq.org_functions.html" title="http://www.jsoniq.org/functions">functions</a>
110+ <a href="jsoniq.org_functions.html" title="http://jsoniq.org/functions">functions</a>
111 <sup>
112 <a href="http://www.w3.org/TR/xquery-30/#dt-external-function" target="_blank" title="There are external functions (either private or public) declared in this module.">(E)</a>
113 </sup>
114
115=== modified file 'doc/zorba/xqdoc/templates/www.w3.org_2005_xpath-functions_math.html'
116--- doc/zorba/xqdoc/templates/www.w3.org_2005_xpath-functions_math.html 2012-09-17 00:36:37 +0000
117+++ doc/zorba/xqdoc/templates/www.w3.org_2005_xpath-functions_math.html 2012-09-25 15:07:26 +0000
118@@ -762,7 +762,7 @@
119 <span>error</span>
120 <ul>
121 <li>
122- <a href="www.jsoniq.org_errors.html" title="http://www.jsoniq.org/errors">errors</a>
123+ <a href="jsoniq.org_errors.html" title="http://jsoniq.org/errors">errors</a>
124 <sup>
125 <img src="images/ZCsmall.gif" alt="ZC" title="This module is part of Zorba core." />
126 </sup>
127@@ -801,10 +801,10 @@
128 </ul>
129 </li>
130 <li>
131- <span>www.jsoniq.org</span>
132+ <span>jsoniq.org</span>
133 <ul>
134 <li>
135- <a href="www.jsoniq.org_functions.html" title="http://www.jsoniq.org/functions">functions</a>
136+ <a href="jsoniq.org_functions.html" title="http://jsoniq.org/functions">functions</a>
137 <sup>
138 <a href="http://www.w3.org/TR/xquery-30/#dt-external-function" target="_blank" title="There are external functions (either private or public) declared in this module.">(E)</a>
139 </sup>
140
141=== modified file 'modules/org/jsoniq/www/CMakeLists.txt'
142--- modules/org/jsoniq/www/CMakeLists.txt 2012-09-17 00:36:37 +0000
143+++ modules/org/jsoniq/www/CMakeLists.txt 2012-09-25 15:07:26 +0000
144@@ -14,10 +14,10 @@
145
146 IF(ZORBA_WITH_JSON)
147 DECLARE_ZORBA_MODULE(FILE functions.xq VERSION 1.0
148- URI "http://www.jsoniq.org/functions")
149+ URI "http://jsoniq.org/functions")
150 DECLARE_ZORBA_MODULE(FILE function-library.xq VERSION 1.0
151- URI "http://www.jsoniq.org/function-library")
152+ URI "http://jsoniq.org/function-library")
153 DECLARE_ZORBA_MODULE (FILE pregenerated/errors.xq
154- URI "http://www.jsoniq.org/errors")
155+ URI "http://jsoniq.org/errors")
156 ENDIF(ZORBA_WITH_JSON)
157
158
159=== modified file 'modules/org/jsoniq/www/function-library.xq'
160--- modules/org/jsoniq/www/function-library.xq 2012-09-06 23:55:13 +0000
161+++ modules/org/jsoniq/www/function-library.xq 2012-09-25 15:07:26 +0000
162@@ -22,7 +22,7 @@
163 : chapter 8 (Function Library). JSONiq extends
164 : the XQuery specification to also deal with JSON data natively. See
165 :
166- : http://www.jsoniq.org/
167+ : http://jsoniq.org/
168 :
169 : for details.
170 :
171@@ -31,9 +31,9 @@
172 :
173 : @author Ghislain Fourny
174 :)
175-module namespace libjn = "http://www.jsoniq.org/function-library";
176+module namespace libjn = "http://jsoniq.org/function-library";
177
178-import module namespace jn = "http://www.jsoniq.org/functions";
179+import module namespace jn = "http://jsoniq.org/functions";
180
181 declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
182 declare option ver:module-version "1.0";
183
184=== modified file 'modules/org/jsoniq/www/functions.xq'
185--- modules/org/jsoniq/www/functions.xq 2012-09-21 18:25:49 +0000
186+++ modules/org/jsoniq/www/functions.xq 2012-09-25 15:07:26 +0000
187@@ -22,7 +22,7 @@
188 : sections 1.7 (Functions) and 1.10 (Update Primitives). JSONiq extends
189 : the XQuery specification to also deal with JSON data natively. See
190 :
191- : http://www.jsoniq.org/
192+ : http://jsoniq.org/
193 :
194 : for details.
195 :
196@@ -31,13 +31,13 @@
197 :
198 : @author Markos Zaharioudakis, Matthias Brantner, Ghislain Fourny
199 :)
200-module namespace jn = "http://www.jsoniq.org/functions";
201+module namespace jn = "http://jsoniq.org/functions";
202
203 import module namespace schema = "http://www.zorba-xquery.com/modules/schema";
204
205 declare namespace err = "http://www.w3.org/2005/xqt-errors";
206-declare namespace jerr = "http://www.jsoniq.org/errors";
207-declare namespace js = "http://www.jsoniq.org/types";
208+declare namespace jerr = "http://jsoniq.org/errors";
209+declare namespace js = "http://jsoniq.org/types";
210
211 declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
212 declare option ver:module-version "1.0";
213@@ -49,7 +49,7 @@
214 : Calling this version of the function is equivalent to calling the
215 : 2 argument version of the function with the second argument
216 :
217- : { "prefix" : "Q{http://www.jsoniq.org/roundtrip}" }
218+ : { "prefix" : "Q{http://jsoniq.org/roundtrip}" }
219 :
220 : @param $items the items to be decoded.
221 : @return the decoded items.
222@@ -103,7 +103,7 @@
223 : 2 argument version of the function with the second argument
224 :
225 : {
226- : "prefix" : "Q{http://www.jsoniq.org/roundtrip}"
227+ : "prefix" : "Q{http://jsoniq.org/roundtrip}"
228 : "serialization-parameters" : <serialization-parameters xmlns="http://www.w3.org/2010/xslt-xquery-serialization"/>
229 : }
230 :
231
232=== modified file 'modules/org/jsoniq/www/pregenerated/errors.xq'
233--- modules/org/jsoniq/www/pregenerated/errors.xq 2012-09-20 19:24:53 +0000
234+++ modules/org/jsoniq/www/pregenerated/errors.xq 2012-09-25 15:07:26 +0000
235@@ -20,7 +20,7 @@
236 :)
237 (:~
238 : This module contains one declaration of a variable for each
239- : error of the http://www.jsoniq.org/errors namespace.
240+ : error of the http://jsoniq.org/errors namespace.
241 : The variables serves as documentation for the errors but can also
242 : be used in the code. For example, one useful scenario is to compare
243 : an error caught in the catch clause of a try-catch expression with one of
244@@ -33,9 +33,9 @@
245
246 xquery version '1.0';
247
248-module namespace jerr = 'http://www.jsoniq.org/errors';
249+module namespace jerr = 'http://jsoniq.org/errors';
250
251-declare variable $jerr:NS := 'http://www.jsoniq.org/errors';
252+declare variable $jerr:NS := 'http://jsoniq.org/errors';
253
254 (:~
255 :It is a type error if the right-hand-side expression of a pair constructor does not return exactly one item.
256
257=== modified file 'src/context/static_context.cpp'
258--- src/context/static_context.cpp 2012-09-19 18:18:02 +0000
259+++ src/context/static_context.cpp 2012-09-25 15:07:26 +0000
260@@ -398,11 +398,11 @@
261
262 const char*
263 static_context::JSONIQ_DM_NS =
264-"http://www.jsoniq.org/types";
265+"http://jsoniq.org/types";
266
267 const char*
268 static_context::JSONIQ_FN_NS =
269-"http://www.jsoniq.org/functions";
270+"http://jsoniq.org/functions";
271
272 #endif
273
274
275=== modified file 'src/diagnostics/diagnostic_list_xq.xq'
276--- src/diagnostics/diagnostic_list_xq.xq 2012-09-17 00:36:37 +0000
277+++ src/diagnostics/diagnostic_list_xq.xq 2012-09-25 15:07:26 +0000
278@@ -76,7 +76,7 @@
279 if ($namespace = "err")
280 then "http://www.w3.org/2005/xqt-errors"
281 else if ($namespace = "jerr")
282- then "http://www.jsoniq.org/errors"
283+ then "http://jsoniq.org/errors"
284 else if ($namespace = "zerr")
285 then "http://www.zorba-xquery.com/errors"
286 else if ($namespace = "zwarn")
287
288=== modified file 'src/functions/func_jsoniq_functions_impl.cpp'
289--- src/functions/func_jsoniq_functions_impl.cpp 2012-09-17 00:36:37 +0000
290+++ src/functions/func_jsoniq_functions_impl.cpp 2012-09-25 15:07:26 +0000
291@@ -175,7 +175,7 @@
292 void populate_context_jsoniq_functions_impl(static_context* sctx)
293 {
294 DECL(sctx, jn_object,
295- (createQName("http://www.jsoniq.org/functions", "", "object"),
296+ (createQName("http://jsoniq.org/functions", "", "object"),
297 GENV_TYPESYSTEM.JSON_OBJECT_TYPE_STAR,
298 GENV_TYPESYSTEM.JSON_OBJECT_TYPE_ONE));
299 }
300
301=== modified file 'src/functions/pregenerated/func_jsoniq_functions.cpp'
302--- src/functions/pregenerated/func_jsoniq_functions.cpp 2012-09-21 19:01:00 +0000
303+++ src/functions/pregenerated/func_jsoniq_functions.cpp 2012-09-25 15:07:26 +0000
304@@ -261,7 +261,7 @@
305
306 {
307 DECL_WITH_KIND(sctx, fn_jsoniq_decode_from_roundtrip,
308- (createQName("http://www.jsoniq.org/functions","","decode-from-roundtrip"),
309+ (createQName("http://jsoniq.org/functions","","decode-from-roundtrip"),
310 GENV_TYPESYSTEM.ITEM_TYPE_STAR,
311 GENV_TYPESYSTEM.ITEM_TYPE_STAR),
312 FunctionConsts::FN_JSONIQ_DECODE_FROM_ROUNDTRIP_1);
313@@ -277,7 +277,7 @@
314
315 {
316 DECL_WITH_KIND(sctx, fn_jsoniq_decode_from_roundtrip,
317- (createQName("http://www.jsoniq.org/functions","","decode-from-roundtrip"),
318+ (createQName("http://jsoniq.org/functions","","decode-from-roundtrip"),
319 GENV_TYPESYSTEM.ITEM_TYPE_STAR,
320 GENV_TYPESYSTEM.JSON_OBJECT_TYPE_ONE,
321 GENV_TYPESYSTEM.ITEM_TYPE_STAR),
322@@ -294,7 +294,7 @@
323
324 {
325 DECL_WITH_KIND(sctx, fn_jsoniq_encode_for_roundtrip,
326- (createQName("http://www.jsoniq.org/functions","","encode-for-roundtrip"),
327+ (createQName("http://jsoniq.org/functions","","encode-for-roundtrip"),
328 GENV_TYPESYSTEM.ITEM_TYPE_STAR,
329 GENV_TYPESYSTEM.ITEM_TYPE_STAR),
330 FunctionConsts::FN_JSONIQ_ENCODE_FOR_ROUNDTRIP_1);
331@@ -310,7 +310,7 @@
332
333 {
334 DECL_WITH_KIND(sctx, fn_jsoniq_encode_for_roundtrip,
335- (createQName("http://www.jsoniq.org/functions","","encode-for-roundtrip"),
336+ (createQName("http://jsoniq.org/functions","","encode-for-roundtrip"),
337 GENV_TYPESYSTEM.ITEM_TYPE_STAR,
338 GENV_TYPESYSTEM.JSON_OBJECT_TYPE_ONE,
339 GENV_TYPESYSTEM.ITEM_TYPE_STAR),
340@@ -327,7 +327,7 @@
341
342 {
343 DECL_WITH_KIND(sctx, fn_jsoniq_parse_json,
344- (createQName("http://www.jsoniq.org/functions","","parse-json"),
345+ (createQName("http://jsoniq.org/functions","","parse-json"),
346 GENV_TYPESYSTEM.STRING_TYPE_QUESTION,
347 GENV_TYPESYSTEM.JSON_ITEM_TYPE_STAR),
348 FunctionConsts::FN_JSONIQ_PARSE_JSON_1);
349@@ -343,7 +343,7 @@
350
351 {
352 DECL_WITH_KIND(sctx, fn_jsoniq_parse_json,
353- (createQName("http://www.jsoniq.org/functions","","parse-json"),
354+ (createQName("http://jsoniq.org/functions","","parse-json"),
355 GENV_TYPESYSTEM.STRING_TYPE_QUESTION,
356 GENV_TYPESYSTEM.JSON_OBJECT_TYPE_ONE,
357 GENV_TYPESYSTEM.JSON_ITEM_TYPE_STAR),
358@@ -360,7 +360,7 @@
359
360 {
361 DECL_WITH_KIND(sctx, fn_jsoniq_keys,
362- (createQName("http://www.jsoniq.org/functions","","keys"),
363+ (createQName("http://jsoniq.org/functions","","keys"),
364 GENV_TYPESYSTEM.JSON_OBJECT_TYPE_ONE,
365 GENV_TYPESYSTEM.STRING_TYPE_STAR),
366 FunctionConsts::FN_JSONIQ_KEYS_1);
367@@ -376,7 +376,7 @@
368
369 {
370 DECL_WITH_KIND(sctx, fn_jsoniq_value,
371- (createQName("http://www.jsoniq.org/functions","","value"),
372+ (createQName("http://jsoniq.org/functions","","value"),
373 GENV_TYPESYSTEM.JSON_OBJECT_TYPE_ONE,
374 GENV_TYPESYSTEM.STRING_TYPE_ONE,
375 GENV_TYPESYSTEM.ITEM_TYPE_QUESTION),
376@@ -393,7 +393,7 @@
377
378 {
379 DECL_WITH_KIND(sctx, fn_jsoniq_project,
380- (createQName("http://www.jsoniq.org/functions","","project"),
381+ (createQName("http://jsoniq.org/functions","","project"),
382 GENV_TYPESYSTEM.JSON_OBJECT_TYPE_ONE,
383 GENV_TYPESYSTEM.STRING_TYPE_STAR,
384 GENV_TYPESYSTEM.JSON_OBJECT_TYPE_ONE),
385@@ -410,7 +410,7 @@
386
387 {
388 DECL_WITH_KIND(sctx, fn_jsoniq_size,
389- (createQName("http://www.jsoniq.org/functions","","size"),
390+ (createQName("http://jsoniq.org/functions","","size"),
391 GENV_TYPESYSTEM.JSON_ARRAY_TYPE_ONE,
392 GENV_TYPESYSTEM.INTEGER_TYPE_ONE),
393 FunctionConsts::FN_JSONIQ_SIZE_1);
394@@ -426,7 +426,7 @@
395
396 {
397 DECL_WITH_KIND(sctx, fn_jsoniq_member,
398- (createQName("http://www.jsoniq.org/functions","","member"),
399+ (createQName("http://jsoniq.org/functions","","member"),
400 GENV_TYPESYSTEM.JSON_ARRAY_TYPE_ONE,
401 GENV_TYPESYSTEM.INTEGER_TYPE_ONE,
402 GENV_TYPESYSTEM.ITEM_TYPE_QUESTION),
403@@ -443,7 +443,7 @@
404
405 {
406 DECL_WITH_KIND(sctx, fn_jsoniq_members,
407- (createQName("http://www.jsoniq.org/functions","","members"),
408+ (createQName("http://jsoniq.org/functions","","members"),
409 GENV_TYPESYSTEM.JSON_ARRAY_TYPE_ONE,
410 GENV_TYPESYSTEM.ITEM_TYPE_STAR),
411 FunctionConsts::FN_JSONIQ_MEMBERS_1);
412@@ -459,7 +459,7 @@
413
414 {
415 DECL_WITH_KIND(sctx, fn_jsoniq_flatten,
416- (createQName("http://www.jsoniq.org/functions","","flatten"),
417+ (createQName("http://jsoniq.org/functions","","flatten"),
418 GENV_TYPESYSTEM.JSON_ARRAY_TYPE_ONE,
419 GENV_TYPESYSTEM.ITEM_TYPE_STAR),
420 FunctionConsts::FN_JSONIQ_FLATTEN_1);
421@@ -492,7 +492,7 @@
422
423 {
424 DECL_WITH_KIND(sctx, fn_jsoniq_null,
425- (createQName("http://www.jsoniq.org/functions","","null"),
426+ (createQName("http://jsoniq.org/functions","","null"),
427 GENV_TYPESYSTEM.JS_NULL_TYPE_ONE),
428 FunctionConsts::FN_JSONIQ_NULL_0);
429
430@@ -507,7 +507,7 @@
431
432 {
433 DECL_WITH_KIND(sctx, fn_jsoniq_is_null,
434- (createQName("http://www.jsoniq.org/functions","","is-null"),
435+ (createQName("http://jsoniq.org/functions","","is-null"),
436 GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_ONE,
437 GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
438 FunctionConsts::FN_JSONIQ_IS_NULL_1);
439
440=== modified file 'src/runtime/spec/mappings.xml'
441--- src/runtime/spec/mappings.xml 2012-09-17 00:36:37 +0000
442+++ src/runtime/spec/mappings.xml 2012-09-25 15:07:26 +0000
443@@ -32,7 +32,7 @@
444 define="ZORBA_SCHEMA_FN_NS"
445 prefix="fn-zorba-schema"/>
446
447- <zorba:namespace uri="http://www.jsoniq.org/functions"
448+ <zorba:namespace uri="http://jsoniq.org/functions"
449 define="JSONIQ_FN_NS"
450 prefix="fn-jsoniq"/>
451
452
453=== modified file 'src/store/naive/store.cpp'
454--- src/store/naive/store.cpp 2012-09-17 00:36:37 +0000
455+++ src/store/naive/store.cpp 2012-09-25 15:07:26 +0000
456@@ -86,7 +86,7 @@
457 const char* Store::XS_URI = "http://www.w3.org/2001/XMLSchema";
458 const char* Store::XML_URI = "http://www.w3.org/2001/XML/1998/namespace";
459 const char* Store::ZXSE_URI = "http://www.zorba-xquery.com/zorba/schema-extensions";
460-const char* Store::JS_URI = "http://www.jsoniq.org/types";
461+const char* Store::JS_URI = "http://jsoniq.org/types";
462
463 const ulong Store::XML_URI_LEN = sizeof(Store::XML_URI);
464
465
466=== modified file 'src/zorbamisc/ns_consts.h'
467--- src/zorbamisc/ns_consts.h 2012-09-19 18:18:02 +0000
468+++ src/zorbamisc/ns_consts.h 2012-09-25 15:07:26 +0000
469@@ -41,7 +41,7 @@
470 #define XSI_NS W3C_NS "2001/XMLSchema-instance"
471
472 #ifdef ZORBA_WITH_JSON
473-#define JSONIQ_ERR_NS "http://www.jsoniq.org/errors"
474+#define JSONIQ_ERR_NS "http://jsoniq.org/errors"
475 #endif
476
477 ///////////////////////////////////////////////////////////////////////////////
478
479=== modified file 'test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/encode_01.xml.res'
480--- test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/encode_01.xml.res 2012-09-13 23:49:28 +0000
481+++ test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/encode_01.xml.res 2012-09-25 15:07:26 +0000
482@@ -1,1 +1,1 @@
483-{ "nan" : { "Q{http://jsoniq.org/roundtrip}type" : "xs:double", "Q{http://jsoniq.org/roundtrip}value" : "NaN" }, "inf" : { "Q{http://jsoniq.org/roundtrip}type" : "xs:double", "Q{http://jsoniq.org/roundtrip}value" : "INF" }, "date" : { "Q{http://jsoniq.org/roundtrip}type" : "xs:date", "Q{http://jsoniq.org/roundtrip}value" : "1066-10-14" }, "QName" : { "Q{http://jsoniq.org/roundtrip}type" : "xs:QName", "Q{http://jsoniq.org/roundtrip}value" : "Q{http://www.jsoniq.org/functions}encode-for-roundtrip", "Q{http://jsoniq.org/roundtrip}prefix" : "jn" }, "EQName" : { "Q{http://jsoniq.org/roundtrip}type" : "xs:QName", "Q{http://jsoniq.org/roundtrip}value" : "Q{http://jsoniq.org/roundtrip}value" } }
484+{ "nan" : { "Q{http://jsoniq.org/roundtrip}type" : "xs:double", "Q{http://jsoniq.org/roundtrip}value" : "NaN" }, "inf" : { "Q{http://jsoniq.org/roundtrip}type" : "xs:double", "Q{http://jsoniq.org/roundtrip}value" : "INF" }, "date" : { "Q{http://jsoniq.org/roundtrip}type" : "xs:date", "Q{http://jsoniq.org/roundtrip}value" : "1066-10-14" }, "QName" : { "Q{http://jsoniq.org/roundtrip}type" : "xs:QName", "Q{http://jsoniq.org/roundtrip}value" : "Q{http://jsoniq.org/functions}encode-for-roundtrip", "Q{http://jsoniq.org/roundtrip}prefix" : "jn" }, "EQName" : { "Q{http://jsoniq.org/roundtrip}type" : "xs:QName", "Q{http://jsoniq.org/roundtrip}value" : "Q{http://jsoniq.org/roundtrip}value" } }
485
486=== modified file 'test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/encode_08.xml.res'
487--- test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/encode_08.xml.res 2012-09-21 01:11:35 +0000
488+++ test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/encode_08.xml.res 2012-09-25 15:07:26 +0000
489@@ -1,1 +1,1 @@
490-{ "nan" : { "Q{http://jsoniq.org/roundtrip}type" : "xs:double", "Q{http://jsoniq.org/roundtrip}value" : "NaN" }, "inf" : { "Q{http://jsoniq.org/roundtrip}type" : "xs:double", "Q{http://jsoniq.org/roundtrip}value" : "INF" } }{ "date" : { "Q{http://jsoniq.org/roundtrip}type" : "xs:date", "Q{http://jsoniq.org/roundtrip}value" : "1066-10-14" } }{ "QName" : { "Q{http://jsoniq.org/roundtrip}type" : "xs:QName", "Q{http://jsoniq.org/roundtrip}value" : "Q{http://www.jsoniq.org/functions}encode-for-roundtrip", "Q{http://jsoniq.org/roundtrip}prefix" : "jn" }, "EQName" : { "Q{http://jsoniq.org/roundtrip}type" : "xs:QName", "Q{http://jsoniq.org/roundtrip}value" : "Q{http://jsoniq.org/roundtrip}value" } }
491\ No newline at end of file
492+{ "nan" : { "Q{http://jsoniq.org/roundtrip}type" : "xs:double", "Q{http://jsoniq.org/roundtrip}value" : "NaN" }, "inf" : { "Q{http://jsoniq.org/roundtrip}type" : "xs:double", "Q{http://jsoniq.org/roundtrip}value" : "INF" } }{ "date" : { "Q{http://jsoniq.org/roundtrip}type" : "xs:date", "Q{http://jsoniq.org/roundtrip}value" : "1066-10-14" } }{ "QName" : { "Q{http://jsoniq.org/roundtrip}type" : "xs:QName", "Q{http://jsoniq.org/roundtrip}value" : "Q{http://jsoniq.org/functions}encode-for-roundtrip", "Q{http://jsoniq.org/roundtrip}prefix" : "jn" }, "EQName" : { "Q{http://jsoniq.org/roundtrip}type" : "xs:QName", "Q{http://jsoniq.org/roundtrip}value" : "Q{http://jsoniq.org/roundtrip}value" } }
493\ No newline at end of file
494
495=== modified file 'test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/roundtrip_01.xml.res'
496--- test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/roundtrip_01.xml.res 2012-09-19 18:44:33 +0000
497+++ test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/roundtrip_01.xml.res 2012-09-25 15:07:26 +0000
498@@ -1,1 +1,1 @@
499-{ "nan" : { "Q{http://jsoniq.org/roundtrip}type" : "xs:double", "Q{http://jsoniq.org/roundtrip}value" : "NaN" }, "inf" : { "Q{http://jsoniq.org/roundtrip}type" : "xs:double", "Q{http://jsoniq.org/roundtrip}value" : "INF" }, "date" : { "Q{http://jsoniq.org/roundtrip}type" : "xs:date", "Q{http://jsoniq.org/roundtrip}value" : "1066-10-14" }, "QName" : { "Q{http://jsoniq.org/roundtrip}type" : "xs:QName", "Q{http://jsoniq.org/roundtrip}value" : "Q{http://www.jsoniq.org/functions}encode-for-roundtrip", "Q{http://jsoniq.org/roundtrip}prefix" : "jn" }, "EQName" : { "Q{http://jsoniq.org/roundtrip}type" : "xs:QName", "Q{http://jsoniq.org/roundtrip}value" : "Q{http://jsoniq.org/roundtrip}value" } }
500+{ "nan" : { "Q{http://jsoniq.org/roundtrip}type" : "xs:double", "Q{http://jsoniq.org/roundtrip}value" : "NaN" }, "inf" : { "Q{http://jsoniq.org/roundtrip}type" : "xs:double", "Q{http://jsoniq.org/roundtrip}value" : "INF" }, "date" : { "Q{http://jsoniq.org/roundtrip}type" : "xs:date", "Q{http://jsoniq.org/roundtrip}value" : "1066-10-14" }, "QName" : { "Q{http://jsoniq.org/roundtrip}type" : "xs:QName", "Q{http://jsoniq.org/roundtrip}value" : "Q{http://jsoniq.org/functions}encode-for-roundtrip", "Q{http://jsoniq.org/roundtrip}prefix" : "jn" }, "EQName" : { "Q{http://jsoniq.org/roundtrip}type" : "xs:QName", "Q{http://jsoniq.org/roundtrip}value" : "Q{http://jsoniq.org/roundtrip}value" } }
501
502=== modified file 'test/rbkt/Queries/zorba/jsoniq/arr_append_01.xq'
503--- test/rbkt/Queries/zorba/jsoniq/arr_append_01.xq 2012-09-17 00:36:37 +0000
504+++ test/rbkt/Queries/zorba/jsoniq/arr_append_01.xq 2012-09-25 15:07:26 +0000
505@@ -1,4 +1,4 @@
506-import module namespace j = "http://www.jsoniq.org/functions";
507+import module namespace j = "http://jsoniq.org/functions";
508
509 variable $a := [ 1, 2, 3];
510
511
512=== modified file 'test/rbkt/Queries/zorba/jsoniq/arr_delete_02.spec'
513--- test/rbkt/Queries/zorba/jsoniq/arr_delete_02.spec 2012-09-17 00:36:37 +0000
514+++ test/rbkt/Queries/zorba/jsoniq/arr_delete_02.spec 2012-09-25 15:07:26 +0000
515@@ -1,1 +1,1 @@
516-Error: http://www.jsoniq.org/errors:JNUP0007
517+Error: http://jsoniq.org/errors:JNUP0007
518
519=== modified file 'test/rbkt/Queries/zorba/jsoniq/arr_delete_03.spec'
520--- test/rbkt/Queries/zorba/jsoniq/arr_delete_03.spec 2012-09-17 00:36:37 +0000
521+++ test/rbkt/Queries/zorba/jsoniq/arr_delete_03.spec 2012-09-25 15:07:26 +0000
522@@ -1,1 +1,1 @@
523-Error: http://www.jsoniq.org/errors:JNUP0016
524+Error: http://jsoniq.org/errors:JNUP0016
525
526=== modified file 'test/rbkt/Queries/zorba/jsoniq/arr_delete_04.spec'
527--- test/rbkt/Queries/zorba/jsoniq/arr_delete_04.spec 2012-09-17 00:36:37 +0000
528+++ test/rbkt/Queries/zorba/jsoniq/arr_delete_04.spec 2012-09-25 15:07:26 +0000
529@@ -1,1 +1,1 @@
530-Error: http://www.jsoniq.org/errors:JNUP0016
531+Error: http://jsoniq.org/errors:JNUP0016
532
533=== modified file 'test/rbkt/Queries/zorba/jsoniq/arr_delete_05.spec'
534--- test/rbkt/Queries/zorba/jsoniq/arr_delete_05.spec 2012-09-17 00:36:37 +0000
535+++ test/rbkt/Queries/zorba/jsoniq/arr_delete_05.spec 2012-09-25 15:07:26 +0000
536@@ -1,1 +1,1 @@
537-Error: http://www.jsoniq.org/errors:JNUP0016
538+Error: http://jsoniq.org/errors:JNUP0016
539
540=== modified file 'test/rbkt/Queries/zorba/jsoniq/arr_delete_08.xq'
541--- test/rbkt/Queries/zorba/jsoniq/arr_delete_08.xq 2012-06-12 13:38:07 +0000
542+++ test/rbkt/Queries/zorba/jsoniq/arr_delete_08.xq 2012-09-25 15:07:26 +0000
543@@ -1,3 +1,3 @@
544-import module namespace j = "http://www.jsoniq.org/functions";
545+import module namespace j = "http://jsoniq.org/functions";
546
547 rename json $o(1)[1] as 3;
548
549=== modified file 'test/rbkt/Queries/zorba/jsoniq/arr_delete_09.xq'
550--- test/rbkt/Queries/zorba/jsoniq/arr_delete_09.xq 2012-06-11 09:41:04 +0000
551+++ test/rbkt/Queries/zorba/jsoniq/arr_delete_09.xq 2012-09-25 15:07:26 +0000
552@@ -1,4 +1,4 @@
553-import module namespace j = "http://www.jsoniq.org/functions";
554+import module namespace j = "http://jsoniq.org/functions";
555
556 declare variable $o := [ [ 1, 2] ];
557
558
559=== modified file 'test/rbkt/Queries/zorba/jsoniq/arr_insert_01.xq'
560--- test/rbkt/Queries/zorba/jsoniq/arr_insert_01.xq 2012-09-17 00:36:37 +0000
561+++ test/rbkt/Queries/zorba/jsoniq/arr_insert_01.xq 2012-09-25 15:07:26 +0000
562@@ -1,4 +1,4 @@
563-import module namespace j = "http://www.jsoniq.org/functions";
564+import module namespace j = "http://jsoniq.org/functions";
565
566 variable $a1 := [ 1, 2, 3 ];
567 variable $a2 := [ ];
568
569=== modified file 'test/rbkt/Queries/zorba/jsoniq/arr_insert_02.xq'
570--- test/rbkt/Queries/zorba/jsoniq/arr_insert_02.xq 2012-09-17 00:36:37 +0000
571+++ test/rbkt/Queries/zorba/jsoniq/arr_insert_02.xq 2012-09-25 15:07:26 +0000
572@@ -1,4 +1,4 @@
573-import module namespace j = "http://www.jsoniq.org/functions";
574+import module namespace j = "http://jsoniq.org/functions";
575
576 variable $a1 := [ 1, 4, 5 ];
577 variable $a2 := [ 1, 2, 5 ];
578
579=== modified file 'test/rbkt/Queries/zorba/jsoniq/arr_insert_03.xq'
580--- test/rbkt/Queries/zorba/jsoniq/arr_insert_03.xq 2012-09-17 00:36:37 +0000
581+++ test/rbkt/Queries/zorba/jsoniq/arr_insert_03.xq 2012-09-25 15:07:26 +0000
582@@ -1,6 +1,6 @@
583-import module namespace j = "http://www.jsoniq.org/functions";
584+import module namespace j = "http://jsoniq.org/functions";
585
586-declare namespace jerr = "http://www.jsoniq.org/errors";
587+declare namespace jerr = "http://jsoniq.org/errors";
588
589 variable $a1 := [ 1, 2, 3 ];
590
591
592=== modified file 'test/rbkt/Queries/zorba/jsoniq/arr_insert_04.xq'
593--- test/rbkt/Queries/zorba/jsoniq/arr_insert_04.xq 2012-09-17 00:36:37 +0000
594+++ test/rbkt/Queries/zorba/jsoniq/arr_insert_04.xq 2012-09-25 15:07:26 +0000
595@@ -1,6 +1,6 @@
596-import module namespace j = "http://www.jsoniq.org/functions";
597+import module namespace j = "http://jsoniq.org/functions";
598
599-declare namespace jerr = "http://www.jsoniq.org/errors";
600+declare namespace jerr = "http://jsoniq.org/errors";
601
602 variable $a := [ 3 ];
603
604
605=== modified file 'test/rbkt/Queries/zorba/jsoniq/arr_insert_05.xq'
606--- test/rbkt/Queries/zorba/jsoniq/arr_insert_05.xq 2012-09-13 12:09:43 +0000
607+++ test/rbkt/Queries/zorba/jsoniq/arr_insert_05.xq 2012-09-25 15:07:26 +0000
608@@ -1,6 +1,6 @@
609-import module namespace j = "http://www.jsoniq.org/functions";
610+import module namespace j = "http://jsoniq.org/functions";
611
612-declare namespace jerr = "http://www.jsoniq.org/errors";
613+declare namespace jerr = "http://jsoniq.org/errors";
614
615 variable $a := [ 3 ];
616
617
618=== modified file 'test/rbkt/Queries/zorba/jsoniq/arr_insert_06.spec'
619--- test/rbkt/Queries/zorba/jsoniq/arr_insert_06.spec 2012-09-13 12:09:43 +0000
620+++ test/rbkt/Queries/zorba/jsoniq/arr_insert_06.spec 2012-09-25 15:07:26 +0000
621@@ -1,1 +1,1 @@
622-Error: http://www.jsoniq.org/errors:JNTY0004
623+Error: http://jsoniq.org/errors:JNTY0004
624
625=== modified file 'test/rbkt/Queries/zorba/jsoniq/arr_insert_06.xq'
626--- test/rbkt/Queries/zorba/jsoniq/arr_insert_06.xq 2012-09-13 12:09:43 +0000
627+++ test/rbkt/Queries/zorba/jsoniq/arr_insert_06.xq 2012-09-25 15:07:26 +0000
628@@ -1,6 +1,6 @@
629-import module namespace j = "http://www.jsoniq.org/functions";
630+import module namespace j = "http://jsoniq.org/functions";
631
632-declare namespace jerr = "http://www.jsoniq.org/errors";
633+declare namespace jerr = "http://jsoniq.org/errors";
634
635 variable $a := [ 3 ];
636
637
638=== modified file 'test/rbkt/Queries/zorba/jsoniq/arr_replace_01.xq'
639--- test/rbkt/Queries/zorba/jsoniq/arr_replace_01.xq 2012-09-17 00:36:37 +0000
640+++ test/rbkt/Queries/zorba/jsoniq/arr_replace_01.xq 2012-09-25 15:07:26 +0000
641@@ -1,4 +1,4 @@
642-import module namespace j = "http://www.jsoniq.org/functions";
643+import module namespace j = "http://jsoniq.org/functions";
644
645 variable $o := { "foo" : "bar" };
646 variable $a := [ 1, 2, 3];
647
648=== modified file 'test/rbkt/Queries/zorba/jsoniq/arr_update_01.xq'
649--- test/rbkt/Queries/zorba/jsoniq/arr_update_01.xq 2012-09-17 00:36:37 +0000
650+++ test/rbkt/Queries/zorba/jsoniq/arr_update_01.xq 2012-09-25 15:07:26 +0000
651@@ -1,4 +1,4 @@
652-import module namespace j = "http://www.jsoniq.org/functions";
653+import module namespace j = "http://jsoniq.org/functions";
654
655 variable $a := [ 1, 2, 3];
656
657
658=== modified file 'test/rbkt/Queries/zorba/jsoniq/arr_update_02.spec'
659--- test/rbkt/Queries/zorba/jsoniq/arr_update_02.spec 2012-07-10 13:03:31 +0000
660+++ test/rbkt/Queries/zorba/jsoniq/arr_update_02.spec 2012-09-25 15:07:26 +0000
661@@ -1,1 +1,1 @@
662-Error: http://www.jsoniq.org/errors:JNUP0009
663\ No newline at end of file
664+Error: http://jsoniq.org/errors:JNUP0009
665\ No newline at end of file
666
667=== modified file 'test/rbkt/Queries/zorba/jsoniq/arr_update_02.xq'
668--- test/rbkt/Queries/zorba/jsoniq/arr_update_02.xq 2012-09-17 00:36:37 +0000
669+++ test/rbkt/Queries/zorba/jsoniq/arr_update_02.xq 2012-09-25 15:07:26 +0000
670@@ -1,4 +1,4 @@
671-import module namespace j = "http://www.jsoniq.org/functions";
672+import module namespace j = "http://jsoniq.org/functions";
673
674 variable $a := [ 1, 2, 3];
675
676
677=== modified file 'test/rbkt/Queries/zorba/jsoniq/coll_dyn_02.spec'
678--- test/rbkt/Queries/zorba/jsoniq/coll_dyn_02.spec 2012-09-15 01:17:21 +0000
679+++ test/rbkt/Queries/zorba/jsoniq/coll_dyn_02.spec 2012-09-25 15:07:26 +0000
680@@ -1,2 +1,2 @@
681 Serialization: method=json
682-Error: http://www.jsoniq.org/errors:JNSE0014
683+Error: http://jsoniq.org/errors:JNSE0014
684
685=== modified file 'test/rbkt/Queries/zorba/jsoniq/data01.spec'
686--- test/rbkt/Queries/zorba/jsoniq/data01.spec 2012-03-13 11:48:34 +0000
687+++ test/rbkt/Queries/zorba/jsoniq/data01.spec 2012-09-25 15:07:26 +0000
688@@ -1,1 +1,1 @@
689-Error: http://www.jsoniq.org/errors:JNTY0004
690+Error: http://jsoniq.org/errors:JNTY0004
691
692=== modified file 'test/rbkt/Queries/zorba/jsoniq/data02.spec'
693--- test/rbkt/Queries/zorba/jsoniq/data02.spec 2012-03-13 11:48:34 +0000
694+++ test/rbkt/Queries/zorba/jsoniq/data02.spec 2012-09-25 15:07:26 +0000
695@@ -1,1 +1,1 @@
696-Error: http://www.jsoniq.org/errors:JNTY0004
697+Error: http://jsoniq.org/errors:JNTY0004
698
699=== modified file 'test/rbkt/Queries/zorba/jsoniq/data03.spec'
700--- test/rbkt/Queries/zorba/jsoniq/data03.spec 2012-03-13 11:48:34 +0000
701+++ test/rbkt/Queries/zorba/jsoniq/data03.spec 2012-09-25 15:07:26 +0000
702@@ -1,1 +1,1 @@
703-Error: http://www.jsoniq.org/errors:JNTY0004
704+Error: http://jsoniq.org/errors:JNTY0004
705
706=== modified file 'test/rbkt/Queries/zorba/jsoniq/data04.spec'
707--- test/rbkt/Queries/zorba/jsoniq/data04.spec 2012-03-13 11:48:34 +0000
708+++ test/rbkt/Queries/zorba/jsoniq/data04.spec 2012-09-25 15:07:26 +0000
709@@ -1,1 +1,1 @@
710-Error: http://www.jsoniq.org/errors:JNTY0004
711+Error: http://jsoniq.org/errors:JNTY0004
712
713=== modified file 'test/rbkt/Queries/zorba/jsoniq/ebv01.xq'
714--- test/rbkt/Queries/zorba/jsoniq/ebv01.xq 2012-02-07 20:19:48 +0000
715+++ test/rbkt/Queries/zorba/jsoniq/ebv01.xq 2012-09-25 15:07:26 +0000
716@@ -1,3 +1,3 @@
717-import module namespace j = "http://www.jsoniq.org/functions";
718+import module namespace j = "http://jsoniq.org/functions";
719
720 fn:boolean(j:null())
721
722=== modified file 'test/rbkt/Queries/zorba/jsoniq/ebv02.xq'
723--- test/rbkt/Queries/zorba/jsoniq/ebv02.xq 2012-03-12 17:04:56 +0000
724+++ test/rbkt/Queries/zorba/jsoniq/ebv02.xq 2012-09-25 15:07:26 +0000
725@@ -1,4 +1,4 @@
726-import module namespace j = "http://www.jsoniq.org/functions";
727+import module namespace j = "http://jsoniq.org/functions";
728
729 (: ebv of an array in a pair :)
730 let $j := { "foo" : [ 1 to 10 ] }
731
732=== modified file 'test/rbkt/Queries/zorba/jsoniq/ebv03.xq'
733--- test/rbkt/Queries/zorba/jsoniq/ebv03.xq 2012-03-12 17:04:56 +0000
734+++ test/rbkt/Queries/zorba/jsoniq/ebv03.xq 2012-09-25 15:07:26 +0000
735@@ -1,4 +1,4 @@
736-import module namespace j = "http://www.jsoniq.org/functions";
737+import module namespace j = "http://jsoniq.org/functions";
738
739 (: ebv of a sequence of an object :)
740 let $j := { "foo" : [ 1 to 10 ], "bar" : true }
741
742=== modified file 'test/rbkt/Queries/zorba/jsoniq/flatten_01.xq'
743--- test/rbkt/Queries/zorba/jsoniq/flatten_01.xq 2011-12-16 05:12:01 +0000
744+++ test/rbkt/Queries/zorba/jsoniq/flatten_01.xq 2012-09-25 15:07:26 +0000
745@@ -1,3 +1,3 @@
746-import module namespace j = "http://www.jsoniq.org/functions";
747+import module namespace j = "http://jsoniq.org/functions";
748
749 j:flatten(j:parse-json("[1, 2, [ 3 ] ]"))
750
751=== modified file 'test/rbkt/Queries/zorba/jsoniq/jn_accumulate.xq'
752--- test/rbkt/Queries/zorba/jsoniq/jn_accumulate.xq 2012-09-15 01:17:21 +0000
753+++ test/rbkt/Queries/zorba/jsoniq/jn_accumulate.xq 2012-09-25 15:07:26 +0000
754@@ -1,4 +1,4 @@
755-import module namespace libjn = "http://www.jsoniq.org/function-library";
756+import module namespace libjn = "http://jsoniq.org/function-library";
757
758 declare variable $xdoc :=
759 <nodes>
760
761=== modified file 'test/rbkt/Queries/zorba/jsoniq/jn_descendant_objects.xq'
762--- test/rbkt/Queries/zorba/jsoniq/jn_descendant_objects.xq 2012-09-06 23:55:13 +0000
763+++ test/rbkt/Queries/zorba/jsoniq/jn_descendant_objects.xq 2012-09-25 15:07:26 +0000
764@@ -1,4 +1,4 @@
765-import module namespace libjn = "http://www.jsoniq.org/function-library";
766+import module namespace libjn = "http://jsoniq.org/function-library";
767
768 let $object :=
769 {
770
771=== modified file 'test/rbkt/Queries/zorba/jsoniq/jn_descendant_pairs.xq'
772--- test/rbkt/Queries/zorba/jsoniq/jn_descendant_pairs.xq 2012-09-06 23:55:13 +0000
773+++ test/rbkt/Queries/zorba/jsoniq/jn_descendant_pairs.xq 2012-09-25 15:07:26 +0000
774@@ -1,4 +1,4 @@
775-import module namespace libjn = "http://www.jsoniq.org/function-library";
776+import module namespace libjn = "http://jsoniq.org/function-library";
777
778 let $object :=
779 {
780
781=== modified file 'test/rbkt/Queries/zorba/jsoniq/jn_intersect.xq'
782--- test/rbkt/Queries/zorba/jsoniq/jn_intersect.xq 2012-09-06 23:55:13 +0000
783+++ test/rbkt/Queries/zorba/jsoniq/jn_intersect.xq 2012-09-25 15:07:26 +0000
784@@ -1,4 +1,4 @@
785-import module namespace libjn = "http://www.jsoniq.org/function-library";
786+import module namespace libjn = "http://jsoniq.org/function-library";
787
788 let $object :=
789 {
790
791=== modified file 'test/rbkt/Queries/zorba/jsoniq/jn_values.xq'
792--- test/rbkt/Queries/zorba/jsoniq/jn_values.xq 2012-09-06 23:55:13 +0000
793+++ test/rbkt/Queries/zorba/jsoniq/jn_values.xq 2012-09-25 15:07:26 +0000
794@@ -1,4 +1,4 @@
795-import module namespace libjn = "http://www.jsoniq.org/function-library";
796+import module namespace libjn = "http://jsoniq.org/function-library";
797
798 let $object :=
799 {
800
801=== modified file 'test/rbkt/Queries/zorba/jsoniq/jndy0003-1.spec'
802--- test/rbkt/Queries/zorba/jsoniq/jndy0003-1.spec 2012-06-19 14:58:25 +0000
803+++ test/rbkt/Queries/zorba/jsoniq/jndy0003-1.spec 2012-09-25 15:07:26 +0000
804@@ -1,1 +1,1 @@
805-Error: http://www.jsoniq.org/errors:JNDY0003
806+Error: http://jsoniq.org/errors:JNDY0003
807
808=== modified file 'test/rbkt/Queries/zorba/jsoniq/jndy0003-2.spec'
809--- test/rbkt/Queries/zorba/jsoniq/jndy0003-2.spec 2012-06-19 14:58:25 +0000
810+++ test/rbkt/Queries/zorba/jsoniq/jndy0003-2.spec 2012-09-25 15:07:26 +0000
811@@ -1,1 +1,1 @@
812-Error: http://www.jsoniq.org/errors:JNDY0003
813+Error: http://jsoniq.org/errors:JNDY0003
814
815=== modified file 'test/rbkt/Queries/zorba/jsoniq/jndy0018-1.spec'
816--- test/rbkt/Queries/zorba/jsoniq/jndy0018-1.spec 2012-07-30 12:23:36 +0000
817+++ test/rbkt/Queries/zorba/jsoniq/jndy0018-1.spec 2012-09-25 15:07:26 +0000
818@@ -1,1 +1,1 @@
819-Error: http://www.jsoniq.org/errors:JNTY0018
820+Error: http://jsoniq.org/errors:JNTY0018
821
822=== modified file 'test/rbkt/Queries/zorba/jsoniq/jndy0018-2.spec'
823--- test/rbkt/Queries/zorba/jsoniq/jndy0018-2.spec 2012-07-30 12:23:36 +0000
824+++ test/rbkt/Queries/zorba/jsoniq/jndy0018-2.spec 2012-09-25 15:07:26 +0000
825@@ -1,1 +1,1 @@
826-Error: http://www.jsoniq.org/errors:JNTY0018
827+Error: http://jsoniq.org/errors:JNTY0018
828
829=== modified file 'test/rbkt/Queries/zorba/jsoniq/jndy0018-3.spec'
830--- test/rbkt/Queries/zorba/jsoniq/jndy0018-3.spec 2012-07-30 12:23:36 +0000
831+++ test/rbkt/Queries/zorba/jsoniq/jndy0018-3.spec 2012-09-25 15:07:26 +0000
832@@ -1,1 +1,1 @@
833-Error: http://www.jsoniq.org/errors:JNTY0018
834+Error: http://jsoniq.org/errors:JNTY0018
835
836=== modified file 'test/rbkt/Queries/zorba/jsoniq/jndy0018-4.spec'
837--- test/rbkt/Queries/zorba/jsoniq/jndy0018-4.spec 2012-07-30 12:23:36 +0000
838+++ test/rbkt/Queries/zorba/jsoniq/jndy0018-4.spec 2012-09-25 15:07:26 +0000
839@@ -1,1 +1,1 @@
840-Error: http://www.jsoniq.org/errors:JNTY0018
841+Error: http://jsoniq.org/errors:JNTY0018
842
843=== modified file 'test/rbkt/Queries/zorba/jsoniq/jnty0004-1.spec'
844--- test/rbkt/Queries/zorba/jsoniq/jnty0004-1.spec 2012-06-19 14:58:25 +0000
845+++ test/rbkt/Queries/zorba/jsoniq/jnty0004-1.spec 2012-09-25 15:07:26 +0000
846@@ -1,1 +1,1 @@
847-Error: http://www.jsoniq.org/errors:JNTY0004
848+Error: http://jsoniq.org/errors:JNTY0004
849
850=== modified file 'test/rbkt/Queries/zorba/jsoniq/jnty0004-2.spec'
851--- test/rbkt/Queries/zorba/jsoniq/jnty0004-2.spec 2012-06-19 14:58:25 +0000
852+++ test/rbkt/Queries/zorba/jsoniq/jnty0004-2.spec 2012-09-25 15:07:26 +0000
853@@ -1,1 +1,1 @@
854-Error: http://www.jsoniq.org/errors:JNTY0004
855+Error: http://jsoniq.org/errors:JNTY0004
856
857=== modified file 'test/rbkt/Queries/zorba/jsoniq/jnty0007-1.spec'
858--- test/rbkt/Queries/zorba/jsoniq/jnty0007-1.spec 2012-06-21 13:56:25 +0000
859+++ test/rbkt/Queries/zorba/jsoniq/jnty0007-1.spec 2012-09-25 15:07:26 +0000
860@@ -1,1 +1,1 @@
861-Error: http://www.jsoniq.org/errors:JNUP0007
862+Error: http://jsoniq.org/errors:JNUP0007
863
864=== modified file 'test/rbkt/Queries/zorba/jsoniq/jnty0007-2.spec'
865--- test/rbkt/Queries/zorba/jsoniq/jnty0007-2.spec 2012-06-21 13:56:25 +0000
866+++ test/rbkt/Queries/zorba/jsoniq/jnty0007-2.spec 2012-09-25 15:07:26 +0000
867@@ -1,1 +1,1 @@
868-Error: http://www.jsoniq.org/errors:JNUP0007
869+Error: http://jsoniq.org/errors:JNUP0007
870
871=== modified file 'test/rbkt/Queries/zorba/jsoniq/jnty0007-4.spec'
872--- test/rbkt/Queries/zorba/jsoniq/jnty0007-4.spec 2012-06-21 13:56:25 +0000
873+++ test/rbkt/Queries/zorba/jsoniq/jnty0007-4.spec 2012-09-25 15:07:26 +0000
874@@ -1,1 +1,1 @@
875-Error: http://www.jsoniq.org/errors:JNUP0007
876+Error: http://jsoniq.org/errors:JNUP0007
877
878=== modified file 'test/rbkt/Queries/zorba/jsoniq/jnty0007-5.spec'
879--- test/rbkt/Queries/zorba/jsoniq/jnty0007-5.spec 2012-06-21 13:56:25 +0000
880+++ test/rbkt/Queries/zorba/jsoniq/jnty0007-5.spec 2012-09-25 15:07:26 +0000
881@@ -1,1 +1,1 @@
882-Error: http://www.jsoniq.org/errors:JNUP0007
883+Error: http://jsoniq.org/errors:JNUP0007
884
885=== modified file 'test/rbkt/Queries/zorba/jsoniq/jnty0007-6.spec'
886--- test/rbkt/Queries/zorba/jsoniq/jnty0007-6.spec 2012-06-21 13:56:25 +0000
887+++ test/rbkt/Queries/zorba/jsoniq/jnty0007-6.spec 2012-09-25 15:07:26 +0000
888@@ -1,1 +1,1 @@
889-Error: http://www.jsoniq.org/errors:JNUP0007
890+Error: http://jsoniq.org/errors:JNUP0007
891
892=== modified file 'test/rbkt/Queries/zorba/jsoniq/jnty0007-7.spec'
893--- test/rbkt/Queries/zorba/jsoniq/jnty0007-7.spec 2012-06-21 13:56:25 +0000
894+++ test/rbkt/Queries/zorba/jsoniq/jnty0007-7.spec 2012-09-25 15:07:26 +0000
895@@ -1,1 +1,1 @@
896-Error: http://www.jsoniq.org/errors:JNUP0007
897+Error: http://jsoniq.org/errors:JNUP0007
898
899=== modified file 'test/rbkt/Queries/zorba/jsoniq/jnty0008-1.spec'
900--- test/rbkt/Queries/zorba/jsoniq/jnty0008-1.spec 2012-06-21 13:56:25 +0000
901+++ test/rbkt/Queries/zorba/jsoniq/jnty0008-1.spec 2012-09-25 15:07:26 +0000
902@@ -1,1 +1,1 @@
903-Error: http://www.jsoniq.org/errors:JNUP0008
904+Error: http://jsoniq.org/errors:JNUP0008
905
906=== modified file 'test/rbkt/Queries/zorba/jsoniq/jnty0008-2.spec'
907--- test/rbkt/Queries/zorba/jsoniq/jnty0008-2.spec 2012-06-21 13:56:25 +0000
908+++ test/rbkt/Queries/zorba/jsoniq/jnty0008-2.spec 2012-09-25 15:07:26 +0000
909@@ -1,1 +1,1 @@
910-Error: http://www.jsoniq.org/errors:JNUP0008
911+Error: http://jsoniq.org/errors:JNUP0008
912
913=== modified file 'test/rbkt/Queries/zorba/jsoniq/jnty0008-3.spec'
914--- test/rbkt/Queries/zorba/jsoniq/jnty0008-3.spec 2012-06-21 13:56:25 +0000
915+++ test/rbkt/Queries/zorba/jsoniq/jnty0008-3.spec 2012-09-25 15:07:26 +0000
916@@ -1,1 +1,1 @@
917-Error: http://www.jsoniq.org/errors:JNUP0008
918+Error: http://jsoniq.org/errors:JNUP0008
919
920=== modified file 'test/rbkt/Queries/zorba/jsoniq/jnty0008-4.spec'
921--- test/rbkt/Queries/zorba/jsoniq/jnty0008-4.spec 2012-06-21 13:56:25 +0000
922+++ test/rbkt/Queries/zorba/jsoniq/jnty0008-4.spec 2012-09-25 15:07:26 +0000
923@@ -1,1 +1,1 @@
924-Error: http://www.jsoniq.org/errors:JNUP0008
925+Error: http://jsoniq.org/errors:JNUP0008
926
927=== modified file 'test/rbkt/Queries/zorba/jsoniq/jnty0008-5.spec'
928--- test/rbkt/Queries/zorba/jsoniq/jnty0008-5.spec 2012-06-21 13:56:25 +0000
929+++ test/rbkt/Queries/zorba/jsoniq/jnty0008-5.spec 2012-09-25 15:07:26 +0000
930@@ -1,1 +1,1 @@
931-Error: http://www.jsoniq.org/errors:JNUP0008
932+Error: http://jsoniq.org/errors:JNUP0008
933
934=== modified file 'test/rbkt/Queries/zorba/jsoniq/jnty0008-6.spec'
935--- test/rbkt/Queries/zorba/jsoniq/jnty0008-6.spec 2012-06-21 13:56:25 +0000
936+++ test/rbkt/Queries/zorba/jsoniq/jnty0008-6.spec 2012-09-25 15:07:26 +0000
937@@ -1,1 +1,1 @@
938-Error: http://www.jsoniq.org/errors:JNUP0008
939+Error: http://jsoniq.org/errors:JNUP0008
940
941=== modified file 'test/rbkt/Queries/zorba/jsoniq/jnty0008-7.spec'
942--- test/rbkt/Queries/zorba/jsoniq/jnty0008-7.spec 2012-06-21 13:56:25 +0000
943+++ test/rbkt/Queries/zorba/jsoniq/jnty0008-7.spec 2012-09-25 15:07:26 +0000
944@@ -1,1 +1,1 @@
945-Error: http://www.jsoniq.org/errors:JNUP0008
946+Error: http://jsoniq.org/errors:JNUP0008
947
948=== modified file 'test/rbkt/Queries/zorba/jsoniq/jnty0008-8.spec'
949--- test/rbkt/Queries/zorba/jsoniq/jnty0008-8.spec 2012-06-21 13:56:25 +0000
950+++ test/rbkt/Queries/zorba/jsoniq/jnty0008-8.spec 2012-09-25 15:07:26 +0000
951@@ -1,1 +1,1 @@
952-Error: http://www.jsoniq.org/errors:JNUP0008
953+Error: http://jsoniq.org/errors:JNUP0008
954
955=== modified file 'test/rbkt/Queries/zorba/jsoniq/jnup0005.spec'
956--- test/rbkt/Queries/zorba/jsoniq/jnup0005.spec 2012-06-19 14:58:25 +0000
957+++ test/rbkt/Queries/zorba/jsoniq/jnup0005.spec 2012-09-25 15:07:26 +0000
958@@ -1,1 +1,1 @@
959-Error: http://www.jsoniq.org/errors:JNUP0005
960+Error: http://jsoniq.org/errors:JNUP0005
961
962=== modified file 'test/rbkt/Queries/zorba/jsoniq/jnup0006.spec'
963--- test/rbkt/Queries/zorba/jsoniq/jnup0006.spec 2012-06-19 14:58:25 +0000
964+++ test/rbkt/Queries/zorba/jsoniq/jnup0006.spec 2012-09-25 15:07:26 +0000
965@@ -1,1 +1,1 @@
966-Error: http://www.jsoniq.org/errors:JNUP0006
967+Error: http://jsoniq.org/errors:JNUP0006
968
969=== modified file 'test/rbkt/Queries/zorba/jsoniq/jnup0009-1.spec'
970--- test/rbkt/Queries/zorba/jsoniq/jnup0009-1.spec 2012-06-19 14:58:25 +0000
971+++ test/rbkt/Queries/zorba/jsoniq/jnup0009-1.spec 2012-09-25 15:07:26 +0000
972@@ -1,1 +1,1 @@
973-Error: http://www.jsoniq.org/errors:JNUP0009
974+Error: http://jsoniq.org/errors:JNUP0009
975
976=== modified file 'test/rbkt/Queries/zorba/jsoniq/jnup0009-2.spec'
977--- test/rbkt/Queries/zorba/jsoniq/jnup0009-2.spec 2012-06-19 14:58:25 +0000
978+++ test/rbkt/Queries/zorba/jsoniq/jnup0009-2.spec 2012-09-25 15:07:26 +0000
979@@ -1,1 +1,1 @@
980-Error: http://www.jsoniq.org/errors:JNUP0009
981+Error: http://jsoniq.org/errors:JNUP0009
982
983=== modified file 'test/rbkt/Queries/zorba/jsoniq/jnup0010.spec'
984--- test/rbkt/Queries/zorba/jsoniq/jnup0010.spec 2012-06-19 14:58:25 +0000
985+++ test/rbkt/Queries/zorba/jsoniq/jnup0010.spec 2012-09-25 15:07:26 +0000
986@@ -1,1 +1,1 @@
987-Error: http://www.jsoniq.org/errors:JNUP0010
988+Error: http://jsoniq.org/errors:JNUP0010
989
990=== modified file 'test/rbkt/Queries/zorba/jsoniq/jnup0011-1.spec'
991--- test/rbkt/Queries/zorba/jsoniq/jnup0011-1.spec 2012-06-19 14:58:25 +0000
992+++ test/rbkt/Queries/zorba/jsoniq/jnup0011-1.spec 2012-09-25 15:07:26 +0000
993@@ -1,1 +1,1 @@
994-Error: http://www.jsoniq.org/errors:JNTY0011
995+Error: http://jsoniq.org/errors:JNTY0011
996
997=== modified file 'test/rbkt/Queries/zorba/jsoniq/jnup0011-2.spec'
998--- test/rbkt/Queries/zorba/jsoniq/jnup0011-2.spec 2012-06-19 14:58:25 +0000
999+++ test/rbkt/Queries/zorba/jsoniq/jnup0011-2.spec 2012-09-25 15:07:26 +0000
1000@@ -1,1 +1,1 @@
1001-Error: http://www.jsoniq.org/errors:JNTY0011
1002+Error: http://jsoniq.org/errors:JNTY0011
1003
1004=== modified file 'test/rbkt/Queries/zorba/jsoniq/member_01.xq'
1005--- test/rbkt/Queries/zorba/jsoniq/member_01.xq 2012-01-10 19:42:22 +0000
1006+++ test/rbkt/Queries/zorba/jsoniq/member_01.xq 2012-09-25 15:07:26 +0000
1007@@ -1,4 +1,4 @@
1008-import module namespace j = "http://www.jsoniq.org/functions";
1009+import module namespace j = "http://jsoniq.org/functions";
1010
1011 let $j := j:parse-json('[ "foo", "bar" ]')
1012 return (empty(j:member($j, 0)), j:member($j, 1), empty(j:member($j, 3)))
1013
1014=== modified file 'test/rbkt/Queries/zorba/jsoniq/member_03.xq'
1015--- test/rbkt/Queries/zorba/jsoniq/member_03.xq 2012-02-05 17:39:57 +0000
1016+++ test/rbkt/Queries/zorba/jsoniq/member_03.xq 2012-09-25 15:07:26 +0000
1017@@ -1,5 +1,5 @@
1018 let $stats := [{
1019- "domain": "www.jsoniq.org"
1020+ "domain": "jsoniq.org"
1021 }]
1022 for $stat in $stats
1023 return $stat("domain")
1024
1025=== modified file 'test/rbkt/Queries/zorba/jsoniq/names_01.xq'
1026--- test/rbkt/Queries/zorba/jsoniq/names_01.xq 2012-03-23 21:17:48 +0000
1027+++ test/rbkt/Queries/zorba/jsoniq/names_01.xq 2012-09-25 15:07:26 +0000
1028@@ -1,3 +1,3 @@
1029-import module namespace j = "http://www.jsoniq.org/functions";
1030+import module namespace j = "http://jsoniq.org/functions";
1031
1032 j:keys(j:parse-json('{ "foo" : "bar" }'))
1033
1034=== modified file 'test/rbkt/Queries/zorba/jsoniq/names_02.xq'
1035--- test/rbkt/Queries/zorba/jsoniq/names_02.xq 2012-03-23 21:17:48 +0000
1036+++ test/rbkt/Queries/zorba/jsoniq/names_02.xq 2012-09-25 15:07:26 +0000
1037@@ -1,4 +1,4 @@
1038-import module namespace j = "http://www.jsoniq.org/functions";
1039+import module namespace j = "http://jsoniq.org/functions";
1040
1041 for $i in j:keys(j:parse-json('{ "foo" : "bar" }'))
1042 return $i
1043
1044=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_constr_03.spec'
1045--- test/rbkt/Queries/zorba/jsoniq/obj_constr_03.spec 2012-03-13 15:35:20 +0000
1046+++ test/rbkt/Queries/zorba/jsoniq/obj_constr_03.spec 2012-09-25 15:07:26 +0000
1047@@ -1,1 +1,1 @@
1048-Error: http://www.jsoniq.org/errors:JNDY0003
1049+Error: http://jsoniq.org/errors:JNDY0003
1050
1051=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_constr_05.spec'
1052--- test/rbkt/Queries/zorba/jsoniq/obj_constr_05.spec 2012-03-13 15:35:20 +0000
1053+++ test/rbkt/Queries/zorba/jsoniq/obj_constr_05.spec 2012-09-25 15:07:26 +0000
1054@@ -1,1 +1,1 @@
1055-Error: http://www.jsoniq.org/errors:JNDY0003
1056+Error: http://jsoniq.org/errors:JNDY0003
1057
1058=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_constr_06.xq'
1059--- test/rbkt/Queries/zorba/jsoniq/obj_constr_06.xq 2012-09-11 15:38:58 +0000
1060+++ test/rbkt/Queries/zorba/jsoniq/obj_constr_06.xq 2012-09-25 15:07:26 +0000
1061@@ -1,4 +1,4 @@
1062 declare namespace err = "http://www.w3.org/2005/xqt-errors";
1063-declare namespace jerr = "http://www.jsoniq.org/errors";
1064+declare namespace jerr = "http://jsoniq.org/errors";
1065
1066 try { { { 1 : 1 } : 1 } } catch jerr:JNTY0004 { $err:description }
1067
1068=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_constr_10.xq'
1069--- test/rbkt/Queries/zorba/jsoniq/obj_constr_10.xq 2012-09-11 15:38:58 +0000
1070+++ test/rbkt/Queries/zorba/jsoniq/obj_constr_10.xq 2012-09-25 15:07:26 +0000
1071@@ -1,4 +1,4 @@
1072 declare namespace err = "http://www.w3.org/2005/xqt-errors";
1073-declare namespace jerr = "http://www.jsoniq.org/errors";
1074+declare namespace jerr = "http://jsoniq.org/errors";
1075
1076 try { { [ 1 to 3] : 1 } } catch jerr:JNTY0004 { $err:description }
1077
1078=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_delete_01.xq'
1079--- test/rbkt/Queries/zorba/jsoniq/obj_delete_01.xq 2012-03-20 15:35:18 +0000
1080+++ test/rbkt/Queries/zorba/jsoniq/obj_delete_01.xq 2012-09-25 15:07:26 +0000
1081@@ -1,4 +1,4 @@
1082-import module namespace j = "http://www.jsoniq.org/functions";
1083+import module namespace j = "http://jsoniq.org/functions";
1084
1085 variable $o := { "foo" : "bar" };
1086
1087
1088=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_delete_02.xq'
1089--- test/rbkt/Queries/zorba/jsoniq/obj_delete_02.xq 2012-03-20 15:35:18 +0000
1090+++ test/rbkt/Queries/zorba/jsoniq/obj_delete_02.xq 2012-09-25 15:07:26 +0000
1091@@ -1,4 +1,4 @@
1092-import module namespace j = "http://www.jsoniq.org/functions";
1093+import module namespace j = "http://jsoniq.org/functions";
1094
1095 variable $o := { "foo" : "bar" };
1096
1097
1098=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_delete_03.spec'
1099--- test/rbkt/Queries/zorba/jsoniq/obj_delete_03.spec 2012-09-17 00:36:37 +0000
1100+++ test/rbkt/Queries/zorba/jsoniq/obj_delete_03.spec 2012-09-25 15:07:26 +0000
1101@@ -1,1 +1,1 @@
1102-Error: http://www.jsoniq.org/errors:JNUP0007
1103+Error: http://jsoniq.org/errors:JNUP0007
1104
1105=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_delete_03.xq'
1106--- test/rbkt/Queries/zorba/jsoniq/obj_delete_03.xq 2012-03-20 15:35:18 +0000
1107+++ test/rbkt/Queries/zorba/jsoniq/obj_delete_03.xq 2012-09-25 15:07:26 +0000
1108@@ -1,4 +1,4 @@
1109-import module namespace j = "http://www.jsoniq.org/functions";
1110+import module namespace j = "http://jsoniq.org/functions";
1111
1112 variable $o := { "foo" : "bar" };
1113
1114
1115=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_delete_05.spec'
1116--- test/rbkt/Queries/zorba/jsoniq/obj_delete_05.spec 2012-09-17 00:36:37 +0000
1117+++ test/rbkt/Queries/zorba/jsoniq/obj_delete_05.spec 2012-09-25 15:07:26 +0000
1118@@ -1,2 +1,2 @@
1119-Error: http://www.jsoniq.org/errors:JNUP0016
1120+Error: http://jsoniq.org/errors:JNUP0016
1121
1122
1123=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_delete_05.xq'
1124--- test/rbkt/Queries/zorba/jsoniq/obj_delete_05.xq 2012-03-20 15:35:18 +0000
1125+++ test/rbkt/Queries/zorba/jsoniq/obj_delete_05.xq 2012-09-25 15:07:26 +0000
1126@@ -1,4 +1,4 @@
1127-import module namespace j = "http://www.jsoniq.org/functions";
1128+import module namespace j = "http://jsoniq.org/functions";
1129
1130 variable $o := { "foo" : "bar" };
1131
1132
1133=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_delete_06.xq'
1134--- test/rbkt/Queries/zorba/jsoniq/obj_delete_06.xq 2012-03-20 15:35:18 +0000
1135+++ test/rbkt/Queries/zorba/jsoniq/obj_delete_06.xq 2012-09-25 15:07:26 +0000
1136@@ -1,4 +1,4 @@
1137-import module namespace j = "http://www.jsoniq.org/functions";
1138+import module namespace j = "http://jsoniq.org/functions";
1139
1140 variable $o :=
1141 {
1142
1143=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_delete_07.xq'
1144--- test/rbkt/Queries/zorba/jsoniq/obj_delete_07.xq 2012-06-12 13:38:07 +0000
1145+++ test/rbkt/Queries/zorba/jsoniq/obj_delete_07.xq 2012-09-25 15:07:26 +0000
1146@@ -1,3 +1,3 @@
1147-import module namespace j = "http://www.jsoniq.org/functions";
1148+import module namespace j = "http://jsoniq.org/functions";
1149
1150 delete json $o(1)[2](3)("foo", "bar");
1151
1152=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_delete_08.xq'
1153--- test/rbkt/Queries/zorba/jsoniq/obj_delete_08.xq 2012-06-12 13:38:07 +0000
1154+++ test/rbkt/Queries/zorba/jsoniq/obj_delete_08.xq 2012-09-25 15:07:26 +0000
1155@@ -1,3 +1,3 @@
1156-import module namespace j = "http://www.jsoniq.org/functions";
1157+import module namespace j = "http://jsoniq.org/functions";
1158
1159 delete json $o(1)["foo"];
1160
1161=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_delete_09.xq'
1162--- test/rbkt/Queries/zorba/jsoniq/obj_delete_09.xq 2012-06-11 09:41:04 +0000
1163+++ test/rbkt/Queries/zorba/jsoniq/obj_delete_09.xq 2012-09-25 15:07:26 +0000
1164@@ -1,4 +1,4 @@
1165-import module namespace j = "http://www.jsoniq.org/functions";
1166+import module namespace j = "http://jsoniq.org/functions";
1167
1168 declare variable $o := [ { "foo" : "foo", "bar" : "bar" } ];
1169
1170
1171=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_insert_01.xq'
1172--- test/rbkt/Queries/zorba/jsoniq/obj_insert_01.xq 2012-09-17 00:36:37 +0000
1173+++ test/rbkt/Queries/zorba/jsoniq/obj_insert_01.xq 2012-09-25 15:07:26 +0000
1174@@ -1,4 +1,4 @@
1175-import module namespace j = "http://www.jsoniq.org/functions";
1176+import module namespace j = "http://jsoniq.org/functions";
1177
1178 variable $o := { "foo" : "bar" };
1179
1180
1181=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_insert_02.spec'
1182--- test/rbkt/Queries/zorba/jsoniq/obj_insert_02.spec 2012-03-20 15:35:18 +0000
1183+++ test/rbkt/Queries/zorba/jsoniq/obj_insert_02.spec 2012-09-25 15:07:26 +0000
1184@@ -1,1 +1,1 @@
1185-Error: http://www.jsoniq.org/errors:JNUP0006
1186+Error: http://jsoniq.org/errors:JNUP0006
1187
1188=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_insert_02.xq'
1189--- test/rbkt/Queries/zorba/jsoniq/obj_insert_02.xq 2012-09-17 00:36:37 +0000
1190+++ test/rbkt/Queries/zorba/jsoniq/obj_insert_02.xq 2012-09-25 15:07:26 +0000
1191@@ -1,3 +1,3 @@
1192-import module namespace j = "http://www.jsoniq.org/functions";
1193+import module namespace j = "http://jsoniq.org/functions";
1194
1195 insert json { "foo" : "blub" } into { "foo" : "bar" }
1196
1197=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_insert_03.xq'
1198--- test/rbkt/Queries/zorba/jsoniq/obj_insert_03.xq 2012-09-17 00:36:37 +0000
1199+++ test/rbkt/Queries/zorba/jsoniq/obj_insert_03.xq 2012-09-25 15:07:26 +0000
1200@@ -1,4 +1,4 @@
1201-import module namespace j = "http://www.jsoniq.org/functions";
1202+import module namespace j = "http://jsoniq.org/functions";
1203
1204 variable $o := { "foo" : "bar" };
1205
1206
1207=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_insert_04.spec'
1208--- test/rbkt/Queries/zorba/jsoniq/obj_insert_04.spec 2012-03-20 15:35:18 +0000
1209+++ test/rbkt/Queries/zorba/jsoniq/obj_insert_04.spec 2012-09-25 15:07:26 +0000
1210@@ -1,1 +1,1 @@
1211-Error: http://www.jsoniq.org/errors:JNUP0005
1212+Error: http://jsoniq.org/errors:JNUP0005
1213
1214=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_insert_04.xq'
1215--- test/rbkt/Queries/zorba/jsoniq/obj_insert_04.xq 2012-09-17 00:36:37 +0000
1216+++ test/rbkt/Queries/zorba/jsoniq/obj_insert_04.xq 2012-09-25 15:07:26 +0000
1217@@ -1,4 +1,4 @@
1218-import module namespace j = "http://www.jsoniq.org/functions";
1219+import module namespace j = "http://jsoniq.org/functions";
1220
1221 variable $o := { "foo" : "bar" };
1222
1223
1224=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_insert_12.spec'
1225--- test/rbkt/Queries/zorba/jsoniq/obj_insert_12.spec 2012-09-13 12:09:43 +0000
1226+++ test/rbkt/Queries/zorba/jsoniq/obj_insert_12.spec 2012-09-25 15:07:26 +0000
1227@@ -1,1 +1,1 @@
1228-Error: http://www.jsoniq.org/errors:JNUP0019
1229+Error: http://jsoniq.org/errors:JNUP0019
1230
1231=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_insert_15.spec'
1232--- test/rbkt/Queries/zorba/jsoniq/obj_insert_15.spec 2012-09-13 12:09:43 +0000
1233+++ test/rbkt/Queries/zorba/jsoniq/obj_insert_15.spec 2012-09-25 15:07:26 +0000
1234@@ -1,1 +1,1 @@
1235-Error: http://www.jsoniq.org/errors:JNDY0003
1236+Error: http://jsoniq.org/errors:JNDY0003
1237
1238=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_insert_16.spec'
1239--- test/rbkt/Queries/zorba/jsoniq/obj_insert_16.spec 2012-09-14 13:04:48 +0000
1240+++ test/rbkt/Queries/zorba/jsoniq/obj_insert_16.spec 2012-09-25 15:07:26 +0000
1241@@ -1,1 +1,1 @@
1242-Error: http://www.jsoniq.org/errors:JNUP0005
1243+Error: http://jsoniq.org/errors:JNUP0005
1244
1245=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_insert_16.xq'
1246--- test/rbkt/Queries/zorba/jsoniq/obj_insert_16.xq 2012-09-14 13:04:48 +0000
1247+++ test/rbkt/Queries/zorba/jsoniq/obj_insert_16.xq 2012-09-25 15:07:26 +0000
1248@@ -1,4 +1,4 @@
1249-import module namespace j = "http://www.jsoniq.org/functions";
1250+import module namespace j = "http://jsoniq.org/functions";
1251
1252 variable $o := { "foo" : "bar" };
1253
1254
1255=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_rename_01.xq'
1256--- test/rbkt/Queries/zorba/jsoniq/obj_rename_01.xq 2012-03-20 15:35:18 +0000
1257+++ test/rbkt/Queries/zorba/jsoniq/obj_rename_01.xq 2012-09-25 15:07:26 +0000
1258@@ -1,4 +1,4 @@
1259-import module namespace j = "http://www.jsoniq.org/functions";
1260+import module namespace j = "http://jsoniq.org/functions";
1261
1262 variable $o := { "foo" : "bar" };
1263
1264
1265=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_rename_02.spec'
1266--- test/rbkt/Queries/zorba/jsoniq/obj_rename_02.spec 2012-09-17 00:36:37 +0000
1267+++ test/rbkt/Queries/zorba/jsoniq/obj_rename_02.spec 2012-09-25 15:07:26 +0000
1268@@ -1,1 +1,1 @@
1269-Error: http://www.jsoniq.org/errors:JNUP0016
1270+Error: http://jsoniq.org/errors:JNUP0016
1271
1272=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_rename_02.xq'
1273--- test/rbkt/Queries/zorba/jsoniq/obj_rename_02.xq 2012-03-20 15:35:18 +0000
1274+++ test/rbkt/Queries/zorba/jsoniq/obj_rename_02.xq 2012-09-25 15:07:26 +0000
1275@@ -1,4 +1,4 @@
1276-import module namespace j = "http://www.jsoniq.org/functions";
1277+import module namespace j = "http://jsoniq.org/functions";
1278
1279 variable $o := { "foo" : "bar" };
1280
1281
1282=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_rename_03.spec'
1283--- test/rbkt/Queries/zorba/jsoniq/obj_rename_03.spec 2012-09-17 00:36:37 +0000
1284+++ test/rbkt/Queries/zorba/jsoniq/obj_rename_03.spec 2012-09-25 15:07:26 +0000
1285@@ -1,1 +1,1 @@
1286-Error: http://www.jsoniq.org/errors:JNUP0006
1287+Error: http://jsoniq.org/errors:JNUP0006
1288
1289=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_rename_03.xq'
1290--- test/rbkt/Queries/zorba/jsoniq/obj_rename_03.xq 2012-03-20 15:35:18 +0000
1291+++ test/rbkt/Queries/zorba/jsoniq/obj_rename_03.xq 2012-09-25 15:07:26 +0000
1292@@ -1,4 +1,4 @@
1293-import module namespace j = "http://www.jsoniq.org/functions";
1294+import module namespace j = "http://jsoniq.org/functions";
1295
1296 variable $o := { "foo" : "bar", "blub" : "bar" };
1297
1298
1299=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_rename_04.xq'
1300--- test/rbkt/Queries/zorba/jsoniq/obj_rename_04.xq 2012-06-12 13:38:07 +0000
1301+++ test/rbkt/Queries/zorba/jsoniq/obj_rename_04.xq 2012-09-25 15:07:26 +0000
1302@@ -1,3 +1,3 @@
1303-import module namespace j = "http://www.jsoniq.org/functions";
1304+import module namespace j = "http://jsoniq.org/functions";
1305
1306 rename json $o(1)[2](3)("foo", "bar") as 3;
1307
1308=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_rename_05.xq'
1309--- test/rbkt/Queries/zorba/jsoniq/obj_rename_05.xq 2012-06-12 13:38:07 +0000
1310+++ test/rbkt/Queries/zorba/jsoniq/obj_rename_05.xq 2012-09-25 15:07:26 +0000
1311@@ -1,3 +1,3 @@
1312-import module namespace j = "http://www.jsoniq.org/functions";
1313+import module namespace j = "http://jsoniq.org/functions";
1314
1315 rename json $o(1)["foo"] as 3;
1316
1317=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_rename_06.xq'
1318--- test/rbkt/Queries/zorba/jsoniq/obj_rename_06.xq 2012-06-11 09:41:04 +0000
1319+++ test/rbkt/Queries/zorba/jsoniq/obj_rename_06.xq 2012-09-25 15:07:26 +0000
1320@@ -1,4 +1,4 @@
1321-import module namespace j = "http://www.jsoniq.org/functions";
1322+import module namespace j = "http://jsoniq.org/functions";
1323
1324 variable $o := { "foo" : { "foo" : "bar" } };
1325
1326
1327=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_replace_01.xq'
1328--- test/rbkt/Queries/zorba/jsoniq/obj_replace_01.xq 2012-03-20 15:35:18 +0000
1329+++ test/rbkt/Queries/zorba/jsoniq/obj_replace_01.xq 2012-09-25 15:07:26 +0000
1330@@ -1,4 +1,4 @@
1331-import module namespace j = "http://www.jsoniq.org/functions";
1332+import module namespace j = "http://jsoniq.org/functions";
1333
1334 variable $o := { "foo" : "bar" };
1335 variable $a := [ 1, 2, 3];
1336
1337=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_replace_02.xq'
1338--- test/rbkt/Queries/zorba/jsoniq/obj_replace_02.xq 2012-06-12 13:38:07 +0000
1339+++ test/rbkt/Queries/zorba/jsoniq/obj_replace_02.xq 2012-09-25 15:07:26 +0000
1340@@ -1,3 +1,3 @@
1341-import module namespace j = "http://www.jsoniq.org/functions";
1342+import module namespace j = "http://jsoniq.org/functions";
1343
1344 replace json value of $o(1)[2](3)("foo", "bar") with 3;
1345
1346=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_replace_03.xq'
1347--- test/rbkt/Queries/zorba/jsoniq/obj_replace_03.xq 2012-06-12 13:38:07 +0000
1348+++ test/rbkt/Queries/zorba/jsoniq/obj_replace_03.xq 2012-09-25 15:07:26 +0000
1349@@ -1,3 +1,3 @@
1350-import module namespace j = "http://www.jsoniq.org/functions";
1351+import module namespace j = "http://jsoniq.org/functions";
1352
1353 replace json value of $o(1)["foo"] with 3;
1354
1355=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_replace_04.xq'
1356--- test/rbkt/Queries/zorba/jsoniq/obj_replace_04.xq 2012-06-11 09:41:04 +0000
1357+++ test/rbkt/Queries/zorba/jsoniq/obj_replace_04.xq 2012-09-25 15:07:26 +0000
1358@@ -1,4 +1,4 @@
1359-import module namespace j = "http://www.jsoniq.org/functions";
1360+import module namespace j = "http://jsoniq.org/functions";
1361
1362 variable $o := { "foo" : { "foo" : "bar " } };
1363 variable $a := [ 1, 2, 3];
1364
1365=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_replace_05.xq'
1366--- test/rbkt/Queries/zorba/jsoniq/obj_replace_05.xq 2012-09-11 15:53:52 +0000
1367+++ test/rbkt/Queries/zorba/jsoniq/obj_replace_05.xq 2012-09-25 15:07:26 +0000
1368@@ -1,4 +1,4 @@
1369-import module namespace j = "http://www.jsoniq.org/functions";
1370+import module namespace j = "http://jsoniq.org/functions";
1371
1372 variable $o := { "foo" : "bar" };
1373 variable $a := [ 1, 2, 3];
1374
1375=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_update_01.xq'
1376--- test/rbkt/Queries/zorba/jsoniq/obj_update_01.xq 2012-07-10 13:03:31 +0000
1377+++ test/rbkt/Queries/zorba/jsoniq/obj_update_01.xq 2012-09-25 15:07:26 +0000
1378@@ -1,4 +1,4 @@
1379-import module namespace j = "http://www.jsoniq.org/functions";
1380+import module namespace j = "http://jsoniq.org/functions";
1381
1382 variable $o := { "foo" : "bar" };
1383
1384
1385=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_update_02.xq'
1386--- test/rbkt/Queries/zorba/jsoniq/obj_update_02.xq 2012-07-10 13:03:31 +0000
1387+++ test/rbkt/Queries/zorba/jsoniq/obj_update_02.xq 2012-09-25 15:07:26 +0000
1388@@ -1,4 +1,4 @@
1389-import module namespace j = "http://www.jsoniq.org/functions";
1390+import module namespace j = "http://jsoniq.org/functions";
1391
1392 variable $o := { "foo" : "bar" };
1393
1394
1395=== modified file 'test/rbkt/Queries/zorba/jsoniq/object_03.xq'
1396--- test/rbkt/Queries/zorba/jsoniq/object_03.xq 2012-09-06 23:55:13 +0000
1397+++ test/rbkt/Queries/zorba/jsoniq/object_03.xq 2012-09-25 15:07:26 +0000
1398@@ -1,4 +1,4 @@
1399-import module namespace jn = "http://www.jsoniq.org/functions";
1400+import module namespace jn = "http://jsoniq.org/functions";
1401
1402 let $j := ({ "product" : "broiler", "store number" : 1, "quantity" : 20 },
1403 { "product" : "toaster", "store number" : 2, "quantity" : 100 },
1404
1405=== modified file 'test/rbkt/Queries/zorba/jsoniq/pair-constructor-atomize-array.spec'
1406--- test/rbkt/Queries/zorba/jsoniq/pair-constructor-atomize-array.spec 2012-09-12 08:39:32 +0000
1407+++ test/rbkt/Queries/zorba/jsoniq/pair-constructor-atomize-array.spec 2012-09-25 15:07:26 +0000
1408@@ -1,1 +1,1 @@
1409-Error: http://www.jsoniq.org/errors:JNTY0004
1410+Error: http://jsoniq.org/errors:JNTY0004
1411
1412=== modified file 'test/rbkt/Queries/zorba/jsoniq/pair-constructor-atomize-object.spec'
1413--- test/rbkt/Queries/zorba/jsoniq/pair-constructor-atomize-object.spec 2012-09-12 08:39:32 +0000
1414+++ test/rbkt/Queries/zorba/jsoniq/pair-constructor-atomize-object.spec 2012-09-25 15:07:26 +0000
1415@@ -1,1 +1,1 @@
1416-Error: http://www.jsoniq.org/errors:JNTY0004
1417+Error: http://jsoniq.org/errors:JNTY0004
1418
1419=== modified file 'test/rbkt/Queries/zorba/jsoniq/pair_01.xq'
1420--- test/rbkt/Queries/zorba/jsoniq/pair_01.xq 2012-03-12 15:43:16 +0000
1421+++ test/rbkt/Queries/zorba/jsoniq/pair_01.xq 2012-09-25 15:07:26 +0000
1422@@ -1,4 +1,4 @@
1423-import module namespace j = "http://www.jsoniq.org/functions";
1424+import module namespace j = "http://jsoniq.org/functions";
1425
1426 let $j := j:parse-json('{ "foo": "bar" }')
1427 return (empty(j:value($j, "bar")), j:value($j, "foo"))
1428
1429=== modified file 'test/rbkt/Queries/zorba/jsoniq/parse_json-02.spec'
1430--- test/rbkt/Queries/zorba/jsoniq/parse_json-02.spec 2012-09-10 16:37:03 +0000
1431+++ test/rbkt/Queries/zorba/jsoniq/parse_json-02.spec 2012-09-25 15:07:26 +0000
1432@@ -1,1 +1,1 @@
1433-Error: http://www.jsoniq.org/errors:JSDY0021
1434+Error: http://jsoniq.org/errors:JSDY0021
1435
1436=== modified file 'test/rbkt/Queries/zorba/jsoniq/parse_json-03.spec'
1437--- test/rbkt/Queries/zorba/jsoniq/parse_json-03.spec 2012-09-10 16:37:03 +0000
1438+++ test/rbkt/Queries/zorba/jsoniq/parse_json-03.spec 2012-09-25 15:07:26 +0000
1439@@ -1,1 +1,1 @@
1440-Error: http://www.jsoniq.org/errors:JSDY0021
1441+Error: http://jsoniq.org/errors:JSDY0021
1442
1443=== modified file 'test/rbkt/Queries/zorba/jsoniq/parse_json-04.spec'
1444--- test/rbkt/Queries/zorba/jsoniq/parse_json-04.spec 2012-09-10 16:37:03 +0000
1445+++ test/rbkt/Queries/zorba/jsoniq/parse_json-04.spec 2012-09-25 15:07:26 +0000
1446@@ -1,1 +1,1 @@
1447-Error: http://www.jsoniq.org/errors:JSDY0020
1448+Error: http://jsoniq.org/errors:JSDY0020
1449
1450=== modified file 'test/rbkt/Queries/zorba/jsoniq/roundtrip/decode_01.xq'
1451--- test/rbkt/Queries/zorba/jsoniq/roundtrip/decode_01.xq 2012-09-14 06:42:05 +0000
1452+++ test/rbkt/Queries/zorba/jsoniq/roundtrip/decode_01.xq 2012-09-25 15:07:26 +0000
1453@@ -14,7 +14,7 @@
1454 },
1455 "QName" : {
1456 "Q{http://jsoniq.org/roundtrip}type" : "xs:QName",
1457- "Q{http://jsoniq.org/roundtrip}value" : "Q{http://www.jsoniq.org/functions}encode-for-roundtrip",
1458+ "Q{http://jsoniq.org/roundtrip}value" : "Q{http://jsoniq.org/functions}encode-for-roundtrip",
1459 "Q{http://jsoniq.org/roundtrip}prefix" : "jn"
1460 },
1461 "EQName" : {
1462
1463=== modified file 'test/rbkt/Queries/zorba/jsoniq/roundtrip/decode_03.spec'
1464--- test/rbkt/Queries/zorba/jsoniq/roundtrip/decode_03.spec 2012-09-20 18:20:33 +0000
1465+++ test/rbkt/Queries/zorba/jsoniq/roundtrip/decode_03.spec 2012-09-25 15:07:26 +0000
1466@@ -1,1 +1,1 @@
1467-Error: http://www.jsoniq.org/errors:JNTY0023
1468+Error: http://jsoniq.org/errors:JNTY0023
1469
1470=== modified file 'test/rbkt/Queries/zorba/jsoniq/roundtrip/decode_05.xq'
1471--- test/rbkt/Queries/zorba/jsoniq/roundtrip/decode_05.xq 2012-09-21 01:11:35 +0000
1472+++ test/rbkt/Queries/zorba/jsoniq/roundtrip/decode_05.xq 2012-09-25 15:07:26 +0000
1473@@ -16,7 +16,7 @@
1474 }, {
1475 "QName" : {
1476 "Q{http://jsoniq.org/roundtrip}type" : "xs:QName",
1477- "Q{http://jsoniq.org/roundtrip}value" : "Q{http://www.jsoniq.org/functions}encode-for-roundtrip",
1478+ "Q{http://jsoniq.org/roundtrip}value" : "Q{http://jsoniq.org/functions}encode-for-roundtrip",
1479 "Q{http://jsoniq.org/roundtrip}prefix" : "jn"
1480 },
1481 "EQName" : {
1482
1483=== modified file 'test/rbkt/Queries/zorba/jsoniq/roundtrip/encode_05.spec'
1484--- test/rbkt/Queries/zorba/jsoniq/roundtrip/encode_05.spec 2012-09-20 19:27:58 +0000
1485+++ test/rbkt/Queries/zorba/jsoniq/roundtrip/encode_05.spec 2012-09-25 15:07:26 +0000
1486@@ -1,1 +1,1 @@
1487-Error: http://www.jsoniq.org/errors:JNTY0023
1488+Error: http://jsoniq.org/errors:JNTY0023
1489
1490=== modified file 'test/rbkt/Queries/zorba/jsoniq/roundtrip/encode_06.spec'
1491--- test/rbkt/Queries/zorba/jsoniq/roundtrip/encode_06.spec 2012-09-20 19:24:53 +0000
1492+++ test/rbkt/Queries/zorba/jsoniq/roundtrip/encode_06.spec 2012-09-25 15:07:26 +0000
1493@@ -1,1 +1,1 @@
1494-Error: http://www.jsoniq.org/errors:JNTY0023
1495+Error: http://jsoniq.org/errors:JNTY0023
1496
1497=== modified file 'test/rbkt/Queries/zorba/jsoniq/serializer-JNSE0022.xq'
1498--- test/rbkt/Queries/zorba/jsoniq/serializer-JNSE0022.xq 2012-09-10 17:47:37 +0000
1499+++ test/rbkt/Queries/zorba/jsoniq/serializer-JNSE0022.xq 2012-09-25 15:07:26 +0000
1500@@ -2,7 +2,7 @@
1501 declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
1502
1503 declare namespace err = "http://www.w3.org/2005/xqt-errors";
1504-declare namespace jerr = "http://www.jsoniq.org/errors";
1505+declare namespace jerr = "http://jsoniq.org/errors";
1506
1507 let $obj := { "message": "test" }
1508 return
1509
1510=== modified file 'test/rbkt/Queries/zorba/jsoniq/serializer-jsoniq-disallow-mixed-1.spec'
1511--- test/rbkt/Queries/zorba/jsoniq/serializer-jsoniq-disallow-mixed-1.spec 2012-09-15 01:17:21 +0000
1512+++ test/rbkt/Queries/zorba/jsoniq/serializer-jsoniq-disallow-mixed-1.spec 2012-09-25 15:07:26 +0000
1513@@ -1,2 +1,2 @@
1514 Serialization: method=json
1515-Error: http://www.jsoniq.org/errors:JNSE0014
1516+Error: http://jsoniq.org/errors:JNSE0014
1517
1518=== modified file 'test/rbkt/Queries/zorba/jsoniq/serializer-jsoniq-disallow-mixed-2.spec'
1519--- test/rbkt/Queries/zorba/jsoniq/serializer-jsoniq-disallow-mixed-2.spec 2012-09-15 01:17:21 +0000
1520+++ test/rbkt/Queries/zorba/jsoniq/serializer-jsoniq-disallow-mixed-2.spec 2012-09-25 15:07:26 +0000
1521@@ -1,2 +1,2 @@
1522 Serialization: method=json
1523-Error: http://www.jsoniq.org/errors:JNSE0014
1524+Error: http://jsoniq.org/errors:JNSE0014
1525
1526=== modified file 'test/rbkt/Queries/zorba/jsoniq/serializer-jsoniq-disallow-mixed-3.spec'
1527--- test/rbkt/Queries/zorba/jsoniq/serializer-jsoniq-disallow-mixed-3.spec 2012-09-15 01:17:21 +0000
1528+++ test/rbkt/Queries/zorba/jsoniq/serializer-jsoniq-disallow-mixed-3.spec 2012-09-25 15:07:26 +0000
1529@@ -1,2 +1,2 @@
1530 Serialization: method=json
1531-Error: http://www.jsoniq.org/errors:JNSE0014
1532+Error: http://jsoniq.org/errors:JNSE0014
1533
1534=== modified file 'test/rbkt/Queries/zorba/jsoniq/serializer-jsoniq-disallow-mixed-4.spec'
1535--- test/rbkt/Queries/zorba/jsoniq/serializer-jsoniq-disallow-mixed-4.spec 2012-09-15 01:17:21 +0000
1536+++ test/rbkt/Queries/zorba/jsoniq/serializer-jsoniq-disallow-mixed-4.spec 2012-09-25 15:07:26 +0000
1537@@ -1,2 +1,2 @@
1538 Serialization: method=json
1539-Error: http://www.jsoniq.org/errors:JNSE0014
1540+Error: http://jsoniq.org/errors:JNSE0014
1541
1542=== modified file 'test/rbkt/Queries/zorba/jsoniq/use_case01.xq'
1543--- test/rbkt/Queries/zorba/jsoniq/use_case01.xq 2012-04-11 20:22:52 +0000
1544+++ test/rbkt/Queries/zorba/jsoniq/use_case01.xq 2012-09-25 15:07:26 +0000
1545@@ -1,6 +1,6 @@
1546 import module namespace ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl";
1547 import module namespace dml = "http://www.zorba-xquery.com/modules/store/dynamic/collections/dml";
1548-import module namespace j = "http://www.jsoniq.org/functions";
1549+import module namespace j = "http://jsoniq.org/functions";
1550
1551 ddl:create(xs:QName("users"));
1552
1553
1554=== modified file 'test/rbkt/Queries/zorba/jsoniq/use_case01_2.xq'
1555--- test/rbkt/Queries/zorba/jsoniq/use_case01_2.xq 2012-04-11 20:22:52 +0000
1556+++ test/rbkt/Queries/zorba/jsoniq/use_case01_2.xq 2012-09-25 15:07:26 +0000
1557@@ -1,6 +1,6 @@
1558 import module namespace ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl";
1559 import module namespace dml = "http://www.zorba-xquery.com/modules/store/dynamic/collections/dml";
1560-import module namespace j = "http://www.jsoniq.org/functions";
1561+import module namespace j = "http://jsoniq.org/functions";
1562
1563 ddl:create(xs:QName("users"));
1564
1565
1566=== modified file 'test/rbkt/Queries/zorba/jsoniq/use_case02.xq'
1567--- test/rbkt/Queries/zorba/jsoniq/use_case02.xq 2012-04-11 20:22:52 +0000
1568+++ test/rbkt/Queries/zorba/jsoniq/use_case02.xq 2012-09-25 15:07:26 +0000
1569@@ -1,6 +1,6 @@
1570 import module namespace ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl";
1571 import module namespace dml = "http://www.zorba-xquery.com/modules/store/dynamic/collections/dml";
1572-import module namespace j = "http://www.jsoniq.org/functions";
1573+import module namespace j = "http://jsoniq.org/functions";
1574
1575 ddl:create(xs:QName("sales"));
1576
1577
1578=== modified file 'test/rbkt/Queries/zorba/jsoniq/use_case03.xq'
1579--- test/rbkt/Queries/zorba/jsoniq/use_case03.xq 2012-04-11 20:22:52 +0000
1580+++ test/rbkt/Queries/zorba/jsoniq/use_case03.xq 2012-09-25 15:07:26 +0000
1581@@ -1,6 +1,6 @@
1582 import module namespace ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl";
1583 import module namespace dml = "http://www.zorba-xquery.com/modules/store/dynamic/collections/dml";
1584-import module namespace j = "http://www.jsoniq.org/functions";
1585+import module namespace j = "http://jsoniq.org/functions";
1586
1587 ddl:create(xs:QName("sales"));
1588 ddl:create(xs:QName("products"));
1589
1590=== modified file 'test/rbkt/Queries/zorba/jsoniq/use_case04.xq'
1591--- test/rbkt/Queries/zorba/jsoniq/use_case04.xq 2012-03-23 21:17:48 +0000
1592+++ test/rbkt/Queries/zorba/jsoniq/use_case04.xq 2012-09-25 15:07:26 +0000
1593@@ -1,4 +1,4 @@
1594-import module namespace j = "http://www.jsoniq.org/functions";
1595+import module namespace j = "http://jsoniq.org/functions";
1596
1597 let $satsDoc :=
1598 {
1599
1600=== modified file 'test/rbkt/Queries/zorba/jsoniq/use_case06.xq'
1601--- test/rbkt/Queries/zorba/jsoniq/use_case06.xq 2012-03-13 11:48:34 +0000
1602+++ test/rbkt/Queries/zorba/jsoniq/use_case06.xq 2012-09-25 15:07:26 +0000
1603@@ -1,4 +1,4 @@
1604-import module namespace j = "http://www.jsoniq.org/functions";
1605+import module namespace j = "http://jsoniq.org/functions";
1606
1607 declare variable $input :=
1608 {
1609
1610=== modified file 'test/rbkt/Queries/zorba/jsoniq/use_case07.xq'
1611--- test/rbkt/Queries/zorba/jsoniq/use_case07.xq 2012-03-13 00:02:13 +0000
1612+++ test/rbkt/Queries/zorba/jsoniq/use_case07.xq 2012-09-25 15:07:26 +0000
1613@@ -1,4 +1,4 @@
1614-import module namespace j = "http://www.jsoniq.org/functions";
1615+import module namespace j = "http://jsoniq.org/functions";
1616
1617 let $j :=
1618 {
1619
1620=== modified file 'test/rbkt/Queries/zorba/jsoniq/use_case08.xq'
1621--- test/rbkt/Queries/zorba/jsoniq/use_case08.xq 2012-03-13 11:48:34 +0000
1622+++ test/rbkt/Queries/zorba/jsoniq/use_case08.xq 2012-09-25 15:07:26 +0000
1623@@ -1,4 +1,4 @@
1624-import module namespace j = "http://www.jsoniq.org/functions";
1625+import module namespace j = "http://jsoniq.org/functions";
1626
1627 let $j :=
1628 [
1629
1630=== modified file 'test/rbkt/Queries/zorba/jsoniq/use_case09.xq'
1631--- test/rbkt/Queries/zorba/jsoniq/use_case09.xq 2012-03-13 11:48:34 +0000
1632+++ test/rbkt/Queries/zorba/jsoniq/use_case09.xq 2012-09-25 15:07:26 +0000
1633@@ -1,4 +1,4 @@
1634-import module namespace j = "http://www.jsoniq.org/functions";
1635+import module namespace j = "http://jsoniq.org/functions";
1636
1637 let $users :=
1638 [
1639
1640=== modified file 'test/rbkt/Queries/zorba/jsoniq/use_case10.xq'
1641--- test/rbkt/Queries/zorba/jsoniq/use_case10.xq 2012-09-17 00:36:37 +0000
1642+++ test/rbkt/Queries/zorba/jsoniq/use_case10.xq 2012-09-25 15:07:26 +0000
1643@@ -1,6 +1,6 @@
1644 import module namespace ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl";
1645 import module namespace dml = "http://www.zorba-xquery.com/modules/store/dynamic/collections/dml";
1646-import module namespace j = "http://www.jsoniq.org/functions";
1647+import module namespace j = "http://jsoniq.org/functions";
1648
1649 ddl:create(xs:QName("users"));
1650
1651
1652=== modified file 'test/rbkt/Queries/zorba/jsoniq/use_case11.xq'
1653--- test/rbkt/Queries/zorba/jsoniq/use_case11.xq 2012-04-11 20:22:52 +0000
1654+++ test/rbkt/Queries/zorba/jsoniq/use_case11.xq 2012-09-25 15:07:26 +0000
1655@@ -1,4 +1,4 @@
1656-import module namespace j = "http://www.jsoniq.org/functions";
1657+import module namespace j = "http://jsoniq.org/functions";
1658
1659 let $feed :=
1660 {
1661
1662=== modified file 'test/rbkt/Queries/zorba/jsoniq/value_01.xq'
1663--- test/rbkt/Queries/zorba/jsoniq/value_01.xq 2012-09-17 00:36:37 +0000
1664+++ test/rbkt/Queries/zorba/jsoniq/value_01.xq 2012-09-25 15:07:26 +0000
1665@@ -1,4 +1,4 @@
1666-import module namespace j = "http://www.jsoniq.org/functions";
1667+import module namespace j = "http://jsoniq.org/functions";
1668
1669 let $json := j:parse-json('{ "foo" : "bar" }')
1670 let $keys := j:keys($json)
1671
1672=== modified file 'test/rbkt/Queries/zorba/jsoniq/values_01.xq'
1673--- test/rbkt/Queries/zorba/jsoniq/values_01.xq 2012-09-17 00:36:37 +0000
1674+++ test/rbkt/Queries/zorba/jsoniq/values_01.xq 2012-09-25 15:07:26 +0000
1675@@ -1,4 +1,4 @@
1676-import module namespace j = "http://www.jsoniq.org/functions";
1677+import module namespace j = "http://jsoniq.org/functions";
1678
1679 let $json := j:parse-json('{ "foo" : "bar" }')
1680 let $keys := j:keys($json)
1681
1682=== modified file 'test/rbkt/Queries/zorba/serialization/cloudscript/extensions3.spec'
1683--- test/rbkt/Queries/zorba/serialization/cloudscript/extensions3.spec 2012-09-15 01:17:21 +0000
1684+++ test/rbkt/Queries/zorba/serialization/cloudscript/extensions3.spec 2012-09-25 15:07:26 +0000
1685@@ -1,2 +1,2 @@
1686-Error: http://www.jsoniq.org/errors:JNSE0014
1687+Error: http://jsoniq.org/errors:JNSE0014
1688 Serialization: method=json
1689
1690=== modified file 'test/rbkt/Queries/zorba/serialization/cloudscript/multiple1.spec'
1691--- test/rbkt/Queries/zorba/serialization/cloudscript/multiple1.spec 2012-09-15 01:17:21 +0000
1692+++ test/rbkt/Queries/zorba/serialization/cloudscript/multiple1.spec 2012-09-25 15:07:26 +0000
1693@@ -1,2 +1,2 @@
1694-Error: http://www.jsoniq.org/errors:JNSE0012
1695+Error: http://jsoniq.org/errors:JNSE0012
1696 Serialization: method=json jsoniq-multiple-items=no
1697
1698=== modified file 'test/rbkt/Queries/zorba/xqdoc/moduleDocumentation.xq'
1699--- test/rbkt/Queries/zorba/xqdoc/moduleDocumentation.xq 2012-09-17 00:36:37 +0000
1700+++ test/rbkt/Queries/zorba/xqdoc/moduleDocumentation.xq 2012-09-25 15:07:26 +0000
1701@@ -63,7 +63,7 @@
1702 ($moduleUri = "http://www.functx.com/") or
1703 ($moduleUri = "http://www.w3.org/2005/xqt-errors") or
1704 ($moduleUri = "http://www.zorba-xquery.com/errors") or
1705- ($moduleUri = "http://www.jsoniq.org/errors") or
1706+ ($moduleUri = "http://jsoniq.org/errors") or
1707 ($moduleUri = "http://www.zorba-xquery.com/warnings")) then ()
1708 else(
1709 local:test-module($xqdoc),

Subscribers

People subscribed via source and target branches