W3C

XQuery Update Facility 1.0 Requirements

W3C Candidate Recommendation 14 March 2008

This version:
http://www.w3.org/TR/2008/CR-xquery-update-10-requirements-20080314/
Latest version:
http://www.w3.org/TR/xquery-update-10-requirements/
Previous version:
http://www.w3.org/TR/2007/WD-xquery-update-10-requirements-20070828/
Editors:
Don Chamberlin, IBM Almaden Research Center <chamberlin@almaden.ibm.com>
Jonathan Robie, Red Hat <jonathan.robie@redhat.com>

Abstract

This document specifies goals and requirements for the XQuery Update Facility.

Status of this Document

This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.

W3C publishes a Candidate Recommendation, as described in the Process Document, to indicate that the document is believed to be stable and to encourage implementation by the developer community. The publication of this document constitutes a call for implementations of this specification.

This document has been developed by the W3C XML Query Working Group, which is part of the XML Activity. It will remain a Candidate Recommendation until at least 20 June 2008. The Working Group expects to eventually publish this document as a Working Group Note.

The XML Query Working Group intends to submit this document for consideration as a W3C Proposed Recommendation at the same time that XQuery Update Facility 1.0 is submitted for the same consideration.

Once the entrance criteria for Proposed Recommendation have been achieved, the Director will be requested to advance this document to Proposed Recommendation status. Working closely with the developer community, we expect to show evidence of implementations by approximately 31 July 2008.

This document includes, for each requirement, a corresponding status, indicating the current situation of the requirement in XQuery Update Facility 1.0 at the time that it was issued as a Candidate Recommendation in March 2008. Three status levels are used:

"Green" status

green status This indicates that the requirement, according to its original formulation, has been completely met. Optional clarificatory text may follow.

"Yellow" status

yellow status This indicates that the requirement has been partially met according to its original formulation. When this status is indicated, explanatory text is provided to better clarify the current scope of the requirement.

"Red" status

red status This indicates that the requirement, according to its original formulation, has not been met. If this is the case, explanatory text is provided.

No substantive changes have been made to this specification since its publication as a Last Call Working Draft.

Please report errors in this document using W3C's public Bugzilla system (instructions can be found at http://www.w3.org/XML/2005/04/qt-bugzilla). If access to that system is not feasible, you may send your comments to the W3C XSLT/XPath/XQuery public comments mailing list, public-qt-comments@w3.org. It will be very helpful if you include the string “[UPDreq]” in the subject line of your report, whether made in Bugzilla or in email. Each Bugzilla entry and email message should contain only one error report. Archives of the comments and responses are available at http://lists.w3.org/Archives/Public/public-qt-comments/.

Publication as a Candidate Recommendation does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.

Table of Contents

1 Goals
2 Usage Scenarios
3 Requirements
    3.1 Terminology
    3.2 General Requirements
    3.3 Relationship to XQuery 1.0
    3.4 XML Query Update Functionality
    3.5 Transaction characteristics

Appendix

A References


1 Goals

This document describes the requirements for the XQuery Update Facility. [XQuery 1.0] provides queries, but has no support for adding new values or changing existing values. The XML Query Working Group intends to add support for updates in a future version of XQuery.

2 Usage Scenarios

The following usage scenarios describe how the XQuery Update Facility may be used in various environments, and represent a wide range of activities and needs that illustrate the problem space to be addressed. They are intended to be used as design cases during the development of the XQuery Update Facility, and should be reviewed when critical decisions are made. These usage scenarios should also prove useful in helping non-members of the XML Query Working Group understand the intent and goals of the project.

2.1 Updating persistent XML stores

Modify XML in persistent XML stores, including native XML databases, XML files stored on a file system, or XML stored in SQL databases.

2.2 Modify XML messages

Modify XML messages to change status and add information created while processing the message.

2.3 Add to existing XML document

Add new data to an existing XML document; for instance, add a new entry to a BLOG or a data log.

2.4 Updating XML registries

Perform updates on configuration files, user profiles, or administrative logs represented in XML.

2.5 Creating edited copies

Create a new copy of an XML document or subtree that differs from the original in the way specified by the update. For instance, updates could be used to modify a web message in order to add new information and change headers to reflect the modified status.

2.6 Modifying XML views

Modifying XML views of non-XML sources, such as a [SQL/XML] view of a SQL database.

3 Requirements

3.1 Terminology

The following key words are used throughout the document to specify the extent to which an item is a requirement for the work of the XML Query Working Group:

MUST

This word means that the item is an absolute requirement.

SHOULD

This word means that there may exist valid reasons not to treat this item as a requirement, but the full implications should be understood and the case carefully weighed before discarding this item.

MAY

This word means that an item deserves attention, but further study is needed to determine whether the item should be treated as a requirement.

When the words MUST, SHOULD, or MAY are used in this technical sense, they occur as a hyperlink to these definitions. These words will also be used with their conventional English meaning, in which case there is no hyperlink. For instance, the phrase "the full implications should be understood" uses the word "should" in its conventional English sense, and therefore occurs without the hyperlink.

3.2 General Requirements

3.2.1 Query Update Syntax

The syntax for updates MAY have more than one syntax binding. One syntax MUST be convenient for humans to read and write.

green status Status: this requirement has been met.

One syntax MUST be expressed in XML in a way that reflects the underlying structure of the operations.

green status Status: this requirement has been met.

3.2.2 Declarativity

The XQuery Update Facility MUST be declarative. Notably, it MUST be independent of any particular evaluation strategy.

green status Status: this requirement has been met.

3.2.3 Protocol Independence

The XQuery Update Facility MUST be defined independently of any protocols with which it is used.

green status Status: this requirement has been met.

3.2.4 Error Conditions

