<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/cts.periodCompareQuery.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>cts.periodCompareQuery</api:function-name><api:suggest>cts.periodcomparequery</api:suggest><api:suggest>cts</api:suggest><api:suggest>periodcomparequery</api:suggest><api:function-link mode="xquery" fullname="cts:period-compare-query">/apidoc/8.0/cts:period-compare-query.xml</api:function-link><api:function mode="javascript" name="periodCompareQuery" type="builtin" lib="cts" category="SearchBuiltins" subcategory="cts:query Constructors" hidden="false" bucket="MarkLogic Built-In Functions" prefix="cts" namespace="http://marklogic.com/cts" fullname="cts.periodCompareQuery"><api:summary>
  Returns a <code xmlns="http://www.w3.org/1999/xhtml">cts:query</code> matching documents that have relevant
  pair of period values.  Searches with the 
  <code xmlns="http://www.w3.org/1999/xhtml">cts:period-compare-query</code>
  constructor require two valid names of period, if the either of the specified
  period does not exist, then an exception is thrown.
</api:summary><api:params><api:param name="axis-1" type="xs:string"><api:param-description>
    Name of the first axis to compare
  </api:param-description><api:param-name>axis-1</api:param-name><api:param-type>String</api:param-type></api:param><api:param name="operator" type="xs:string"><api:param-description>
    A comparison operator. Period is the two timestamps contained in the axis.
    <p xmlns="http://www.w3.org/1999/xhtml">
      Operators include:</p>
      <blockquote xmlns="http://www.w3.org/1999/xhtml"><dl>
        <dt>"aln_equals"</dt>
        <dd>Match documents whose period1 equals period2.</dd>
        <dt>"aln_contains"</dt>
        <dd>Match documents whose period1 contains period2. i.e. period1 
	starts before period2 starts and ends before period2 ends.</dd>
        <dt>"aln_contained_by"</dt>
        <dd>Match documents whose period1 is contained by period2.</dd>
        <dt>"aln_meets"</dt>
        <dd>Match documents whose period1 meets period2, i.e. period1 ends at 
	period2 start.</dd>
        <dt>"aln_met_by"</dt>
        <dd>Match documents whose period1 meets period2, i.e. period1 starts 
	at period2 end.</dd>
        <dt>"aln_before"</dt>
        <dd>Match documents whose period1 is before period2, i.e. period1 ends 
	before period2 starts.</dd>
        <dt>"aln_after"</dt>
        <dd>Match documents whose period1 is after period2, i.e. period1 
	starts after period2 ends.</dd>
        <dt>"aln_starts"</dt>
        <dd>Match documents whose period1 starts period2, i.e. period1 starts 
	at period2 start and ends before period2 ends.</dd>
        <dt>"aln_started_by"</dt>
        <dd>Match documents whose period2 starts period1, i.e. period1 starts 
	at period2 start and ends after period2 ends.</dd>
        <dt>"aln_finishes"</dt>
        <dd>Match documents whose period1 finishes period2, i.e. period1 
	finishes at period2 finish and starts after period2 starts.</dd>
        <dt>"aln_finished_by"</dt>
        <dd>Match documents whose period2 finishes period1, i.e. period1 
	finishes at period2 finish and starts before period2 starts.</dd>
        <dt>"aln_overlaps"</dt>
        <dd>Match documents whose period1 overlaps period2, i.e. period1 
	starts before period2 start and ends before period2 ends but after 
	period2 starts.</dd>
        <dt>"aln_overlapped_by"</dt>
        <dd>Match documents whose period2 overlaps period1, i.e. period1 
	starts after period2 start but before period2 ends annd ends after 
	period2 ends.</dd>
        <dt>"iso_contains"</dt>
        <dd>Match documents whose period1 contains period2 in sql 2011 standard.
        i.e. period1 starts before or at period2 starts and ends before or 
	at period2 ends.</dd>
        <dt>"iso_overlaps"</dt>
        <dd>Match documents whose period1 overlaps period2 in sql 2011 standard.
        i.e. period1 and period2 have common time period.</dd>
        <dt>"iso_succeeds"</dt>
        <dd>Match documents whose period1 succeeds period2 in sql 2011 standard.
        i.e. period1 starts at or after period2 ends</dd>
        <dt>"iso_precedes"</dt>
        <dd>Match documents whose period1 precedes period2 in sql 2011 standard.
        i.e. period1 ends at or before period2 ends</dd>
        <dt>"iso_succeeds"</dt>
        <dd>Match documents whose period1 succeeds period2 in sql 2011 standard.
        i.e. period1 starts at or after period2 ends</dd>
        <dt>"iso_precedes"</dt>
        <dd>Match documents whose period1 precedes period2 in sql 2011 standard.
        i.e. period1 ends at or before period2 ends</dd>
        <dt>"iso_imm_succeeds"</dt>
        <dd>Match documents whose period1 immediately succeeds period2 in 
	sql 2011 standard.  i.e. period1 starts at period2 ends</dd>
        <dt>"iso_imm_precedes"</dt>
        <dd>Match documents whose period1 immediately precedes period2 in 
	sql 2011 standard.  i.e. period1 ends at period2 ends</dd>
      </dl></blockquote>
  </api:param-description><api:param-name>operator</api:param-name><api:param-type>String</api:param-type></api:param><api:param name="axis-2" type="xs:string"><api:param-description>
    Name of the second period to compare
  </api:param-description><api:param-name>axis-2</api:param-name><api:param-type>String</api:param-type></api:param><api:param name="options" type="xs:string*" optional="true"><api:param-description>
    Options to this query.  The default is ().
    <p xmlns="http://www.w3.org/1999/xhtml">
      Options include:</p>
      <blockquote xmlns="http://www.w3.org/1999/xhtml"><dl>
        <dt>"cached"</dt>
        <dd>Cache the results of this query in the list cache.</dd>
        <dt>"uncached"</dt>
        <dd>Do not cache the results of this query in the list cache.</dd>
      </dl></blockquote>
  </api:param-description><api:param-name>options</api:param-name><api:param-type>String[]</api:param-type></api:param></api:params><api:return>cts.periodCompareQuery</api:return><api:usage>
  <p xmlns="http://www.w3.org/1999/xhtml">If you want to constrain on a range of period comparisons, you can combine multiple
  <code>cts:</code> constructors together
  with <code>cts:and-query</code> or any of the other composable
  <code>cts:query</code> constructors, as in the last part of the example
  below.</p>
  <p xmlns="http://www.w3.org/1999/xhtml">If neither "cached" nor "uncached" is present, it specifies "cached".</p>
  <p xmlns="http://www.w3.org/1999/xhtml">
    Negative "min-occurs" or "max-occurs" values will be treated as 0 and
    non-integral values will be rounded down.  An error will be raised if
    the "min-occurs" value is greater than the "max-occurs" value.
  </p>
</api:usage><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
cts.periodCompareQuery("system","aln_overlaps","valid",
    "cached", xs.double("3.13"));

</pre></api:example></api:function></api:function-page>