{ "ns" : "http://zorba.io/modules/store/static/collections/ddl", "description" : " This modules defines a set of functions for managing collections that are\n declared in the prolog of a module.\n For example, it provides functions to create, delete, or introspect\n collections.\n

\n This module is part of\n Zorba's XQuery Data Definition Facility.\n All the collections managed by this module\n have to be pre-declared in the prolog of a module. Please refer to the\n general documentation\n for more information and examples.\n", "sees" : [ "Data Lifecycle", "XQuery Data Definition Facility", "http://zorba.io/modules/latest/zorba.io/modules/store/static/integrity-constraints/dml", "http://zorba.io/modules/latest/zorba.io/modules/store/static/collections/dml", "http://zorba.io/modules/latest/zorba.io/modules/store/static/collections/ddl", "http://zorba.io/modules/latest/zorba.io/modules/store/static/indexes/ddl", "http://zorba.io/modules/latest/zorba.io/modules/store/static/indexes/dml", "http://zorba.io/modules/latest/zorba.io/errors" ], "authors" : [ "Nicolae Brinza, Matthias Brantner, David Graf, Till Westmann, Markos Zaharioudakis" ], "version" : null, "encoding" : "utf-8", "namespaces" : [ { "uri" : "http://zorba.io/modules/store/static/collections/ddl", "prefix" : "cddl" }, { "uri" : "http://zorba.io/options/versioning", "prefix" : "ver" }, { "uri" : "http://zorba.io/errors", "prefix" : "zerr" } ], "functions" : [ { "arity" : 0, "name" : "available-collections", "qname" : "cddl:available-collections", "signature" : "() as xs:QName* external", "description" : " Gets the QNames of the collections that have been statically declared and\n are available, if any.\n", "summary" : "

Gets the QNames of the collections that have been statically declared and\n are available, if any.

", "annotation_str" : "", "annotations" : [ ], "updating" : false, "parameters" : [ ], "returns" : { "type" : "xs:QName*", "description" : "A sequence comprising one QName for each statically declared and available collection or an emtpy sequence if no such collections are available." }, "errors" : [ ] }, { "arity" : 1, "name" : "create", "qname" : "cddl:create", "signature" : "($name as xs:QName) external", "description" : " Creates a collection.\n", "summary" : "

Creates a collection.

", "annotation_str" : "", "annotations" : [ ], "updating" : true, "parameters" : [ { "name" : "name", "type" : "xs:QName", "occurence" : null, "description" : "
The of the collection to create.
" } ], "returns" : { "type" : null, "description" : "An empty XDM instance and a pending update list that, once applied, creates a collection with the given name." }, "errors" : [ "zerr:ZDDY0001 if $name is not equal to any of the declared collections in the static context.", "zerr:ZDDY0002 if a collection with $name already exists." ] }, { "arity" : 2, "name" : "create", "qname" : "cddl:create", "signature" : "($name as xs:QName, $content as item()*) external", "description" : " Creates a collection and adds the given sequence as content to the new\n collection.\n", "summary" : "

Creates a collection and adds the given sequence as content to the new\n collection.

", "annotation_str" : "", "annotations" : [ ], "updating" : true, "parameters" : [ { "name" : "name", "type" : "xs:QName", "occurence" : null, "description" : "
The name of the collection to create.
" }, { "name" : "content", "type" : "item()", "occurence" : null, "description" : "
The sequences of items (nodes or JSON items) to be added to the new collection.
" } ], "returns" : { "type" : null, "description" : "An empty XDM instance and a pending update list that, once applied, creates a collection with the given name and inserts the given items into it." }, "errors" : [ "zerr:ZDDY0001 if $name is not equal to any of the declared collections in the static context.", "zerr:ZDDY0002 if a collection with $name already exists.", "zerr:ZDTY0001 if $content does not match the expected type declared by the collection according to the rules for SequenceType Matching." ] }, { "arity" : 0, "name" : "declared-collections", "qname" : "cddl:declared-collections", "signature" : "() as xs:QName* external", "description" : " Gets the collections that have been declared in the prolog of the static\n context.\n", "summary" : "

Gets the collections that have been declared in the prolog of the static\n context.

", "annotation_str" : "", "annotations" : [ ], "updating" : false, "parameters" : [ ], "returns" : { "type" : "xs:QName*", "description" : "A sequence of QNames, one for each collection created in the static context, or an emtpy sequence." }, "errors" : [ ] }, { "arity" : 1, "name" : "delete", "qname" : "cddl:delete", "signature" : "($name as xs:QName) external", "description" : " Deletes a collection.\n", "summary" : "

Deletes a collection.

", "annotation_str" : "", "annotations" : [ ], "updating" : true, "parameters" : [ { "name" : "name", "type" : "xs:QName", "occurence" : null, "description" : "
The collection to delete.
" } ], "returns" : { "type" : null, "description" : "An empty XDM instance and a pending update list that, once applied, deletes the collection with the given name." }, "errors" : [ "zerr:ZDDY0001 if $name is not equal to any of the declared collections in the static context.", "zerr:ZDDY0003 if the collection identified by $name is not available.", "zerr:ZDDY0013 if the domain or key expression of any of the available indexes access the collection having $name.", "zerr:ZDDY0015 if any of the in-scope variables references an item that belongs to the collection having $name" ] }, { "arity" : 1, "name" : "is-available-collection", "qname" : "cddl:is-available-collection", "signature" : "($name as xs:QName) as xs:boolean external", "description" : " Gets whether a collection is statically declared and available.\n", "summary" : "

Gets whether a collection is statically declared and available.

", "annotation_str" : "", "annotations" : [ ], "updating" : false, "parameters" : [ { "name" : "name", "type" : "xs:QName", "occurence" : null, "description" : "
The name of the collection to check.
" } ], "returns" : { "type" : "xs:boolean", "description" : "true if the collection was statically declared and is available; false otherwise." }, "errors" : [ ] }, { "arity" : 1, "name" : "is-declared-collection", "qname" : "cddl:is-declared-collection", "signature" : "($name as xs:QName) as xs:boolean external", "description" : " Gers whether a collection was declared in the prolog of the static context.\n", "summary" : "

Gers whether a collection was declared in the prolog of the static context.

", "annotation_str" : "", "annotations" : [ ], "updating" : false, "parameters" : [ { "name" : "name", "type" : "xs:QName", "occurence" : null, "description" : "
The name of the collection to check.
" } ], "returns" : { "type" : "xs:boolean", "description" : "true if the collection was declared; false otherwise." }, "errors" : [ ] } ], "variables" : [ ] }