Initial commit with Till's changes
diff --git a/aql/allens.html b/aql/allens.html
new file mode 100644
index 0000000..5cc7e1e
--- /dev/null
+++ b/aql/allens.html
@@ -0,0 +1,615 @@
+<!DOCTYPE html>
+<!--
+ | Generated by Apache Maven Doxia at 2015-05-29
+ | Rendered using Apache Maven Fluido Skin 1.3.0
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <meta name="Date-Revision-yyyymmdd" content="20150529" />
+    <meta http-equiv="Content-Language" content="en" />
+    <title>AsterixDB - </title>
+    <link rel="stylesheet" href="../css/apache-maven-fluido-1.3.0.min.css" />
+    <link rel="stylesheet" href="../css/site.css" />
+    <link rel="stylesheet" href="../css/print.css" media="print" />
+
+      
+    <script type="text/javascript" src="../js/apache-maven-fluido-1.3.0.min.js"></script>
+
+    
+            </head>
+        <body class="topBarDisabled">
+          
+                
+                    
+    
+        <div class="container-fluid">
+          <div id="banner">
+        <div class="pull-left">
+                                                  <a href=".././" id="bannerLeft">
+                                                                                                <img src="../images/asterixlogo.png"  alt="AsterixDB"/>
+                </a>
+                      </div>
+        <div class="pull-right">                  <a href="http://incubator.apache.org/" id="bannerRight">
+                                                                                                <img src="../images/egg-logo.png"  alt="Apache Software Foundation Incubator"/>
+                </a>
+      </div>
+        <div class="clear"><hr/></div>
+      </div>
+
+      <div id="breadcrumbs">
+        <ul class="breadcrumb">
+                
+                    
+                  <li id="publishDate">Last Published: 2015-05-29</li>
+                      
+                
+                    
+                 <li id="projectVersion" class="pull-right">Version: 0.8.7-SNAPSHOT</li>
+      
+                                            <li class="divider pull-right">|</li>
+                        
+    <li class="pull-right">              <a href="../index.html" title="Home">
+        Home</a>
+  </li>
+
+                        </ul>
+      </div>
+
+            
+      <div class="row-fluid">
+        <div id="leftColumn" class="span3">
+          <div class="well sidebar-nav">
+                
+                    
+                <ul class="nav nav-list">
+                    <li class="nav-header">Apache Software Foundation</li>
+                                
+      <li>
+    
+                          <a href="http://www.apache.org/" class="externalLink" title="Home">
+          <i class="none"></i>
+        Home</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="http://www.apache.org/foundation/sponsorship.html" class="externalLink" title="Donate">
+          <i class="none"></i>
+        Donate</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="http://www.apache.org/foundation/thanks.html" class="externalLink" title="Thanks">
+          <i class="none"></i>
+        Thanks</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="http://www.apache.org/security/" class="externalLink" title="Security">
+          <i class="none"></i>
+        Security</a>
+            </li>
+                              <li class="nav-header">User Documentation</li>
+                                
+      <li>
+    
+                          <a href="../install.html" title="Installing and Managing AsterixDB using Managix">
+          <i class="none"></i>
+        Installing and Managing AsterixDB using Managix</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="../aql/primer.html" title="AsterixDB 101: An ADM and AQL Primer">
+          <i class="none"></i>
+        AsterixDB 101: An ADM and AQL Primer</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="../aql/primer-sql-like.html" title="AsterixDB 101: An ADM and AQL Primer (For SQL Fans)">
+          <i class="none"></i>
+        AsterixDB 101: An ADM and AQL Primer (For SQL Fans)</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="../aql/js-sdk.html" title="AsterixDB Javascript SDK">
+          <i class="none"></i>
+        AsterixDB Javascript SDK</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="../aql/datamodel.html" title="Asterix Data Model (ADM)">
+          <i class="none"></i>
+        Asterix Data Model (ADM)</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="../aql/manual.html" title="Asterix Query Language (AQL)">
+          <i class="none"></i>
+        Asterix Query Language (AQL)</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="../aql/functions.html" title="AQL Functions">
+          <i class="none"></i>
+        AQL Functions</a>
+            </li>
+                  
+      <li class="active">
+    
+            <a href="#"><i class="none"></i>AQL Allen's Relations Functions</a>
+          </li>
+                  
+      <li>
+    
+                          <a href="../aql/similarity.html" title="AQL Support of Similarity Queries">
+          <i class="none"></i>
+        AQL Support of Similarity Queries</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="../aql/externaldata.html" title="Accessing External Data">
+          <i class="none"></i>
+        Accessing External Data</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="../aql/filters.html" title="Filter-Based LSM Index Acceleration">
+          <i class="none"></i>
+        Filter-Based LSM Index Acceleration</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="../api.html" title="REST API to AsterixDB">
+          <i class="none"></i>
+        REST API to AsterixDB</a>
+            </li>
+            </ul>
+                
+                    
+                
+          <hr class="divider" />
+
+           <div id="poweredBy">
+                            <div class="clear"></div>
+                            <div class="clear"></div>
+                            <div class="clear"></div>
+                                                                                                                         <a href=".././" title="Hyracks" class="builtBy">
+        <img class="builtBy"  alt="Hyracks" src="../images/hyrax_ts.png"    />
+      </a>
+                      </div>
+          </div>
+        </div>
+        
+                
+        <div id="bodyColumn"  class="span9" >
+                                  
+            <h1>AsterixDB Temporal Functions: Allen&#x2019;s Relations</h1>
+<div class="section">
+<h2><a name="toc" id="toc">Table of Contents</a><a name="Table_of_Contents"></a></h2>
+
+<ul>
+  
+<li><a href="#AboutAllensRelations">About Allen&#x2019;s Relations</a></li>
+  
+<li><a href="#AllensRelatonsFunctions">Allen&#x2019;s Relations Functions</a></li>
+</ul></div>
+<div class="section">
+<h2><a name="AboutAllensRelations" id="AboutAllensRelations">About Allen&#x2019;s Relations</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="About_Allens_Relations_Back_to_TOC"></a></h2>
+<p>AsterixDB supports Allen&#x2019;s relations over interval types. Allen&#x2019;s relations are also called Allen&#x2019;s interval algebra. There are totally 13 base relations described by this algebra, and all of them are supported in AsterixDB (note that <tt>interval-equals</tt> is supported by the <tt>=</tt> comparison symbol so there is no extra function for it). </p>
+<p>A detailed description of Allen&#x2019;s relations can be found from its <a class="externalLink" href="http://en.wikipedia.org/wiki/Allen&apos;s_interval_algebra">wikipedia entry</a>. </p></div>
+<div class="section">
+<h2><a name="AllensRelatonsFunctions" id="AllensRelatonsFunctions">Allen&#x2019;s Relations Functions</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Allens_Relations_Functions_Back_to_TOC"></a></h2>
+<div class="section">
+<h3>interval-before, interval-after<a name="interval-before_interval-after"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>interval-before(interval1, interval2)
+interval-after(interval1, interval2)
+</pre></div></li>
+  
+<li>
+<p>These two functions check whether an interval happens before/after another interval. </p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>interval1</tt>, <tt>interval2</tt>: two intervals to be compared</li>
+  </ul></li>
+  
+<li>
+<p>Return Value:</p>
+<p>A <tt>boolean</tt> value. Specifically, <tt>interval-before(interval1, interval2)</tt> is true if and only if <tt>interval1.end &lt; interval2.start</tt>, and <tt>interval-after(interval1, interval2)</tt> is true if and only if <tt>interval1.start &gt; interval2.end</tt>. If any of the two inputs is <tt>null</tt>, <tt>null</tt> is returned.</p></li>
+  
+<li>
+<p>Examples:</p>
+  
+<div class="source">
+<pre>let $itv1 := interval-from-date(&quot;2000-01-01&quot;, &quot;2005-01-01&quot;)
+let $itv2 := interval-from-date(&quot;2005-05-01&quot;, &quot;2012-09-09&quot;)
+return {&quot;interval-before&quot;: interval-before($itv1, $itv2), &quot;interval-after&quot;: interval-after($itv2, $itv1)}
+</pre></div></li>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;interval-before&quot;: true, &quot;interval-after&quot;: true }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>interval-covers, interval-covered-by<a name="interval-covers_interval-covered-by"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>interval-covers(interval1, interval2)
+interval-covered-by(interval1, interval2)
+</pre></div></li>
+  
+<li>
+<p>These two functions check whether one interval covers the other interval.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>interval1</tt>, <tt>interval2</tt>: two intervals to be compared</li>
+  </ul></li>
+  
+<li>
+<p>Return Value:</p>
+<p>A <tt>boolean</tt> value. Specifically, <tt>interval-covers(interval1, interval2)</tt> is true if and only if</p>
+  
+<div class="source">
+<pre>interval1.start &lt;= interval2.start
+AND interval1.end &gt;= interval2.end
+</pre></div>
+<p><tt>interval-covered-by(interval1, interval2)</tt> is true if and only if</p>
+  
+<div class="source">
+<pre>interval2.start &lt;= interval1.start
+AND interval2.end &gt;= interval1.end
+</pre></div>
+<p>For both functions, if any of the two inputs is <tt>null</tt>, <tt>null</tt> is returned.</p></li>
+  
+<li>
+<p>Examples:</p>
+  
+<div class="source">
+<pre>let $itv1 := interval-from-date(&quot;2000-01-01&quot;, &quot;2005-01-01&quot;)
+let $itv2 := interval-from-date(&quot;2000-03-01&quot;, &quot;2004-09-09&quot;)
+let $itv3 := interval-from-date(&quot;2006-08-01&quot;, &quot;2007-03-01&quot;)
+let $itv4 := interval-from-date(&quot;2004-09-10&quot;, &quot;2012-08-01&quot;)
+return {&quot;interval-covers&quot;: interval-covers($itv1, $itv2), &quot;interval-covered-by&quot;: interval-covered-by($itv3, $itv4)}
+</pre></div></li>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;interval-covers&quot;: true, &quot;interval-covered-by&quot;: true }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>interval-overlaps, interval-overlapped-by<a name="interval-overlaps_interval-overlapped-by"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>interval-overlaps(interval1, interval2)
+interval-overlapped-by(interval1, interval2)
+</pre></div></li>
+  
+<li>
+<p>These functions check whether two intervals overlap with each other.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>interval1</tt>, <tt>interval2</tt>: two intervals to be compared</li>
+  </ul></li>
+  
+<li>
+<p>Return Value:</p>
+<p>A <tt>boolean</tt> value. Specifically, <tt>interval-overlaps(interval1, interval2)</tt> is true if and only if</p>
+  
+<div class="source">
+<pre>interval1.start &lt; interval2.start
+AND interval2.end &gt; interval1.end
+AND interval1.end &gt; interval2.start
+</pre></div>
+<p><tt>interval-overlapped-by(interval1, interval2)</tt> is true if and only if</p>
+  
+<div class="source">
+<pre>interval2.start &lt; interval1.start
+AND interval1.end &gt; interval2.end
+AND interval2.end &gt; interval1.start
+</pre></div>
+<p>For all these functions, if any of the two inputs is <tt>null</tt>, <tt>null</tt> is returned.</p>
+<p>Note that <tt>interval-overlaps</tt> and <tt>interval-overlapped-by</tt> are following the Allen&#x2019;s relations on the definition of overlap.</p></li>
+  
+<li>
+<p>Examples:</p>
+  
+<div class="source">
+<pre>let $itv1 := interval-from-date(&quot;2000-01-01&quot;, &quot;2005-01-01&quot;)
+let $itv2 := interval-from-date(&quot;2004-05-01&quot;, &quot;2012-09-09&quot;)
+let $itv3 := interval-from-date(&quot;2006-08-01&quot;, &quot;2007-03-01&quot;)
+let $itv4 := interval-from-date(&quot;2004-09-10&quot;, &quot;2006-12-31&quot;)
+return {&quot;overlaps&quot;: interval-overlaps($itv1, $itv2), 
+        &quot;overlapped-by&quot;: interval-overlapped-by($itv3, $itv4)}
+</pre></div></li>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;overlaps&quot;: true, &quot;overlapped-by&quot;: true }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>interval-overlapping<a name="interval-overlapping"></a></h3>
+<p>Note that <tt>interval-overlapping</tt> is not an Allen&#x2019;s Relation, but syntactic sugar we added for the case that the intersect of two intervals is not empty. Basically this function returns true if any of these functions return true: <tt>interval-overlaps</tt>, <tt>interval-overlapped-by</tt>, <tt>interval-covers</tt>, or <tt>interval-covered-by</tt>.</p>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>interval-overlapping(interval1, interval2)
+</pre></div></li>
+  
+<li>
+<p>This functions check whether two intervals share any points with each other. </p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>interval1</tt>, <tt>interval2</tt>: two intervals to be compared</li>
+  </ul></li>
+  
+<li>
+<p>Return Value:</p>
+<p>A <tt>boolean</tt> value. Specifically, <tt>interval-overlapping(interval1, interval2)</tt> is true if</p>
+  
+<div class="source">
+<pre>(interval2.start &gt;= interval1.start
+AND interval2.start &lt; interval1.end)
+OR
+(interval2.end &gt; interval1.start
+AND interval2.end &lt;= interval1.end)
+</pre></div>
+<p>If any of the two inputs is <tt>null</tt>, <tt>null</tt> is returned.</p></li>
+  
+<li>
+<p>Examples:</p>
+  
+<div class="source">
+<pre>let $itv1 := interval-from-date(&quot;2000-01-01&quot;, &quot;2005-01-01&quot;)
+let $itv2 := interval-from-date(&quot;2004-05-01&quot;, &quot;2012-09-09&quot;)
+let $itv3 := interval-from-date(&quot;2006-08-01&quot;, &quot;2007-03-01&quot;)
+let $itv4 := interval-from-date(&quot;2004-09-10&quot;, &quot;2006-12-31&quot;)
+return {&quot;overlapping1&quot;: interval-overlapping($itv1, $itv2), 
+        &quot;overlapping2&quot;: interval-overlapping($itv3, $itv4)}
+</pre></div></li>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;overlapping1&quot;: true, &quot;overlapping2&quot;: true }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>interval-meets, interval-met-by<a name="interval-meets_interval-met-by"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>interval-meets(interval1, interval2)
+interval-met-by(interval1, interval2)
+</pre></div></li>
+  
+<li>
+<p>These two functions check whether an interval meets with another interval. </p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>interval1</tt>, <tt>interval2</tt>: two intervals to be compared</li>
+  </ul></li>
+  
+<li>
+<p>Return Value:</p>
+<p>A <tt>boolean</tt> value. Specifically, <tt>interval-meets(interval1, interval2)</tt> is true if and only if <tt>interval1.end = interval2.start</tt>, and <tt>interval-met-by(interval1, interval2)</tt> is true if and only if <tt>interval1.start = interval2.end</tt>. If any of the two inputs is <tt>null</tt>, <tt>null</tt> is returned.</p></li>
+  
+<li>
+<p>Examples:</p>
+  
+<div class="source">
+<pre>let $itv1 := interval-from-date(&quot;2000-01-01&quot;, &quot;2005-01-01&quot;)
+let $itv2 := interval-from-date(&quot;2005-01-01&quot;, &quot;2012-09-09&quot;)
+let $itv3 := interval-from-date(&quot;2006-08-01&quot;, &quot;2007-03-01&quot;)
+let $itv4 := interval-from-date(&quot;2004-09-10&quot;, &quot;2006-08-01&quot;)
+return {&quot;meets&quot;: interval-meets($itv1, $itv2), &quot;metby&quot;: interval-met-by($itv3, $itv4)}
+</pre></div></li>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;meets&quot;: true, &quot;metby&quot;: true }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>interval-starts, interval-started-by<a name="interval-starts_interval-started-by"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>interval-starts(interval1, interval2)
+interval-started-by(interval1, interval2)
+</pre></div></li>
+  
+<li>
+<p>These two functions check whether one interval starts with the other interval.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>interval1</tt>, <tt>interval2</tt>: two intervals to be compared</li>
+  </ul></li>
+  
+<li>
+<p>Return Value:</p>
+<p>A <tt>boolean</tt> value. Specifically, <tt>interval-starts(interval1, interval2)</tt> returns true if and only if</p>
+  
+<div class="source">
+<pre>interval1.start = interval2.start
+AND interval1.end &lt;= interval2.end
+</pre></div>
+<p><tt>interval-started-by(interval1, interval2)</tt> returns true if and only if</p>
+  
+<div class="source">
+<pre>interval1.start = interval2.start
+AND interval2.end &lt;= interval1.end
+</pre></div>
+<p>For both functions, if any of the two inputs is <tt>null</tt>, <tt>null</tt> is returned.</p></li>
+  
+<li>
+<p>Examples:</p>
+  
+<div class="source">
+<pre>let $itv1 := interval-from-date(&quot;2000-01-01&quot;, &quot;2005-01-01&quot;)
+let $itv2 := interval-from-date(&quot;2000-01-01&quot;, &quot;2012-09-09&quot;)
+let $itv3 := interval-from-date(&quot;2006-08-01&quot;, &quot;2007-03-01&quot;)
+let $itv4 := interval-from-date(&quot;2006-08-01&quot;, &quot;2006-08-01&quot;)
+return {&quot;interval-starts&quot;: interval-starts($itv1, $itv2), &quot;interval-started-by&quot;: interval-started-by($itv3, $itv4)}
+</pre></div></li>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;interval-starts&quot;: true, &quot;interval-started-by&quot;: true }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>interval-ends, interval-ended-by<a name="interval-ends_interval-ended-by"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>interval-ends(interval1, interval2)
+interval-ended-by(interval1, interval2)
+</pre></div></li>
+  
+<li>
+<p>These two functions check whether one interval ends with the other interval.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>interval1</tt>, <tt>interval2</tt>: two intervals to be compared</li>
+  </ul></li>
+  
+<li>
+<p>Return Value:</p>
+<p>A <tt>boolean</tt> value. Specifically, <tt>interval-ends(interval1, interval2)</tt> returns true if and only if</p>
+  
+<div class="source">
+<pre>interval1.end = interval2.end
+AND interval1.start &gt;= interval2.start
+</pre></div>
+<p><tt>interval-ended-by(interval1, interval2)</tt> returns true if and only if</p>
+  
+<div class="source">
+<pre>interval2.end = interval1.end
+AND interval2.start &gt;= interval1.start
+</pre></div>
+<p>For both functions, if any of the two inputs is <tt>null</tt>, <tt>null</tt> is returned.</p></li>
+  
+<li>
+<p>Examples:</p>
+  
+<div class="source">
+<pre>let $itv1 := interval-from-date(&quot;2000-01-01&quot;, &quot;2005-01-01&quot;)
+let $itv2 := interval-from-date(&quot;1998-01-01&quot;, &quot;2005-01-01&quot;)
+let $itv3 := interval-from-date(&quot;2006-08-01&quot;, &quot;2007-03-01&quot;)
+let $itv4 := interval-from-date(&quot;2006-09-10&quot;, &quot;2007-03-01&quot;)
+return {&quot;interval-ends&quot;: interval-ends($itv1, $itv2), &quot;interval-ended-by&quot;: interval-ended-by($itv3, $itv4) }
+</pre></div></li>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;interval-ends&quot;: true, &quot;interval-ended-by&quot;: true }
+</pre></div></li>
+</ul></div></div>
+                  </div>
+            </div>
+          </div>
+
+    <hr/>
+
+    <footer>
+            <div class="container-fluid">
+              <div class="row span12">Copyright &copy;                   2015.
+          All Rights Reserved.      
+                    
+      </div>
+
+                                                                  <?xml version="1.0" encoding="UTF-8"?>
+<div class="row-fluid">Apache AsterixDB, AsterixDB, Apache, the Apache
+        feather logo, and the Apache AsterixDB project logo are either
+        registered trademarks or trademarks of The Apache Software
+        Foundation in the United States and other countries.
+        All other marks mentioned may be trademarks or registered
+        trademarks of their respective owners.</div>
+                  
+        
+                </div>
+    </footer>
+  </body>
+</html>