Hi Maurice,
Depending on the chosen format, different outputs will be generated by json:parse. Traditionally, it is true that only XML was generated by this function, but in newer versions (and in alignment with the XQuery 3.1 specs and the fn:parse-json function), it is also possible now to convert JSON data to atomic XQuery items (maps, arrays, strings, numbers and booleans) [1,2]. The resulting representation will be more memory-efficient, and access to XQuery maps is blazing fast, but it won’t be possible to store this representation to a database.
Hope this helps, greetings, Christian
[1] http://docs.basex.org/wiki/JSON_Module#XQuery [2] http://docs.basex.org/wiki/JSON_Module#XQuery_Format
On Wed, Nov 15, 2017 at 8:30 AM, m.vankeulen@utwente.nl wrote:
Christian,
The JSON Module suggests that JSON objects are represented as XML-documents with a certain structure, not as immutable maps. Is there support in BaseX for json:parse and json:serialize for parsing JSON in textual form into immutable maps and back to JSON in textual form?
Kind regards, Maurice van Keulen
--
Dr.Ir. M. van Keulen - Associate Professor, Data Management Technology
Univ. of Twente, Dept of EEMCS, POBox 217, 7500 AE Enschede, Netherlands
Email: m.vankeulen@utwente.nl, Phone: +31 534893688, Fax: +31 534892927
Room: ZI 2013, WWW: http://www.cs.utwente.nl/~keulen
On 13 Nov 2017 23:31 +0100, Christian Grün christian.gruen@gmail.com, wrote:
In XQuery, JSON objects are represented as immutable maps. Please check out the documentations to learn how these data structures can be changed [1,2]. _______________
[1] http://docs.basex.org/wiki/Map_Module [2] https://www.w3.org/TR/xpath-functions-31/#maps-and-arrays
On Sun, Nov 12, 2017 at 3:42 AM, E. Wray Johnson wray.johnson@gmail.com wrote:
What is the best way to update JSON objects (only some object values) by unique id?
What is the best way to delete JSON objects by unique id?
Wray Johnson (m) 704-293-9008