[xquery-talk] MarkLogic using JSONiq for processing JSON ?

Ghislain Fourny g at 28.io
Fri May 8 05:46:03 PDT 2015


My understanding of the reason why XQuery 3.1 and JSONiq diverge is
also use-case based. If you are interested in some more background, I
believe there were two drivers all along:

1. Support for NoSQL document store querying.
2. Support for map and array structures in memory.

Both use cases are important, even if their importance varies from
project to project or from company to company.

JSONiq was designed 100% for NoSQL document store querying : it is (on
purpose) optimized for supporting use case 1 and only use case 1.

XQuery 3.1 also covers use case 2. Supporting both use cases and
making compromises between the two was not trivial, which is why there
was a lot of work put into the discussions and the design in the
working group.

I share Adam's feeling 100%. Everybody took the time to patiently
listen to one another, which is one of the aspects of the working
group I valued the most. I enjoyed each meeting we had and learned a
lot from the discussions -- paradoxically, I also had the feeling of
knowing JSONiq better after having them.

To me, one of the main concrete technical differences (if I correctly
remember) is that JSONiq manipulates trees/documents (both with XML
and JSON), so that when you put data into an object, it is copied over
(even if most of the time the optimizer can spare the actual copying).
This eliminates many serialization issues when data gets roundtripped
around. XQuery 3.1 is more data-structure oriented as use case 2
requires retaining the original identity of map and array values,
which theoretically allows graphs. This difference is important and
noticeable when updates and scripting kick in.

Of course, for each set of use cases, standards and interoperability
are always desirable, so I can understand Dana's discomfort. I also
think, though, that it is natural for different languages to emerge if
the use cases differ and, in the broader context of IT, think that it
is wise to pragmatically select technologies based on what one wants
to achieve.

On the bright side also: the data models behind the languages are
similar, and both languages can run on the same virtual machine. Zorba
already supports XQuery 3.0 and JSONiq side by side.

I hope it makes sense.

Kind regards,

On Fri, May 8, 2015 at 1:21 PM, Adam Retter <adam.retter at googlemail.com> wrote:
>> No, all the arguments were all technical
>> Getting agreement on all these points was a very lengthy process with much heated argument. Although the decisions made were not always the ones I personally advocated, I think the final language works well.
> Absolutely! Whilst I am more of an occasional frequenter and
> contributor to the XQuery WG, having seen the level of collaborative
> work and perseverance that that has gone into adding Maps and Arrays
> to XQuery, I can say that I am impressed.
> From my perspective, it was a difficult process, but everyone worked
> hard together and the technical arguments were always foremost. Whilst
> working under the constraints of backwards compatibility and creating
> a cohesive data model and language, I think the result speaks for
> itself. Certainly many of eXist's users are very happy with the new
> Maps and Arrays work in XQuery 3.1 and we frequently receive positive
> feedback on this.
> --
> Adam Retter
> skype: adam.retter
> tweet: adamretter
> http://www.adamretter.org.uk
> _______________________________________________
> talk at x-query.com
> http://x-query.com/mailman/listinfo/talk

More information about the talk mailing list