Database Reference
In-Depth Information
RESTXQ was inspired by the JAX-RS specification JSR-311 . RESTXQ attempts to be
nondisruptive by allowing you to annotate existing functions, which will then
become HTTP-aware in a web-enabled XQuery processor or continue to work fine in
a standalone processor. While XQuery URL rewriting is specific to eXist, RESTXQ
attempts to create a standard XQuery 3.0 approach to servicing HTTP requests with
XQuery, thereby allowing you to execute your XQuery web applications on any
RESTXQ-compatible XQuery processor.
RESTXQ is a relatively young project: an implementation for eXist started in early
2012, and a beta version became part of eXist 2.0. Progress is still being made toward
a final RESTXQ 1.0 version , but it is already very usable in eXist and many people are
doing so. There are also implementations available in BaseX, Zorba, and MarkLogic.
RESTXQ offers great potential, and need not be solely limited to HTTP in the future;
ultimately, RESTXQ might enable XQuery URL rewriting and the REST Server to be
reimplemented in XQuery as a set of resource functions. Documentation for
RESTXQ is fairly limited at the moment, and the best source of information is most
likely Chapter 4 of the paper “RESTful XQuery” from the conference proceedings of
XML Prague 2012. 1 Next, we will demonstrate how to make use of the features of
RESTXQ, and you'll find a more complete example of using it in “RESTXQ” on page
353 .
Configuring RESTXQ
RESTXQ monitors the eXist database, and when XQueries are stored that contain
RESTXQ annotations, RESTXQ is configured to route matching HTTP requests to
the identified resource functions. RESTXQ accomplishes this monitoring by means
of a trigger , which is enabled by default on all database collections via the collection
configuration in /db/system/config/db/collection.xconf . You may enable or disable
RESTXQ monitoring by adding its trigger configuration to or removing it from the
configuration for a specific collection. For more details, see “System Collections” on
page 90 and “Database Triggers” on page 449 .
1 Adam Retter, “RESTful XQuery: Standardised XQuery 3.0 Annotations for REST,” XML Prague 2012—Con‐
ference Proceedings (2012): 91-123.
 
Search WWH ::




Custom Search