Loading TOC...

MarkLogic 9 Product Documentation
temporal functions (Temporal)

This module contains the functions used to insert, delete and manage temporal documents.

To understand the temporal functions, you need to understand the meaning of the following terms:

  • Instant: an instant of time, such as "now", "12/31/2012, 01:00:00 am".
  • Period: an anchored duration of time (e.g. December 01, 1999 through December 31, 2000, the fall semester)
  • Axis: a named pair of range indexes that is the container for periods.
  • Valid time: when a fact was true in modeled reality.
  • System time: when a fact was stored in the database.
  • User-defined time: a time value that user provides in replacement of system start time.
  • LSQT (Last Stable Query Time): a document with a system start time before this point can be queried and a document with a system start time after this point can be updated and ingested.

The Tiered Storage function module is installed as the following file:

  • install_dir/Modules/MarkLogic/temporal.xqy

where install_dir is the directory in which MarkLogic Server is installed.

To use the temporal.xqy module in your own XQuery modules, include the following line in your XQuery prolog:

import module namespace temporal="http://marklogic.com/xdmp/temporal" 
          at "/MarkLogic/temporal.xqy";
32 functions
Function name Description
temporal.advanceLsqt This function enables Last Stable Query Time (LSQT) on the named collection and advances the LSQT for the collection to the maximum system start time.
temporal.axes This function returns all the axis names defined in the schema databases.
temporal.axisCreate This function constructs an axis definition based on the existing range indexes that can be added to a temporal collection in subsequent API calls.
temporal.axisGetEnd This function returns the range index used to define the end of the period by the named axis.
temporal.axisGetStart This function returns the range index used to define the start of the period by the named axis.
temporal.axisRemove This function removes an axis definition from the schema database.
temporal.collectionCreate This function constructs a named and protected temporal collection in the schema database with the specified system and optional valid axes.
temporal.collectionGetAxis This function returns the name of either the system or valid axis in the named temporal collection.
temporal.collectionGetOptions This function returns the options set on the temporal collection.
temporal.collectionRemove This function removes the named temporal collection from the Schemas database.
temporal.collections This function returns all of the temporal collection names in the schema database.
temporal.collectionSetOptions This function sets the options on the temporal collection.
temporal.documentDelete This function deletes the temporal document identified by the given URI.
temporal.documentInsert This function inserts a document into the database and stores it as a temporal document.
temporal.documentLoad This function inserts a document into the database and stores it as a temporal document.
temporal.documentProtect Protects a temporal document from certain temporal operations, such as update, delete or wipe for a specific period of time.
temporal.documentWipe Deletes all versions of a temporal document.
temporal.getLsqt This function returns the Last Stable Query Time (LSQT) for the collection at current moment.
temporal.getLsqtAutomation This function returns whether Last Stable Query Time (LSQT) management is automatically managed (true) or not automatically managed (false).
temporal.getLsqtAutomationLag When the LSQT is advanced automatically, this function returns how far behind (in milliseconds) the Last Stable Query Time (LSQT) is from latest system time.
temporal.getLsqtAutomationPeriod This function returns how often Last Stable Query Time (LSQT) is automatically advanced, in milliseconds.
temporal.getUseLsqt This function specifies whether the named temporal collection has LSQT (Last Stable Query Time) enabled (true) or disabled (false).
temporal.nodeDelete Deletes a node from the database.
temporal.nodeInsertAfter Adds an immediately following sibling to a node in a temporal document.
temporal.nodeInsertBefore Adds an immediately preceding sibling to a node in a temporal document.
temporal.nodeInsertChild Adds a new last child to a node in a temporal document.
temporal.nodeReplace Replaces a node in a temporal document.
temporal.setLsqtAutomation This function sets whether Last Stable Query Time (LSQT) management is automatic.
temporal.setUseLsqt This function enables or disables the use of LSQT (Last Stable Query Time) on the named collection.
temporal.statementGetSystemTime This function gets the system start time on temporal documents that are inserted or deleted in the same statement as this function.
temporal.statementSetDocumentVersionUri This function sets document URI for a temporal document to be used for the new version of temporal document to be generated in the current statement.
temporal.statementSetSystemTime This function sets the system start time on temporal documents that are inserted or deleted in the same statement as this function.