The XQuery Update Facility MUST define standard error conditions that can occur during the execution of an update.

green status Status: this requirement has been met.

3.2.5 Static Type Checking

The XQuery Update Facility SHOULD provide an optional static type checking feature.

green status Status: this requirement has been met.

3.3 Relationship to XQuery 1.0

3.3.1 Based on Data Model

The XQuery Update Facility MUST be defined on the [XQuery 1.0 and XPath 2.0 Data Model].

green status Status: this requirement has been met.

Note:

The properties of a Data Model instance that can be modified by the XQuery Update Facility are discussed in 3.4 XML Query Update Functionality.

3.3.2 Based on XQuery

The XQuery Update Facility MUST be based on [XQuery 1.0]. The XQuery Update Facility MUST use XQuery to identify items to be updated. The XQuery Update Facility MUST use XQuery to specify items used in the updates.

green status Status: this requirement has been met.

3.4 XML Query Update Functionality

3.4.1 Locus of modifications

The XQuery Update Facility MUST be able to change the properties of existing nodes while preserving their identity. The XQuery Update Facility MUST be able to create a new copy of a node with a specific set of changes.

green status Status: this requirement has been met.

3.4.2 Delete

The XQuery Update Facility MUST be able to delete nodes.

green status Status: this requirement has been met.

3.4.3 Insert

The XQuery Update Facility MUST be able to insert new nodes in specified positions.

green status Status: this requirement has been met.

3.4.4 Replace

The XQuery Update Facility MUST be able to replace a node.

green status Status: this requirement has been met.

3.4.5 Changing values

The XQuery Update Facility MUST be able to change the value returned by the typed-value accessor for a node.

green status Status: this requirement has been met.

3.4.6 Modifying properties

The XQuery Update Facility SHOULD be able to modify some of the properties of a node such as the name, type, content, nilled, base-URI, etc.

green status Status: this requirement has been met. The base-URI can not be modified.

3.4.7 Moving nodes

The XQuery Update Facility MAY be able to move a node from one location to another.

red status Status: this requirement has not been met. A node can be deleted, and a copy inserted in a new location, but it will have a new identity. The Working Group felt that this functionality would limit the environments in which the XQuery Update Facility could be implemented.

3.4.8 Conditional updates

The XQuery Update Facility MUST be able to do conditional updates.

green status Status: this requirement has been met.

3.4.9 Iterative updates

The XQuery Update Facility MUST be able to iterate over nodes to do updates.

green status Status: this requirement has been met.

3.4.10 Validation

The XQuery Update Facility MAY support an explicit XML Schema validation operation that preserves node identity.

yellow status This requirement has not been met according to its original formulation; however, the revalidation mode can be set to ensure that type information is recovered and the resulting document is valid according to the governing schema.

Note:

The XQuery 1.0 validate expression creates a new copy of each validated node, with a new identity. This requirement involves preservation of identity.

3.4.11 Compositionality

The XQuery Update Facility MUST be able to compose update operators with other update operators.

green status Status: this requirement has been met.

The XQuery Update Facility MAY be compositional with respect to XQuery expressions; that is, it may be possible to use an update wherever an XQuery expression is used.

red status Status: this requirement has not been met Updating expressions are limited to specific syntactic contexts..

3.4.12 Parameterization

The XQuery Update Facility SHOULD provide a means to parameterize update operations.

green status Status: this requirement has been met. Updating functions and external variables may both be used to parameterize update operations.

3.5 Transaction characteristics

In this section, the terms Atomicity, Consistency, Isolation, and Durability are taken from the ACID model of transaction characteristics for databases, which is described in [Transaction Processing Concepts and Techniques].

3.5.1 Atomicity

The XQuery Update Facility MUST provide a set of atomic operations, and MUST define a means to group atomic operations into an atomic execution unit.

green status Status: this requirement has been met. Multiple atomic operations can be done in a single query, which constitutes the atomic execution unit.

3.5.2 Consistency

At the end of an outermost update operation (that is, an update operation invoked from the external environment), the data model MUST be consistent with respect to the constraints specified in the Data Model. In particular, all type annotations MUST be consistent with the content of the items they govern.

green status Status: this requirement has been met.

The XQuery Update Facility MAY define additional levels of granularity at which Data Model constraints are enforced.

red status Status: this requirement has not been met.

3.5.3 Isolation

The XQuery Update Facility SHOULD define the means by which operations can be isolated from concurrent operations.

yellow status The XQuery Update Facility defines operations purely in terms of the XML Data Model. Propagation of XDM changes to an underlying persistent store or other software system is beyond the scope of this specification. This includes isolation.

3.5.4 Durability

The XQuery Update Facility MUST define a means to control the durability of atomic operations and atomic execution units.

yellow status The XQuery Update Facility defines operations purely in terms of the XML Data Model. Propagation of XDM changes to an underlying persistent store or other software system is beyond the scope of this specification. This includes durability.

A References

Transaction Processing Concepts and Techniques
Gray, J. and Reuter, A. 1994. Transaction Processing Concepts and Techniques. Morgan Kaufmann Publishers, San Mateo, CA
SQL/XML
International Organization for Standardization (ISO). ISO/IEC 9075-14:2003, Information Technology - Database Languages - SQL - Part 14, XML-Related Specifications (SQL/XML). (Available from American National Standards Institute, New York, NY 10036, (212) 642-4900.)
XQuery 1.0 and XPath 2.0 Data Model
World Wide Web Consortium. XQuery 1.0 and XPath 2.0 Data Model. W3C Recommendation 23 January 2007. See http://www.w3.org/TR/xpath-datamodel/.
XQuery 1.0
World Wide Web Consortium. XQuery 1.0. W3C Recommendation 23 January 2007. See http://www.w3.org/TR/xquery/.