Chapter 10 Alignment with XQuery Working Drafts
This chapter documents the relationship of Galax to the target W3C
working drafts. Galax 0.5.0 is a prototype implementation, and
therefore it is not (yet) completely aligned with the relevant W3C
working drafts (WDs). This chapter also document the non-standard
features in Galax
0.5.0 and the known bugs and limitations.
Galax 0.5.0 implements the October 2004 XQuery 1.0 and XPath 2.0
Working Drafts, the XML 1.0 Recommendation, the Namespaces in XML
Recommendation, and XML Schema Recommendation (Parts 1 and 2).
Galax 0.5.0 implements large parts, but not all of the following W3C
working drafts related to XQuery:
10.1 Data Model
Galax 0.5.0 fully supports the XQuery 1.0 and XPath 2.0 Data Model.
Galax 0.5.0 implements an xsd:float value as an xsd:double value.
The alignment issues in this section follow the outline of the
"Expressions" section in http://www.w3c.org/TR/xquery. If a
subsection is not listed here, it means that Galax 0.5.0 implements
the semantics described in that section.
Galax 0.5.0 does not support:
-
XPath 1.0 compatibility modes.
- Collations.
- The construction mode. Type annotations on copied
elements are always erased/eliminated.
- The ordering mode. Input order is always preserved.
The implicit timezone is set to the local timezone.
Galax's processing model is similar to XQuery's abstract processing
model. See Section 8 for more information on
Galax's internal processing model.
Galax 0.5.0 does not check that a numeric value is equal to NaN
when computing an effective boolean value.
Galax 0.5.0 does not support the fn:collection() function.
The context item and values for external
variables can be specified on the command line or in the API. See
Sections 5.1.1 and 6.2.
Galax requires that all actual types, that is, those types that annote
input documents be in the in-scope schema definitions. Galax
will raise a dynamic error if it encounters a type in a document that
is not imported into the query by an import schema prolog statement.
Galax supports the Schema Import, Static Typing, and
Full Axis features.
Galax 0.5.0 does not support import of mutually recursive modules.
Galax 0.5.0 does not support the Pragmas feature.
Galax 0.5.0 does not support must-understand extensions.
Galax 0.5.0 does not support static typing extensions.
Galax 0.5.0 implements an xsd:float value as an xsd:double value.
Galax 0.5.0 supports all axes with the exception of the
preceding and following axes.
Galax 0.5.0 does not support the DocumentTest,
ElementTest, AttribteTest,
SchemaElementTest, or SchemaAttribteTest in path
expressions. These kind tests, however, are supported wherever else a
SequenceType is expected.
When constructing a new element, Galax 0.5.0always
erases/eliminates type annotations on copied elements.
When constructing a new element, Galax 0.5.0requires that
the new element's attributes precede its other content.
Galax 0.5.0does not permit document nodes in the content of a new
element.
Namespace declarations in input and output documents and in input
queries are not handled consistently.
We are working on
this.
Galax 0.5.0 will accept queries that contain the ordered or
unordered expressions, but they have no effect on query
evaluation (i.e., they are no-ops).
Although module declarations and module import statements are
supported, they are not well tested.
Galax 0.5.0 does not support recursive modules import.
Galax 0.5.0 does not support collations.
Galax 0.5.0 does not support the construction declaration.
Galax 0.5.0 does not support the default ordering declaration.
Schema components in an imported schema are mapped into XQuery
types according to the mapping rules specified in the XQuery 1.0
Formal Semantics (see below).
10.3 XQuery 1.0 Formal Semantics
The XQuery 1.0 formal semantics defines the mapping of every XQuery
expression into an expression in the XQuery core, and it defines the
static and dynamic semantics of each core expression. The formal
semantics also defines how imported schemas are mapped into internal
XQuery types.
Galax 0.5.0 implements the static and dynamic semantics of core
expressions defined in the XQuery 1.0 Formal Semantics.
10.4 Functions and Operators
Galax 0.5.0 supports most of the functions in the XQuery 1.0 and
XPath 2.0 Functions and Operators document. The signatures of
supported functions are listed in $GALAXLIB/pervasive.xq.
Galax 0.5.0 does not support the following functions:
fn:nilled
fn:document-uri
fn:round-half-to-even
fn:codepoints-to-string
fn:string-to-codepoints
fn:escape-uri
fn:normalize-unicode
op:gYearMonth-equal
op:gYear-equal
op:gMonthDay-equal
op:gMonth-equal
op:gDay-equal
fn:resolve-QName
fn:get-namespace-uri-for-prefix
fn:get-in-scop-namespaces
fn:number
fn:id
fn:idref
fn:collection
fn:default-collation
The fn:trace function emits its input sequence and message are to standard output.
n
Galax 0.5.0does not support constructor functions for user-defined
types.
Functions
and Operators Section 12 Functions and Operators on base64Binary and hexBinary
Galax 0.5.0 does not support any functions on binary data.
Galax 0.5.0 supports most of the basic casting rules.
10.5 Use Cases
See $GALAXHOME/usecases/STATUS
10.6 Galax 0.5.0 extensions
10.6.1 Defining XQuery Types in the Query Prolog
Type values are available in a query by either importing a
predefined XML schema using the import schema declaration in the
query prolog or by defining XQuery types explicitly in the query prolog.
Galax 0.5.0 supports the definition of XQuery types in the query
prolog using the internal type syntax defined in the XQuery 1.0
Formal Semantics. The grammar is provided here for reference:
TypeDeclaration ::= ("define" "element" QName "{" TypeDefn? "}")
| ("define" "attribute" QName "{" TypeDefn? "}")
| ("define" "type" QName "{" TypeDefn? "}")
TypeDefn ::= TypeUnion
| TypeBoth
| TypeSequence
| TypeSimpleType
| TypeAttributeRef
| TypeElementRef
| TypeTypeRef
| TypeParenthesized
| TypeNone
TypeUnion ::= TypeDefn "|" TypeDefn
TypeBoth ::= TypeDefn "&" TypeDefn
TypeSequence ::= TypeDefn "," TypeDefn
TypeSimpleType ::= QName OccurrenceIndicator
TypeAttributeRef ::= "attribute" NameTest ("{" TypeDefn? "}")? OccurrenceIndicator
TypeElementRef ::= "element" NameTest ("{" TypeDefn? "}")? OccurrenceIndicator
TypeTypeRef ::= "type" NameTest OccurrenceIndicator
TypeParenthesized::= "(" TypeDefn? ")" OccurrenceIndicator
TypeNone ::= "none"
10.6.2 Galax specific functions
Galax-only functions are put in the Galax namespace
(http://db.bell-labs.com/galax), which is bound by default to the
glx: prefix.
See $GALAXHOME/lib/pervasive.xq for a complete list of functions
in the Galax namespace.