http://zorba.io/modules/store/dynamic/collections/w3c/ddl

View as XML or JSON.

This modules defines a set of functions for managing persistent, ordered, and updatable collections.

Such collections are identified by a URI as defined in the XQuery specification. However, please note that we do not advise users to use collections identified by URIs. Instead, we refer to the data lifecycle documentation. It gives an overview of several ways to work with collections, documents, and other data-structures.

Function Summary

available-collections () as xs:string*

The function returns a sequence of URIs of the collections that are available.

create ($uri as xs:string)

Creates the collection with the given URI.

create ($uri as xs:string, $content as node()*)

Creates the collection with the given URI and adds copies of the given sequence to the new collection.

delete ($uri as xs:string)

Deletes the collection with the given URI.

from-qname ($name as xs:QName) as xs:string

THIS FUNCTION IS FOR INTERNAL USE ONLY.

is-available-collection ($uri as xs:string) as xs:boolean

Checks whether a collection with the given URI exists.

to-qname ($uri as xs:string) as xs:QName

THIS FUNCTION IS FOR INTERNAL USE ONLY.

Functions

available-collections#0

declare  function ddl:available-collections() as xs:string*
The function returns a sequence of URIs of the collections that are available. The sequence will be empty if there are no collections.

Parameters

Returns

xs:string*
A sequence of URIs, one for each available collection, or an emtpy sequence.

create#1

declare  function ddl:create($uri as xs:string)
Creates the collection with the given URI.

Parameters

uri as xs:string
The URI of the collection to create.

Returns

An empty XDM instance and a pending update list that, once applied, creates a collection with the given URI.

create#2

declare  function ddl:create($uri as xs:string, $content as node()*)
Creates the collection with the given URI and adds copies of the given sequence to the new collection.

Parameters

uri as xs:string
The URI of the collection to create.
content as node()
The sequence of nodes to add to the new collection.

Returns

An empty XDM instance and a pending update list that, once applied, creates a collection identified by $uri and inserts $content into it.

delete#1

declare  function ddl:delete($uri as xs:string)
Deletes the collection with the given URI.

Parameters

uri as xs:string
The URI of the collection to delete.

Returns

An empty XDM instance and a pending update list that, once applied, deletes the collection identified by $uri.

from-qname#1

declare  function ddl:from-qname($name as xs:QName) as xs:string
THIS FUNCTION IS FOR INTERNAL USE ONLY. Gets the namespace component of the given QName.

Parameters

name as xs:QName
The QName whose namespace component should be returned.

Returns

xs:string
The namespace component of $name

is-available-collection#1

declare  function ddl:is-available-collection($uri as xs:string) as xs:boolean
Checks whether a collection with the given URI exists.

Parameters

uri as xs:string
The URI of the collection to check.

Returns

xs:boolean
true if the collection is available and false otherwise.

to-qname#1

declare  function ddl:to-qname($uri as xs:string) as xs:QName
THIS FUNCTION IS FOR INTERNAL USE ONLY. Converts a URI given as a string into a reserved QName. This QName is used in the module to be able to store collections identified by URIs using dynamic collections that are identified by QNames.

Parameters

uri as xs:string
URI to convert to a reserved QName.

Returns

xs:QName
The reserved QName for the given URI.