You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by im...@apache.org on 2015/05/30 03:47:28 UTC
[13/13] incubator-asterixdb-site git commit: Initial commit with
Till's changes
Initial commit with Till's changes
Project: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/commit/ed124d8f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/tree/ed124d8f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/diff/ed124d8f
Branch: refs/heads/asf-site
Commit: ed124d8f295a07f524a018747e88d543f930ba5d
Parents:
Author: Ian Maxon <ia...@maxons.email>
Authored: Fri May 29 18:44:11 2015 -0700
Committer: Ian Maxon <ia...@maxons.email>
Committed: Fri May 29 18:44:11 2015 -0700
----------------------------------------------------------------------
api.html | 543 ++++
aql/allens.html | 615 ++++
aql/datamodel.html | 707 +++++
aql/externaldata.html | 443 +++
aql/filters.html | 256 ++
aql/functions.html | 4740 ++++++++++++++++++++++++++++
aql/js-sdk.html | 897 ++++++
aql/manual.html | 925 ++++++
aql/primer-sql-like.html | 832 +++++
aql/primer.html | 842 +++++
aql/similarity.html | 403 +++
css/apache-maven-fluido-1.3.0.min.css | 9 +
css/print.css | 23 +
css/site.css | 1 +
csv.html | 392 +++
images/accessories-text-editor.png | Bin 0 -> 746 bytes
images/add.gif | Bin 0 -> 397 bytes
images/apache-maven-project-2.png | Bin 0 -> 33442 bytes
images/application-certificate.png | Bin 0 -> 923 bytes
images/asf_logo_wide.png | Bin 0 -> 14470 bytes
images/asterixlogo.png | Bin 0 -> 15334 bytes
images/contact-new.png | Bin 0 -> 736 bytes
images/document-properties.png | Bin 0 -> 577 bytes
images/drive-harddisk.png | Bin 0 -> 700 bytes
images/egg-logo.png | Bin 0 -> 8626 bytes
images/fix.gif | Bin 0 -> 366 bytes
images/hyrax_ts.png | Bin 0 -> 4949 bytes
images/icon_error_sml.gif | Bin 0 -> 633 bytes
images/icon_help_sml.gif | Bin 0 -> 1072 bytes
images/icon_info_sml.gif | Bin 0 -> 638 bytes
images/icon_success_sml.gif | Bin 0 -> 604 bytes
images/icon_warning_sml.gif | Bin 0 -> 625 bytes
images/image-x-generic.png | Bin 0 -> 662 bytes
images/internet-web-browser.png | Bin 0 -> 1017 bytes
images/logos/build-by-maven-black.png | Bin 0 -> 2294 bytes
images/logos/build-by-maven-white.png | Bin 0 -> 2260 bytes
images/logos/maven-feather.png | Bin 0 -> 3330 bytes
images/network-server.png | Bin 0 -> 536 bytes
images/package-x-generic.png | Bin 0 -> 717 bytes
images/profiles/pre-release.png | Bin 0 -> 32607 bytes
images/profiles/retired.png | Bin 0 -> 22003 bytes
images/profiles/sandbox.png | Bin 0 -> 33010 bytes
images/remove.gif | Bin 0 -> 607 bytes
images/rss.png | Bin 0 -> 474 bytes
images/update.gif | Bin 0 -> 1090 bytes
images/window-new.png | Bin 0 -> 583 bytes
img/glyphicons-halflings-white.png | Bin 0 -> 8777 bytes
img/glyphicons-halflings.png | Bin 0 -> 12799 bytes
index.html | 253 ++
install.html | 1211 +++++++
js/apache-maven-fluido-1.3.0.min.js | 21 +
overview.html | 279 ++
52 files changed, 13392 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/api.html
----------------------------------------------------------------------
diff --git a/api.html b/api.html
new file mode 100644
index 0000000..19f6b4f
--- /dev/null
+++ b/api.html
@@ -0,0 +1,543 @@
+<!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>
+
+ <a href="aql/allens.html" title="AQL Allen's Relations Functions">
+ <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 class="active">
+
+ <a href="#"><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>REST API to AsterixDB</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="#DdlApi">DDL API</a></li>
+
+<li><a href="#UpdateApi">Update API</a></li>
+
+<li><a href="#QueryApi">Query API</a></li>
+
+<li><a href="#AsynchronousResultApi">Asynchronous Result API</a></li>
+
+<li><a href="#QueryStatusApi">Query Status API</a></li>
+
+<li><a href="#ErrorCodes">Error Codes</a></li>
+</ul></div>
+<div class="section">
+<h2><a name="DdlApi" id="DdlApi">DDL API</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="DDL_API_Back_to_TOC"></a></h2>
+<p><i>End point for the data definition statements</i></p>
+<p>Endpoint: <i>/ddl</i></p>
+<p>Parameters:</p>
+
+<table border="0" class="table table-striped">
+
+<tr class="a">
+
+<td>Parameter</td>
+
+<td>Description</td>
+
+<td>Required?</td>
+</tr>
+
+<tr class="b">
+
+<td>ddl</td>
+
+<td>String containing DDL statements to modify Metadata</td>
+
+<td>Yes</td>
+</tr>
+</table>
+<p>This call does not return any result. If the operations were successful, HTTP OK status code is returned.</p>
+<div class="section">
+<h3>Example<a name="Example"></a></h3>
+<div class="section">
+<h4>DDL Statements<a name="DDL_Statements"></a></h4>
+
+<div class="source">
+<pre> drop dataverse company if exists;
+ create dataverse company;
+ use dataverse company;
+
+ create type Emp as open {
+ id : int32,
+ name : string
+ };
+
+ create dataset Employee(Emp) primary key id;
+</pre></div>
+<p>API call for the above DDL statements in the URL-encoded form.</p>
+<p>[http://localhost:19002/ddl?ddl=drop%20dataverse%20company%20if%20exists;create%20dataverse%20company;use%20dataverse%20company;create%20type%20Emp%20as%20open%20{id%20:%20int32,name%20:%20string};create%20dataset%20Employee(Emp)%20primary%20key%20id;](<a class="externalLink" href="http://localhost:19002/ddl?ddl=drop%20dataverse%20company%20if%20exists;create%20dataverse%20company;use%20dataverse%20company;create%20type%20Emp%20as%20open%20{id%20:%20int32,name%20:%20string};create%20dataset%20Employee(Emp)%20primary%20key%20id;">http://localhost:19002/ddl?ddl=drop%20dataverse%20company%20if%20exists;create%20dataverse%20company;use%20dataverse%20company;create%20type%20Emp%20as%20open%20{id%20:%20int32,name%20:%20string};create%20dataset%20Employee(Emp)%20primary%20key%20id;</a>)</p></div>
+<div class="section">
+<h4>Response<a name="Response"></a></h4>
+<p><i>HTTP OK 200</i><br /><tt><NO PAYLOAD></tt></p></div></div></div>
+<div class="section">
+<h2><a name="UpdateApi" id="UpdateApi">Update API</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Update_API_Back_to_TOC"></a></h2>
+<p><i>End point for update statements (INSERT, DELETE and LOAD)</i></p>
+<p>Endpoint: <i>/update</i></p>
+<p>Parameters:</p>
+
+<table border="0" class="table table-striped">
+
+<tr class="a">
+
+<td>Parameter</td>
+
+<td>Description</td>
+
+<td>Required?</td>
+</tr>
+
+<tr class="b">
+
+<td>statements</td>
+
+<td>String containing update (insert/delete) statements to execute</td>
+
+<td>Yes</td>
+</tr>
+</table>
+<p>This call does not return any result. If the operations were successful, HTTP OK status code is returned.</p>
+<div class="section">
+<h3>Example<a name="Example"></a></h3>
+<div class="section">
+<h4>Update Statements<a name="Update_Statements"></a></h4>
+
+<div class="source">
+<pre> use dataverse company;
+
+ insert into dataset Employee({ "id":123,"name":"John Doe"});
+</pre></div>
+<p>API call for the above update statement in the URL-encoded form.</p>
+<p>[http://localhost:19002/update?statements=use%20dataverse%20company;insert%20into%20dataset%20Employee({%20%22id%22:123,%22name%22:%22John%20Doe%22});](<a class="externalLink" href="http://localhost:19002/update?statements=use%20dataverse%20company;insert%20into%20dataset%20Employee({%20%22id%22:123,%22name%22:%22John%20Doe%22});">http://localhost:19002/update?statements=use%20dataverse%20company;insert%20into%20dataset%20Employee({%20%22id%22:123,%22name%22:%22John%20Doe%22});</a>)</p></div>
+<div class="section">
+<h4>Response<a name="Response"></a></h4>
+<p><i>HTTP OK 200</i><br /><tt><NO PAYLOAD></tt></p></div></div></div>
+<div class="section">
+<h2><a name="QueryApi" id="QueryApi">Query API</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Query_API_Back_to_TOC"></a></h2>
+<p><i>End point for query statements</i></p>
+<p>Endpoint: <i>/query</i></p>
+<p>Parameters:</p>
+
+<table border="0" class="table table-striped">
+
+<tr class="a">
+
+<td>Parameter</td>
+
+<td>Description</td>
+
+<td>Required?</td>
+</tr>
+
+<tr class="b">
+
+<td>query</td>
+
+<td>Query string to pass to ASTERIX for execution</td>
+
+<td>Yes</td>
+</tr>
+
+<tr class="a">
+
+<td>mode</td>
+
+<td>Indicate if call should be synchronous or asynchronous. mode = synchronous blocks the call until results are available; mode = asynchronous returns immediately with a handle that can be used later to check the query’s status and to fetch results when available</td>
+
+<td>No. default mode = synchronous</td>
+</tr>
+</table>
+<p>Result: The result is returned as a JSON object as follows</p>
+
+<div class="source">
+<pre> {
+ results: <result as a string, if mode = synchronous>
+ error-code: [<code>, <message>] (if an error occurs)
+ handle: <opaque result handle, if mode = asynchronous>
+ }
+</pre></div>
+<div class="section">
+<h3>Example<a name="Example"></a></h3>
+<div class="section">
+<h4>Select query with synchronous result delivery<a name="Select_query_with_synchronous_result_delivery"></a></h4>
+
+<div class="source">
+<pre> use dataverse company;
+
+ for $l in dataset('Employee') return $l;
+</pre></div>
+<p>API call for the above query statement in the URL-encoded form.</p>
+<p>[http://localhost:19002/query?query=use%20dataverse%20company;for%20$l%20in%20dataset(‘Employee’)%20return%20$l;](<a class="externalLink" href="http://localhost:19002/query?query=use%20dataverse%20company;for%20$l%20in%20dataset('Employee')%20return%20$l;">http://localhost:19002/query?query=use%20dataverse%20company;for%20$l%20in%20dataset('Employee')%20return%20$l;</a>)</p></div>
+<div class="section">
+<h4>Response<a name="Response"></a></h4>
+<p><i>HTTP OK 200</i><br />Payload</p>
+
+<div class="source">
+<pre> {
+ "results": [
+ [
+ "{ "id": 123, "name": "John Doe" }"
+ ]
+ ]
+ }
+</pre></div></div>
+<div class="section">
+<h4>Same select query with asynchronous result delivery<a name="Same_select_query_with_asynchronous_result_delivery"></a></h4>
+<p>API call for the above query statement in the URL-encoded form with mode=asynchronous</p>
+<p>[http://localhost:19002/query?query=use%20dataverse%20company;for%20$l%20in%20dataset(‘Employee’)%20return%20$l;&mode=asynchronous](<a class="externalLink" href="http://localhost:19002/query?query=use%20dataverse%20company;for%20$l%20in%20dataset('Employee')%20return%20$l;&mode=asynchronous">http://localhost:19002/query?query=use%20dataverse%20company;for%20$l%20in%20dataset('Employee')%20return%20$l;&mode=asynchronous</a>)</p></div>
+<div class="section">
+<h4>Response<a name="Response"></a></h4>
+<p><i>HTTP OK 200</i><br />Payload</p>
+
+<div class="source">
+<pre> {
+ "handle": [45,0]
+ }
+</pre></div></div></div></div>
+<div class="section">
+<h2><a name="AsynchronousResultApi" id="AsynchronousResultApi">Asynchronous Result API</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Asynchronous_Result_API_Back_to_TOC"></a></h2>
+<p><i>End point to fetch the results of an asynchronous query</i></p>
+<p>Endpoint: <i>/query/result</i></p>
+<p>Parameters:</p>
+
+<table border="0" class="table table-striped">
+
+<tr class="a">
+
+<td>Parameter</td>
+
+<td>Description</td>
+
+<td>Required?</td>
+</tr>
+
+<tr class="b">
+
+<td>handle</td>
+
+<td>Result handle that was returned by a previous call to a /query call with mode = asynchronous</td>
+
+<td>Yes</td>
+</tr>
+</table>
+<p>Result: The result is returned as a JSON object as follows:</p>
+
+<div class="source">
+<pre> {
+ results: <result as a string, if mode = synchronous, or mode = asynchronous and results are available>
+ error-code: [<code>, <message>] (if an error occurs)
+ }
+</pre></div>
+<p>If mode = asynchronous and results are not available, the returned JSON object is empty: { }</p>
+<div class="section">
+<h3>Example<a name="Example"></a></h3>
+<div class="section">
+<h4>Fetching results for asynchronous query<a name="Fetching_results_for_asynchronous_query"></a></h4>
+<p>We use the handle returned by the asynchronous query to get the results for the query. The handle returned was:</p>
+
+<div class="source">
+<pre> {
+ "handle": [45,0]
+ }
+</pre></div>
+<p>API call for reading results from the previous asynchronous query in the URL-encoded form.</p>
+<p><a class="externalLink" href="http://localhost:19002/query/result?handle=%7B%22handle%22%3A+%5B45%2C+0%5D%7D">http://localhost:19002/query/result?handle=%7B%22handle%22%3A+%5B45%2C+0%5D%7D</a></p></div>
+<div class="section">
+<h4>Response<a name="Response"></a></h4>
+<p><i>HTTP OK 200</i><br />Payload</p>
+
+<div class="source">
+<pre> {
+ "results": [
+ [
+ "{ "id": 123, "name": "John Doe" }"
+ ]
+ ]
+ }
+</pre></div></div></div></div>
+<div class="section">
+<h2><a name="QueryStatusApi" id="QueryStatusApi">Query Status API</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Query_Status_API_Back_to_TOC"></a></h2>
+<p><i>End point to check the status of the query asynchronous</i></p>
+<p>Endpoint: <i>/query/status</i></p>
+<p>Parameters:</p>
+
+<table border="0" class="table table-striped">
+
+<tr class="a">
+
+<td>Parameter</td>
+
+<td>Description</td>
+
+<td>Required?</td>
+</tr>
+
+<tr class="b">
+
+<td>handle</td>
+
+<td>Result handle that was returned by a previous call to a /query call with mode = asynchronous</td>
+
+<td>Yes</td>
+</tr>
+</table>
+<p>Result: The result is returned as a JSON object as follows:</p>
+
+<div class="source">
+<pre> {
+ status: ("RUNNING" | "SUCCESS" | "ERROR")
+ }
+</pre></div></div>
+<div class="section">
+<h2><a name="ErrorCodes" id="ErrorCodes">Error Codes</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Error_Codes_Back_to_TOC"></a></h2>
+<p>Table of error codes and their types:</p>
+
+<table border="0" class="table table-striped">
+
+<tr class="a">
+
+<td>Code</td>
+
+<td>Type</td>
+</tr>
+
+<tr class="b">
+
+<td>1</td>
+
+<td>Invalid statement</td>
+</tr>
+
+<tr class="a">
+
+<td>2</td>
+
+<td>Parse failures</td>
+</tr>
+
+<tr class="b">
+
+<td>99</td>
+
+<td>Uncategorized error</td>
+</tr>
+</table></div>
+ </div>
+ </div>
+ </div>
+
+ <hr/>
+
+ <footer>
+ <div class="container-fluid">
+ <div class="row span12">Copyright © 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>
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/aql/allens.html
----------------------------------------------------------------------
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’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’s Relations</a></li>
+
+<li><a href="#AllensRelatonsFunctions">Allen’s Relations Functions</a></li>
+</ul></div>
+<div class="section">
+<h2><a name="AboutAllensRelations" id="AboutAllensRelations">About Allen’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’s relations over interval types. Allen’s relations are also called Allen’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’s relations can be found from its <a class="externalLink" href="http://en.wikipedia.org/wiki/Allen's_interval_algebra">wikipedia entry</a>. </p></div>
+<div class="section">
+<h2><a name="AllensRelatonsFunctions" id="AllensRelatonsFunctions">Allen’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 < interval2.start</tt>, and <tt>interval-after(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("2000-01-01", "2005-01-01")
+let $itv2 := interval-from-date("2005-05-01", "2012-09-09")
+return {"interval-before": interval-before($itv1, $itv2), "interval-after": interval-after($itv2, $itv1)}
+</pre></div></li>
+
+<li>
+<p>The expected result is:</p>
+
+<div class="source">
+<pre>{ "interval-before": true, "interval-after": 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 <= interval2.start
+AND interval1.end >= 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 <= interval1.start
+AND interval2.end >= 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("2000-01-01", "2005-01-01")
+let $itv2 := interval-from-date("2000-03-01", "2004-09-09")
+let $itv3 := interval-from-date("2006-08-01", "2007-03-01")
+let $itv4 := interval-from-date("2004-09-10", "2012-08-01")
+return {"interval-covers": interval-covers($itv1, $itv2), "interval-covered-by": interval-covered-by($itv3, $itv4)}
+</pre></div></li>
+
+<li>
+<p>The expected result is:</p>
+
+<div class="source">
+<pre>{ "interval-covers": true, "interval-covered-by": 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 < interval2.start
+AND interval2.end > interval1.end
+AND interval1.end > 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 < interval1.start
+AND interval1.end > interval2.end
+AND interval2.end > 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’s relations on the definition of overlap.</p></li>
+
+<li>
+<p>Examples:</p>
+
+<div class="source">
+<pre>let $itv1 := interval-from-date("2000-01-01", "2005-01-01")
+let $itv2 := interval-from-date("2004-05-01", "2012-09-09")
+let $itv3 := interval-from-date("2006-08-01", "2007-03-01")
+let $itv4 := interval-from-date("2004-09-10", "2006-12-31")
+return {"overlaps": interval-overlaps($itv1, $itv2),
+ "overlapped-by": interval-overlapped-by($itv3, $itv4)}
+</pre></div></li>
+
+<li>
+<p>The expected result is:</p>
+
+<div class="source">
+<pre>{ "overlaps": true, "overlapped-by": 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’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 >= interval1.start
+AND interval2.start < interval1.end)
+OR
+(interval2.end > interval1.start
+AND interval2.end <= 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("2000-01-01", "2005-01-01")
+let $itv2 := interval-from-date("2004-05-01", "2012-09-09")
+let $itv3 := interval-from-date("2006-08-01", "2007-03-01")
+let $itv4 := interval-from-date("2004-09-10", "2006-12-31")
+return {"overlapping1": interval-overlapping($itv1, $itv2),
+ "overlapping2": interval-overlapping($itv3, $itv4)}
+</pre></div></li>
+
+<li>
+<p>The expected result is:</p>
+
+<div class="source">
+<pre>{ "overlapping1": true, "overlapping2": 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("2000-01-01", "2005-01-01")
+let $itv2 := interval-from-date("2005-01-01", "2012-09-09")
+let $itv3 := interval-from-date("2006-08-01", "2007-03-01")
+let $itv4 := interval-from-date("2004-09-10", "2006-08-01")
+return {"meets": interval-meets($itv1, $itv2), "metby": interval-met-by($itv3, $itv4)}
+</pre></div></li>
+
+<li>
+<p>The expected result is:</p>
+
+<div class="source">
+<pre>{ "meets": true, "metby": 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 <= 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 <= 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("2000-01-01", "2005-01-01")
+let $itv2 := interval-from-date("2000-01-01", "2012-09-09")
+let $itv3 := interval-from-date("2006-08-01", "2007-03-01")
+let $itv4 := interval-from-date("2006-08-01", "2006-08-01")
+return {"interval-starts": interval-starts($itv1, $itv2), "interval-started-by": interval-started-by($itv3, $itv4)}
+</pre></div></li>
+
+<li>
+<p>The expected result is:</p>
+
+<div class="source">
+<pre>{ "interval-starts": true, "interval-started-by": 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 >= 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 >= 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("2000-01-01", "2005-01-01")
+let $itv2 := interval-from-date("1998-01-01", "2005-01-01")
+let $itv3 := interval-from-date("2006-08-01", "2007-03-01")
+let $itv4 := interval-from-date("2006-09-10", "2007-03-01")
+return {"interval-ends": interval-ends($itv1, $itv2), "interval-ended-by": interval-ended-by($itv3, $itv4) }
+</pre></div></li>
+
+<li>
+<p>The expected result is:</p>
+
+<div class="source">
+<pre>{ "interval-ends": true, "interval-ended-by": true }
+</pre></div></li>
+</ul></div></div>
+ </div>
+ </div>
+ </div>
+
+ <hr/>
+
+ <footer>
+ <div class="container-fluid">
+ <div class="row span12">Copyright © 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>
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/aql/datamodel.html
----------------------------------------------------------------------
diff --git a/aql/datamodel.html b/aql/datamodel.html
new file mode 100644
index 0000000..d4150f8
--- /dev/null
+++ b/aql/datamodel.html
@@ -0,0 +1,707 @@
+<!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 class="active">
+
+ <a href="#"><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>
+
+ <a href="../aql/allens.html" title="AQL Allen's Relations Functions">
+ <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>Asterix Data Model (ADM)</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="#PrimitiveTypes">Primitive Types</a>
+
+<ul>
+
+<li><a href="#PrimitiveTypesBoolean">Boolean</a></li>
+
+<li><a href="#PrimitiveTypesInt">Int8 / Int16 / Int32 / Int64</a></li>
+
+<li><a href="#PrimitiveTypesFloat">Float</a></li>
+
+<li><a href="#PrimitiveTypesDouble">Double</a></li>
+
+<li><a href="#PrimitiveTypesString">String</a></li>
+
+<li><a href="#PrimitiveTypesPoint">Point</a></li>
+
+<li><a href="#PrimitiveTypesLine">Line</a></li>
+
+<li><a href="#PrimitiveTypesRectangle">Rectangle</a></li>
+
+<li><a href="#PrimitiveTypesCircle">Circle</a></li>
+
+<li><a href="#PrimitiveTypesPolygon">Polygon</a></li>
+
+<li><a href="#PrimitiveTypesDate">Date</a></li>
+
+<li><a href="#PrimitiveTypesTime">Time</a></li>
+
+<li><a href="#PrimitiveTypesDateTime">Datetime</a></li>
+
+<li><a href="#PrimitiveTypesDuration">Duration/Year-month-duration/Day-time-duration</a></li>
+
+<li><a href="#PrimitiveTypesInterval">Interval</a></li>
+ </ul></li>
+
+<li><a href="#DerivedTypes">Derived Types</a>
+
+<ul>
+
+<li><a href="#DerivedTypesRecord">Record</a></li>
+
+<li><a href="#DerivedTypesOrderedList">OrderedList</a></li>
+
+<li><a href="#DerivedTypesUnorderedList">UnorderedList</a></li>
+ </ul></li>
+</ul>
+<p>An instance of Asterix data model (ADM) can be a <i><i>primitive type</i></i> (<tt>int32</tt>, <tt>int64</tt>, <tt>string</tt>, <tt>float</tt>, <tt>double</tt>, <tt>date</tt>, <tt>time</tt>, <tt>datetime</tt>, etc. or <tt>null</tt>) or a <i><i>derived type</i></i>.</p></div>
+<div class="section">
+<h2><a name="PrimitiveTypes" id="PrimitiveTypes">Primitive Types</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Primitive_Types_Back_to_TOC"></a></h2>
+<div class="section">
+<h3><a name="PrimitiveTypesBoolean" id="PrimitiveTypesBoolean">Boolean</a><font size="4"><a href="#toc">[Back to TOC]</a></font><a name="BooleanBack_to_TOC"></a></h3>
+<p><tt>boolean</tt> data type can have one of the two values: <i><i>true</i></i> or <i><i>false</i></i>.</p>
+
+<ul>
+
+<li>
+<p>Example:</p>
+
+<div class="source">
+<pre>let $t := true
+let $f := false
+return { "true": $t, "false": $f }
+</pre></div></li>
+</ul>
+
+<ul>
+
+<li>
+<p>The expected result is:</p>
+
+<div class="source">
+<pre>{ "true": true, "false": false }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3><a name="PrimitiveTypesInt" id="PrimitiveTypesInt">Int8 / Int16 / Int32 / Int64</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Int8__Int16__Int32__Int64_Back_to_TOC"></a></h3>
+<p>Integer types using 8, 16, 32, or 64 bits. The ranges of these types are:</p>
+
+<ul>
+
+<li><tt>int8</tt>: -127 to 127</li>
+
+<li><tt>int16</tt>: -32767 to 32767</li>
+
+<li><tt>int32</tt>: -2147483647 to 2147483647</li>
+
+<li><tt>int64</tt>: -9223372036854775808 to 9223372036854775807</li>
+
+<li>
+<p>Example:</p>
+
+<div class="source">
+<pre>let $v8 := int8("125")
+let $v16 := int16("32765")
+let $v32 := 294967295
+let $v64 := int64("1700000000000000000")
+return { "int8": $v8, "int16": $v16, "int32": $v32, "int64": $v64}
+</pre></div></li>
+</ul>
+
+<ul>
+
+<li>
+<p>The expected result is:</p>
+
+<div class="source">
+<pre>{ "int8": 125i8, "int16": 32765i16, "int32": 294967295, "int64": 1700000000000000000i64 }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3><a name="PrimitiveTypesFloat" id="PrimitiveTypesFloat">Float</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Float_Back_to_TOC"></a></h3>
+<p><tt>float</tt> represents approximate numeric data values using 4 bytes. The range of a float value can be from 2^(-149) to (2-2^(-23)·2^(127) for both positive and negative. Beyond these ranges will get <tt>INF</tt> or <tt>-INF</tt>.</p>
+
+<ul>
+
+<li>
+<p>Example:</p>
+
+<div class="source">
+<pre>let $v1 := float("NaN")
+let $v2 := float("INF")
+let $v3 := float("-INF")
+let $v4 := float("-2013.5")
+return { "v1": $v1, "v2": $v2, "v3": $v3, "v4": $v4 }
+</pre></div></li>
+</ul>
+
+<ul>
+
+<li>
+<p>The expected result is:</p>
+
+<div class="source">
+<pre>{ "v1": NaNf, "v2": Infinityf, "v3": -Infinityf, "v4": -2013.5f }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3><a name="PrimitiveTypesDouble" id="PrimitiveTypesDouble">Double</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Double_Back_to_TOC"></a></h3>
+<p><tt>double</tt> represents approximate numeric data values using 8 bytes. The range of a double value can be from (2^(-1022)) to (2-2^(-52))·2^(1023) for both positive and negative. Beyond these ranges will get <tt>INF</tt> or <tt>-INF</tt>.</p>
+
+<ul>
+
+<li>
+<p>Example:</p>
+
+<div class="source">
+<pre>let $v1 := double("NaN")
+let $v2 := double("INF")
+let $v3 := double("-INF")
+let $v4 := double("-2013.593823748327284")
+return { "v1": $v1, "v2": $v2, "v3": $v3, "v4": $v4 }
+</pre></div></li>
+</ul>
+
+<ul>
+
+<li>
+<p>The expected result is:</p>
+
+<div class="source">
+<pre>{ "v1": NaNd, "v2": Infinityd, "v3": -Infinityd, "v4": -2013.5938237483274d }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3><a name="PrimitiveTypesString" id="PrimitiveTypesString">String</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="String_Back_to_TOC"></a></h3>
+<p><tt>string</tt> represents a sequence of characters.</p>
+
+<ul>
+
+<li>
+<p>Example:</p>
+
+<div class="source">
+<pre>let $v1 := string("This is a string.")
+let $v2 := string("\"This is a quoted string\"")
+return { "v1": $v1, "v2": $v2 }
+</pre></div></li>
+</ul>
+
+<ul>
+
+<li>
+<p>The expected result is:</p>
+
+<div class="source">
+<pre>{ "v1": "This is a string.", "v2": "\"This is a quoted string\"" }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3><a name="PrimitiveTypesPoint" id="PrimitiveTypesPoint">Point</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Point_Back_to_TOC"></a></h3>
+<p><tt>point</tt> is the fundamental two-dimensional building block for spatial types. It consists of two <tt>double</tt> coordinates x and y.</p>
+
+<ul>
+
+<li>
+<p>Example:</p>
+
+<div class="source">
+<pre>let $v1 := point("80.10d, -10E5")
+let $v2 := point("5.10E-10d, -10E5")
+return { "v1": $v1, "v2": $v2 }
+</pre></div></li>
+</ul>
+
+<ul>
+
+<li>
+<p>The expected result is:</p>
+
+<div class="source">
+<pre>{ "v1": point("80.1,-1000000.0"), "v2": point("5.1E-10,-1000000.0") }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3><a name="PrimitiveTypesLine" id="PrimitiveTypesLine">Line</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Line_Back_to_TOC"></a></h3>
+<p><tt>line</tt> consists of two points that represent the start and the end points of a line segment.</p>
+
+<ul>
+
+<li>
+<p>Example:</p>
+
+<div class="source">
+<pre>let $v1 := line("10.1234,11.1e-1 +10.2E-2,-11.22")
+let $v2 := line("0.1234,-1.00e-10 +10.5E-2,-01.02")
+return { "v1": $v1, "v2": $v2 }
+</pre></div></li>
+</ul>
+
+<ul>
+
+<li>
+<p>The expected result is:</p>
+
+<div class="source">
+<pre>{ "v1": line("10.1234,1.11 0.102,-11.22"), "v2": line("0.1234,-1.0E-10 0.105,-1.02") }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3><a name="PrimitiveTypesRectangle" id="PrimitiveTypesRectangle">Rectangle</a><font size="4"><a href="#toc">[Back to TOC]</a></font><a name="RectangleBack_to_TOC"></a></h3>
+<p><tt>rectangle</tt> consists of two points that represent the <i><i>bottom left</i></i> and <i><i>upper right</i></i> corners of a rectangle.</p>
+
+<ul>
+
+<li>
+<p>Example:</p>
+
+<div class="source">
+<pre>let $v1 := rectangle("5.1,11.8 87.6,15.6548")
+let $v2 := rectangle("0.1234,-1.00e-10 5.5487,0.48765")
+return { "v1": $v1, "v2": $v2 }
+</pre></div></li>
+</ul>
+
+<ul>
+
+<li>
+<p>The expected result is:</p>
+
+<div class="source">
+<pre>{ "v1": rectangle("5.1,11.8 87.6,15.6548"), "v2": rectangle("0.1234,-1.0E-10 5.5487,0.48765") }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3><a name="PrimitiveTypesCircle" id="PrimitiveTypesCircle">Circle</a><font size="4"><a href="#toc">[Back to TOC]</a></font><a name="CircleBack_to_TOC"></a></h3>
+<p><tt>circle</tt> consists of one point that represents the center of the circle and a radius of type <tt>double</tt>.</p>
+
+<ul>
+
+<li>
+<p>Example:</p>
+
+<div class="source">
+<pre>let $v1 := circle("10.1234,11.1e-1 +10.2E-2")
+let $v2 := circle("0.1234,-1.00e-10 +10.5E-2")
+return { "v1": $v1, "v2": $v2 }
+</pre></div></li>
+</ul>
+
+<ul>
+
+<li>
+<p>The expected result is:</p>
+
+<div class="source">
+<pre>{ "v1": circle("10.1234,1.11 0.102"), "v2": circle("0.1234,-1.0E-10 0.105") }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3><a name="PrimitiveTypesPolygon" id="PrimitiveTypesPolygon">Polygon</a><font size="4"><a href="#toc">[Back to TOC]</a></font><a name="PolygonBack_to_TOC"></a></h3>
+<p><tt>polygon</tt> consists of <i><i>n</i></i> points that represent the vertices of a <i><i>simple closed</i></i> polygon.</p>
+
+<ul>
+
+<li>
+<p>Example:</p>
+
+<div class="source">
+<pre>let $v1 := polygon("-1.2,+1.3e2 -2.14E+5,2.15 -3.5e+2,03.6 -4.6E-3,+4.81")
+let $v2 := polygon("-1.0,+10.5e2 -02.15E+50,2.5 -1.0,+3.3e3 -2.50E+05,20.15 +3.5e+2,03.6 -4.60E-3,+4.75 -2,+1.0e2 -2.00E+5,20.10 30.5,03.25 -4.33E-3,+4.75")
+return { "v1": $v1, "v2": $v2 }
+</pre></div></li>
+</ul>
+
+<ul>
+
+<li>
+<p>The expected result is:</p>
+
+<div class="source">
+<pre>{ "v1": polygon("-1.2,130.0 -214000.0,2.15 -350.0,3.6 -0.0046,4.81"), "v2": polygon("-1.0,1050.0 -2.15E50,2.5 -1.0,3300.0 -250000.0,20.15 350.0,3.6 -0.0046,4.75 -2.0,100.0 -200000.0,20.1 30.5,3.25 -0.00433,4.75") }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3><a name="PrimitiveTypesDate" id="PrimitiveTypesDate">Date</a><font size="4"><a href="#toc">[Back to TOC]</a></font><a name="DateBack_to_TOC"></a></h3>
+<p><tt>date</tt> represents a time point along the Gregorian calendar system specified by the year, month and day. ASTERIX supports the date from <tt>-9999-01-01</tt> to <tt>9999-12-31</tt>.</p>
+<p>A date value can be represented in two formats, extended format and basic format.</p>
+
+<ul>
+
+<li>Extended format is represented as <tt>[-]yyyy-mm-dd</tt> for <tt>year-month-day</tt>. Each field should be padded if there are less digits than the format specified.</li>
+
+<li>Basic format is in the format of <tt>[-]yyyymmdd</tt>.</li>
+
+<li>
+<p>Example:</p>
+
+<div class="source">
+<pre>let $v1 := date("2013-01-01")
+let $v2 := date("-19700101")
+return { "v1": $v1, "v2": $v2 }
+</pre></div></li>
+</ul>
+
+<ul>
+
+<li>
+<p>The expected result is:</p>
+
+<div class="source">
+<pre>{ "v1": date("2013-01-01"), "v2": date("-1970-01-01") }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3><a name="PrimitiveTypesTime" id="PrimitiveTypesTime">Time</a><font size="4"><a href="#toc">[Back to TOC]</a></font><a name="TimeBack_to_TOC"></a></h3>
+<p><tt>time</tt> type describes the time within the range of a day. It is represented by three fields: hour, minute and second. Millisecond field is optional as the fraction of the second field. Its extended format is as <tt>hh:mm:ss[.mmm]</tt> and the basic format is <tt>hhmmss[mmm]</tt>. The value domain is from <tt>00:00:00.000</tt> to <tt>23:59:59.999</tt>.</p>
+<p>Timezone field is optional for a time value. Timezone is represented as <tt>[+|-]hh:mm</tt> for extended format or <tt>[+|-]hhmm</tt> for basic format. Note that the sign designators cannot be omitted. <tt>Z</tt> can also be used to represent the UTC local time. If no timezone information is given, it is UTC by default.</p>
+
+<ul>
+
+<li>
+<p>Example:</p>
+
+<div class="source">
+<pre>let $v1 := time("12:12:12.039Z")
+let $v2 := time("000000000-0800")
+return { "v1": $v1, "v2": $v2 }
+</pre></div></li>
+</ul>
+
+<ul>
+
+<li>
+<p>The expected result is:</p>
+
+<div class="source">
+<pre>{ "v1": time("12:12:12.039Z"), "v2": time("08:00:00.000Z") }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3><a name="PrimitiveTypesDateTime" id="PrimitiveTypesDateTime">Datetime</a><font size="4"><a href="#toc">[Back to TOC]</a></font><a name="DatetimeBack_to_TOC"></a></h3>
+<p>A <tt>datetime</tt> value is a combination of an <tt>date</tt> and <tt>time</tt>, representing a fixed time point along the Gregorian calendar system. The value is among <tt>-9999-01-01 00:00:00.000</tt> and <tt>9999-12-31 23:59:59.999</tt>.</p>
+<p>A <tt>datetime</tt> value is represented as a combination of the representation of its <tt>date</tt> part and <tt>time</tt> part, separated by a separator <tt>T</tt>. Either extended or basic format can be used, and the two parts should be the same format.</p>
+<p>Millisecond field and timezone field are optional, as specified in the <tt>time</tt> type.</p>
+
+<ul>
+
+<li>
+<p>Example:</p>
+
+<div class="source">
+<pre>let $v1 := datetime("2013-01-01T12:12:12.039Z")
+let $v2 := datetime("-19700101T000000000-0800")
+return { "v1": $v1, "v2": $v2 }
+</pre></div></li>
+</ul>
+
+<ul>
+
+<li>
+<p>The expected result is:</p>
+
+<div class="source">
+<pre>{ "v1": datetime("2013-01-01T12:12:12.039Z"), "v2": datetime("-1970-01-01T08:00:00.000Z") }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3><a name="PrimitiveTypesDuration" id="PrimitiveTypesDuration">Duration/Year-month-duration/Day-time-duration</a><font size="4"><a href="#toc">[Back to TOC]</a></font><a name="DurationYear-month-durationDay-time-durationBack_to_TOC"></a></h3>
+<p><tt>duration</tt> represents a duration of time. A duration value is specified by integers on at least one of the following fields: year, month, day, hour, minute, second, and millisecond.</p>
+<p>A duration value is in the format of <tt>[-]PnYnMnDTnHnMn.mmmS</tt>. The millisecond part (as the fraction of the second field) is optional, and when no millisecond field is used, the decimal point should also be absent.</p>
+<p>Negative durations are also supported for the arithmetic operations between time instance types (<tt>date</tt>, <tt>time</tt> and <tt>datetime</tt>), and is used to roll the time back for the given duration. For example <tt>date("2012-01-01") + duration("-P3D")</tt> will return <tt>date("2011-12-29")</tt>.</p>
+<p>There are also two sub-duration types, namely <tt>year-month-duration</tt> and <tt>day-time-duration</tt>. <tt>year-month-duration</tt> represents only the years and months of a duration, while <tt>day-time-duration</tt> represents only the day to millisecond fields. Different from the <tt>duration</tt> type, both these two subtypes are totally ordered, so they can be used for comparison and index construction.</p>
+<p>Note that a canonical representation of the duration is always returned, regardless whether the duration is in the canonical representation or not from the user’s input. More information about canonical representation can be found from <a class="externalLink" href="http://www.w3.org/TR/xpath-functions/#canonical-dayTimeDuration">XPath dayTimeDuration Canonical Representation</a> and <a class="externalLink" href="http://www.w3.org/TR/xpath-functions/#canonical-yearMonthDuration">yearMonthDuration Canonical Representation</a>.</p>
+
+<ul>
+
+<li>
+<p>Example:</p>
+
+<div class="source">
+<pre>let $v1 := duration("P100Y12MT12M")
+let $v2 := duration("-PT20.943S")
+return { "v1": $v1, "v2": $v2 }
+</pre></div></li>
+</ul>
+
+<ul>
+
+<li>
+<p>The expected result is:</p>
+
+<div class="source">
+<pre>{ "v1": duration("P101YT12M"), "v2": duration("-PT20.943S") }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3><a name="PrimitiveTypesInterval" id="PrimitiveTypesInterval">Interval</a><font size="4"><a href="#toc">[Back to TOC]</a></font><a name="IntervalBack_to_TOC"></a></h3>
+<p><tt>interval</tt> represents inclusive-exclusive ranges of time. It is defined by two time point values with the same temporal type(<tt>date</tt>, <tt>time</tt> or <tt>datetime</tt>).</p>
+
+<ul>
+
+<li>
+<p>Example:</p>
+
+<div class="source">
+<pre>let $v1 := interval-from-date(date("2013-01-01"), date("20130505"))
+let $v2 := interval-from-time(time("00:01:01"), time("213901049+0800"))
+let $v3 := interval-from-datetime(datetime("2013-01-01T00:01:01"), datetime("20130505T213901049+0800"))
+return { "v1": $v1, "v2": $v2, "v3": $v3 }
+</pre></div></li>
+</ul>
+
+<ul>
+
+<li>
+<p>The expected result is:</p>
+
+<div class="source">
+<pre>{ "v1": interval-date("2013-01-01, 2013-05-05"), "v2": interval-time("00:01:01.000Z, 13:39:01.049Z"), "v3": interval-datetime("2013-01-01T00:01:01.000Z, 2013-05-05T13:39:01.049Z") }
+</pre></div></li>
+</ul></div></div>
+<div class="section">
+<h2><a name="DerivedTypes" id="DerivedTypes">Derived Types</a><font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Derived_TypesBack_to_TOC"></a></h2>
+<div class="section">
+<h3><a name="DerivedTypesRecord" id="DerivedTypesRecord">Record</a><font size="4"><a href="#toc">[Back to TOC]</a></font><a name="RecordBack_to_TOC"></a></h3>
+<p>A <tt>record</tt> contains a set of fields, where each field is described by its name and type. A record type is either open or closed. Open records can contain fields that are not part of the type definition, while closed records cannot. Syntactically, record constructors are surrounded by curly braces “{…}”.</p>
+<p>An example would be</p>
+
+<div class="source">
+<pre> { "id": 213508, "name": "Alice Bob" }
+</pre></div></div>
+<div class="section">
+<h3><a name="DerivedTypesOrderedList" id="DerivedTypesOrderedList">OrderedList</a><font size="4"><a href="#toc">[Back to TOC]</a></font><a name="OrderedListBack_to_TOC"></a></h3>
+<p>An <tt>orderedList</tt> is a sequence of values for which the order is determined by creation or insertion. OrderedList constructors are denoted by brackets: “[…]”.</p>
+<p>An example would be</p>
+
+<div class="source">
+<pre> ["alice", 123, "bob", null]
+</pre></div></div>
+<div class="section">
+<h3><a name="DerivedTypesUnorderedList" id="DerivedTypesUnorderedList">UnorderedList</a><font size="4"><a href="#toc">[Back to TOC]</a></font><a name="UnorderedListBack_to_TOC"></a></h3>
+<p>An <tt>unorderedList</tt> is an unordered sequence of values, similar to bags in SQL. UnorderedList constructors are denoted by two opening flower braces followed by data and two closing flower braces, like “{{…}}”.</p>
+<p>An example would be</p>
+
+<div class="source">
+<pre> {{"hello", 9328, "world", [1, 2, null]}}
+</pre></div></div></div>
+ </div>
+ </div>
+ </div>
+
+ <hr/>
+
+ <footer>
+ <div class="container-fluid">
+ <div class="row span12">Copyright © 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>