Changes

Jump to navigation Jump to search
18 bytes added ,  15:19, 20 May 2013
no edit summary
* {{Code|db:list-details("docs")}} returns the names plus additional data of all documents from the database named {{Code|docs}}.
|}
 
==db:system==
{| width='100%'
|-
| width='90' | '''Signatures'''
|{{Func|db:system||element(system)}}
|-
| '''Summary'''
|Returns information on the database system, such as the database path and current database settings.
|}
 
==db:backups==
{| width='100%'
|-
| width='90' | '''Signatures'''
|{{Func|db:backups||element(backup)*}}<br/>{{Func|db:backups|$db as xs:string|element(backup)*}}
|-
| '''Summary'''
|Returns an element sequence containing all available database backups.<br/>If a database {{Code|$db}} is specified, the sequence will be restricted to the backups matching this database.
|-
| '''Examples'''
|
* {{Code|db:backups("factbook")}} returns all backups that have been made from the {{Code|factbook}} database.
|}
 
=Read Operations=
==db:open==
|}
==db:systemretrieve== 
{| width='100%'
|-
| width='90' | '''Signatures'''
|{{Func|db:systemretrieve|$db as xs:string, $path as xs:string|element(system)xs:base64Binary}}
|-
| '''Summary'''
|Returns information on the a binary database system, such as resource addressed by the database path {{Code|$db}} and current database settings.{{Code|$path}==db:backups==as [[Streaming Module|streamable]] {{Code| width='100%'xs:base64Binary}}.
|-
| width='90' | '''SignaturesErrors'''|{{FuncError|db:backupsBXDB0003||element#Errors}} the database is not ''persistent'' (backupstored on disk)*}}.<br/>{{FuncError|db:backupsFODC0002|$db as xs:string|element(backup)*XQuery Errors#Functions Errors}}|-| '''Summary'''|Returns an element sequence containing all available database backupsthe addressed resource cannot be retrieved.<br/>If a database {{CodeError|$dbFODC0007|XQuery Errors#Functions Errors}} the specified path is specified, the sequence will be restricted to the backups matching this databaseinvalid.
|-
| '''Examples'''
|
* {{Code|declare option output:method 'raw';<br/>db:backupsretrieve("factbookDB", "music/01.mp3")}} returns all backups that have been made from the {{Code|factbook}} databasespecified audio file as raw data.* <code><nowiki>stream:materialize(db:retrieve("DB", "music/01.mp3"))</nowiki></code> returns a materialized representation of the streamable result.
|}
=Retrieval= ==db:textnode-id==
{| width='100%'
|-
| width='90' | '''Signatures'''
|{{Func|db:textnode-id|$db nodes as xs:string, $string as itemnode()*|text()xs:integer*}}
|-
| '''Summary'''
|Returns all text nodes the ''id'' values of the database specified nodes supplied by the database {{Code|$dbnodes}} that have {{Code, which must all be [[#Database Nodes|$string}} as their string valuedatabase nodes]].<br/>Each database node has a persistent ''id'', which remains valid after update operations. If availableso far no updates have been performed, the ''pre'' value index is used equal to speed up evaluationthe ''id'' value and can be requested instead, which provides access to database nodes in constant time.
|-
| '''ExamplesErrors'''|* {{CodeError|db:text("DB", "QUERY")/..}} returns the parents of all text nodes of the database {{CodeBXDB0001|DB#Errors}} that match the string {{Code|QUERY$nodes}}contains a node which is not stored in a database.
|}
==db:textnode-rangepre==
{| width='100%'
|-
| width='90' | '''Signatures'''
|{{Func|db:textnode-rangepre|$db as xs:string, $min as xs:string, $max nodes as node()*|xs:string|text()integer*}}
|-
| '''Summary'''
|Returns all text nodes the ''pre'' values of the database specified nodes supplied by the database {{Code|$dbnodes}} that , which must all be [[#Database Nodes|database nodes]]. <br/>The ''pre'' value provides access to a database node in constant time, but it is ''transient'', i.e., it may change when database updates are located in between the performed.|-| '''Errors'''|{{CodeError|BXDB0001|$min#Errors}} and {{Code|$maxnodes}} strings. If available, the value index contains a node which is used to speed up evaluationnot stored in a database.
|-
| '''Examples'''
|
* {{Code|db:textnode-rangepre(doc("DB", "2000", "2001input"))}} returns all text nodes of the database {{Code|DB0}} that are found in between {{Code|2000}} and if the database {{Code|2001input}}contains a single document.
|}
==db:attributename== {{Mark|Added with Version 7.7}}: 
{| width='100%'
|-
| width='90' | '''Signatures'''
|{{Func|db:attributename|$db node as xs:string, $string as itemnode()|attribute()*}}<br/>{{Func|db:attribute|$db as xs:string, $string as item(), $attname as xs:string|attribute()*}}
|-
| '''Summary'''
|Returns all attribute nodes the name of the database in which the specified by the [[#Database Nodes|database node]] {{Code|$db}} that have {{Code|$string}} as string value. If available, the value index is used to speed up evaluation.<br />If {{Code|$attnamenode}} is specified, the resulting attribute nodes are filtered by their attribute namestored.
|-
| '''ExamplesErrors'''|* {{CodeError|BXDB0001|db:attribute("DB", "QUERY", "id")/..#Errors}} returns the parents of all {{Code|id$nodes}} attribute nodes of the contains a node which is not stored in a database {{Code|DB}} that have {{Code|QUERY}} as string value.
|}
==db:attribute-rangepath== {{Mark|Added with Version 7.7}}: 
{| width='100%'
|-
| width='90' | '''Signatures'''
|{{Func|db:attribute-rangepath|$db node as xs:string, $min as xs:string, $max as xs:string|attributenode()*}}<br/>{{Func|db:attribute-range|$db as xs:string, $min as xs:string, $max as xs:string, $attname as xs:string|attribute()*}}
|-
| '''Summary'''
|Returns all attributes the path of the database document in which the specified by the [[#Database Nodes|database node]] {{Code|$dbnode}}, the string values of which are larger than or equal to {{Code|$min}} and smaller than or equal to {{Code|$max}}. If available, the value index is used to speed up evaluationstored.
|-
| '''ExamplesErrors'''|* {{CodeError|db:attribute-range("DB", "id456", "id473", 'id')}} returns all {{CodeBXDB0001|@id#Errors}} attributes of the database {{Code|DB$nodes}} that have contains a string value node which is not stored in between {{Code|id456}} and {{Code|id473}}a database.
|}
=Contents= ==db:fulltexttext==
{| width='100%'
|-
| width='90' | '''Signatures'''
|{{Func|db:fulltexttext|$db as xs:string, $terms string as xs:stringitem()|text()*}}
|-
| '''Summary'''
|Returns all text nodes from the full-text index of the database specified by the database {{Code|$db}} that contain the text specified as have {{Code|$termsstring}}as their string value.<br/>The options used for building the full-text will also be applied to the search terms. As an exampleIf available, if the index terms have been stemmed, the search string will be stemmed as well.|-| '''Errors'''|{{Error|BXDB0004|#Errors}} the full-text value index is not availableused to speed up evaluation.
|-
| '''Examples'''
|
* {{Code|db:fulltexttext("DB", "QUERY")/..}} returns the parents of all text nodes of the database {{Code|DB}} that contain match the string {{Code|QUERY}}.
|}
==db:retrievetext-range== 
{| width='100%'
|-
| width='90' | '''Signatures'''
|{{Func|db:retrievetext-range|$db as xs:string, $path min as xs:string|, $max as xs:base64Binarystring|text()*}}
|-
| '''Summary'''
|Returns a binary all text nodes of the database resource addressed specified by the database {{Code|$db}} and that are located in between the {{Code|$pathmin}} as [[Streaming Module|streamable]] and {{Code|xs:base64Binary$max}}strings.|-| '''Errors'''|{{Error|BXDB0003|#Errors}} If available, the database is not ''persistent'' (stored on disk).<br/>{{Error|FODC0002|XQuery Errors#Functions Errors}} the addressed resource cannot be retrieved.<br/>{{Error|FODC0007|XQuery Errors#Functions Errors}} the specified path value index is invalidused to speed up evaluation.
|-
| '''Examples'''
|
* {{Code|declare option output:method 'raw';<br/>db:retrievetext-range("DB", "music/01.mp3")}} returns the specified audio file as raw data.* <code><nowiki>stream:materialize(db:retrieve("DB2000", "music/01.mp32001"))</nowiki></code> }} returns a materialized representation all text nodes of the streamable resultdatabase {{Code|DB}} that are found in between {{Code|2000}} and {{Code|2001}}.
|}
==db:node-idattribute==
{| width='100%'
|-
| width='90' | '''Signatures'''
|{{Func|db:node-idattribute|$nodes db as nodexs:string, $string as item()|attribute()*}}<br/>{{Func|db:attribute|$db as xs:integerstring, $string as item(), $attname as xs:string|attribute()*}}
|-
| '''Summary'''
|Returns the ''id'' values all attribute nodes of the nodes supplied database specified by the database {{Code|$db}} that have {{Code|$nodesstring}}as string value. If available, which must all be [[#Database Nodes|database nodes]]the value index is used to speed up evaluation.<br/>Each database node has a persistent ''id'', which remains valid after update operations. If so far no updates have been performed{{Code|$attname}} is specified, the ''pre'' value is equal to the ''id'' value and can be requested instead, which provides access to database resulting attribute nodes in constant timeare filtered by their attribute name.
|-
| '''ErrorsExamples'''|* {{ErrorCode|BXDB0001db:attribute("DB", "QUERY", "id")/..}} returns the parents of all {{Code|#Errorsid}} attribute nodes of the database {{Code|$nodesDB}} that have {{Code|QUERY}} contains a node which is not stored in a databaseas string value.
|}
==db:nodeattribute-prerange==
{| width='100%'
|-
| width='90' | '''Signatures'''
|{{Func|db:nodeattribute-prerange|$nodes db as nodexs:string, $min as xs:string, $max as xs:string|attribute()*}}<br/>{{Func|db:attribute-range|$db as xs:integerstring, $min as xs:string, $max as xs:string, $attname as xs:string|attribute()*}}
|-
| '''Summary'''
|Returns the ''pre'' values all attributes of the nodes supplied database specified by the database {{Code|$nodesdb}}, the string values of which must all be [[#Database Nodes|database nodes]]. <br/>The ''pre'' value provides access are larger than or equal to a database node in constant time, but it is ''transient'', i.e., it may change when database updates are performed.|-| '''Errors'''|{{ErrorCode|BXDB0001|#Errors$min}} and smaller than or equal to {{Code|$nodesmax}} contains a node which . If available, the value index is not stored in a databaseused to speed up evaluation.
|-
| '''Examples'''
|
* {{Code|db:nodeattribute-pre(docrange("inputDB", "id456", "id473"), 'id')}} returns all {{Code|0@id}} if attributes of the database {{Code|inputDB}} contains that have a single documentstring value in between {{Code|id456}} and {{Code|id473}}.
|}
==db:namefulltext== {{Mark|Added with Version 7.7}}: 
{| width='100%'
|-
| width='90' | '''Signatures'''
|{{Func|db:namefulltext|$node db as xs:string, $terms as node()|xs:string|text()*}}
|-
| '''Summary'''
|Returns all text nodes from the name full-text index of the database in which specified by the database {{Code|$db}} that contain the text specified [[#Database Nodes|database node]] as {{Code|$nodeterms}} is stored.<br/>The options used for building the full-text will also be applied to the search terms. As an example, if the index terms have been stemmed, the search string will be stemmed as well.
|-
| '''Errors'''
|{{Error|BXDB0001BXDB0004|#Errors}} {{Code|$nodes}} contains a node which the full-text index is not stored in a database.|} ==db:path== {{Mark|Added with Version 7available.7}}: {| width='100%'
|-
| width='90' | '''SignaturesExamples'''|* {{FuncCode|db:path|$node as nodefulltext("DB", "QUERY")|xs:string}}|-| '''Summary'''|Returns the path returns all text nodes of the database document in which the specified [[#Database Nodes|database node]] {{Code|$node}} is stored.|-| '''Errors'''|{{Error|BXDB0001|#ErrorsDB}} that contain the string {{Code|$nodesQUERY}} contains a node which is not stored in a database.
|}
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu