Hi Christian,
Thanks. Very curious to hear about XQJ's fate.
I am currently using BaseX for data integration which got me thinking about integration of XQuery in other web applications (node/python/clojure etc.). I was triggered by the recent thread about node-basex[1] and Hans Jürgen and your Balisage paper [2]. I was considering what the most performant way would be to return XQuery results as native types. Eg. function returns an array with maps or XML nodes and it gets converted to the host application's native data types so the application can use the results as if they were native data types.
Maybe the only viable way to tackle this *is* via HTTP and a smart serialization (EDN[3] for example is such a, non-JSON, serialization that includes type info) but I was thinking if there was an existing lower-level way (without the BaseX HTTP layer). XQJ would enable this (at least for XQuery < 3) but I have doubts if it would deserialize non-atomic XDM values (like nested maps/arrays) as this is new to XQuery 3, I didn't check but I figure that the BaseXClient on which it is based also doesn't provide the XDM metadata for each nested item.
Just pondering how to bridge from XQuery to other languages.
[1]: http://www.mail-archive.com/basex-talk%40mailman.uni-konstanz.de/msg07882.ht... [2]: http://www.balisage.net/Proceedings/vol15/html/Rennau01/BalisageVol15-Rennau... [3]: https://github.com/edn-format/edn
On Tue, Apr 5, 2016 at 11:58 AM, Christian Grün christian.gruen@gmail.com wrote:
Hi Marc,
Is it right that the current XQJ driver for BaseX doesn't support XQuery 3 syntax? Everytime I try to use a query that includes some of the newer features it barks at me with Invalid XQuery syntax, syntax does not pass static validation. Is there way to get around that, say, when the result would not use these XQuery 3 data types?
I'm wondering what the fate is of XQJ in general. Will it remain relevant?
I decided to pass on your question directly to Charles Foster; he might be able to give you some outlook!
Also I am confused why files.basex /maven repo has XQJ driver 1.6.0 and xqj.net has 1.4.0 as the latest or what the difference is.
I have sent a pull request to Charles’ repo; it may be included in the next version there.
The reason I was looking into XQJ was that it provides ways to get XDM type info with the result. I would like to be able to deal with the result from a query at a higher level than just strings. I've briefly looked into BaseXClient.java which seems to be able to return XDM metadata but then I saw that XQJ could do this out of the box.
Right, that’s only possible with XQJ.
In general I would be interested to hear what the best way would be to get a client to deal with query responses as native (client-side) types (including hashmaps and arrays) instead of strings. Would it be better to focus on using BaseXClient and forget about XQJ?
From my perspective, it’s good to use XQuery whenever possible and use our Client Module to address BaseX server instances [1] ;)
Cheers, Christian