XQuery IntelliJ Plugin 1.5 Functions and Operators

This document includes material copied from or derived from the XPath and XQuery specifications. Copyright © 1999-2017 W3C® (MIT, ERCIM, Keio, Beihang).

Abstract

This document defines the functions, operators, annotations, and options used by the XQuery IntelliJ Plugin to implement the XQuery integration with JetBrain’s IntelliJ IDEs.

Table of Contents

1 Introduction

The purpose of this document is to catalog the options, annotations, functions, and operators used by the XQuery IntelliJ Plugin to implement support for XQuery in the IntelliJ family of Integrated Development Environments (IDEs). This is in addition to the options, annotations, functions, and operators defined by XQuery and the different vendor implementations of XQuery supported by the plugin.

These extensions can be grouped into two categories. The first is the options and annotations used to provide context such as versioning to the built-in function definitions. The second is the functions and operators used internally to provide static analysis and other functionality for the plugin.

This document does not describe the options, annotations, functions, and operators supported by the different XQuery vendors.

1.1 Namespaces and prefixes

This document uses the following namespace prefixes to represent the namespace URIs with which they are listed. These namespace prefixes are not predeclared and their use in this document is not normative.

Functions defined with the op prefix are described here to underpin the definitions of the operators in XQuery vendor extensions. These functions are not available directly to users, and there is no requirement that implementations should actually provide these functions. For this reason, no namespace is associated with the op prefix.

1.2 Common definitions

These values are used by different parts of this specification to describe the format of strings in annotations, options, functions, and operators.

1.2.1 implementation

An implementation is one of:

  1. basex
  2. exist-db
  3. marklogic
  4. saxon

It specifies which XQuery processor the module definitions apply to.

1.2.2 specification

A specification is one of:

  1. expath-binary – EXPath Binary Module
  2. expath-crypto – EXPath Cryptographic Module
  3. expath-file – EXPath File Module
  4. expath-geo – EXPath Geo Module
  5. expath-http – EXPath HTTP Client Module
  6. expath-webapp – EXPath Web Applications
  7. expath-zip – EXPath ZIP Module
  8. exquery-request – EXQuery HTTP Request Module 1.0
  9. exquery-restxq – EXQuery RESTXQ 1.0: RESTful Annotations for XQuery
  10. xpath-functions – XPath and XQuery Functions and Operators

It specifies which XQuery specification the module applies to.

1.2.3 version

A version can be a major/minor (e.g. 7.0), major/minor/patch (e.g. 7.7.2), MarkLogic major/minor/patch (e.g. 8.0-6.2), or major/minor/date (e.g. 1.0-20131203) version string.

1.2.4 QName

A QName can be specified in one of the following formats:

URIQualifiedName ::= "Q{" AnyURI "}" NCName
ClarkQName ::= "{" AnyURI "}" NCName
LexicalQName ::= NCName ":" NCName
LexicalNCName ::= NCName

Here, ClarkQName is the Clark notation for QNames created by James Clark.

2 Options

2.1 o:implements-module

Summary

Specifies the version of a specification supported by an implementation.

Syntax
implementation "/" version S "as" S specification "/" version ###### Example
declare option o:implements-module "basex/7.8 as expath-binary/1.0-20131203";

2.2 o:requires

Summary

Specifies the specification or implementation, and minimum version of those that is required for the given built-in module definitions.

Syntax
(implementation|specification) "/" version ###### Example
declare option o:requires "marklogic/7.0";

2.3 o:requires-import

Summary

Specifies the specification or implementation, and minimum version of those that is required for the given imported module definitions.

Syntax
(implementation|specification) "/" version ";" S "location-uri" "=" "(none)"
(implementation|specification) "/" version ";" S "location-uri" "=" AnyURI ###### Example
declare option o:requires-import "basex/7.5; location-uri=(none)";

3.1 op:QName-parse

Summary

Parses a string as a QName.

Signature
op:QName-parse($qname as xs:string, $namespaces as map(xs:string, xs:string)) as xs:QName
Rules

The string is parsed as follows:

  1. If the string is a URIQualifiedName, the return value is an expanded, non-lexical QName with the namespace uri being the AnyURI part, and the local name being the NCName part. The prefix of the QName is missing.

  2. If the string is a ClarkQName, the return value is an expanded, non-lexical QName with the namespace uri being the AnyURI part, and the local name being the NCName part. The prefix of the QName is missing.

  3. If the string is a LexicalQName, the return value is an expanded lexical QName with the prefix being the first NCName part and the local name being the second NCName part. The namespace uri is the entry in the $namespaces map where the key is the QName prefix. If the prefix does not exist in the map, an err:XPST0081 error is raised.

  4. If the string is a LexicalNCName, the return value is equivalent to parsing Q{}local-name where local-name is the content of this string.

  5. Otherwise, an invalid QName format error is raised.

3.2 op:QName-presentation

Summary

Returns the presentation form of the QName.

Signature
op:QName-presentation($qname as xs:QName) as xs:string
Rules

The QName is formatted as follows:

  1. prefix:local-name if the QName has a defined prefix.

  2. Q{namespace}local-name if the QName has a namespace without a defined prefix.

  3. local-name if the QName does not have a specified namespace.

A References

A.1 W3C References

A.2 EXPath References

A.3 EXQuery References