XML &, query languages   Table of contents   Indexes   Quilt: an XML query language

 

Query languages

 Bryan, Martin 
 
 Martin  Bryan
 Technical Manager
  Churchdown 
 Gloucestershire 
 The Diffuse Project, EU 
 United Kingdom 
The Diffuse Project, EU,  29 Oldbury Orchard
Churchdown  Gloucestershire United Kingdom  GL3 2PU
Phone: +44 1452 714029 Fax: +44 1452 714029 email: mtbryan@diffuse.org web site: www.diffuse.org
 Biography
 Martin Bryan - Martin Bryan is an independent consultant in the use of SGML, XML and related standards. He has represented both the British Standards Institute and the International SGML Users' Group on the ISO committees responsible for the development of the SGML and its related standards for over a decade, and is one of the co-editors of the HyTime-based ISO Topic Maps standard. After maintaining the European Commission's web site on the use of a wide range of standards for Open Information Interchange for five years, Martin Bryan has been appointed Technical Manager of the Diffuse Project, whose role is to promote the use and development of standards within European Information Society R&D projects. Martin Bryan is also Project Manager for the CEN/ISSS Electronic Commerce Workshop's project group on Defining and Managing Semantics and Datatypes.
 Abstract
 The Query Languages session will provide delegates with an exploration across the breadth of query standards and mechanisms, including both theory and case studies.
 

Developing an XML query language

 On 31st January 2000 W3C published a first draft of itsXML Query Requirements . These identify the following requirements of any query language to be created for the querying of XML-encoded data sources:
 
 3.2 General Requirements
 3.2.1 Query Language Syntax
 The XML Query Language MAY have more than one syntax binding. One query language syntax MUST be convenient for humans to read and write. One query language syntax MUST be expressed in XML in a way that reflects the underlying structure of the query.
 3.2.2 Declarativity
 The XML Query Language MUST be declarative. Notably, it MUST not enforce a particular evaluation strategy.
 3.2.3 Protocol Independence
 The XML Query Language MUST be defined independently of any protocols with which it is used.
 3.2.4 Error Conditions
 The XML Query Language MUST define standard error conditions that can occur during the execution of a query, such as processing errors within expressions, unavailability of external functions to the query processor, or processing errors generated by external functions.
 3.2.5 Updates
 Version 1.0 of the XML Query Language MUST not preclude the ability to add update capabilities in future versions.
 3.2.6 Defined for Finite Instances
 The XML Query Language MUST be defined for finite instances of the data model. It MAY be defined for infinite instances.
 3.3 XML Query Data Model
 3.3.1 Reliance on XML Information Set
 The XML Query Data Model relies on information provided by XML Processors and Schema Processors, and it MUST ensure that it does not require information that is not made available by such processors. For XML constructs found in XML 1.0 or the Namespaces Recommendation, the XML Query Data Model MUST show how the equivalent XML Query Data Model constructs are are defined in terms of items in the XML Information Set. The XML Query Data Model SHOULD represent all information items, or provide justification for any information items omitted. For information found in the XML Schema, such as datatypes, the Data Model MUST coordinate with the XML Schema Working Group to ensure that schema processors may be relied on to provide the information needed to construct the Data Model.
 3.3.2 Datatypes
 The XML Query Data Model MUST represent both XML 1.0 character data and the simple and complex types of the XML Schema specification.
 3.3.3 Collections
 The XML Query Data Model MUST represent collections of documents and collections of simple and complex values. (Note that collections are not part of the current XML Infoset.)
 3.3.4 References
 The XML Query Data Model MUST include support for references, including both references within an XML document and references from one XML document to another.
 3.3.5 Schema Availability
 Queries MUST be possible whether or not a schema is available (in this document, the term "schema" may refer to either an XML Schema or a DTD). If a schema is available, the data model MUST represent any items which they define for their instances, such as default attributes, entity expansions, or data types. These items will not be present if a schema is not present.
 3.3.6 Namespace Awareness
 The XML Query Language and XML Query Language Data Model MUST be namespace aware.
 3.4 XML Query Functionality
 3.4.1 Supported Operations
 The XML Query Language MUST support operations on all data types represented by the XML Query Data Model (see datatypes, collections, references).
 3.4.2 Text and Element Boundaries
 Operations on text MUST be applicable to text that spans element boundaries.
 3.4.3 Universal and Existential Quantifiers
 Operations on collections MUST include support for universal and existential quantifiers.
 3.4.4 Hierarchy and Sequence
 Queries MUST support operations on hierarchy and sequence of document structures.
 3.4.5 Combination
 The XML Query Language MUST be able to combine related information from different parts of a given document or from multiple documents.
 3.4.6 Aggregation
 The XML Query Language MUST be able to compute summary information from a group of related document elements (this operation is sometimes called "aggregation.")
 3.4.7 Composition of Operations
 The XML Query Language MUST support expressions in which operations can be composed, including the use of queries as operands.
 3.4.8 NULL Values
 The XML Query Language MUST include support for NULL values. Therefore, all operators MUST take NULL values into account, including logical operators.
 3.4.9 Structural Preservation
 Queries MUST be able to preserve the relative hierarchy and sequence of input document structures in query results.
 3.4.10 Structural Transformation
 Queries MUST be able to transform XML structures and MUST be able to create new structures.
 3.4.11 References
 Queries MUST be able to traverse intra- and inter-document references.
 3.4.12 Identity Preservation
 Queries MUST be able to preserve the identity of items in the XML Query Data Model.
 3.4.13 Operations on Literal Data
 Queries SHOULD be able to operate on XML Query Data Model instances specified with the query. We refer to such data as "literal data" in this document.
 3.4.14 Operations on Names
 Queries SHOULD be able to operate on names, such as element names, attribute names, and processing instruction targets, and to operate on combinations of names and data.
 3.4.15 Operations on Schemas
 Queries SHOULD provide access to the XML schema or DTD for a document, if there is one. If the schema is represented as a DTD, a mapping to an appropriate XML Schema representation MAY be required.
 3.4.16 Extensibility
 The XML Query Language SHOULD support the use of externally defined functions on all datatypes of the XML Query Data Model. The interface to such functions SHOULD be defined by the Query Language, and SHOULD distinguish these functions from functions defined in the Query Language. The implementation of externally defined functions is not part of the Query Language.
 3.4.17 Environment Information
 The XML Query Language MUST provide access to information derived from the environment in which the query is executed, such as the current date, time, or user.
 3.4.18 Closure
 Queries MUST be closed with respect to the XML Query Data Model. Both the input to a query and the output of a query MUST be defined purely in terms of the XML Query Data Model. Non-XML sources such as traditional databases or objects may be queried if they are given an XML Query Data Model representation. Similarly, query results are defined purely in terms of the XML Query Data Model. In software systems these results may be instantiated in any convenient representation such as DOM nodes, hyperlinks, XML text, or various data formats.
 In this session the presentations will describe various techniques for meeting some or all of these requirements
 Bibliography
 
XQL XML Query Requirements

XML &, query languages   Table of contents   Indexes   Quilt: an XML query language