Hi!
While learning about xml databases and how to access them, I came across your jax-rx project. While most of REST is quite straightforward, I don't see any method to define external variables. I don't quite understand why the possibility to define not only the xquery, but also the values for its external variables has been left out?
It would - after all - be nice... Just like parameter substitution in SQL APIs...
POST could get variable values and value types in an additional <variables> block. GET could accept parameters like var.* - probably deriving the type from the variable declaration in the xquery. If the http querystring (which always is a string...) cannot be converted accordingly, it could throw.
What do you think? HPO
Hans-Peter,
thanks for your feedback. Yes, your suggestion sounds useful – and it makes even more sense if server-side query files are to be executed. We’ve added your idea to our todo stack; most probably it will be included in the next minor release of our (still young) API.
Feel free to ask for more, Christian
On Thu, May 6, 2010 at 11:58 PM, Hans-Peter Oeri hp@oeri.ch wrote:
Hi!
While learning about xml databases and how to access them, I came across your jax-rx project. While most of REST is quite straightforward, I don't see any method to define external variables. I don't quite understand why the possibility to define not only the xquery, but also the values for its external variables has been left out?
It would - after all - be nice... Just like parameter substitution in SQL APIs...
POST could get variable values and value types in an additional <variables> block. GET could accept parameters like var.* - probably deriving the type from the variable declaration in the xquery. If the http querystring (which always is a string...) cannot be converted accordingly, it could throw.
What do you think? HPO
___________________________
Christian Gruen Universitaet Konstanz Department of Computer & Information Science D-78457 Konstanz, Germany Tel: +49 (0)7531/88-4449, Fax: +49 (0)7531/88-3577 http://www.inf.uni-konstanz.de/~gruen
Hi!
On 05/08/2010 02:34 AM, Christian Grün wrote:
thanks for your feedback. Yes, your suggestion sounds useful - and it makes even more sense if server-side query files are to be executed.
Ack.
We've added your idea to our todo stack; most probably it will be included in the next minor release of our (still young) API.
Wow, that would be fast ;)
Feel free to ask for more,
Are there any concept documents available? Because - if I understand XQuery correctly, which I'm not sure of - variables are part of the "static context". Wouldn't it be necessary, to include a whole "static context" block for a "full" api?
As I said, I'm only now learning this whole thing.. So please bear with me if I'm wrong...
HP
Are there any concept documents available?
Our JAX-RX API was inspired by two XML processors, namely BaseX and TreeTank. As TreeTank only supports XPath, but offers other features such as revisioning, we started off with adding common features to the API. We have an internal project page, which we want to make public soon.
Because - if I understand XQuery correctly, which I'm not sure of - variables are part of the "static context". Wouldn't it be necessary, to include a whole "static context" block for a "full" api?
True; this way, users could also define other properties, such as default namespaces, base uri, etc. within the REST request. As our core principle was to keep the API simple, we decided that the user should specify static features within the prolog of the query file. If more people show interest in a more powerful API, we might include requests such as yours in future releases.
Best, Christian ___________________________
Christian Gruen Universitaet Konstanz Department of Computer & Information Science D-78457 Konstanz, Germany Tel: +49 (0)7531/88-4449, Fax: +49 (0)7531/88-3577 http://www.inf.uni-konstanz.de/~gruen
basex-talk@mailman.uni-konstanz.de