jax-rx and external variables
Thursday, 6 May 2010 · 4 messages · last reply 10 May 2010
HO
Hans-Peter Oeri6 May 2010 23:58 #
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
CG
Christian Grün8 May 2010 02:34 #
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
Quoted text · Hans-Peter Oeri · 20 lines
On Thu, May 6, 2010 at 11:58 PM, Hans-Peter Oeri <hp at 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
HO
Hans-Peter Oeri9 May 2010 13:58 #
Hi!
Quoted text · Christian Grün · 3 lines
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.
Quoted text · Christian Grün · 2 lines
> 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 ;)
Quoted text · Christian Grün · 1 line
> 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
CG
Christian Grün10 May 2010 11:25 #
Quoted text · Hans-Peter Oeri · 1 line
> 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.
Quoted text · Hans-Peter Oeri · 4 lines
> 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
Written for BaseX 6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery