{ "ns" : "http://zorba.io/modules/store/dynamic/collections/dml", "description" : " This modules provides a set of functions to modify a collection\n and retrieve the items contained in a particular collection.\n

\n Please refer to our documentation for\n more information\n about the lifecycle management and the manipulation of such collections.\n", "sees" : [ "Data Lifecycle", "http://zorba.io/modules/zorba.io/modules/store/dynamic/collections/ddl", "http://zorba.io/modules/zorba.io/errors" ], "authors" : [ "Matthias Brantner, David Graf, Till Westmann, Markos Zaharioudakis" ], "version" : null, "encoding" : "utf-8", "namespaces" : [ { "uri" : "http://zorba.io/annotations", "prefix" : "an" }, { "uri" : "http://zorba.io/modules/store/dynamic/collections/dml", "prefix" : "dml" }, { "uri" : "http://zorba.io/options/versioning", "prefix" : "ver" }, { "uri" : "http://zorba.io/errors", "prefix" : "zerr" } ], "functions" : [ { "arity" : 3, "name" : "apply-insert-after", "qname" : "dml:apply-insert-after", "signature" : "($name as xs:QName, $target as item(), $content as item()*) as item()* external", "description" : " This function does the same thing as insert-after() except it\n immediately applies the resulting pending updates and returns the items that\n have been inserted.\n", "summary" : "

This function does the same thing as insert-after() except it\n immediately applies the resulting pending updates and returns the items that\n have been inserted.

", "annotation_str" : " %an:sequential", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "sequential", "value" : "" } ], "updating" : false, "parameters" : [ { "name" : "name", "type" : "xs:QName", "occurence" : null, "description" : "
The name of the collection to insert into.
" }, { "name" : "target", "type" : "item()", "occurence" : null, "description" : "
The item in the collection after which $content will be inserted.
" }, { "name" : "content", "type" : "item()", "occurence" : null, "description" : "
The sequence of items whose copies to insert.
" } ], "returns" : { "type" : "item()*", "description" : "The sequence of items that have been inserted." }, "errors" : [ "zerr:ZDDY0003 if the collection is not available.", "zerr:ZDDY0011 if $target is not in the collection." ] }, { "arity" : 3, "name" : "apply-insert-before", "qname" : "dml:apply-insert-before", "signature" : "($name as xs:QName, $target as item(), $content as item()*) as item()* external", "description" : " This function does the same thing as insert-before() except it\n immediately applies the resulting pending updates and returns the items that\n have been inserted.\n", "summary" : "

This function does the same thing as insert-before() except it\n immediately applies the resulting pending updates and returns the items that\n have been inserted.

", "annotation_str" : " %an:sequential", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "sequential", "value" : "" } ], "updating" : false, "parameters" : [ { "name" : "name", "type" : "xs:QName", "occurence" : null, "description" : "
The name of the collection to insert into.
" }, { "name" : "target", "type" : "item()", "occurence" : null, "description" : "
The item in the collection before which $content will be inserted.
" }, { "name" : "content", "type" : "item()", "occurence" : null, "description" : "
The sequence of items whose copies to insert.
" } ], "returns" : { "type" : "item()*", "description" : "The sequence of items that have been inserted." }, "errors" : [ "zerr:ZDDY0003 if the collection is not available." ] }, { "arity" : 2, "name" : "apply-insert-first", "qname" : "dml:apply-insert-first", "signature" : "($name as xs:QName, $content as item()*) as item()* external", "description" : " This function does the same thing as insert-first() except it\n immediately applies the resulting pending updates and returns the items that\n have been inserted.\n", "summary" : "

This function does the same thing as insert-first() except it\n immediately applies the resulting pending updates and returns the items that\n have been inserted.

", "annotation_str" : " %an:sequential", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "sequential", "value" : "" } ], "updating" : false, "parameters" : [ { "name" : "name", "type" : "xs:QName", "occurence" : null, "description" : "
The name of the collection to insert into.
" }, { "name" : "content", "type" : "item()", "occurence" : null, "description" : "
The sequence of items whose copies to insert.
" } ], "returns" : { "type" : "item()*", "description" : "The sequence of items that have been inserted." }, "errors" : [ "zerr:ZDDY0003 if the collection is not available." ] }, { "arity" : 2, "name" : "apply-insert-last", "qname" : "dml:apply-insert-last", "signature" : "($name as xs:QName, $content as item()*) as item()* external", "description" : " This function does the same thing as insert-last() except it\n immediately applies the resulting pending updates and returns the items that\n have been inserted.\n", "summary" : "

This function does the same thing as insert-last() except it\n immediately applies the resulting pending updates and returns the items that\n have been inserted.

", "annotation_str" : " %an:sequential", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "sequential", "value" : "" } ], "updating" : false, "parameters" : [ { "name" : "name", "type" : "xs:QName", "occurence" : null, "description" : "
The name of the collection to insert into.
" }, { "name" : "content", "type" : "item()", "occurence" : null, "description" : "
The sequence of items whose copies to insert.
" } ], "returns" : { "type" : "item()*", "description" : "The sequence of items that have been inserted." }, "errors" : [ "zerr:ZDDY0003 if the collection is not available." ] }, { "arity" : 1, "name" : "collection-name", "qname" : "dml:collection-name", "signature" : "($item as item()) as xs:QName external", "description" : " Gets the name of the collection the given item (node or JSON item) belongs\n to.\n", "summary" : "

Gets the name of the collection the given item (node or JSON item) belongs\n to.

", "annotation_str" : "", "annotations" : [ ], "updating" : false, "parameters" : [ { "name" : "item", "type" : "item()", "occurence" : null, "description" : "
The item for which to get the name of the collection.
" } ], "returns" : { "type" : "xs:QName", "description" : "The name of the collection to which $item belongs." }, "errors" : [ "zerr:ZDDY0011 if $item does not belong to a collection." ] }, { "arity" : 1, "name" : "collection", "qname" : "dml:collection", "signature" : "($name as xs:QName) as item()* external", "description" : " Gets the sequence of nodes or JSON items from a collection.\n", "summary" : "

Gets the sequence of nodes or JSON items from a collection.

", "annotation_str" : "", "annotations" : [ ], "updating" : false, "parameters" : [ { "name" : "name", "type" : "xs:QName", "occurence" : null, "description" : "
The name of the collection.
" } ], "returns" : { "type" : "item()*", "description" : "The sequence contained in the given collection." }, "errors" : [ "zerr:ZDDY0003 if the collection is not available." ] }, { "arity" : 2, "name" : "collection", "qname" : "dml:collection", "signature" : "($name as xs:QName, $skip as xs:integer) as item()* external", "description" : " Gets the sequence of items (nodes or JSON items) from a collection.\n", "summary" : "

Gets the sequence of items (nodes or JSON items) from a collection.

", "annotation_str" : "", "annotations" : [ ], "updating" : false, "parameters" : [ { "name" : "name", "type" : "xs:QName", "occurence" : null, "description" : "
The name of the collection.
" }, { "name" : "skip", "type" : "xs:integer", "occurence" : null, "description" : "
The number of collection items to skip.
" } ], "returns" : { "type" : "item()*", "description" : "The sub-sequence contained in the given collection." }, "errors" : [ "zerr:ZDDY0003 if the collection is not available." ] }, { "arity" : 3, "name" : "collection", "qname" : "dml:collection", "signature" : "($name as xs:QName, $start as xs:anyURI, $skip as xs:integer) as item()* external", "description" : " Gets the sequence of items (nodes or JSON items) from a collection.\n The parameters $start and $skip can be used to\n skip over items at the beginning of the collection.\n If both are given, both are applied: first, $start to skip to\n that item and then $skip to skip that additional number of\n items.\n", "summary" : "

Gets the sequence of items (nodes or JSON items) from a collection.

", "annotation_str" : "", "annotations" : [ ], "updating" : false, "parameters" : [ { "name" : "name", "type" : "xs:QName", "occurence" : null, "description" : "
The name of the collection.
" }, { "name" : "start", "type" : "xs:anyURI", "occurence" : null, "description" : "
A reference to the first item to return.
" }, { "name" : "skip", "type" : "xs:integer", "occurence" : null, "description" : "
The additional number of items to skip.
" } ], "returns" : { "type" : "item()*", "description" : "The sub-sequence from the given collection." }, "errors" : [ "zerr:ZAPI0028 If the given URI is not a valid node position computed by the np:node-position function.", "zerr:ZDDY0003 if the collection is not available.", "zerr:ZSTR0066 If $start does not reference a node from the collection $name." ] }, { "arity" : 1, "name" : "delete-first", "qname" : "dml:delete-first", "signature" : "($name as xs:QName) external", "description" : " Deletes the first item from a collection.\n", "summary" : "

Deletes the first item from a collection.

", "annotation_str" : "", "annotations" : [ ], "updating" : true, "parameters" : [ { "name" : "name", "type" : "xs:QName", "occurence" : null, "description" : "
The name of the collection to delete from.
" } ], "returns" : { "type" : null, "description" : "An empty XDM instance and a pending update list that, once applied, deletes the first item from the collection." }, "errors" : [ "zerr:ZDDY0011 if the collection is empty." ] }, { "arity" : 2, "name" : "delete-first", "qname" : "dml:delete-first", "signature" : "($name as xs:QName, $number as xs:integer) external", "description" : " Deletes the first N items from a collection.\n", "summary" : "

Deletes the first N items from a collection.

", "annotation_str" : "", "annotations" : [ ], "updating" : true, "parameters" : [ { "name" : "name", "type" : "xs:QName", "occurence" : null, "description" : "
The name of the collection to delete from.
" }, { "name" : "number", "type" : "xs:integer", "occurence" : null, "description" : "
The number of items to delete.
" } ], "returns" : { "type" : null, "description" : "An empty XDM instance and a pending update list that, once applied, deletes the items from the collection." }, "errors" : [ "zerr:ZDDY0003 if the collection is not available.", "zerr:ZDDY0011 if the collection contains less than $number items." ] }, { "arity" : 1, "name" : "delete-last", "qname" : "dml:delete-last", "signature" : "($name as xs:QName) external", "description" : " Deletes the last item from a collection.\n", "summary" : "

Deletes the last item from a collection.

", "annotation_str" : "", "annotations" : [ ], "updating" : true, "parameters" : [ { "name" : "name", "type" : "xs:QName", "occurence" : null, "description" : "
The name of the collection to delete from.
" } ], "returns" : { "type" : null, "description" : "An empty XDM instance and a pending update list that, once applied, deletes the last item from the collection." }, "errors" : [ "zerr:ZDDY0003 if the collection is not available.", "zerr:ZDDY0011 if the collection is empty." ] }, { "arity" : 2, "name" : "delete-last", "qname" : "dml:delete-last", "signature" : "($name as xs:QName, $number as xs:integer) external", "description" : " Deletes the last N items from a collection.\n", "summary" : "

Deletes the last N items from a collection.

", "annotation_str" : "", "annotations" : [ ], "updating" : true, "parameters" : [ { "name" : "name", "type" : "xs:QName", "occurence" : null, "description" : "
The name of the collection to delete from.
" }, { "name" : "number", "type" : "xs:integer", "occurence" : null, "description" : "
The number of items to delete.
" } ], "returns" : { "type" : null, "description" : "An empty XDM instance and a pending update list that, once applied, deletes the last N items." }, "errors" : [ "zerr:ZDDY0003 if the collection is not available.", "zerr:ZDDY0011 if the collection contains less than $number items." ] }, { "arity" : 1, "name" : "delete", "qname" : "dml:delete", "signature" : "($items as item()*) external", "description" : " Deletes items (nodes or JSON items) from a collection.\n", "summary" : "

Deletes items (nodes or JSON items) from a collection.

", "annotation_str" : "", "annotations" : [ ], "updating" : true, "parameters" : [ { "name" : "items", "type" : "item()", "occurence" : null, "description" : "
The items in the collection to delete.
" } ], "returns" : { "type" : null, "description" : "An empty XDM instance and a pending update list that, once applied, deletes the items from their collections." }, "errors" : [ "zerr:ZDDY0011 if any item in $items is not a member of a collection or not all items belong to the same collection." ] }, { "arity" : 2, "name" : "edit", "qname" : "dml:edit", "signature" : "($target as item(), $content as item()) external", "description" : " Edits the first supplied item so as to make it look exactly like a copy of\n the second supplied item while retaining its original identity.\n", "summary" : "

Edits the first supplied item so as to make it look exactly like a copy of\n the second supplied item while retaining its original identity.

", "annotation_str" : "", "annotations" : [ ], "updating" : true, "parameters" : [ { "name" : "target", "type" : "item()", "occurence" : null, "description" : "
The target item to be edited.
" }, { "name" : "content", "type" : "item()", "occurence" : null, "description" : "
The item that serves as an edit goal.
" } ], "returns" : { "type" : null, "description" : "An empty XDM instance and a pending update list that, once applied, performs the edit." }, "errors" : [ "zerr:ZDDY0003 if the collection to which $target belongs is not available.", "zerr:ZDDY0006 if the collection to which $target belongs is append-only, const, or queue.", "zerr:ZDDY0017 if $target is not a member of a collection.", "zerr:ZDDY0037 if the collection is append-only.", "zerr:ZDDY0038 if the collection is a queue.", "zerr:ZDDY0039 if $target is not a root.", "zerr:ZDDY0040 if $target cannot be updated to match the content (for example, because the target is a node and the content is an object)." ] }, { "arity" : 1, "name" : "index-of", "qname" : "dml:index-of", "signature" : "($item as item()) as xs:integer external", "description" : " Gets the position of the given item (node or JSON item) within its\n collection.\n", "summary" : "

Gets the position of the given item (node or JSON item) within its\n collection.

", "annotation_str" : "", "annotations" : [ ], "updating" : false, "parameters" : [ { "name" : "item", "type" : "item()", "occurence" : null, "description" : "
The item to get the index of.
" } ], "returns" : { "type" : "xs:integer", "description" : "The position of $item in its collection." }, "errors" : [ "zerr:ZDDY0011 if $item does not belong to a collection." ] }, { "arity" : 3, "name" : "insert-after", "qname" : "dml:insert-after", "signature" : "($name as xs:QName, $pos as item(), $content as item()*) external", "description" : " Inserts copies of the given items (nodes or JSON items)\n into a collection at the position directly following the given target item.\n", "summary" : "

Inserts copies of the given items (nodes or JSON items)\n into a collection at the position directly following the given target item.

", "annotation_str" : "", "annotations" : [ ], "updating" : true, "parameters" : [ { "name" : "name", "type" : "xs:QName", "occurence" : null, "description" : "
The name of the collection to insert into.
" }, { "name" : "pos", "type" : "item()", "occurence" : null, "description" : "" }, { "name" : "content", "type" : "item()", "occurence" : null, "description" : "
The sequence of items whose copies to insert.
" } ], "returns" : { "type" : null, "description" : "An empty XDM instance and a pending update list that, once applied, inserts the items into the collection." }, "errors" : [ "zerr:ZDDY0003 if the collection is not available.", "zerr:ZDDY0011 if $target is not in the collection." ] }, { "arity" : 3, "name" : "insert-before", "qname" : "dml:insert-before", "signature" : "($name as xs:QName, $target as item(), $content as item()*) external", "description" : " Inserts copies of the given items (nodes or JSON items)\n into a collection at the position directly preceding the given target item.\n", "summary" : "

Inserts copies of the given items (nodes or JSON items)\n into a collection at the position directly preceding the given target item.

", "annotation_str" : "", "annotations" : [ ], "updating" : true, "parameters" : [ { "name" : "name", "type" : "xs:QName", "occurence" : null, "description" : "
The name of the collection to insert into.
" }, { "name" : "target", "type" : "item()", "occurence" : null, "description" : "
The item in the collection before which $content will be inserted.
" }, { "name" : "content", "type" : "item()", "occurence" : null, "description" : "
The sequence of items whose copies to insert.
" } ], "returns" : { "type" : null, "description" : "An empty XDM instance and a pending update list that, once applied, inserts the items into the collection." }, "errors" : [ "zerr:ZDDY0003 if the collection is not available.", "zerr:ZDDY0011 if $target is not in the collection." ] }, { "arity" : 2, "name" : "insert-first", "qname" : "dml:insert-first", "signature" : "($name as xs:QName, $content as item()*) external", "description" : " Inserts copies of the given items (nodes or JSON items)\n at the beginning of the collection.\n", "summary" : "

Inserts copies of the given items (nodes or JSON items)\n at the beginning of the collection.

", "annotation_str" : "", "annotations" : [ ], "updating" : true, "parameters" : [ { "name" : "name", "type" : "xs:QName", "occurence" : null, "description" : "
The name of the collection to insert into.
" }, { "name" : "content", "type" : "item()", "occurence" : null, "description" : "
The sequence of items whose copies to insert.
" } ], "returns" : { "type" : null, "description" : "An empty XDM instance and a pending update list that, once applied, inserts the items into the collection." }, "errors" : [ "zerr:ZDDY0003 if the collection is not available." ] }, { "arity" : 2, "name" : "insert-last", "qname" : "dml:insert-last", "signature" : "($name as xs:QName, $content as item()*) external", "description" : " Inserts copies of the given items (nodes or JSON items)\n at the end of the collection.\n", "summary" : "

Inserts copies of the given items (nodes or JSON items)\n at the end of the collection.

", "annotation_str" : "", "annotations" : [ ], "updating" : true, "parameters" : [ { "name" : "name", "type" : "xs:QName", "occurence" : null, "description" : "
The name of the collection to insert into.
" }, { "name" : "content", "type" : "item()", "occurence" : null, "description" : "
The sequence of items whose copies to insert.
" } ], "returns" : { "type" : null, "description" : "An empty XDM instance and a pending update list that, once applied, inserts the items into the collection." }, "errors" : [ "zerr:ZDDY0003 if the collection is not available." ] }, { "arity" : 1, "name" : "truncate", "qname" : "dml:truncate", "signature" : "($name as xs:QName) external", "description" : " Deletes the entire contents of a collection.\n", "summary" : "

Deletes the entire contents of a collection.

", "annotation_str" : "", "annotations" : [ ], "updating" : true, "parameters" : [ { "name" : "name", "type" : "xs:QName", "occurence" : null, "description" : "
The name of the collection whose contents to delete.
" } ], "returns" : { "type" : null, "description" : "An empty XDM instance and a pending update list that, once applied, deletes the contents." }, "errors" : [ "zerr:ZDDY0003 if the collection is not available." ] } ], "variables" : [ ] }