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:16 UTC

[01/13] incubator-asterixdb-site git commit: Initial commit with Till's changes

Repository: incubator-asterixdb-site
Updated Branches:
  refs/heads/asf-site [created] ed124d8f2


http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/overview.html
----------------------------------------------------------------------
diff --git a/overview.html b/overview.html
new file mode 100644
index 0000000..d8210c3
--- /dev/null
+++ b/overview.html
@@ -0,0 +1,279 @@
+<!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>
+    
+                          <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: A Big Data Management System</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="#WhatIsAsterixDB">What Is AsterixDB?</a></li>
+  
+<li><a href="#GettingAndUsingAsterixDB">Getting and Using AsterixDB</a></li>
+</ul></div>
+<div class="section">
+<h2><a name="WhatIsAsterixDB" id="WhatIsAsterixDB">What Is AsterixDB?</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="What_Is_AsterixDB_Back_to_TOC"></a></h2>
+<p>In a nutshell, AsterixDB is a full-function BDMS (Big Data Management System) with a rich feature set that distinguishes it from pretty much any other Big Data platform that&#x2019;s out and available today. We believe that its feature set makes it well-suited to modern needs such as web data warehousing and social data storage and analysis. AsterixDB has:</p>
+
+<ul>
+  
+<li>A semistructured NoSQL style data model (ADM) resulting from extending JSON with object database ideas</li>
+  
+<li>An expressive and declarative query language (AQL) that supports a broad range of queries and analysis over semistructured data</li>
+  
+<li>A parallel runtime query execution engine, Hyracks, that has been scale-tested on up to 1000+ cores and 500+ disks</li>
+  
+<li>Partitioned LSM-based data storage and indexing to support efficient ingestion and management of semistructured data</li>
+  
+<li>Support for query access to externally stored data (e.g., data in HDFS) as well as to data stored natively by AsterixDB</li>
+  
+<li>A rich set of primitive data types, including spatial and temporal data in addition to integer, floating point, and textual data</li>
+  
+<li>Secondary indexing options that include B+ trees, R trees, and inverted keyword (exact and fuzzy) index types</li>
+  
+<li>Support for fuzzy and spatial queries as well as for more traditional parametric queries</li>
+  
+<li>Basic transactional (concurrency and recovery) capabilities akin to those of a NoSQL store</li>
+</ul></div>
+<div class="section">
+<h2><a name="GettingAndUsingAsterixDB" id="GettingAndUsingAsterixDB">Getting and Using AsterixDB</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Getting_and_Using_AsterixDB_Back_to_TOC"></a></h2>
+<p>You are most likely here because you are interested in getting your hands on AsterixDB&#x2014;so you would like to know how to get it, how to set it up, and how to use it. The following is a list of the supporting documents that we have available today:</p>
+
+<ol style="list-style-type: decimal">
+  
+<li>
+<p><a href="install.html">Installing AsterixDB using Managix</a> : This is our installation guide, and it is where you should start. This document will tell you how to obtain, install, and manage instances of <a class="externalLink" href="http://asterixdb.ics.uci.edu/download.html">AsterixDB</a>, including both single-machine setup (for developers) as well as cluster installations (for deployment in its intended form).</p></li>
+  
+<li>
+<p><a href="aql/primer.html">AsterixDB 101: An ADM and AQL Primer</a> : This is a first-timers introduction to the user model of the AsterixDB BDMS, by which we mean the view of AsterixDB as seen from the perspective of an &#x201c;average user&#x201d; or Big Data application developer. The AsterixDB user model consists of its data modeling features (ADM) and its query capabilities (AQL). This document presents a tiny &#x201c;social data warehousing&#x201d; example and uses it as a backdrop for describing, by example, the key features of AsterixDB. By working through this document, you will learn how to define the artifacts needed to manage data in AsterixDB, how to load data into the system, how to use most of the basic features of its query language, and how to insert and delete data dynamically.</p></li>
+  
+<li>
+<p><a href="aql/datamodel.html">Asterix Data Model (ADM)</a>, <a href="aql/functions.html">Asterix Functions</a>, <a href="aql/allens.html">Asterix functions for Allen&#x2019;s Relations</a>, and <a href="aql/manual.html">Asterix Query Language (AQL)</a> : These are reference documents that catalog the primitive data types and built-in functions available in AQL and the reference manual for AQL itself.</p></li>
+  
+<li>
+<p><a href="api.html">REST API to AsterixDB</a> : Access to data in an AsterixDB instance is provided via a REST-based API. This is a short document that describes the REST API entry points and their URL syntax.</p></li>
+</ol>
+<p>To all who have now come this far: Thanks for your interest in AsterixDB, and for kicking its tires in its Beta form. In addition to getting the system and trying it out, please sign up as a member of the AsterixDB user mailing list (asterixdb-users (at) googlegroups.com) so that you can contact us easily with your questions, issues, and other feedback. We want AsterixDB to be a &#x201c;big hit&#x201d; some day, and we are anxious to see what users do with it and to learn from that feedback what we should be working on most urgently in the next phase of the project.</p></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>


[06/13] incubator-asterixdb-site git commit: Initial commit with Till's changes

Posted by im...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/aql/similarity.html
----------------------------------------------------------------------
diff --git a/aql/similarity.html b/aql/similarity.html
new file mode 100644
index 0000000..d26b6f0
--- /dev/null
+++ b/aql/similarity.html
@@ -0,0 +1,403 @@
+<!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 class="active">
+    
+            <a href="#"><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 Support of Similarity Queries</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="#Motivation">Motivation</a></li>
+  
+<li><a href="#DataTypesAndSimilarityFunctions">Data Types and Similarity Functions</a></li>
+  
+<li><a href="#SimilaritySelectionQueries">Similarity Selection Queries</a></li>
+  
+<li><a href="#SimilarityJoinQueries">Similarity Join Queries</a></li>
+  
+<li><a href="#UsingIndexesToSupportSimilarityQueries">Using Indexes to Support Similarity Queries</a></li>
+</ul></div>
+<div class="section">
+<h2><a name="Motivation" id="Motivation">Motivation</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Motivation_Back_to_TOC"></a></h2>
+<p>Similarity queries are widely used in applications where users need to find records that satisfy a similarity predicate, while exact matching is not sufficient. These queries are especially important for social and Web applications, where errors, abbreviations, and inconsistencies are common. As an example, we may want to find all the movies starring Schwarzenegger, while we don&#x2019;t know the exact spelling of his last name (despite his popularity in both the movie industry and politics :-)). As another example, we want to find all the Facebook users who have similar friends. To meet this type of needs, AsterixDB supports similarity queries using efficient indexes and algorithms.</p></div>
+<div class="section">
+<h2><a name="DataTypesAndSimilarityFunctions" id="DataTypesAndSimilarityFunctions">Data Types and Similarity Functions</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Data_Types_and_Similarity_Functions_Back_to_TOC"></a></h2>
+<p>AsterixDB supports <a class="externalLink" href="http://en.wikipedia.org/wiki/Levenshtein_distance">edit distance</a> (on strings) and <a class="externalLink" href="http://en.wikipedia.org/wiki/Jaccard_index">Jaccard</a> (on sets). For instance, in our <a href="primer.html#ADM:_Modeling_Semistructed_Data_in_AsterixDB">TinySocial</a> example, the <tt>friend-ids</tt> of a Facebook user forms a set of friends, and we can define a similarity between the sets of friends of two users. We can also convert a string to a set of grams of a length &#x201c;n&#x201d; (called &#x201c;n-grams&#x201d;) and define the Jaccard similarity between the two gram sets of the two strings. Formally, the &#x201c;n-grams&#x201d; of a string are its substrings of length &#x201c;n&#x201d;. For instance, the 3-grams of the string <tt>schwarzenegger</tt> are <tt>sch</tt>, <tt>chw</tt>, <tt>hwa</tt>, &#x2026;, <tt>ger</tt>.</p>
+<p>AsterixDB provides <a href="functions.html#Tokenizing_Functions">tokenization functions</a> to convert strings to sets, and the <a href="functions.html#Similarity_Functions">similarity functions</a>.</p></div>
+<div class="section">
+<h2><a name="SimilaritySelectionQueries" id="SimilaritySelectionQueries">Similarity Selection Queries</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Similarity_Selection_Queries_Back_to_TOC"></a></h2>
+<p>The following <a href="functions.html#edit-distance">query</a> asks for all the Facebook users whose name is similar to <tt>Suzanna Tilson</tt>, i.e., their edit distance is at most 2.</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    for $user in dataset('FacebookUsers')
+    let $ed := edit-distance($user.name, &quot;Suzanna Tilson&quot;)
+    where $ed &lt;= 2
+    return $user
+</pre></div>
+<p>The following <a href="functions.html#similarity-jaccard">query</a> asks for all the Facebook users whose set of friend ids is similar to <tt>[1,5,9]</tt>, i.e., their Jaccard similarity is at least 0.6.</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    for $user in dataset('FacebookUsers')
+    let $sim := similarity-jaccard($user.friend-ids, [1,5,9])
+    where $sim &gt;= 0.6f
+    return $user
+</pre></div>
+<p>AsterixDB allows a user to use a similarity operator <tt>~=</tt> to express a condition by defining the similarity function and threshold using &#x201c;set&#x201d; statements earlier. For instance, the above query can be equivalently written as:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    set simfunction &quot;jaccard&quot;;
+    set simthreshold &quot;0.6f&quot;;
+
+    for $user in dataset('FacebookUsers')
+    where $user.friend-ids ~= [1,5,9]
+    return $user
+</pre></div>
+<p>In this query, we first declare Jaccard as the similarity function using <tt>simfunction</tt> and then specify the threshold <tt>0.6f</tt> using <tt>simthreshold</tt>.</p></div>
+<div class="section">
+<h2><a name="SimilarityJoinQueries" id="SimilarityJoinQueries">Similarity Join Queries</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Similarity_Join_Queries_Back_to_TOC"></a></h2>
+<p>AsterixDB supports fuzzy joins between two sets. The following <a href="primer.html#Query_5_-_Fuzzy_Join">query</a> finds, for each Facebook user, all Twitter users with names similar to their name based on the edit distance.</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    set simfunction &quot;edit-distance&quot;;
+    set simthreshold &quot;3&quot;;
+
+    for $fbu in dataset FacebookUsers
+    return {
+        &quot;id&quot;: $fbu.id,
+        &quot;name&quot;: $fbu.name,
+        &quot;similar-users&quot;: for $t in dataset TweetMessages
+                            let $tu := $t.user
+                            where $tu.name ~= $fbu.name
+                            return {
+                            &quot;twitter-screenname&quot;: $tu.screen-name,
+                            &quot;twitter-name&quot;: $tu.name
+                            }
+    };
+</pre></div></div>
+<div class="section">
+<h2><a name="UsingIndexesToSupportSimilarityQueries" id="UsingIndexesToSupportSimilarityQueries">Using Indexes to Support Similarity Queries</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Using_Indexes_to_Support_Similarity_Queries_Back_to_TOC"></a></h2>
+<p>AsterixDB uses two types of indexes to support similarity queries, namely &#x201c;ngram index&#x201d; and &#x201c;keyword index&#x201d;.</p>
+<div class="section">
+<h3>NGram Index<a name="NGram_Index"></a></h3>
+<p>An &#x201c;ngram index&#x201d; is constructed on a set of strings. We generate n-grams for each string, and build an inverted list for each n-gram that includes the ids of the strings with this gram. A similarity query can be answered efficiently by accessing the inverted lists of the grams in the query and counting the number of occurrences of the string ids on these inverted lists. The similar idea can be used to answer queries with Jaccard similarity. A detailed description of these techniques is available at this <a class="externalLink" href="http://www.ics.uci.edu/~chenli/pub/icde2009-memreducer.pdf">paper</a>.</p>
+<p>For instance, the following DDL statements create an ngram index on the <tt>FacebookUsers.name</tt> attribute using an inverted index of 3-grams.</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    create index fbUserIdx on FacebookUsers(name) type ngram(3);
+</pre></div>
+<p>The number &#x201c;3&#x201d; in &#x201c;ngram(3)&#x201d; is the length &#x201c;n&#x201d; in the grams. This index can be used to optimize similarity queries on this attribute using <a href="functions.html#edit-distance">edit-distance</a>, <a href="functions.html#edit-distance-check">edit-distance-check</a>, <a href="functions.html#similarity-jaccard">similarity-jaccard</a>, or <a href="functions.html#similarity-jaccard-check">similarity-jaccard-check</a> queries on this attribute where the similarity is defined on sets of 3-grams. This index can also be used to optimize queries with the &#x201c;<a href="functions.html#contains">contains()</a>&#x201d; predicate (i.e., substring matching) since it can be also be solved by counting on the inverted lists of the grams in the query string.</p>
+<div class="section">
+<h4>NGram Index usage case - <a href="functions.html#edit-distance">edit-distance</a><a name="NGram_Index_usage_case_-_edit-distance"></a></h4>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    for $user in dataset('FacebookUsers')
+    let $ed := edit-distance($user.name, &quot;Suzanna Tilson&quot;)
+    where $ed &lt;= 2
+    return $user
+</pre></div></div>
+<div class="section">
+<h4>NGram Index usage case - <a href="functions.html#edit-distance-check">edit-distance-check</a><a name="NGram_Index_usage_case_-_edit-distance-check"></a></h4>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    for $user in dataset('FacebookUsers')
+    let $ed := edit-distance-check($user.name, &quot;Suzanna Tilson&quot;, 2)
+    where $ed[0]
+    return $ed[1]
+</pre></div></div>
+<div class="section">
+<h4>NGram Index usage case - <a href="functions.html#similarity-jaccard">similarity-jaccard</a><a name="NGram_Index_usage_case_-_similarity-jaccard"></a></h4>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    for $user in dataset('FacebookUsers')
+    let $sim := similarity-jaccard($user.friend-ids, [1,5,9])
+    where $sim &gt;= 0.6f
+    return $user
+</pre></div></div>
+<div class="section">
+<h4>NGram Index usage case - <a href="functions.html#similarity-jaccard-check">similarity-jaccard-check</a><a name="NGram_Index_usage_case_-_similarity-jaccard-check"></a></h4>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    for $user in dataset('FacebookUsers')
+    let $sim := similarity-jaccard($user.friend-ids, [1,5,9])
+    where $sim &gt;= 0.6f
+    return $user
+</pre></div></div>
+<div class="section">
+<h4>NGram Index usage case - <a href="functions.html#contains">contains()</a><a name="NGram_Index_usage_case_-_contains"></a></h4>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    for $i in dataset('FacebookMessages')
+    where contains($i.message, &quot;phone&quot;)
+    return {&quot;mid&quot;: $i.message-id, &quot;message&quot;: $i.message}
+</pre></div></div></div>
+<div class="section">
+<h3>Keyword Index<a name="Keyword_Index"></a></h3>
+<p>A &#x201c;keyword index&#x201d; is constructed on a set of strings or sets (e.g., OrderedList, UnorderedList). Instead of generating grams as in an ngram index, we generate tokens (e.g., words) and for each token, construct an inverted list that includes the ids of the records with this token. The following two examples show how to create keyword index on two different types:</p>
+<div class="section">
+<h4>Keyword Index on String Type<a name="Keyword_Index_on_String_Type"></a></h4>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    create index fbMessageIdx on FacebookMessages(message) type keyword;
+
+    for $o in dataset('FacebookMessages')
+    let $jacc := similarity-jaccard-check(word-tokens($o.message), word-tokens(&quot;love like verizon&quot;), 0.2f)
+    where $jacc[0]
+    return $o
+</pre></div></div>
+<div class="section">
+<h4>Keyword Index on UnorderedList Type<a name="Keyword_Index_on_UnorderedList_Type"></a></h4>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    create index fbUserIdx_fids on FacebookUsers(friend-ids) type keyword;
+
+    for $c in dataset('FacebookUsers')
+    let $jacc := similarity-jaccard-check($c.friend-ids, {{3,10}}, 0.5f)
+    where $jacc[0]
+    return $c
+</pre></div>
+<p>As shown above, keyword index can be used to optimize queries with token-based similarity predicates, including <a href="functions.html#similarity-jaccard">similarity-jaccard</a> and <a href="functions.html#similarity-jaccard-check">similarity-jaccard-check</a>.</p></div></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>


[13/13] incubator-asterixdb-site git commit: Initial commit with Till's changes

Posted by im...@apache.org.
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>&lt;NO PAYLOAD&gt;</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({ &quot;id&quot;:123,&quot;name&quot;:&quot;John Doe&quot;});
+</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>&lt;NO PAYLOAD&gt;</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&#x2019;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: &lt;result as a string, if mode = synchronous&gt;
+       error-code: [&lt;code&gt;, &lt;message&gt;] (if an error occurs)
+       handle: &lt;opaque result handle, if mode = asynchronous&gt;
+    }
+</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(&#x2018;Employee&#x2019;)%20return%20$l;](<a class="externalLink" href="http://localhost:19002/query?query=use%20dataverse%20company;for%20$l%20in%20dataset(&apos;Employee&apos;)%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>    {
+      &quot;results&quot;: [
+          [
+              &quot;{ &quot;id&quot;: 123, &quot;name&quot;: &quot;John Doe&quot; }&quot;
+          ]
+      ]
+    }
+</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(&#x2018;Employee&#x2019;)%20return%20$l;&amp;mode=asynchronous](<a class="externalLink" href="http://localhost:19002/query?query=use%20dataverse%20company;for%20$l%20in%20dataset(&apos;Employee&apos;)%20return%20$l;&amp;mode=asynchronous">http://localhost:19002/query?query=use%20dataverse%20company;for%20$l%20in%20dataset('Employee')%20return%20$l;&amp;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>    {
+        &quot;handle&quot;: [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: &lt;result as a string, if mode = synchronous, or mode = asynchronous and results are available&gt;
+       error-code: [&lt;code&gt;, &lt;message&gt;] (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>    {
+        &quot;handle&quot;: [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>    {
+      &quot;results&quot;: [
+          [
+              &quot;{ &quot;id&quot;: 123, &quot;name&quot;: &quot;John Doe&quot; }&quot;
+          ]
+      ]
+    }
+</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: (&quot;RUNNING&quot; | &quot;SUCCESS&quot; | &quot;ERROR&quot;)
+    }
+</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 &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>

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&#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>

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 { &quot;true&quot;: $t, &quot;false&quot;: $f }
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;true&quot;: true, &quot;false&quot;: 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(&quot;125&quot;)
+let $v16 := int16(&quot;32765&quot;)
+let $v32 := 294967295
+let $v64 := int64(&quot;1700000000000000000&quot;)
+return { &quot;int8&quot;: $v8, &quot;int16&quot;: $v16, &quot;int32&quot;: $v32, &quot;int64&quot;: $v64}
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;int8&quot;: 125i8, &quot;int16&quot;: 32765i16, &quot;int32&quot;: 294967295, &quot;int64&quot;: 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)&#xb7;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(&quot;NaN&quot;)
+let $v2 := float(&quot;INF&quot;)
+let $v3 := float(&quot;-INF&quot;)
+let $v4 := float(&quot;-2013.5&quot;)
+return { &quot;v1&quot;: $v1, &quot;v2&quot;: $v2, &quot;v3&quot;: $v3, &quot;v4&quot;: $v4 }
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;v1&quot;: NaNf, &quot;v2&quot;: Infinityf, &quot;v3&quot;: -Infinityf, &quot;v4&quot;: -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))&#xb7;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(&quot;NaN&quot;)
+let $v2 := double(&quot;INF&quot;)
+let $v3 := double(&quot;-INF&quot;)
+let $v4 := double(&quot;-2013.593823748327284&quot;)
+return { &quot;v1&quot;: $v1, &quot;v2&quot;: $v2, &quot;v3&quot;: $v3, &quot;v4&quot;: $v4 }
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;v1&quot;: NaNd, &quot;v2&quot;: Infinityd, &quot;v3&quot;: -Infinityd, &quot;v4&quot;: -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(&quot;This is a string.&quot;)
+let $v2 := string(&quot;\&quot;This is a quoted string\&quot;&quot;)
+return { &quot;v1&quot;: $v1, &quot;v2&quot;: $v2 }
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;v1&quot;: &quot;This is a string.&quot;, &quot;v2&quot;: &quot;\&quot;This is a quoted string\&quot;&quot; }
+</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(&quot;80.10d, -10E5&quot;)
+let $v2 := point(&quot;5.10E-10d, -10E5&quot;)
+return { &quot;v1&quot;: $v1, &quot;v2&quot;: $v2 }
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;v1&quot;: point(&quot;80.1,-1000000.0&quot;), &quot;v2&quot;: point(&quot;5.1E-10,-1000000.0&quot;) }
+</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(&quot;10.1234,11.1e-1 +10.2E-2,-11.22&quot;)
+let $v2 := line(&quot;0.1234,-1.00e-10 +10.5E-2,-01.02&quot;)
+return { &quot;v1&quot;: $v1, &quot;v2&quot;: $v2 }
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;v1&quot;: line(&quot;10.1234,1.11 0.102,-11.22&quot;), &quot;v2&quot;: line(&quot;0.1234,-1.0E-10 0.105,-1.02&quot;) }
+</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(&quot;5.1,11.8 87.6,15.6548&quot;)
+let $v2 := rectangle(&quot;0.1234,-1.00e-10 5.5487,0.48765&quot;)
+return { &quot;v1&quot;: $v1, &quot;v2&quot;: $v2 }
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;v1&quot;: rectangle(&quot;5.1,11.8 87.6,15.6548&quot;), &quot;v2&quot;: rectangle(&quot;0.1234,-1.0E-10 5.5487,0.48765&quot;) }
+</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(&quot;10.1234,11.1e-1 +10.2E-2&quot;)
+let $v2 := circle(&quot;0.1234,-1.00e-10 +10.5E-2&quot;)
+return { &quot;v1&quot;: $v1, &quot;v2&quot;: $v2 }
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;v1&quot;: circle(&quot;10.1234,1.11 0.102&quot;), &quot;v2&quot;: circle(&quot;0.1234,-1.0E-10 0.105&quot;) }
+</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(&quot;-1.2,+1.3e2 -2.14E+5,2.15 -3.5e+2,03.6 -4.6E-3,+4.81&quot;)
+let $v2 := polygon(&quot;-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&quot;)
+return { &quot;v1&quot;: $v1, &quot;v2&quot;: $v2 }
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;v1&quot;: polygon(&quot;-1.2,130.0 -214000.0,2.15 -350.0,3.6 -0.0046,4.81&quot;), &quot;v2&quot;: polygon(&quot;-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&quot;) }
+</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(&quot;2013-01-01&quot;)
+let $v2 := date(&quot;-19700101&quot;)
+return { &quot;v1&quot;: $v1, &quot;v2&quot;: $v2 }
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;v1&quot;: date(&quot;2013-01-01&quot;), &quot;v2&quot;: date(&quot;-1970-01-01&quot;) }
+</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(&quot;12:12:12.039Z&quot;)
+let $v2 := time(&quot;000000000-0800&quot;)
+return { &quot;v1&quot;: $v1, &quot;v2&quot;: $v2 }
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;v1&quot;: time(&quot;12:12:12.039Z&quot;), &quot;v2&quot;: time(&quot;08:00:00.000Z&quot;) }
+</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(&quot;2013-01-01T12:12:12.039Z&quot;)
+let $v2 := datetime(&quot;-19700101T000000000-0800&quot;)
+return { &quot;v1&quot;: $v1, &quot;v2&quot;: $v2 }
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;v1&quot;: datetime(&quot;2013-01-01T12:12:12.039Z&quot;), &quot;v2&quot;: datetime(&quot;-1970-01-01T08:00:00.000Z&quot;) }
+</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(&quot;2012-01-01&quot;) + duration(&quot;-P3D&quot;)</tt> will return <tt>date(&quot;2011-12-29&quot;)</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&#x2019;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(&quot;P100Y12MT12M&quot;)
+let $v2 := duration(&quot;-PT20.943S&quot;)
+return { &quot;v1&quot;: $v1, &quot;v2&quot;: $v2 }
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;v1&quot;: duration(&quot;P101YT12M&quot;), &quot;v2&quot;: duration(&quot;-PT20.943S&quot;) }
+</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(&quot;2013-01-01&quot;), date(&quot;20130505&quot;))
+let $v2 := interval-from-time(time(&quot;00:01:01&quot;), time(&quot;213901049+0800&quot;))
+let $v3 := interval-from-datetime(datetime(&quot;2013-01-01T00:01:01&quot;), datetime(&quot;20130505T213901049+0800&quot;))
+return { &quot;v1&quot;: $v1, &quot;v2&quot;: $v2, &quot;v3&quot;: $v3 }
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;v1&quot;: interval-date(&quot;2013-01-01, 2013-05-05&quot;), &quot;v2&quot;: interval-time(&quot;00:01:01.000Z, 13:39:01.049Z&quot;), &quot;v3&quot;: interval-datetime(&quot;2013-01-01T00:01:01.000Z, 2013-05-05T13:39:01.049Z&quot;) }
+</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 &#xfb01;elds, where each &#xfb01;eld is described by its name and type. A record type is either open or closed. Open records can contain &#xfb01;elds that are not part of the type de&#xfb01;nition, while closed records cannot. Syntactically, record constructors are surrounded by curly braces &#x201c;{&#x2026;}&#x201d;.</p>
+<p>An example would be</p>
+
+<div class="source">
+<pre>    { &quot;id&quot;: 213508, &quot;name&quot;: &quot;Alice Bob&quot; }
+</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: &#x201c;[&#x2026;]&#x201d;.</p>
+<p>An example would be</p>
+
+<div class="source">
+<pre>    [&quot;alice&quot;, 123, &quot;bob&quot;, 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 &#x201c;{{&#x2026;}}&#x201d;.</p>
+<p>An example would be</p>
+
+<div class="source">
+<pre>    {{&quot;hello&quot;, 9328, &quot;world&quot;, [1, 2, null]}}
+</pre></div></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>


[05/13] incubator-asterixdb-site git commit: Initial commit with Till's changes

Posted by im...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/css/apache-maven-fluido-1.3.0.min.css
----------------------------------------------------------------------
diff --git a/css/apache-maven-fluido-1.3.0.min.css b/css/apache-maven-fluido-1.3.0.min.css
new file mode 100644
index 0000000..7db4133
--- /dev/null
+++ b/css/apache-maven-fluido-1.3.0.min.css
@@ -0,0 +1,9 @@
+/*!
+ * Bootstrap v2.1.0
+ *
+ * Copyright 2012 Twitter, Inc
+ * Licensed under the Apache License v2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Designed and built with all the love in the world @twitter by @mdo and @fat.
+ */article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}a:hover,a:active{outline:0}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{height:auto;max-width:100%;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic}#map_canvas img{max-width:none}button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle}button,input{*overflow:visible;line-height:normal}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button}input[type="search"]{-webkit-box-sizing:content-box;-moz-box-sizing:con
 tent-box;box-sizing:content-box;-webkit-appearance:textfield}input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none}textarea{overflow:auto;vertical-align:top}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;color:#333;background-color:#fff}a{color:#08c;text-decoration:none}a:hover{color:#005580;text-decoration:underline}.img-rounded{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.img-polaroid{padding:4px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-box-shadow:0
  1px 3px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.1);box-shadow:0 1px 3px rgba(0,0,0,0.1)}.img-circle{-webkit-border-radius:500px;-moz-border-radius:500px;border-radius:500px}.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.span12{width:940px}.span11{width:860px}.span10{width:780px}.span9{width:700px}.span8{width:620px}.span7{width:540px}.span6{width:460px}.span5{width:380px}.span4{width:300px}.span3{width:220px}.span2{width:140px}.span1{width:60px}.offset12{margin-left:980px}.offset11{margin-left:900px}.offset10{margin-left:820px}.offset9{margin-left:740px}.offset8{margin-left:660px}.offset7{margin-left:580px}.offset6{margin-left:500px}.offset5{margin-left:420px}.offset4{margin-left:340px}.offset3{margin-left:260px}.offset2{margin-left:180px}.offs
 et1{margin-left:100px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.127659574468085%;*margin-left:2.074468085106383%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.48936170212765%;*width:91.43617021276594%}.row-fluid .span10{width:82.97872340425532%;*width:82.92553191489361%}.row-fluid .span9{width:74.46808510638297%;*width:74.41489361702126%}.row-fluid .span8{width:65.95744680851064%;*width:65.90425531914893%}.row-fluid .span7{width:57.44680851063829%;*width:57.39361702127659%}.row-fluid .span6{width:48.93617021276595%;*width:48.88297872340425%}.row-fluid .span5{width:40.42553191489362%;*width:40.37234042553192%}.row-fluid .span4{width:31.9
 14893617021278%;*width:31.861702127659576%}.row-fluid .span3{width:23.404255319148934%;*width:23.351063829787233%}.row-fluid .span2{width:14.893617021276595%;*width:14.840425531914894%}.row-fluid .span1{width:6.382978723404255%;*width:6.329787234042553%}.row-fluid .offset12{margin-left:104.25531914893617%;*margin-left:104.14893617021275%}.row-fluid .offset12:first-child{margin-left:102.12765957446808%;*margin-left:102.02127659574467%}.row-fluid .offset11{margin-left:95.74468085106382%;*margin-left:95.6382978723404%}.row-fluid .offset11:first-child{margin-left:93.61702127659574%;*margin-left:93.51063829787232%}.row-fluid .offset10{margin-left:87.23404255319149%;*margin-left:87.12765957446807%}.row-fluid .offset10:first-child{margin-left:85.1063829787234%;*margin-left:84.99999999999999%}.row-fluid .offset9{margin-left:78.72340425531914%;*margin-left:78.61702127659572%}.row-fluid .offset9:first-child{margin-left:76.59574468085106%;*margin-left:76.48936170212764%}.row-fluid .offset8{mar
 gin-left:70.2127659574468%;*margin-left:70.10638297872339%}.row-fluid .offset8:first-child{margin-left:68.08510638297872%;*margin-left:67.9787234042553%}.row-fluid .offset7{margin-left:61.70212765957446%;*margin-left:61.59574468085106%}.row-fluid .offset7:first-child{margin-left:59.574468085106375%;*margin-left:59.46808510638297%}.row-fluid .offset6{margin-left:53.191489361702125%;*margin-left:53.085106382978715%}.row-fluid .offset6:first-child{margin-left:51.063829787234035%;*margin-left:50.95744680851063%}.row-fluid .offset5{margin-left:44.68085106382979%;*margin-left:44.57446808510638%}.row-fluid .offset5:first-child{margin-left:42.5531914893617%;*margin-left:42.4468085106383%}.row-fluid .offset4{margin-left:36.170212765957444%;*margin-left:36.06382978723405%}.row-fluid .offset4:first-child{margin-left:34.04255319148936%;*margin-left:33.93617021276596%}.row-fluid .offset3{margin-left:27.659574468085104%;*margin-left:27.5531914893617%}.row-fluid .offset3:first-child{margin-left:25
 .53191489361702%;*margin-left:25.425531914893618%}.row-fluid .offset2{margin-left:19.148936170212764%;*margin-left:19.04255319148936%}.row-fluid .offset2:first-child{margin-left:17.02127659574468%;*margin-left:16.914893617021278%}.row-fluid .offset1{margin-left:10.638297872340425%;*margin-left:10.53191489361702%}.row-fluid .offset1:first-child{margin-left:8.51063829787234%;*margin-left:8.404255319148938%}[class*="span"].hide,.row-fluid [class*="span"].hide{display:none}[class*="span"].pull-right,.row-fluid [class*="span"].pull-right{float:right}.container{margin-right:auto;margin-left:auto;*zoom:1}.container:before,.container:after{display:table;line-height:0;content:""}.container:after{clear:both}.container-fluid{padding-right:20px;padding-left:20px;*zoom:1}.container-fluid:before,.container-fluid:after{display:table;line-height:0;content:""}.container-fluid:after{clear:both}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:20px;font-weight:200;line-height:30px}small{font-size:8
 5%}strong{font-weight:bold}em{font-style:italic}cite{font-style:normal}.muted{color:#999}h1,h2,h3,h4,h5,h6{margin:10px 0;font-family:inherit;font-weight:bold;line-height:1;color:inherit;text-rendering:optimizelegibility}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-weight:normal;line-height:1;color:#999}h1{font-size:36px;line-height:40px}h2{font-size:30px;line-height:40px}h3{font-size:24px;line-height:40px}h4{font-size:18px;line-height:20px}h5{font-size:14px;line-height:20px}h6{font-size:12px;line-height:20px}h1 small{font-size:24px}h2 small{font-size:18px}h3 small{font-size:14px}h4 small{font-size:14px}.page-header{padding-bottom:9px;margin:20px 0 30px;border-bottom:1px solid #eee}ul,ol{padding:0;margin:0 0 10px 25px}ul ul,ul ol,ol ol,ol ul{margin-bottom:0}li{line-height:20px}ul.unstyled,ol.unstyled{margin-left:0;list-style:none}dl{margin-bottom:20px}dt,dd{line-height:20px}dt{font-weight:bold}dd{margin-left:10px}.dl-horizontal dt{float:left;width:120px;overflow:hidden;
 clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:130px}hr{margin:20px 0;border:0;border-top:1px solid #eee;border-bottom:1px solid #fff}abbr[title]{cursor:help;border-bottom:1px dotted #999}abbr.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:0 0 0 15px;margin:0 0 20px;border-left:5px solid #eee}blockquote p{margin-bottom:0;font-size:16px;font-weight:300;line-height:25px}blockquote small{display:block;line-height:20px;color:#999}blockquote small:before{content:'\2014 \00A0'}blockquote.pull-right{float:right;padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0}blockquote.pull-right p,blockquote.pull-right small{text-align:right}blockquote.pull-right small:before{content:''}blockquote.pull-right small:after{content:'\00A0 \2014'}q:before,q:after,blockquote:before,blockquote:after{content:""}address{display:block;margin-bottom:20px;font-style:normal;line-height:20px}code,pre{padding:0 3px 2px
 ;font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:12px;color:#333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}code{padding:2px 4px;color:#d14;background-color:#f7f7f9;border:1px solid #e1e1e8}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:20px;word-break:break-all;word-wrap:break-word;white-space:pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}pre.prettyprint{margin-bottom:20px}pre code{padding:0;color:inherit;background-color:transparent;border:0}.pre-scrollable{max-height:340px;overflow-y:scroll}form{margin:0 0 20px}fieldset{padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:40px;color:#333;border:0;border-bottom:1px solid #e5e5e5}legend small{font-size:15px;color:#999}label,input,button,select,textarea{font-size:14px;font-we
 ight:normal;line-height:20px}input,button,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif}label{display:block;margin-bottom:5px}select,textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{display:inline-block;height:20px;padding:4px 6px;margin-bottom:9px;font-size:14px;line-height:20px;color:#555;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}input,textarea{width:210px}textarea{height:auto}textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"]
 ,.uneditable-input{background-color:#fff;border:1px solid #ccc;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border linear .2s,box-shadow linear .2s;-moz-transition:border linear .2s,box-shadow linear .2s;-o-transition:border linear .2s,box-shadow linear .2s;transition:border linear .2s,box-shadow linear .2s}textarea:focus,input[type="text"]:focus,input[type="password"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="time"]:focus,input[type="week"]:focus,input[type="number"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="color"]:focus,.uneditable-input:focus{border-color:rgba(82,168,236,0.8);outline:0;outline:thin dotted \9;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-
 box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;*margin-top:0;line-height:normal;cursor:pointer}input[type="file"],input[type="image"],input[type="submit"],input[type="reset"],input[type="button"],input[type="radio"],input[type="checkbox"]{width:auto}select,input[type="file"]{height:30px;*margin-top:4px;line-height:30px}select{width:220px;background-color:#fff;border:1px solid #bbb}select[multiple],select[size]{height:auto}select:focus,input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.uneditable-input,.uneditable-textarea{color:#999;cursor:not-allowed;background-color:#fcfcfc;border-color:#ccc;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025)
 ;box-shadow:inset 0 1px 2px rgba(0,0,0,0.025)}.uneditable-input{overflow:hidden;white-space:nowrap}.uneditable-textarea{width:auto;height:auto}input:-moz-placeholder,textarea:-moz-placeholder{color:#999}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#999}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#999}.radio,.checkbox{min-height:18px;padding-left:18px}.radio input[type="radio"],.checkbox input[type="checkbox"]{float:left;margin-left:-18px}.controls>.radio:first-child,.controls>.checkbox:first-child{padding-top:5px}.radio.inline,.checkbox.inline{display:inline-block;padding-top:5px;margin-bottom:0;vertical-align:middle}.radio.inline+.radio.inline,.checkbox.inline+.checkbox.inline{margin-left:10px}.input-mini{width:60px}.input-small{width:90px}.input-medium{width:150px}.input-large{width:210px}.input-xlarge{width:270px}.input-xxlarge{width:530px}input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input[class*
 ="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"]{float:none;margin-left:0}.input-append input[class*="span"],.input-append .uneditable-input[class*="span"],.input-prepend input[class*="span"],.input-prepend .uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"],.row-fluid .input-prepend [class*="span"],.row-fluid .input-append [class*="span"]{display:inline-block}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:926px}input.span11,textarea.span11,.uneditable-input.span11{width:846px}input.span10,textarea.span10,.uneditable-input.span10{width:766px}input.span9,textarea.span9,.uneditable-input.span9{width:686px}input.span8,textarea.span8,.unedit
 able-input.span8{width:606px}input.span7,textarea.span7,.uneditable-input.span7{width:526px}input.span6,textarea.span6,.uneditable-input.span6{width:446px}input.span5,textarea.span5,.uneditable-input.span5{width:366px}input.span4,textarea.span4,.uneditable-input.span4{width:286px}input.span3,textarea.span3,.uneditable-input.span3{width:206px}input.span2,textarea.span2,.uneditable-input.span2{width:126px}input.span1,textarea.span1,.uneditable-input.span1{width:46px}.controls-row{*zoom:1}.controls-row:before,.controls-row:after{display:table;line-height:0;content:""}.controls-row:after{clear:both}.controls-row [class*="span"]{float:left}input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#eee}input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"][readonly],input[type="checkbox"][readonly]{background-color:transparent}.control-group.warning>label,.control-group.warning .h
 elp-block,.control-group.warning .help-inline{color:#c09853}.control-group.warning .checkbox,.control-group.warning .radio,.control-group.warning input,.control-group.warning select,.control-group.warning textarea{color:#c09853;border-color:#c09853;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.warning .checkbox:focus,.control-group.warning .radio:focus,.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus{border-color:#a47e3c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e}.control-group.warning .input-prepend .add-on,.control-group.warning .input-append .add-on{color:#c09853;background-color:#fcf8e3;border-color:#c09853}.control-group.error>label,.control-group.error 
 .help-block,.control-group.error .help-inline{color:#b94a48}.control-group.error .checkbox,.control-group.error .radio,.control-group.error input,.control-group.error select,.control-group.error textarea{color:#b94a48;border-color:#b94a48;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.error .checkbox:focus,.control-group.error .radio:focus,.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus{border-color:#953b39;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392}.control-group.error .input-prepend .add-on,.control-group.error .input-append .add-on{color:#b94a48;background-color:#f2dede;border-color:#b94a48}.control-group.success>label,.control-group.success .help-block,.control
 -group.success .help-inline{color:#468847}.control-group.success .checkbox,.control-group.success .radio,.control-group.success input,.control-group.success select,.control-group.success textarea{color:#468847;border-color:#468847;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.success .checkbox:focus,.control-group.success .radio:focus,.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus{border-color:#356635;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b}.control-group.success .input-prepend .add-on,.control-group.success .input-append .add-on{color:#468847;background-color:#dff0d8;border-color:#468847}input:focus:required:invalid,textarea:focus:required:invalid,selec
 t:focus:required:invalid{color:#b94a48;border-color:#ee5f5b}input:focus:required:invalid:focus,textarea:focus:required:invalid:focus,select:focus:required:invalid:focus{border-color:#e9322d;-webkit-box-shadow:0 0 6px #f8b9b7;-moz-box-shadow:0 0 6px #f8b9b7;box-shadow:0 0 6px #f8b9b7}.form-actions{padding:19px 20px 20px;margin-top:20px;margin-bottom:20px;background-color:#f5f5f5;border-top:1px solid #e5e5e5;*zoom:1}.form-actions:before,.form-actions:after{display:table;line-height:0;content:""}.form-actions:after{clear:both}.help-block,.help-inline{color:#595959}.help-block{display:block;margin-bottom:10px}.help-inline{display:inline-block;*display:inline;padding-left:5px;vertical-align:middle;*zoom:1}.input-append,.input-prepend{margin-bottom:5px;font-size:0;white-space:nowrap}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input{position:relative;margin-bottom:0;*margin-left:0;font-size:1
 4px;vertical-align:top;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.input-append input:focus,.input-prepend input:focus,.input-append select:focus,.input-prepend select:focus,.input-append .uneditable-input:focus,.input-prepend .uneditable-input:focus{z-index:2}.input-append .add-on,.input-prepend .add-on{display:inline-block;width:auto;height:20px;min-width:16px;padding:4px 5px;font-size:14px;font-weight:normal;line-height:20px;text-align:center;text-shadow:0 1px 0 #fff;background-color:#eee;border:1px solid #ccc}.input-append .add-on,.input-prepend .add-on,.input-append .btn,.input-prepend .btn{margin-left:-1px;vertical-align:top;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-append .active,.input-prepend .active{background-color:#a9dba9;border-color:#46a546}.input-prepend .add-on,.input-prepend .btn{margin-right:-1px}.input-prepend .add-on:first-child,.input-prepend .btn:first-child{-webkit-border-radius:3px 0 0 
 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.input-append input,.input-append select,.input-append .uneditable-input{-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.input-append .add-on:last-child,.input-append .btn:last-child{-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.input-prepend.input-append input,.input-prepend.input-append select,.input-prepend.input-append .uneditable-input{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-prepend.input-append .add-on:first-child,.input-prepend.input-append .btn:first-child{margin-right:-1px;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.input-prepend.input-append .add-on:last-child,.input-prepend.input-append .btn:last-child{margin-left:-1px;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}input.search-query{padding-right:14px;pad
 ding-right:4px \9;padding-left:14px;padding-left:4px \9;margin-bottom:0;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.form-search .input-append .search-query,.form-search .input-prepend .search-query{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.form-search .input-append .search-query{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search .input-append .btn{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .search-query{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .btn{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search input,.form-inline input,.form-horizontal input,.form-search textarea,.form-inline textarea,.form-horizontal textarea,.form-search select,.form-inline select,.for
 m-horizontal select,.form-search .help-inline,.form-inline .help-inline,.form-horizontal .help-inline,.form-search .uneditable-input,.form-inline .uneditable-input,.form-horizontal .uneditable-input,.form-search .input-prepend,.form-inline .input-prepend,.form-horizontal .input-prepend,.form-search .input-append,.form-inline .input-append,.form-horizontal .input-append{display:inline-block;*display:inline;margin-bottom:0;vertical-align:middle;*zoom:1}.form-search .hide,.form-inline .hide,.form-horizontal .hide{display:none}.form-search label,.form-inline label,.form-search .btn-group,.form-inline .btn-group{display:inline-block}.form-search .input-append,.form-inline .input-append,.form-search .input-prepend,.form-inline .input-prepend{margin-bottom:0}.form-search .radio,.form-search .checkbox,.form-inline .radio,.form-inline .checkbox{padding-left:0;margin-bottom:0;vertical-align:middle}.form-search .radio input[type="radio"],.form-search .checkbox input[type="checkbox"],.form-inli
 ne .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:left;margin-right:3px;margin-left:0}.control-group{margin-bottom:10px}legend+.control-group{margin-top:20px;-webkit-margin-top-collapse:separate}.form-horizontal .control-group{margin-bottom:20px;*zoom:1}.form-horizontal .control-group:before,.form-horizontal .control-group:after{display:table;line-height:0;content:""}.form-horizontal .control-group:after{clear:both}.form-horizontal .control-label{float:left;width:140px;padding-top:5px;text-align:right}.form-horizontal .controls{*display:inline-block;*padding-left:20px;margin-left:160px;*margin-left:0}.form-horizontal .controls:first-child{*padding-left:160px}.form-horizontal .help-block{margin-top:10px;margin-bottom:0}.form-horizontal .form-actions{padding-left:160px}table{max-width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0}.table{width:100%;margin-bottom:20px}.table th,.table td{padding:8px;line-height:20px;text-alig
 n:left;vertical-align:top;border-top:1px solid #ddd}.table th{font-weight:bold}.table thead th{vertical-align:bottom}.table caption+thead tr:first-child th,.table caption+thead tr:first-child td,.table colgroup+thead tr:first-child th,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child th,.table thead:first-child tr:first-child td{border-top:0}.table tbody+tbody{border-top:2px solid #ddd}.table-condensed th,.table-condensed td{padding:4px 5px}.table-bordered{border:1px solid #ddd;border-collapse:separate;*border-collapse:collapse;border-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.table-bordered th,.table-bordered td{border-left:1px solid #ddd}.table-bordered caption+thead tr:first-child th,.table-bordered caption+tbody tr:first-child th,.table-bordered caption+tbody tr:first-child td,.table-bordered colgroup+thead tr:first-child th,.table-bordered colgroup+tbody tr:first-child th,.table-bordered colgroup+tbody tr:first-child
  td,.table-bordered thead:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child td{border-top:0}.table-bordered thead:first-child tr:first-child th:first-child,.table-bordered tbody:first-child tr:first-child td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered thead:first-child tr:first-child th:last-child,.table-bordered tbody:first-child tr:first-child td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px}.table-bordered thead:last-child tr:last-child th:first-child,.table-bordered tbody:last-child tr:last-child td:first-child,.table-bordered tfoot:last-child tr:last-child td:first-child{-webkit-border-radius:0 0 0 4px;-moz-border-radius:0 0 0 4px;border-radius:0 0 0 4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px}.table-b
 ordered thead:last-child tr:last-child th:last-child,.table-bordered tbody:last-child tr:last-child td:last-child,.table-bordered tfoot:last-child tr:last-child td:last-child{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px}.table-bordered caption+thead tr:first-child th:first-child,.table-bordered caption+tbody tr:first-child td:first-child,.table-bordered colgroup+thead tr:first-child th:first-child,.table-bordered colgroup+tbody tr:first-child td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered caption+thead tr:first-child th:last-child,.table-bordered caption+tbody tr:first-child td:last-child,.table-bordered colgroup+thead tr:first-child th:last-child,.table-bordered colgroup+tbody tr:first-child td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-right-topleft:4px}.table-striped tbody tr:nth-child(odd) td,.table-s
 triped tbody tr:nth-child(odd) th{background-color:#f9f9f9}.table-hover tbody tr:hover td,.table-hover tbody tr:hover th{background-color:#f5f5f5}table [class*=span],.row-fluid table [class*=span]{display:table-cell;float:none;margin-left:0}table .span1{float:none;width:44px;margin-left:0}table .span2{float:none;width:124px;margin-left:0}table .span3{float:none;width:204px;margin-left:0}table .span4{float:none;width:284px;margin-left:0}table .span5{float:none;width:364px;margin-left:0}table .span6{float:none;width:444px;margin-left:0}table .span7{float:none;width:524px;margin-left:0}table .span8{float:none;width:604px;margin-left:0}table .span9{float:none;width:684px;margin-left:0}table .span10{float:none;width:764px;margin-left:0}table .span11{float:none;width:844px;margin-left:0}table .span12{float:none;width:924px;margin-left:0}table .span13{float:none;width:1004px;margin-left:0}table .span14{float:none;width:1084px;margin-left:0}table .span15{float:none;width:1164px;margin-left:
 0}table .span16{float:none;width:1244px;margin-left:0}table .span17{float:none;width:1324px;margin-left:0}table .span18{float:none;width:1404px;margin-left:0}table .span19{float:none;width:1484px;margin-left:0}table .span20{float:none;width:1564px;margin-left:0}table .span21{float:none;width:1644px;margin-left:0}table .span22{float:none;width:1724px;margin-left:0}table .span23{float:none;width:1804px;margin-left:0}table .span24{float:none;width:1884px;margin-left:0}.table tbody tr.success td{background-color:#dff0d8}.table tbody tr.error td{background-color:#f2dede}.table tbody tr.info td{background-color:#d9edf7}[class^="icon-"],[class*=" icon-"]{display:inline-block;width:14px;height:14px;margin-top:1px;*margin-right:.3em;line-height:14px;vertical-align:text-top;background-image:url("../img/glyphicons-halflings.png");background-position:14px 14px;background-repeat:no-repeat}.icon-white,.nav>.active>a>[class^="icon-"],.nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[clas
 s^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"]{background-image:url("../img/glyphicons-halflings-white.png")}.icon-glass{background-position:0 0}.icon-music{background-position:-24px 0}.icon-search{background-position:-48px 0}.icon-envelope{background-position:-72px 0}.icon-heart{background-position:-96px 0}.icon-star{background-position:-120px 0}.icon-star-empty{background-position:-144px 0}.icon-user{background-position:-168px 0}.icon-film{background-position:-192px 0}.icon-th-large{background-position:-216px 0}.icon-th{background-position:-240px 0}.icon-th-list{background-position:-264px 0}.icon-ok{background-position:-288px 0}.icon-remove{background-position:-312px 0}.icon-zoom-in{background-position:-336px 0}.icon-zoom-out{background-position:-360px 0}.icon-off{background-position:-384px 0}.icon-signal{background-position:-408px 0}.icon-cog{background-position:-432px 0}.icon-trash{back
 ground-position:-456px 0}.icon-home{background-position:0 -24px}.icon-file{background-position:-24px -24px}.icon-time{background-position:-48px -24px}.icon-road{background-position:-72px -24px}.icon-download-alt{background-position:-96px -24px}.icon-download{background-position:-120px -24px}.icon-upload{background-position:-144px -24px}.icon-inbox{background-position:-168px -24px}.icon-play-circle{background-position:-192px -24px}.icon-repeat{background-position:-216px -24px}.icon-refresh{background-position:-240px -24px}.icon-list-alt{background-position:-264px -24px}.icon-lock{background-position:-287px -24px}.icon-flag{background-position:-312px -24px}.icon-headphones{background-position:-336px -24px}.icon-volume-off{background-position:-360px -24px}.icon-volume-down{background-position:-384px -24px}.icon-volume-up{background-position:-408px -24px}.icon-qrcode{background-position:-432px -24px}.icon-barcode{background-position:-456px -24px}.icon-tag{background-position:0 -48px}.ic
 on-tags{background-position:-25px -48px}.icon-book{background-position:-48px -48px}.icon-bookmark{background-position:-72px -48px}.icon-print{background-position:-96px -48px}.icon-camera{background-position:-120px -48px}.icon-font{background-position:-144px -48px}.icon-bold{background-position:-167px -48px}.icon-italic{background-position:-192px -48px}.icon-text-height{background-position:-216px -48px}.icon-text-width{background-position:-240px -48px}.icon-align-left{background-position:-264px -48px}.icon-align-center{background-position:-288px -48px}.icon-align-right{background-position:-312px -48px}.icon-align-justify{background-position:-336px -48px}.icon-list{background-position:-360px -48px}.icon-indent-left{background-position:-384px -48px}.icon-indent-right{background-position:-408px -48px}.icon-facetime-video{background-position:-432px -48px}.icon-picture{background-position:-456px -48px}.icon-pencil{background-position:0 -72px}.icon-map-marker{background-position:-24px -72p
 x}.icon-adjust{background-position:-48px -72px}.icon-tint{background-position:-72px -72px}.icon-edit{background-position:-96px -72px}.icon-share{background-position:-120px -72px}.icon-check{background-position:-144px -72px}.icon-move{background-position:-168px -72px}.icon-step-backward{background-position:-192px -72px}.icon-fast-backward{background-position:-216px -72px}.icon-backward{background-position:-240px -72px}.icon-play{background-position:-264px -72px}.icon-pause{background-position:-288px -72px}.icon-stop{background-position:-312px -72px}.icon-forward{background-position:-336px -72px}.icon-fast-forward{background-position:-360px -72px}.icon-step-forward{background-position:-384px -72px}.icon-eject{background-position:-408px -72px}.icon-chevron-left{background-position:-432px -72px}.icon-chevron-right{background-position:-456px -72px}.icon-plus-sign{background-position:0 -96px}.icon-minus-sign{background-position:-24px -96px}.icon-remove-sign{background-position:-48px -96px
 }.icon-ok-sign{background-position:-72px -96px}.icon-question-sign{background-position:-96px -96px}.icon-info-sign{background-position:-120px -96px}.icon-screenshot{background-position:-144px -96px}.icon-remove-circle{background-position:-168px -96px}.icon-ok-circle{background-position:-192px -96px}.icon-ban-circle{background-position:-216px -96px}.icon-arrow-left{background-position:-240px -96px}.icon-arrow-right{background-position:-264px -96px}.icon-arrow-up{background-position:-289px -96px}.icon-arrow-down{background-position:-312px -96px}.icon-share-alt{background-position:-336px -96px}.icon-resize-full{background-position:-360px -96px}.icon-resize-small{background-position:-384px -96px}.icon-plus{background-position:-408px -96px}.icon-minus{background-position:-433px -96px}.icon-asterisk{background-position:-456px -96px}.icon-exclamation-sign{background-position:0 -120px}.icon-gift{background-position:-24px -120px}.icon-leaf{background-position:-48px -120px}.icon-fire{backgrou
 nd-position:-72px -120px}.icon-eye-open{background-position:-96px -120px}.icon-eye-close{background-position:-120px -120px}.icon-warning-sign{background-position:-144px -120px}.icon-plane{background-position:-168px -120px}.icon-calendar{background-position:-192px -120px}.icon-random{width:16px;background-position:-216px -120px}.icon-comment{background-position:-240px -120px}.icon-magnet{background-position:-264px -120px}.icon-chevron-up{background-position:-288px -120px}.icon-chevron-down{background-position:-313px -119px}.icon-retweet{background-position:-336px -120px}.icon-shopping-cart{background-position:-360px -120px}.icon-folder-close{background-position:-384px -120px}.icon-folder-open{width:16px;background-position:-408px -120px}.icon-resize-vertical{background-position:-432px -119px}.icon-resize-horizontal{background-position:-456px -118px}.icon-hdd{background-position:0 -144px}.icon-bullhorn{background-position:-24px -144px}.icon-bell{background-position:-48px -144px}.icon-
 certificate{background-position:-72px -144px}.icon-thumbs-up{background-position:-96px -144px}.icon-thumbs-down{background-position:-120px -144px}.icon-hand-right{background-position:-144px -144px}.icon-hand-left{background-position:-168px -144px}.icon-hand-up{background-position:-192px -144px}.icon-hand-down{background-position:-216px -144px}.icon-circle-arrow-right{background-position:-240px -144px}.icon-circle-arrow-left{background-position:-264px -144px}.icon-circle-arrow-up{background-position:-288px -144px}.icon-circle-arrow-down{background-position:-312px -144px}.icon-globe{background-position:-336px -144px}.icon-wrench{background-position:-360px -144px}.icon-tasks{background-position:-384px -144px}.icon-filter{background-position:-408px -144px}.icon-briefcase{background-position:-432px -144px}.icon-fullscreen{background-position:-456px -144px}.dropup,.dropdown{position:relative}.dropdown-toggle{*margin-bottom:-3px}.dropdown-toggle:active,.open .dropdown-toggle{outline:0}.car
 et{display:inline-block;width:0;height:0;vertical-align:top;border-top:4px solid #000;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.dropdown .caret{margin-top:8px;margin-left:2px}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);*border-right-width:2px;*border-bottom-width:2px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.dropdown-menu a{display:blo
 ck;padding:3px 20px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap}.dropdown-menu li>a:hover,.dropdown-menu li>a:focus,.dropdown-submenu:hover>a{color:#fff;text-decoration:none;background-color:#08c;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0)}.dropdown-menu .active>a,.dropdown-menu .active>a:hover{color:#fff;text-decoration:none;background-color:#08c;background-color:#0081c2;background-image:linear-gradient(to bottom,#08c,#0077b3);background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100
 %,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-repeat:repeat-x;outline:0;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0)}.dropdown-menu .disabled>a,.dropdown-menu .disabled>a:hover{color:#999}.dropdown-menu .disabled>a:hover{text-decoration:none;cursor:default;background-color:transparent}.open{*z-index:1000}.open>.dropdown-menu{display:block}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid #000;content:"\2191"}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}.dropdown-submenu{position:relative}.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px}.d
 ropdown-submenu:hover .dropdown-menu{display:block}.dropdown-submenu>a:after{display:block;float:right;width:0;height:0;margin-top:5px;margin-right:-10px;border-color:transparent;border-left-color:#ccc;border-style:solid;border-width:5px 0 5px 5px;content:" "}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown .dropdown-menu .nav-header{padding-right:20px;padding-left:20px}.typeahead{margin-top:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-large{padding:24px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.well-small{padding:9px;-webkit-border-rad
 ius:3px;-moz-border-radius:3px;border-radius:3px}.fade{opacity:0;-webkit-transition:opacity .15s linear;-moz-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{position:relative;height:0;overflow:hidden;overflow:visible \9;-webkit-transition:height .35s ease;-moz-transition:height .35s ease;-o-transition:height .35s ease;transition:height .35s ease}.collapse.in{height:auto}.close{float:right;font-size:20px;font-weight:bold;line-height:20px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.btn{display:inline-block;*display:inline;padding:4px 14px;margin-bottom:0;*margin-left:.3em;font-size:14px;line-height:20px;*line-height:20px;color:#333;text-align:center;text-shadow:0 1px 1px rgba(255,255,255,0.75);
 vertical-align:middle;cursor:pointer;background-color:#f5f5f5;*background-color:#e6e6e6;background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-repeat:repeat-x;border:1px solid #bbb;*border:0;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-bottom-color:#a2a2a2;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe6e6e6',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false);*zoom:1;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-
 shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.btn:hover,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.btn:active,.btn.active{background-color:#ccc \9}.btn:first-child{*margin-left:0}.btn:hover{color:#333;text-decoration:none;background-color:#e6e6e6;*background-color:#d9d9d9;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.active,.btn:active{background-color:#e6e6e6;background-color:#d9d9d9 \9;background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2p
 x rgba(0,0,0,0.05)}.btn.disabled,.btn[disabled]{cursor:default;background-color:#e6e6e6;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-large{padding:9px 14px;font-size:16px;line-height:normal;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.btn-large [class^="icon-"]{margin-top:2px}.btn-small{padding:3px 9px;font-size:12px;line-height:18px}.btn-small [class^="icon-"]{margin-top:0}.btn-mini{padding:2px 6px;font-size:11px;line-height:16px}.btn-block{display:block;width:100%;padding-right:0;padding-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.btn-block+.btn-block{margin-top:5px}.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active{color:rgba(255,255,255,0.75)}.btn{border-color:#c5c5c5;border-color:rgba(0,0,0,0.15) rgba(0,0,0,0.15) rgba(0,0,0,0.25)}.btn-primary{color:#fff;text-shadow:0 -1p
 x 0 rgba(0,0,0,0.25);background-color:#006dcc;*background-color:#04c;background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-image:-moz-linear-gradient(top,#08c,#04c);background-repeat:repeat-x;border-color:#04c #0044cc #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false)}.btn-primary:hover,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.btn-primary:active,.btn-primary.active{background-color:#039 \9}.btn-warning{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#faa732;*background-color:#f89
 406;background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-repeat:repeat-x;border-color:#f89406 #f89406 #ad6704;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false)}.btn-warning:hover,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{color:#fff;background-color:#f89406;*background-color:#df8505}.btn-warning:active,.btn-warning.active{background-color:#c67605 \9}.btn-danger{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#da4f49;*background-color:#bd362f;background-image:-webki
 t-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#bd362f));background-image:-webkit-linear-gradient(top,#ee5f5b,#bd362f);background-image:-o-linear-gradient(top,#ee5f5b,#bd362f);background-image:linear-gradient(to bottom,#ee5f5b,#bd362f);background-image:-moz-linear-gradient(top,#ee5f5b,#bd362f);background-repeat:repeat-x;border-color:#bd362f #bd362f #802420;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffbd362f',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false)}.btn-danger:hover,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{color:#fff;background-color:#bd362f;*background-color:#a9302a}.btn-danger:active,.btn-danger.active{background-color:#942a25 \9}.btn-success{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#5bb75b;*background-color:#51a351;background-image:-webkit-gradient(linear,0 0,0 100%,from
 (#62c462),to(#51a351));background-image:-webkit-linear-gradient(top,#62c462,#51a351);background-image:-o-linear-gradient(top,#62c462,#51a351);background-image:linear-gradient(to bottom,#62c462,#51a351);background-image:-moz-linear-gradient(top,#62c462,#51a351);background-repeat:repeat-x;border-color:#51a351 #51a351 #387038;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff51a351',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false)}.btn-success:hover,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled]{color:#fff;background-color:#51a351;*background-color:#499249}.btn-success:active,.btn-success.active{background-color:#408140 \9}.btn-info{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#49afcd;*background-color:#2f96b4;background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#2f96b4));backgr
 ound-image:-webkit-linear-gradient(top,#5bc0de,#2f96b4);background-image:-o-linear-gradient(top,#5bc0de,#2f96b4);background-image:linear-gradient(to bottom,#5bc0de,#2f96b4);background-image:-moz-linear-gradient(top,#5bc0de,#2f96b4);background-repeat:repeat-x;border-color:#2f96b4 #2f96b4 #1f6377;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff2f96b4',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false)}.btn-info:hover,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{color:#fff;background-color:#2f96b4;*background-color:#2a85a0}.btn-info:active,.btn-info.active{background-color:#24748c \9}.btn-inverse{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#363636;*background-color:#222;background-image:-webkit-gradient(linear,0 0,0 100%,from(#444),to(#222));background-image:-webkit-linear-gradient(top,#444,#222);backgr
 ound-image:-o-linear-gradient(top,#444,#222);background-image:linear-gradient(to bottom,#444,#222);background-image:-moz-linear-gradient(top,#444,#222);background-repeat:repeat-x;border-color:#222 #222222 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff444444',endColorstr='#ff222222',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false)}.btn-inverse:hover,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled]{color:#fff;background-color:#222;*background-color:#151515}.btn-inverse:active,.btn-inverse.active{background-color:#080808 \9}button.btn,input[type="submit"].btn{*padding-top:3px;*padding-bottom:3px}button.btn::-moz-focus-inner,input[type="submit"].btn::-moz-focus-inner{padding:0;border:0}button.btn.btn-large,input[type="submit"].btn.btn-large{*padding-top:7px;*padding-bottom:7px}button.btn.btn-small,input[type="submit"].btn.btn-small{
 *padding-top:3px;*padding-bottom:3px}button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-bottom:1px}.btn-link,.btn-link:active{background-color:transparent;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-link{color:#08c;cursor:pointer;border-color:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-link:hover{color:#005580;text-decoration:underline;background-color:transparent}.btn-group{position:relative;*margin-left:.3em;font-size:0;white-space:nowrap}.btn-group:first-child{*margin-left:0}.btn-group+.btn-group{margin-left:5px}.btn-toolbar{margin-top:10px;margin-bottom:10px;font-size:0}.btn-toolbar .btn-group{display:inline-block;*display:inline;*zoom:1}.btn-toolbar .btn+.btn,.btn-toolbar .btn-group+.btn,.btn-toolbar .btn+.btn-group{margin-left:5px}.btn-group>.btn{position:relative;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group>.btn+.btn{margin-left:-1px}.btn-group
 >.btn,.btn-group>.dropdown-menu{font-size:14px}.btn-group>.btn-mini{font-size:11px}.btn-group>.btn-small{font-size:12px}.btn-group>.btn-large{font-size:16px}.btn-group>.btn:first-child{margin-left:0;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-topleft:4px}.btn-group>.btn:last-child,.btn-group>.dropdown-toggle{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px}.btn-group>.btn.large:first-child{margin-left:0;-webkit-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-webkit-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-topleft:6px}.btn-group>.btn.large:last-child,.btn-group>.large.dropdown-toggle{-webkit-border-top-right-radius:6px;b
 order-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;border-bottom-right-radius:6px;-moz-border-radius-topright:6px;-moz-border-radius-bottomright:6px}.btn-group>.btn:hover,.btn-group>.btn:focus,.btn-group>.btn:active,.btn-group>.btn.active{z-index:2}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{*padding-top:5px;padding-right:8px;*padding-bottom:5px;padding-left:8px;-webkit-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.btn-group>.btn-mini+.dropdown-toggle{*padding-top:2px;padding-right:5px;*padding-bottom:2px;padding-left:5px}.btn-group>.btn-small+.dropdown-toggle{*padding-top:5px;*padding-bottom:4px}.btn-group>.btn
 -large+.dropdown-toggle{*padding-top:7px;padding-right:12px;*padding-bottom:7px;padding-left:12px}.btn-group.open .dropdown-toggle{background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.btn-group.open .btn.dropdown-toggle{background-color:#e6e6e6}.btn-group.open .btn-primary.dropdown-toggle{background-color:#04c}.btn-group.open .btn-warning.dropdown-toggle{background-color:#f89406}.btn-group.open .btn-danger.dropdown-toggle{background-color:#bd362f}.btn-group.open .btn-success.dropdown-toggle{background-color:#51a351}.btn-group.open .btn-info.dropdown-toggle{background-color:#2f96b4}.btn-group.open .btn-inverse.dropdown-toggle{background-color:#222}.btn .caret{margin-top:8px;margin-left:0}.btn-mini .caret,.btn-small .caret,.btn-large .caret{margin-top:6px}.btn-large .caret{border-top-width:5p
 x;border-right-width:5px;border-left-width:5px}.dropup .btn-large .caret{border-top:0;border-bottom:5px solid #000}.btn-primary .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret,.btn-success .caret,.btn-inverse .caret{border-top-color:#fff;border-bottom-color:#fff}.btn-group-vertical{display:inline-block;*display:inline;*zoom:1}.btn-group-vertical .btn{display:block;float:none;width:100%;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group-vertical .btn+.btn{margin-top:-1px;margin-left:0}.btn-group-vertical .btn:first-child{-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.btn-group-vertical .btn:last-child{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.btn-group-vertical .btn-large:first-child{-webkit-border-radius:6px 6px 0 0;-moz-border-radius:6px 6px 0 0;border-radius:6px 6px 0 0}.btn-group-vertical .btn-large:last-child{-webkit-border-radius:0 0 6px 6px;-moz-bo
 rder-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.alert{padding:8px 35px 8px 14px;margin-bottom:20px;color:#c09853;text-shadow:0 1px 0 rgba(255,255,255,0.5);background-color:#fcf8e3;border:1px solid #fbeed5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.alert h4{margin:0}.alert .close{position:relative;top:-2px;right:-21px;line-height:20px}.alert-success{color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.alert-danger,.alert-error{color:#b94a48;background-color:#f2dede;border-color:#eed3d7}.alert-info{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}.alert-block{padding-top:14px;padding-bottom:14px}.alert-block>p,.alert-block>ul{margin-bottom:0}.alert-block p+p{margin-top:5px}.nav{margin-bottom:20px;margin-left:0;list-style:none}.nav>li>a{display:block}.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>.pull-right{float:right}.nav-header{display:block;padding:3px 15px;font-size:11px;font-weight:bold;line-height:20px;color:#999;t
 ext-shadow:0 1px 0 rgba(255,255,255,0.5);text-transform:uppercase}.nav li+.nav-header{margin-top:9px}.nav-list{padding-right:15px;padding-left:15px;margin-bottom:0}.nav-list>li>a,.nav-list .nav-header{margin-right:-15px;margin-left:-15px;text-shadow:0 1px 0 rgba(255,255,255,0.5)}.nav-list>li>a{padding:3px 15px}.nav-list>.active>a,.nav-list>.active>a:hover{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.2);background-color:#08c}.nav-list [class^="icon-"]{margin-right:2px}.nav-list .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.nav-tabs,.nav-pills{*zoom:1}.nav-tabs:before,.nav-pills:before,.nav-tabs:after,.nav-pills:after{display:table;line-height:0;content:""}.nav-tabs:after,.nav-pills:after{clear:both}.nav-tabs>li,.nav-pills>li{float:left}.nav-tabs>li>a,.nav-pills>li>a{padding-right:12px;padding-left:12px;margin-right:2px;line-height:14px}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{margin-
 bottom:-1px}.nav-tabs>li>a{padding-top:8px;padding-bottom:8px;line-height:20px;border:1px solid transparent;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eeeeee #ddd}.nav-tabs>.active>a,.nav-tabs>.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-pills>li>a{padding-top:8px;padding-bottom:8px;margin-top:2px;margin-bottom:2px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.nav-pills>.active>a,.nav-pills>.active>a:hover{color:#fff;background-color:#08c}.nav-stacked>li{float:none}.nav-stacked>li>a{margin-right:0}.nav-tabs.nav-stacked{border-bottom:0}.nav-tabs.nav-stacked>li>a{border:1px solid #ddd;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.nav-tabs.nav-stacked>li:first-child>a{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radi
 us:4px;-moz-border-radius-topright:4px;-moz-border-radius-topleft:4px}.nav-tabs.nav-stacked>li:last-child>a{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomright:4px;-moz-border-radius-bottomleft:4px}.nav-tabs.nav-stacked>li>a:hover{z-index:2;border-color:#ddd}.nav-pills.nav-stacked>li>a{margin-bottom:3px}.nav-pills.nav-stacked>li:last-child>a{margin-bottom:1px}.nav-tabs .dropdown-menu{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.nav-pills .dropdown-menu{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.nav .dropdown-toggle .caret{margin-top:6px;border-top-color:#08c;border-bottom-color:#08c}.nav .dropdown-toggle:hover .caret{border-top-color:#005580;border-bottom-color:#005580}.nav-tabs .dropdown-toggle .caret{margin-top:8px}.nav .active .dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#f
 ff}.nav-tabs .active .dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.nav>.dropdown.active>a:hover{cursor:pointer}.nav-tabs .open .dropdown-toggle,.nav-pills .open .dropdown-toggle,.nav>li.dropdown.open.active>a:hover{color:#fff;background-color:#999;border-color:#999}.nav li.dropdown.open .caret,.nav li.dropdown.open.active .caret,.nav li.dropdown.open a:hover .caret{border-top-color:#fff;border-bottom-color:#fff;opacity:1;filter:alpha(opacity=100)}.tabs-stacked .open>a:hover{border-color:#999}.tabbable{*zoom:1}.tabbable:before,.tabbable:after{display:table;line-height:0;content:""}.tabbable:after{clear:both}.tab-content{overflow:auto}.tabs-below>.nav-tabs,.tabs-right>.nav-tabs,.tabs-left>.nav-tabs{border-bottom:0}.tab-content>.tab-pane,.pill-content>.pill-pane{display:none}.tab-content>.active,.pill-content>.active{display:block}.tabs-below>.nav-tabs{border-top:1px solid #ddd}.tabs-below>.nav-tabs>li{margin-top:-1px;margin-bottom:0}.tabs-below>.nav-tabs>li>a
 {-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.tabs-below>.nav-tabs>li>a:hover{border-top-color:#ddd;border-bottom-color:transparent}.tabs-below>.nav-tabs>.active>a,.tabs-below>.nav-tabs>.active>a:hover{border-color:transparent #ddd #ddd #ddd}.tabs-left>.nav-tabs>li,.tabs-right>.nav-tabs>li{float:none}.tabs-left>.nav-tabs>li>a,.tabs-right>.nav-tabs>li>a{min-width:74px;margin-right:0;margin-bottom:3px}.tabs-left>.nav-tabs{float:left;margin-right:19px;border-right:1px solid #ddd}.tabs-left>.nav-tabs>li>a{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.tabs-left>.nav-tabs>li>a:hover{border-color:#eee #dddddd #eee #eeeeee}.tabs-left>.nav-tabs .active>a,.tabs-left>.nav-tabs .active>a:hover{border-color:#ddd transparent #ddd #ddd;*border-right-color:#fff}.tabs-right>.nav-tabs{float:right;margin-left:19px;border-left:1px solid #ddd}.tabs-right>.nav-tabs>li>a{margin-left:-1px;-webkit-
 border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.tabs-right>.nav-tabs>li>a:hover{border-color:#eee #eeeeee #eee #dddddd}.tabs-right>.nav-tabs .active>a,.tabs-right>.nav-tabs .active>a:hover{border-color:#ddd #ddd #ddd transparent;*border-left-color:#fff}.nav>.disabled>a{color:#999}.nav>.disabled>a:hover{text-decoration:none;cursor:default;background-color:transparent}.navbar{*position:relative;*z-index:2;margin-bottom:20px;overflow:visible;color:#555}.navbar-inner{min-height:40px;padding-right:20px;padding-left:20px;background-color:#fafafa;background-image:-moz-linear-gradient(top,#fff,#f2f2f2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#f2f2f2));background-image:-webkit-linear-gradient(top,#fff,#f2f2f2);background-image:-o-linear-gradient(top,#fff,#f2f2f2);background-image:linear-gradient(to bottom,#fff,#f2f2f2);background-repeat:repeat-x;border:1px solid #d4d4d4;-webkit-border-radius:4px;-moz-border-radius:4px;border-radiu
 s:4px;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffffffff',endColorstr='#fff2f2f2',GradientType=0);-webkit-box-shadow:0 1px 4px rgba(0,0,0,0.065);-moz-box-shadow:0 1px 4px rgba(0,0,0,0.065);box-shadow:0 1px 4px rgba(0,0,0,0.065)}.navbar .container{width:auto}.nav-collapse.collapse{height:auto}.navbar .brand{display:block;float:left;padding:10px 20px 10px;margin-left:-20px;font-size:20px;font-weight:200;color:#555;text-shadow:0 1px 0 #fff}.navbar .brand:hover{text-decoration:none}.navbar-text{margin-bottom:0;line-height:40px}.navbar-link{color:#555}.navbar-link:hover{color:#333}.navbar .divider-vertical{height:40px;margin:0 9px;border-right:1px solid #fff;border-left:1px solid #f2f2f2}.navbar .btn,.navbar .btn-group{margin-top:6px}.navbar .btn-group .btn{margin:0}.navbar-form{margin-bottom:0;*zoom:1}.navbar-form:before,.navbar-form:after{display:table;line-height:0;content:""}.navbar-form:after{clear:both}.navbar-form input,.navbar-form select,.navbar-form .rad
 io,.navbar-form .checkbox{margin-top:5px}.navbar-form input,.navbar-form select,.navbar-form .btn{display:inline-block;margin-bottom:0}.navbar-form input[type="image"],.navbar-form input[type="checkbox"],.navbar-form input[type="radio"]{margin-top:3px}.navbar-form .input-append,.navbar-form .input-prepend{margin-top:6px;white-space:nowrap}.navbar-form .input-append input,.navbar-form .input-prepend input{margin-top:0}.navbar-search{position:relative;float:left;margin-top:5px;margin-bottom:0}.navbar-search .search-query{padding:4px 14px;margin-bottom:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:1;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.navbar-static-top{position:static;width:100%;margin-bottom:0}.navbar-static-top .navbar-inner{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030;margin-bottom:0}.navbar-fix
 ed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner,.navbar-static-top .navbar-inner{border:0}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding-right:0;padding-left:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.navbar-fixed-top{top:0}.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.1),0 1px 10px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.1),0 1px 10px rgba(0,0,0,0.1);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.1),0 1px 10px rgba(0,0,0,0.1)}.navbar-fixed-bottom{bottom:0}.navbar-fixed-bottom .navbar-inner{-webkit-box-shadow:inset 0 1px 0 rgba(0,0,0,0.1),0 -1px 10px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 1px 0 rgba(0,0,0,0.1),0 -1px 10px rgba(0,0,0,0.1);box-shadow:inset 0 1px 0 rgba(0,0,0,0.1),0 -1px 10px rgba(0,0,0,0.1)}.navbar .nav{position:relative;left:0;displ
 ay:block;float:left;margin:0 10px 0 0}.navbar .nav.pull-right{float:right}.navbar .nav>li{float:left}.navbar .nav>li>a{float:none;padding:10px 15px 10px;color:#555;text-decoration:none;text-shadow:0 1px 0 #fff}.navbar .nav .dropdown-toggle .caret{margin-top:8px}.navbar .nav>li>a:focus,.navbar .nav>li>a:hover{color:#333;text-decoration:none;background-color:transparent}.navbar .nav>.active>a,.navbar .nav>.active>a:hover,.navbar .nav>.active>a:focus{color:#555;text-decoration:none;background-color:#e5e5e5;-webkit-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);-moz-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);box-shadow:inset 0 3px 8px rgba(0,0,0,0.125)}.navbar .btn-navbar{display:none;float:right;padding:7px 10px;margin-right:5px;margin-left:5px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#ededed;*background-color:#e5e5e5;background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#e5e5e5));background-image:-webkit-linear-gradient(top,#f2f2f2,#e5e5e5);back
 ground-image:-o-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:linear-gradient(to bottom,#f2f2f2,#e5e5e5);background-image:-moz-linear-gradient(top,#f2f2f2,#e5e5e5);background-repeat:repeat-x;border-color:#e5e5e5 #e5e5e5 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffe5e5e5',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075)}.navbar .btn-navbar:hover,.navbar .btn-navbar:active,.navbar .btn-navbar.active,.navbar .btn-navbar.disabled,.navbar .btn-navbar[disabled]{color:#fff;background-color:#e5e5e5;*background-color:#d9d9d9}.navbar .btn-navbar:active,.navbar .btn-navbar.active{background-co
 lor:#ccc \9}.navbar .btn-navbar .icon-bar{display:block;width:18px;height:2px;background-color:#f5f5f5;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,0.25);-moz-box-shadow:0 1px 0 rgba(0,0,0,0.25);box-shadow:0 1px 0 rgba(0,0,0,0.25)}.btn-navbar .icon-bar+.icon-bar{margin-top:3px}.navbar .nav>li>.dropdown-menu:before{position:absolute;top:-7px;left:9px;display:inline-block;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-left:7px solid transparent;border-bottom-color:rgba(0,0,0,0.2);content:''}.navbar .nav>li>.dropdown-menu:after{position:absolute;top:-6px;left:10px;display:inline-block;border-right:6px solid transparent;border-bottom:6px solid #fff;border-left:6px solid transparent;content:''}.navbar-fixed-bottom .nav>li>.dropdown-menu:before{top:auto;bottom:-7px;border-top:7px solid #ccc;border-bottom:0;border-top-color:rgba(0,0,0,0.2)}.navbar-fixed-bottom .nav>li>.dropdown-menu:after{top:auto;bottom:-6
 px;border-top:6px solid #fff;border-bottom:0}.navbar .nav li.dropdown.open>.dropdown-toggle,.navbar .nav li.dropdown.active>.dropdown-toggle,.navbar .nav li.dropdown.open.active>.dropdown-toggle{color:#555;background-color:#e5e5e5}.navbar .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.navbar .nav li.dropdown.open>.dropdown-toggle .caret,.navbar .nav li.dropdown.active>.dropdown-toggle .caret,.navbar .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.navbar .pull-right>li>.dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right{right:0;left:auto}.navbar .pull-right>li>.dropdown-menu:before,.navbar .nav>li>.dropdown-menu.pull-right:before{right:12px;left:auto}.navbar .pull-right>li>.dropdown-menu:after,.navbar .nav>li>.dropdown-menu.pull-right:after{right:13px;left:auto}.navbar .pull-right>li>.dropdown-menu .dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right .dropdown-menu{right:100%;left:
 auto;margin-right:-1px;margin-left:0;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.navbar-inverse{color:#999}.navbar-inverse .navbar-inner{background-color:#1b1b1b;background-image:-moz-linear-gradient(top,#222,#111);background-image:-webkit-gradient(linear,0 0,0 100%,from(#222),to(#111));background-image:-webkit-linear-gradient(top,#222,#111);background-image:-o-linear-gradient(top,#222,#111);background-image:linear-gradient(to bottom,#222,#111);background-repeat:repeat-x;border-color:#252525;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff222222',endColorstr='#ff111111',GradientType=0)}.navbar-inverse .brand,.navbar-inverse .nav>li>a{color:#999;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.navbar-inverse .brand:hover,.navbar-inverse .nav>li>a:hover{color:#fff}.navbar-inverse .nav>li>a:focus,.navbar-inverse .nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .nav .active>a,.navbar-inverse .nav .act
 ive>a:hover,.navbar-inverse .nav .active>a:focus{color:#fff;background-color:#111}.navbar-inverse .navbar-link{color:#999}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .divider-vertical{border-right-color:#222;border-left-color:#111}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle{color:#fff;background-color:#111}.navbar-inverse .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#999;border-bottom-color:#999}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .navbar-search .search-query{color:#fff;background-color:#515151;border-color:#111;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);-moz-box-shado
 w:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.navbar-inverse .navbar-search .search-query:-moz-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:-ms-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query::-webkit-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:focus,.navbar-inverse .navbar-search .search-query.focused{padding:5px 15px;color:#333;text-shadow:0 1px 0 #fff;background-color:#fff;border:0;outline:0;-webkit-box-shadow:0 0 3px rgba(0,0,0,0.15);-moz-box-shadow:0 0 3px rgba(0,0,0,0.15);box-shadow:0 0 3px rgba(0,0,0,0.15)}.navbar-inverse .btn-navbar{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e0e0e;*background-color:#040404;background-image:-webkit-gradient(linear,0 0,0 100%,from(#151515),to(#040404));background-image:-
 webkit-linear-gradient(top,#151515,#040404);background-image:-o-linear-gradient(top,#151515,#040404);background-image:linear-gradient(to bottom,#151515,#040404);background-image:-moz-linear-gradient(top,#151515,#040404);background-repeat:repeat-x;border-color:#040404 #040404 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff151515',endColorstr='#ff040404',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false)}.navbar-inverse .btn-navbar:hover,.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active,.navbar-inverse .btn-navbar.disabled,.navbar-inverse .btn-navbar[disabled]{color:#fff;background-color:#040404;*background-color:#000}.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active{background-color:#000 \9}.breadcrumb{padding:8px 15px;margin:0 0 20px;list-style:none;background-color:#f5f5f5;-webkit-border-radius:4px;-moz-border-radius:4px;borde
 r-radius:4px}.breadcrumb li{display:inline-block;*display:inline;text-shadow:0 1px 0 #fff;*zoom:1}.breadcrumb .divider{padding:0 5px;color:#ccc}.breadcrumb .active{color:#999}.pagination{height:40px;margin:20px 0}.pagination ul{display:inline-block;*display:inline;margin-bottom:0;margin-left:0;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;*zoom:1;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:0 1px 2px rgba(0,0,0,0.05);box-shadow:0 1px 2px rgba(0,0,0,0.05)}.pagination li{display:inline}.pagination a,.pagination span{float:left;padding:0 14px;line-height:38px;text-decoration:none;background-color:#fff;border:1px solid #ddd;border-left-width:0}.pagination a:hover,.pagination .active a,.pagination .active span{background-color:#f5f5f5}.pagination .active a,.pagination .active span{color:#999;cursor:default}.pagination .disabled span,.pagination .disabled a,.pagination .disabled a:hover{color:#999;cursor:default;background-color:transparent}.paginatio
 n li:first-child a,.pagination li:first-child span{border-left-width:1px;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.pagination li:last-child a,.pagination li:last-child span{-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.pagination-centered{text-align:center}.pagination-right{text-align:right}.pager{margin:20px 0;text-align:center;list-style:none;*zoom:1}.pager:before,.pager:after{display:table;line-height:0;content:""}.pager:after{clear:both}.pager li{display:inline}.pager a{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.pager a:hover{text-decoration:none;background-color:#f5f5f5}.pager .next a{float:right}.pager .previous a{float:left}.pager .disabled a,.pager .disabled a:hover{color:#999;cursor:default;background-color:#fff}.modal-open .dropdown-menu{z-index:2050}.modal-open .dropdow
 n.open{*z-index:2050}.modal-open .popover{z-index:2060}.modal-open .tooltip{z-index:2080}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop,.modal-backdrop.fade.in{opacity:.8;filter:alpha(opacity=80)}.modal{position:fixed;top:50%;left:50%;z-index:1050;width:560px;margin:-250px 0 0 -280px;overflow:auto;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box}.modal.fade{top:-25%;-webkit-transition:opacity .3s linear,top .3s ease-out;-moz-transition:opacity .3s linear,top .3s ease-out;-o-transition:opacity .3s linear,top .3s ease-out;transition:opacity .3s linear,top .3
 s ease-out}.modal.fade.in{top:50%}.modal-header{padding:9px 15px;border-bottom:1px solid #eee}.modal-header .close{margin-top:2px}.modal-header h3{margin:0;line-height:30px}.modal-body{max-height:400px;padding:15px;overflow-y:auto}.modal-form{margin-bottom:0}.modal-footer{padding:14px 15px 15px;margin-bottom:0;text-align:right;background-color:#f5f5f5;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;*zoom:1;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.modal-footer:before,.modal-footer:after{display:table;line-height:0;content:""}.modal-footer:after{clear:both}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.tooltip{position:absolute;z-index:1030;display:block;padding:5px;font-size:11px;opacity:0;filter:alpha(opacity=0);visibility:visible}.tooltip.in{opacity:.8;filter:alpha(opacity=80)}.tooltip.top{m
 argin-top:-3px}.tooltip.right{margin-left:3px}.tooltip.bottom{margin-top:3px}.tooltip.left{margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-color:#000;border-width:5px 5px 0}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-right-color:#000;border-width:5px 5px 5px 0}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-left-color:#000;border-width:5px 0 5px 5px}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-color:#000;border-width:0 5px 5px}.popover{position:absolute;top:0;left:0;z-index:1010;display:none;width:236px;padding:1px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);
 -webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.popover.top{margin-bottom:10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-right:10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;font-weight:normal;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover-content p,.popover-content ul,.popover-content ol{margin-bottom:0}.popover .arrow,.popover .arrow:after{position:absolute;display:inline-block;width:0;height:0;border-color:transparent;border-style:solid}.popover .arrow:after{z-index:-1;content:""}.popover.top .arrow{bottom:-10px;left:50%;margin-le
 ft:-10px;border-top-color:#fff;border-width:10px 10px 0}.popover.top .arrow:after{bottom:-1px;left:-11px;border-top-color:rgba(0,0,0,0.25);border-width:11px 11px 0}.popover.right .arrow{top:50%;left:-10px;margin-top:-10px;border-right-color:#fff;border-width:10px 10px 10px 0}.popover.right .arrow:after{bottom:-11px;left:-1px;border-right-color:rgba(0,0,0,0.25);border-width:11px 11px 11px 0}.popover.bottom .arrow{top:-10px;left:50%;margin-left:-10px;border-bottom-color:#fff;border-width:0 10px 10px}.popover.bottom .arrow:after{top:-1px;left:-11px;border-bottom-color:rgba(0,0,0,0.25);border-width:0 11px 11px}.popover.left .arrow{top:50%;right:-10px;margin-top:-10px;border-left-color:#fff;border-width:10px 0 10px 10px}.popover.left .arrow:after{right:-1px;bottom:-11px;border-left-color:rgba(0,0,0,0.25);border-width:11px 0 11px 11px}.thumbnails{margin-left:-20px;list-style:none;*zoom:1}.thumbnails:before,.thumbnails:after{display:table;line-height:0;content:""}.thumbnails:after{clear:bo
 th}.row-fluid .thumbnails{margin-left:0}.thumbnails>li{float:left;margin-bottom:20px;margin-left:20px}.thumbnail{display:block;padding:4px;line-height:20px;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.055);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.055);box-shadow:0 1px 3px rgba(0,0,0,0.055);-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}a.thumbnail:hover{border-color:#08c;-webkit-box-shadow:0 1px 4px rgba(0,105,214,0.25);-moz-box-shadow:0 1px 4px rgba(0,105,214,0.25);box-shadow:0 1px 4px rgba(0,105,214,0.25)}.thumbnail>img{display:block;max-width:100%;margin-right:auto;margin-left:auto}.thumbnail .caption{padding:9px;color:#555}.label,.badge{font-size:11.844px;font-weight:bold;line-height:14px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);white-space:nowrap;vertical-align:baseline;background-color:#999}.lab
 el{padding:1px 4px 2px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.badge{padding:1px 9px 2px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px}a.label:hover,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.label-important,.badge-important{background-color:#b94a48}.label-important[href],.badge-important[href]{background-color:#953b39}.label-warning,.badge-warning{background-color:#f89406}.label-warning[href],.badge-warning[href]{background-color:#c67605}.label-success,.badge-success{background-color:#468847}.label-success[href],.badge-success[href]{background-color:#356635}.label-info,.badge-info{background-color:#3a87ad}.label-info[href],.badge-info[href]{background-color:#2d6987}.label-inverse,.badge-inverse{background-color:#333}.label-inverse[href],.badge-inverse[href]{background-color:#1a1a1a}.btn .label,.btn .badge{position:relative;top:-1px}.btn-mini .label,.btn-mini .badge{top:0}@-webkit-keyframes progress-bar-stripes{from
 {background-position:40px 0}to{background-position:0 0}}@-moz-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-ms-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:0 0}to{background-position:40px 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f7f7f7;background-image:-moz-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f5f5f5),to(#f9f9f9));background-image:-webkit-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-o-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:linear-gradient(to bottom,#f5f5f5,#f9f9f9);background-repeat:repeat-x;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff
 f5f5f5',endColorstr='#fff9f9f9',GradientType=0);-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress .bar{float:left;width:0;height:100%;font-size:12px;color:#fff;text-align:center;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e90d2;background-image:-moz-linear-gradient(top,#149bdf,#0480be);background-image:-webkit-gradient(linear,0 0,0 100%,from(#149bdf),to(#0480be));background-image:-webkit-linear-gradient(top,#149bdf,#0480be);background-image:-o-linear-gradient(top,#149bdf,#0480be);background-image:linear-gradient(to bottom,#149bdf,#0480be);background-repeat:repeat-x;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff149bdf',endColorstr='#ff0480be',GradientType=0);-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-box-sizing:border-box;-moz-box-sizing:border
 -box;box-sizing:border-box;-webkit-transition:width .6s ease;-moz-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress .bar+.bar{-webkit-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15)}.progress-striped .bar{background-color:#149bdf;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparen
 t 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;-moz-background-size:40px 40px;-o-background-size:40px 40px;background-size:40px 40px}.progress.active .bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-danger .bar,.progress .bar-danger{background-color:#dd514c;background-image:-moz-linear-gradient(top,#ee5
 f5b,#c43c35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#c43c35));background-image:-webkit-linear-gradient(top,#ee5f5b,#c43c35);background-image:-o-linear-gradient(top,#ee5f5b,#c43c35);background-image:linear-gradient(to bottom,#ee5f5b,#c43c35);background-repeat:repeat-x;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffc43c35',GradientType=0)}.progress-danger.progress-striped .bar,.progress-striped .bar-danger{background-color:#ee5f5b;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-l
 inear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-success .bar,.progress .bar-success{background-color:#5eb95e;background-image:-moz-linear-gradient(top,#62c462,#57a957);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#57a957));background-image:-webkit-linear-gradient(top,#62c462,#57a957);background-image:-o-linear-gradient(top,#62c462,#57a957);background-image:linear-gradient(to bottom,#62c462,#57a957);background-repeat:repeat-x;filter:progid:dximagetransform.microsoft.gradient(star
 tColorstr='#ff62c462',endColorstr='#ff57a957',GradientType=0)}.progress-success.progress-striped .bar,.progress-striped .

<TRUNCATED>


[03/13] incubator-asterixdb-site git commit: Initial commit with Till's changes

Posted by im...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/install.html
----------------------------------------------------------------------
diff --git a/install.html b/install.html
new file mode 100644
index 0000000..e5f8237
--- /dev/null
+++ b/install.html
@@ -0,0 +1,1211 @@
+<!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 class="active">
+    
+            <a href="#"><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>
+    
+                          <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>Introduction</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="#PrerequisitesForInstallingAsterixDB">Prerequisites for Installing AsterixDB</a></li>
+  
+<li><a href="#Section1SingleMachineAsterixDBInstallation">Section 1: Single-Machine AsterixDB installation</a></li>
+  
+<li><a href="#Section2SingleMachineAsterixDBInstallationAdvanced">Section 2: Single-Machine AsterixDB installation (Advanced)</a></li>
+  
+<li><a href="#Section3InstallingAsterixDBOnAClusterOfMultipleMachines">Section 3: Installing AsterixDB on a Cluster of Multiple Machines</a></li>
+  
+<li><a href="#Section4ManagingTheLifecycleOfAnAsterixDBInstance">Section 4: Managing the Lifecycle of an AsterixDB Instance</a></li>
+  
+<li><a href="#Section5FAQ">Section 5: Frequently Asked Questions</a></li>
+</ul>
+<p>This is a quickstart guide for getting AsterixDB running in a distributed environment. This guide also introduces the AsterixDB installer (nicknamed <i><i>Managix</i></i>) and describes how it can be used to create and manage an AsterixDB instance. By following the simple steps described in this guide, you will get a running instance of AsterixDB. You shall be able to use AsterixDB from its Web interface and manage its lifecycle using Managix. This document assumes that you are running some version of <i><i>Linux</i></i> or <i><i>MacOS X</i></i>.</p></div>
+<div class="section">
+<h2><a name="PrerequisitesForInstallingAsterixDB" id="PrerequisitesForInstallingAsterixDB">Prerequisites for Installing AsterixDB</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Prerequisites_for_Installing_AsterixDB_Back_to_TOC"></a></h2>
+<p>Prerequisite:</p>
+
+<ul>
+  
+<li><a class="externalLink" href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">JDK&gt;=7</a> (Otherwise known as JDK&gt;=1.7).</li>
+</ul>
+<p>To know the version of Java installed on your system, execute the following:</p>
+
+<div class="source">
+<pre>    $ java -version
+</pre></div>
+<p>If your version is at least 1.7.0_x, similar to the output shown below, you are good to proceed.</p>
+
+<div class="source">
+<pre>    java version &quot;1.7.0_13&quot;
+    Java(TM) SE Runtime Environment (build 1.7.0_13-b20)
+    Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)
+</pre></div>
+<p>If you need to upgrade or install java, please follow the instructions below.</p>
+
+<ul>
+  
+<li>
+<p>For Linux: <a class="externalLink" href="http://docs.oracle.com/javase/7/docs/webnotes/install/linux/linux-jdk.html">JDK 7 Linux Install</a> JDK would be installed at a path under /usr/lib/jvm/jdk-version .</p></li>
+  
+<li>
+<p>For Mac: <a class="externalLink" href="http://docs.oracle.com/javase/7/docs/webnotes/install/mac/mac-jdk.html">JDK 7 Mac Install</a> JDK would be installed at /Library/Java/JavaVirtualMachines/jdk-version/Contents/Home .</p></li>
+</ul>
+<p>The java installation directory is referred as JAVA_HOME. Since we upgraded/installed Java, we need to ensure JAVA_HOME points to the installation directory of JDK. Modify your ~/.bash_profile (or ~/.bashrc) and define JAVA_HOME accordingly. After the modification, execute the following:</p>
+
+<div class="source">
+<pre>    $ java -version
+</pre></div>
+<p>If the version information you obtain does not show 1.7, you need to update the PATH variable. To do so, execute the following:</p>
+
+<div class="source">
+<pre>    $ echo &quot;PATH=$JAVA_HOME/bin:$PATH&quot; &gt;&gt; ~/.bash_profile (or ~/.bashrc)
+    $ source ~/.bash_profile (or ~/.bashrc)
+</pre></div></div>
+<div class="section">
+<h2><a name="Section1SingleMachineAsterixDBInstallation" id="Section1SingleMachineAsterixDBInstallation">Section 1: Single-Machine AsterixDB installation</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Section_1:_Single-Machine_AsterixDB_installation_Back_to_TOC"></a></h2>
+<p>We assume a user called &#x201c;Joe&#x201d; with a home directory as /home/joe. On a Mac, the home directory for user Joe would be /Users/joe.</p>
+<div class="section">
+<h3>Configuring Environment<a name="Configuring_Environment"></a></h3>
+<p>Ensure that JAVA_HOME variable is defined and points to the the java installation directory on your machine. To verify, execute the following:</p>
+
+<div class="source">
+<pre>    $ echo $JAVA_HOME
+</pre></div>
+<p>If you do not see any output, JAVA_HOME is not defined. We need to add the following line to your profile located at /home/joe/.bash_profile or /home/joe/.bashrc, whichever you are using. If you do not have any of these files, create a ~/.bash_profile file.</p>
+
+<div class="source">
+<pre>    export JAVA_HOME=&lt;Path to Java installation directory&gt;
+</pre></div>
+<p>After you have edited ~/.bash_profile (or ~/.bashrc), execute the following to make the changes effective in current shell:</p>
+
+<div class="source">
+<pre>    $ source /home/joe/.bash_profile (or /home/joe/.bashrc)
+</pre></div>
+<p>Before proceeding, verify that JAVA_HOME is defined by executing the following:</p>
+
+<div class="source">
+<pre>    $ echo $JAVA_HOME
+</pre></div></div>
+<div class="section">
+<h3>Configuring SSH<a name="Configuring_SSH"></a></h3>
+<p>If SSH is not enabled on your system, please follow the instruction below to enable/install it or else skip to the section <a href="#Configuring_Password-less_SSH">Configuring Password-less SSH</a>.</p>
+<div class="section">
+<h4>Enabling SSH on Mac<a name="Enabling_SSH_on_Mac"></a></h4>
+<p>The Apple Mac OS X operating system has SSH installed by default but the SSH daemon is not enabled. This means you can&#x2019;t login remotely or do remote copies until you enable it. To enable it, go to &#x2018;System Preferences&#x2019;. Under &#x2018;Internet &amp; Networking&#x2019; there is a &#x2018;Sharing&#x2019; icon. Run that. In the list that appears, check the &#x2018;Remote Login&#x2019; option. Also check the &#x201c;All users&#x201d; radio button for &#x201c;Allow access for&#x201d;. This starts the SSH daemon immediately and you can remotely login using your username. The &#x2018;Sharing&#x2019; window shows at the bottom the name and IP address to use. You can also find this out using &#x2018;whoami&#x2019; and &#x2018;ifconfig&#x2019; from the Terminal application.</p></div>
+<div class="section">
+<h4>Enabling SSH on Linux<a name="Enabling_SSH_on_Linux"></a></h4>
+
+<div class="source">
+<pre>    sudo apt-get install openssh-server
+</pre></div>
+<p>Assumming that you have enabled SSH on your system, let us proceed.</p></div>
+<div class="section">
+<h4>Configuring Password-less SSH<a name="Configuring_Password-less_SSH"></a></h4>
+<p>For our single-machine setup of AsterixDB, we need to configure password-less SSH access to localhost. We assume that you are on the machine where you want to install AsterixDB. To verify if you already have password-less SSH configured, execute the following:</p>
+
+<div class="source">
+<pre>     $ ssh 127.0.0.1
+</pre></div>
+<p>If you get an output similar to one shown below, type &#x201c;yes&#x201d; and press enter.</p>
+
+<div class="source">
+<pre>    The authenticity of host '127.0.0.1 (127.0.0.1)' can't be established.
+    RSA key fingerprint is aa:7b:51:90:74:39:c4:f6:28:a2:9d:47:c2:8d:33:31.
+    Are you sure you want to continue connecting (yes/no)?
+</pre></div>
+<p>If you are not prompted for a password, that is if you get an output similar to one shown below, it signifies that you already have password-less SSH configured. </p>
+
+<div class="source">
+<pre>    $ ssh 127.0.0.1
+    Last login: Sat Mar 23 22:52:49 2013
+</pre></div>
+<p>[Important: Password-less SSH requires the use of a (public,private) key-pair. The key-pair is located as a pair of files under  $HOME/.ssh directory. It is required that the (public,private) key-pair files have default names (id_rsa.pub, id_rsa) respectively.  If you are using different names, please rename the files to use the default names]</p>
+<p>Skip to the next section <a href="#Configuring_Managix">Configuring Managix</a>.</p>
+<p>You are here because you were prompted for a password. You need to configure password-less SSH.<br />We shall generate a (public,private) key-pair as id_rsa.pub and id_rsa respectively. If $HOME/.ssh already contains a (public,private) key-pair, please ensure the files are renamed before proceeding. Follow the instructions below.</p>
+
+<div class="source">
+<pre>     $ ssh-keygen -t rsa -P &quot;&quot;
+    Generating public/private rsa key pair.
+    Enter file in which to save the key (/home/joe/.ssh/id_rsa):   
+    [Important: Please ensure that we use the default value, so simply press enter]
+</pre></div>
+<p>If a key already exists, you should get an output similar to what is shown below. Press &#x2018;y&#x2019; to overwrite the existing key. It is required to use the default name. If you wish to not overwrite a pre-existing key, ensure that the pre-existing key is saved with a different name.</p>
+
+<div class="source">
+<pre>    /home/joe/.ssh/id_rsa already exists.
+    Overwrite (y/n)?
+</pre></div>
+<p>You should see an output similar to one shown below:</p>
+
+<div class="source">
+<pre>    The key fingerprint is:
+    4d:b0:30:14:45:cc:99:86:15:48:17:0b:39:a0:05:ca joe@joe-machine
+    The key's randomart image is:
+    +--[ RSA 2048]----+
+    |  ..o+B@O=       |
+    |.. o  ==*+       |
+    |.E.    oo .      |
+    |         o       |
+    |        S .      |
+    |                 |
+    |                 |
+    |                 |
+    |                 |
+    +-----------------+
+</pre></div>
+<p>Note: for Linux users, you may not get an image representation of the key, but this is not an error. Next, execute the following:</p>
+
+<div class="source">
+<pre>      $ cat $HOME/.ssh/id_rsa.pub &gt;&gt; $HOME/.ssh/authorized_keys
+      $ chmod 700  $HOME/.ssh/authorized_keys
+</pre></div>
+<p>We shall now retry SSH without password.</p>
+
+<div class="source">
+<pre>    $ ssh 127.0.0.1
+</pre></div>
+<p>You may see an output similar to one shown below:</p>
+
+<div class="source">
+<pre>    The authenticity of host '127.0.0.1 (127.0.0.1)' can't be established.
+    RSA key fingerprint is aa:7b:51:90:74:39:c4:f6:28:a2:9d:47:c2:8d:33:31.
+    Are you sure you want to continue connecting (yes/no)?
+</pre></div>
+<p>Type &#x2018;yes&#x2019; and press the enter key. You should see an output similar to one shown below:</p>
+
+<div class="source">
+<pre>    Warning: Permanently added '127.0.0.1' (RSA) to the list of known hosts.
+    Last login: Thu Mar 28 12:27:10 2013
+</pre></div>
+<p>You should now be able to log in without being prompted for a password or a response.</p>
+
+<div class="source">
+<pre>    ssh 127.0.0.1
+    Last login: Sat Mar 23 22:54:40 2013
+</pre></div>
+<p>Execute &#x2018;exit&#x2019; to close the session.</p>
+
+<div class="source">
+<pre>    $ exit
+    logout
+    Connection to 127.0.0.1 closed.
+</pre></div></div></div>
+<div class="section">
+<h3>Configuring Managix<a name="Configuring_Managix"></a></h3>
+<p>You will need the AsterixDB installer (a.k.a. Managix). Download Managix from <a class="externalLink" href="http://asterixdb.ics.uci.edu/download.html">here</a>; this includes the bits for Managix as well as AsterixDB.</p>
+<p>To be able to create an AsterixDB instance and manage its lifecycle, the Managix requires you to configure a set of configuration files namely:</p>
+
+<ul>
+  
+<li><tt>conf/managix-conf.xml</tt>: A configuration XML file that contains configuration settings for Managix.</li>
+  
+<li>A configuration XML file that describes the nodes in the cluster, e.g., <tt>clusters/local/local.xml</tt>.</li>
+</ul>
+<p>Since we intend to run AsterixDB on a single node, Managix can auto-configure itself and populate the above configuration files. To auto-configure Managix, execute the following in the MANAGIX_HOME directory:</p>
+
+<div class="source">
+<pre>     /home/joe/asterix-mgmt&gt; $ managix configure
+</pre></div>
+<p>Let us do a sample run to validate the set of configuration files auto-generated by Managix.</p>
+
+<div class="source">
+<pre>    /home/joe/asterix-mgmt&gt; $ managix validate
+      INFO: Environment [OK]
+      INFO: Managix Configuration [OK]
+
+
+    /home/joe/asterix-mgmt&gt; $ managix validate -c clusters/local/local.xml
+      INFO: Environment [OK]
+      INFO: Cluster configuration [OK]
+</pre></div></div>
+<div class="section">
+<h3>Creating an AsterixDB instance<a name="Creating_an_AsterixDB_instance"></a></h3>
+<p>Now that we have configured Managix, we shall next create an AsterixDB instance. An AsterixDB instance is identified by a unique name and is created using the <tt>create</tt> command. The usage description for the <tt>create</tt> command can be obtained by executing the following:</p>
+
+<div class="source">
+<pre>     $ managix help -cmd create
+     Creates an AsterixDB instance with a specified name. Post creation, the instance is in ACTIVE state,
+     indicating its availability for executing statements/queries.
+     Usage arguments/options:
+     -n Name of the AsterixDB instance.
+     -c Path to the cluster configuration file
+</pre></div>
+<p>We shall now use the <tt>create</tt> command to create an AsterixDB instance by the name &#x201c;my_asterix&#x201d;. In doing so, we shall use the cluster configuration file that was auto-generated by Managix.</p>
+
+<div class="source">
+<pre>     $ managix create -n my_asterix -c clusters/local/local.xml
+</pre></div>
+<p>A sample output of the above command is shown below:</p>
+
+<div class="source">
+<pre>    INFO: Name:my_asterix
+    Created:Thu Mar 07 11:14:13 PST 2013
+    Web-Url:http://127.0.0.1:19001
+    State:ACTIVE
+</pre></div>
+<p>The third line above shows the web-url <a class="externalLink" href="http://127.0.0.1:19001">http://127.0.0.1:19001</a> for an AsterixDB&#x2019;s web interface. The AsterixDB instance is in the &#x2018;ACTIVE&#x2019; state, indicating that you may access the web interface by navigating to the web url.</p>
+<p>Type in the following &#x201c;Hello World&#x201d; query in the box:</p>
+
+<div class="source">
+<pre>    let $message := 'Hello World!'
+    return $message
+</pre></div>
+<p>Press the &#x201c;Run&#x201d; button. If the query result shows on the output box, then Congratulations! You have successfully created an AsterixDB instance!</p></div></div>
+<div class="section">
+<h2><a name="Section2SingleMachineAsterixDBInstallationAdvanced" id="Section2SingleMachineAsterixDBInstallationAdvanced">Section 2: Single-Machine AsterixDB installation (Advanced)</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Section_2:_Single-Machine_AsterixDB_installation_Advanced_Back_to_TOC"></a></h2>
+<p>We assume that you have successfully completed the single-machine AsterixDB installation by following the instructions above in section <a href="#Section_1:_Single-Machine_AsterixDB_installation">AsterixDB installation</a>. In this section, we shall cover advanced topics related to AsterixDB configuration. Before we proceed, it is imperative to go through some preliminary concepts related to AsterixDB runtime.</p>
+<div class="section">
+<h3>AsterixDB Runtime<a name="AsterixDB_Runtime"></a></h3>
+<p>An AsterixDB runtime comprises of a &#x2018;&#x2018;master node&#x2019;&#x2019; and a set of &#x2018;&#x2018;worker nodes&#x2019;&#x2019;, each identified by a unique id. The master node runs a &#x2018;&#x2018;Cluster Controller&#x2019;&#x2019; service (a.k.a. &#x2018;&#x2018;CC&#x2019;&#x2019;), while each worker node runs a &#x2018;&#x2018;Node Controller&#x2019;&#x2019; service (a.k.a. &#x2018;&#x2018;NC&#x2019;&#x2019;). Please note that a node in an AsterixDB cluster is a logical concept in the sense that multiple nodes may map to a single physical machine, which is the case for a single-machine AsterixDB installation. This association or mapping between an AsterixDB node and a physical machine is captured in a cluster configuration XML file. In addition, the XML file contains properties and parameters associated with each node.</p>
+<div class="section">
+<h4>AsterixDB Runtime Configuration<a name="AsterixDB_Runtime_Configuration"></a></h4>
+<p>As observed earlier, Managix can auto-configure itself for a single-machine setup. As part of auto-configuration, Managix generated the cluster XML file. Let us understand the components of the generated cluster XML file. If you have configured Managix (via the <tt>configure</tt> command), you can find a similar cluster XML file as $MANAGIX_HOME/clusters/local/local.xml. The following is a sample XML file generated on a Ubuntu (Linux) setup:</p>
+
+<div class="source">
+<pre>    &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
+    &lt;cluster xmlns=&quot;cluster&quot;&gt;
+        &lt;name&gt;local&lt;/name&gt;
+        &lt;java_home&gt;/usr/lib/jvm/jdk1.7.0&lt;/java_home&gt;
+        &lt;log_dir&gt;/home/joe/asterix-mgmt/clusters/local/working_dir/logs&lt;/log_dir&gt;
+        &lt;txn_log_dir&gt;/home/joe/asterix-mgmt/clusters/local/working_dir/logs&lt;/txn_log_dir&gt;
+        &lt;iodevices&gt;/home/joe/asterix-mgmt/clusters/local/working_dir&lt;/iodevices&gt;
+        &lt;store&gt;storage&lt;/store&gt;
+        &lt;working_dir&gt;
+            &lt;dir&gt;/home/joe/asterix-mgmt/clusters/local/working_dir&lt;/dir&gt;
+            &lt;NFS&gt;true&lt;/NFS&gt;
+        &lt;/working_dir&gt;
+        &lt;master_node&gt;
+            &lt;id&gt;master&lt;/id&gt;
+            &lt;client_ip&gt;127.0.0.1&lt;/client_ip&gt;
+            &lt;cluster_ip&gt;127.0.0.1&lt;/cluster_ip&gt;
+            &lt;client_port&gt;1098&lt;/client_port&gt;
+            &lt;cluster_port&gt;1099&lt;/cluster_port&gt;
+            &lt;http_port&gt;8888&lt;/http_port&gt;
+        &lt;/master_node&gt;
+        &lt;node&gt;
+            &lt;id&gt;node1&lt;/id&gt;
+            &lt;cluster_ip&gt;127.0.0.1&lt;/cluster_ip&gt;
+        &lt;/node&gt;
+    &lt;/cluster&gt;
+</pre></div>
+<p>We shall next explain the components of the cluster configuration XML file.</p></div>
+<div class="section">
+<h4>(1) Defining nodes in AsterixDB runtime<a name="a1_Defining_nodes_in_AsterixDB_runtime"></a></h4>
+<p>The single-machine AsterixDB instance configuration that is auto-generated by Managix (using the <tt>configure</tt> command) involves a master node (CC) and a worker node (NC). Each node is assigned a unique id and provided with an ip address (called &#x2018;&#x2018;cluster_ip&#x2019;&#x2019;) that maps a node to a physical machine. The following snippet from the above XML file captures the master/worker nodes in our AsterixDB installation.</p>
+
+<div class="source">
+<pre>        &lt;master_node&gt;
+            &lt;id&gt;master&lt;/id&gt;
+            &lt;client_ip&gt;127.0.0.1&lt;/client_ip&gt;
+            &lt;cluster_ip&gt;127.0.0.1&lt;/cluster_ip&gt;
+            &lt;client_port&gt;1098&lt;/client_port&gt;
+            &lt;cluster_port&gt;1099&lt;/cluster_port&gt;
+            &lt;http_port&gt;8888&lt;/http_port&gt;
+        &lt;/master_node&gt;
+        &lt;node&gt;
+            &lt;id&gt;node1&lt;/id&gt;
+            &lt;cluster_ip&gt;127.0.0.1&lt;/cluster_ip&gt;
+        &lt;/node&gt;
+</pre></div>
+<p>The following is a description of the different elements in the cluster configuration xml file.</p>
+
+<table border="0" class="table table-striped">
+
+<tr class="a">
+  
+<td>Property</td>
+  
+<td>Description</td>
+</tr>
+
+<tr class="b">
+  
+<td>id</td>
+  
+<td>A unique id for a node.</td>
+</tr>
+
+<tr class="a">
+  
+<td>cluster_ip</td>
+  
+<td>IP address of the machine to which a node maps to. This address is used for all internal communication between the nodes.</td>
+</tr>
+
+<tr class="b">
+  
+<td>client_ip</td>
+  
+<td>Provided for the master node. This IP should be reachable from clients that want to connect with AsterixDB via its web interface.</td>
+</tr>
+
+<tr class="a">
+  
+<td>client_port</td>
+  
+<td>Provided for the master node. This is the port at which the Cluster Controller (CC) service listens for connections from clients.</td>
+</tr>
+
+<tr class="b">
+  
+<td>cluster_port</td>
+  
+<td>Provided for the master node. This is the port used by the Cluster Controller (CC) service to listen for connections from Node Controllers (NCs). </td>
+</tr>
+
+<tr class="a">
+  
+<td>http-port</td>
+  
+<td>Provided for the master node. This is the http port used by the Cluster Controller (CC) service. </td>
+</tr>
+
+</table></div>
+<div class="section">
+<h4>(2) Properties associated with a worker node (NC) in AsterixDB<a name="a2_Properties_associated_with_a_worker_node_NC_in_AsterixDB"></a></h4>
+<p>The following is a list of properties associated with each worker node in an AsterixDB configuration.</p>
+
+<table border="0" class="table table-striped">
+
+<tr class="a">
+  
+<td>Property</td>
+  
+<td>Description</td>
+</tr>
+
+<tr class="b">
+  
+<td>java_home</td>
+  
+<td>Java installation directory at each node.</td>
+</tr>
+
+<tr class="a">
+  
+<td>log_dir</td>
+  
+<td>A directory where the worker node JVM may write logs.</td>
+</tr>
+
+<tr class="b">
+  
+<td>txn_log_dir</td>
+  
+<td>A directory where the worker node writes transaction logs.</td>
+</tr>
+
+<tr class="a">
+  
+<td>iodevices</td>
+  
+<td>Comma separated list of IO Device mount points.</td>
+</tr>
+
+<tr class="b">
+  
+<td>store</td>
+  
+<td>A data directory (under each iodevice) that AsterixDB uses to store data belonging to dataset(s).</td>
+</tr>
+</table>
+<p>All the above properties can be defined at the global level or a local level. In the former case, these properties apply to all the nodes in an AsterixDB configuration. In the latter case, these properties apply only to the node(s) under which they are defined. A property defined at the local level overrides the definition at the global level.</p></div>
+<div class="section">
+<h4>(3) Working directory of an AsterixDB instance<a name="a3_Working_directory_of_an_AsterixDB_instance"></a></h4>
+<p>Next we explain the following setting in the file $MANAGIX_HOME/clusters/local/local.xml.</p>
+
+<div class="source">
+<pre>        &lt;working_dir&gt;
+            &lt;dir&gt;/Users/joe/asterix-mgmt/clusters/local/working_dir&lt;/dir&gt;
+            &lt;NFS&gt;true&lt;/NFS&gt;
+        &lt;/working_dir&gt;
+</pre></div>
+<p>Managix associates a working directory with an AsterixDB instance and uses this directory for transferring binaries to each node. If there is a directory that is readable by each node, Managix can use it to place binaries that can be accessed and used by all the nodes in the AsterixDB set up. A network file system (NFS) provides such a functionality for a cluster of physical machines so that a path on NFS is accessible from each machine in the cluster. In the single-machine set up described above, all nodes correspond to a single physical machine. Each path on the local file system is accessible to all the nodes in the AsterixDB setup and the boolean value for NFS above is thus set to <tt>true</tt>.</p></div></div>
+<div class="section">
+<h3>Managix Configuration<a name="Managix_Configuration"></a></h3>
+<p>Managix allows creation and management of multiple AsterixDB instances and uses Zookeeper as its back-end database to keep track of information related to each instance. We need to provide a set of one or more hosts that Managix can use to run a Zookeeper instance. Zookeeper runs as a daemon process on each of the specified hosts. At each host, Zookeeper stores data under the Zookeeper home directory specified as part of the configuration. The following is an example configuration <tt>$MANAGIX_HOME/conf/managix-conf.xml</tt> that has Zookeeper running on the localhost (127.0.0.1) :</p>
+
+<div class="source">
+<pre>    &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
+    &lt;configuration xmlns=&quot;installer&quot;&gt;
+        &lt;zookeeper&gt;
+            &lt;homeDir&gt;/home/joe/asterix/.installer/zookeeper&lt;/homeDir&gt;
+            &lt;clientPort&gt;2900&lt;/clientPort&gt;
+            &lt;servers&gt;
+                &lt;server&gt;127.0.0.1&lt;/server&gt;
+            &lt;/servers&gt;
+        &lt;/zookeeper&gt;
+    &lt;/configuration&gt;
+</pre></div>
+<p>It is possible to have a single host for Zookeeper. A larger number of hosts would use Zookeeper&#x2019;s replication and fault-tolerance feature such that a failure of a host running Zookeeper would not result in loss of information about existing AsterixDB instances.</p></div></div>
+<div class="section">
+<h2><a name="Section3InstallingAsterixDBOnAClusterOfMultipleMachines" id="Section3InstallingAsterixDBOnAClusterOfMultipleMachines">Section 3: Installing AsterixDB on a Cluster of Multiple Machines</a><font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Section_3:_Installing_AsterixDB_on_a_Cluster_of_Multiple_MachinesBack_to_TOC"></a></h2>
+<p>We assume that you have read the two sections above on single-machine AsterixDB setup. Next we explain how to install AsterixDB in a cluster of multiple machines. As an example, we assume we want to setup AsterixDB on a cluster of three machines, in which we use one machine (called machine A) as the master node and two other machines (called machine B and machine C) as the worker nodes, as shown in the following diagram:</p>
+<p><img src="https://asterixdb.googlecode.com/files/AsterixCluster.png" alt="AsterixCluster" /></p>
+<p>Notice that each machine has a &#x2018;&#x2018;cluster_ip&#x2019;&#x2019; address, which is used by these machines for their intra-cluster communication. Meanwhile, the master machine also has a &#x2018;&#x2018;client_ip&#x2019;&#x2019; address, using which an end-user outside the cluster can communicate with this machine. The reason we differentiate between these two types of IP addresses is that we can have a cluster of machines using a private network. In this case they have internal ip addresses that cannot be used outside the network. In the case all the machines are on a public network, the &#x201c;client_ip&#x201d; and &#x201c;cluster_ip&#x201d; of the master machine can share the same address.</p>
+<p>Next we describe how to set up AsterixDB in this cluster, assuming no Managix has been installed on these machines.</p>
+<div class="section">
+<h3>Step (1): Configure SSH<a name="Step_1:_Configure_SSH"></a></h3>
+<p>The steps of setting up SSH are similar to those in the single-machine setup case. We assume we have a common user account called &#x201c;joe&#x201d; on each machine in the cluster.</p>
+<p>On the master machine, do the following:</p>
+
+<div class="source">
+<pre>    machineA&gt; ssh 127.0.0.1
+</pre></div>
+<p>If you get an output similar to one shown below, type &#x201c;yes&#x201d; and press enter.</p>
+
+<div class="source">
+<pre>    The authenticity of host '127.0.0.1 (127.0.0.1)' can't be established.
+    RSA key fingerprint is aa:7b:51:90:74:39:c4:f6:28:a2:9d:47:c2:8d:33:31.
+    Are you sure you want to continue connecting (yes/no)?
+</pre></div>
+<p>If you are not prompted for a password, that is if you get an output similar to one shown below, it signifies that you already have password-less SSH configured. </p>
+
+<div class="source">
+<pre>    $ ssh 127.0.0.1
+    Last login: Sat Mar 23 22:52:49 2013
+</pre></div>
+<p>[Important: Password-less SSH requires the use of a (public,private) key-pair. The key-pair is located as a pair of files under  $HOME/.ssh directory. It is required that the (public,private) key-pair files have default names (id_rsa.pub, id_rsa) respectively.  If you are using different names, please rename the files to use the default names]</p>
+<p>If you are prompted for a password, execute the following</p>
+
+<div class="source">
+<pre>    machineA&gt; ssh-keygen -t rsa -P &quot;&quot;
+    machineA&gt; cat $HOME/.ssh/id_rsa.pub &gt;&gt; $HOME/.ssh/authorized_keys
+    machineA&gt; chmod 700  $HOME/.ssh/authorized_keys
+</pre></div>
+<p>If $HOME is not on the NFS, copy the id_rsa.pub to the directory ~/.ssh (login with the same account) on each machine, and then do the following on each machine. (Notice that this step is not needed if the folder &#x201c;.ssh&#x201d; is on the NFS and can be accessed by all the nodes.)</p>
+
+<div class="source">
+<pre>    cd ~/.ssh
+    cat id_rsa.pub &gt;&gt; authorized_keys
+    chmod 700  $HOME/.ssh/authorized_keys
+</pre></div>
+<p>Then run the following step again and type &#x201c;yes&#x201d; if prompted:</p>
+
+<div class="source">
+<pre>    machineA&gt; ssh 127.0.0.1
+</pre></div></div>
+<div class="section">
+<h3>Step (2): Define the AsterixDB cluster<a name="Step_2:_Define_the_AsterixDB_cluster"></a></h3>
+<p>We first log into the master machine as the user &#x201c;joe&#x201d;. On this machine, download Managix from <a class="externalLink" href="http://asterixdb.ics.uci.edu/download.html">here</a> (save as above), then do the following steps similar to the single-machine case described above:</p>
+
+<div class="source">
+<pre>    machineA&gt; cd ~
+    machineA&gt; mkdir asterix-mgmt
+    machineA&gt; cd asterix-mgmt
+    machineA&gt; unzip  &lt;path to the Managix zip bundle&gt;
+</pre></div>
+<p>Note that it is recommended that MANAGIX_HOME is not located on a network file system (NFS). Managix creates artifacts/logs that are not required to be shared. Any overhead associated with creating artifacts/logs on the NFS should be avoided.</p>
+<p>We also need an AsterixDB configuration XML file for the cluster. We give the name to the cluster, say, &#x201c;rainbow&#x201d;. We create a folder for the configuration of this cluster:</p>
+
+<div class="source">
+<pre>    machineA&gt; mkdir asterix-mgmt/rainbow_cluster
+</pre></div>
+<p>For this cluster we create a configuration file <tt>$MANAGIX_HOME/rainbow_cluster/rainbow.xml</tt>. The following is a sample file with explanation of the properties:</p>
+
+<div class="source">
+<pre>    &lt;cluster xmlns=&quot;cluster&quot;&gt;
+
+      &lt;!-- Name of the cluster --&gt;
+      &lt;name&gt;rainbow&lt;/name&gt;
+
+      &lt;!-- username, which should be valid for all the three machines --&gt;
+      &lt;username&gt;joe&lt;/username&gt;
+
+      &lt;!-- The working directory of Managix. It is recommended for the working
+           directory to be on a network file system (NFS) that can accessed by
+           all machines.
+           Managix creates the directory if it it doesn't exist. --&gt;
+      &lt;working_dir&gt;
+        &lt;dir&gt;/home/joe/managix-workingDir&lt;/dir&gt;
+        &lt;NFS&gt;true&lt;/NFS&gt;
+      &lt;/working_dir&gt;
+
+      &lt;!-- Directory for Asterix to store worker logs information for each machine.
+           Needs to be on the local file system of each machine.
+           Managix creates the directory if it doesn't exist.
+           This property can be overriden for a node by redefining at the node level. --&gt;
+      &lt;log_dir&gt;/mnt/joe/logs&lt;/log_dir&gt;
+
+      &lt;!-- Directory for Asterix to store transaction log information for each machine.
+           Needs to be on the local file system of each machine.
+           Managix creates the directory if it doesn't exist.
+           This property can be overriden for a node by redefining at the node level. --&gt;
+      &lt;txn_log_dir&gt;/mnt/joe/txn_logs&lt;/txn_log_dir&gt;
+
+      &lt;!-- Mount point of an iodevice. Use a comma separated list for a machine that
+           has multiple iodevices (disks).
+           This property can be overriden for a node by redefining at the node level. --&gt;
+      &lt;iodevices&gt;/mnt/joe&lt;/iodevices&gt;
+
+      &lt;!-- Path on each iodevice where Asterix will store its data --&gt;
+      &lt;store&gt;storage&lt;/store&gt;
+
+      &lt;!-- Java home for each machine --&gt;
+      &lt;java_home&gt;/usr/lib/jvm/jdk1.7.0&lt;/java_home&gt;
+
+      &lt;!-- IP addresses of the master machine A --&gt;
+      &lt;master_node&gt;
+        &lt;id&gt;master&lt;/id&gt;
+        &lt;client_ip&gt;128.195.52.177&lt;/client_ip&gt;
+        &lt;cluster_ip&gt;192.168.100.0&lt;/cluster_ip&gt;
+        &lt;client_port&gt;1098&lt;/client_port&gt;
+        &lt;cluster_port&gt;1099&lt;/cluster_port&gt;
+        &lt;http_port&gt;8888&lt;/http_port&gt;
+      &lt;/master_node&gt;
+
+      &lt;!-- IP address(es) of machine B --&gt;
+      &lt;node&gt;
+        &lt;id&gt;nodeB&lt;/id&gt;
+        &lt;cluster_ip&gt;192.168.100.1&lt;/cluster_ip&gt;
+      &lt;/node&gt;
+
+       &lt;!-- IP address(es) of machine C --&gt;
+      &lt;node&gt;
+        &lt;id&gt;nodeC&lt;/id&gt;
+        &lt;cluster_ip&gt;192.168.100.2&lt;/cluster_ip&gt;
+      &lt;/node&gt;
+    &lt;/cluster&gt;
+</pre></div>
+<p>As stated before, each of the above properties can be defined at the cluster level, in which case it applies to all the nodes in the system. Each property can also be defined at a node level.</p>
+<p>Once we have formed the cluster XML file, we can validate the configuration by doing the following:</p>
+
+<div class="source">
+<pre>    managix validate -c rainbow_cluster/rainbow.xml
+</pre></div>
+<p>This will verify the contents of the file, and also attempt to ssh to each node in the cluster to ensure that password-less SSH is configured correctly. You may see output like</p>
+
+<div class="source">
+<pre>    The authenticity of host '192.168.100.1 (192.168.100.1)' can't be established.
+    RSA key fingerprint is 89:80:31:1f:be:51:16:d7:2b:f5:e0:b3:2c:bd:83:94.
+    Are you sure you want to continue connecting (yes/no)?
+</pre></div>
+<p>and this output may be repeated for each node in the cluster. Answer &#x201c;yes&#x201d; each time.</p>
+<p>If the final output contains the following lines (possibly separated by the RSA prompts mentione above):</p>
+
+<div class="source">
+<pre>    INFO: Environment [OK]
+    INFO: Cluster configuration [OK]
+</pre></div>
+<p>it means that the XML configuration file is correct!</p></div>
+<div class="section">
+<h3>Step (3): Configuring Managix<a name="Step_3:_Configuring_Managix"></a></h3>
+<p>Managix uses a configuration XML file at <tt>$MANAGIX_HOME/conf/managix-conf.xml</tt> to configure its own properties, such as its Zookeeper service. We can use the <tt>configure</tt> command to auto-generate this configuration file:</p>
+
+<div class="source">
+<pre>    machineA&gt; managix configure
+</pre></div>
+<p>We use the <tt>validate</tt> command to validate the Managix configuration. To do so, execute the following.</p>
+
+<div class="source">
+<pre>    machineA&gt; managix validate
+    INFO: Environment [OK]
+    INFO: Managix Configuration [OK]
+</pre></div>
+<p>Note that the <tt>configure</tt> command also generates a cluster configuration XML file at $MANAGIX_HOME/clusters/local/local.xml. This file is not needed in the case of a cluster of machines.</p></div>
+<div class="section">
+<h3>Step (4): Creating an AsterixDB instance<a name="Step_4:_Creating_an_AsterixDB_instance"></a></h3>
+<p>Now that we have configured Managix, we shall next create an AsterixDB instance, which is identified by a unique name and is created using the <tt>create</tt> command. The usage description for the <tt>create</tt> command can be obtained by executing the following:</p>
+
+<div class="source">
+<pre>    machineA&gt; managix help -cmd create
+
+     Creates an AsterixDB instance with a specified name. Post creation, the instance is in ACTIVE state,
+     indicating its availability for executing statements/queries.
+     Usage arguments/options:
+     -n Name of the AsterixDB instance.
+     -c Path to the cluster configuration file
+</pre></div>
+<p>We shall now use the <tt>create</tt> command to create an AsterixDB instance called &#x201c;rainbow_asterix&#x201d;. In doing so, we shall use the cluster configuration file that was auto-generated by Managix.</p>
+
+<div class="source">
+<pre>    machineA&gt; managix create -n rainbow_asterix -c clusters/rainbow.xml
+</pre></div>
+<p>If the response message does not have warning, then Congratulations! You have successfully installed AsterixDB on this cluster of machines!</p>
+<p>Please refer to the section <a href="#Section_4:_Managing_the_Lifecycle_of_an_AsterixDB_Instance">Managing the Lifecycle of an AsterixDB Instance</a> for a detailed description on the set of available commands/operations that let you manage the lifecycle of an AsterixDB instance. Note that the output of the commands varies with the cluster definition and may not apply to the cluster specification you built above.</p></div></div>
+<div class="section">
+<h2><a name="Section4ManagingTheLifecycleOfAnAsterixDBInstance" id="Section4ManagingTheLifecycleOfAnAsterixDBInstance">Section 4: Managing the Lifecycle of an AsterixDB Instance</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Section_4:_Managing_the_Lifecycle_of_an_AsterixDB_Instance_Back_to_TOC"></a></h2>
+<p>Now that we have an AsterixDB instance running, let us use Managix to manage the instance&#x2019;s lifecycle. Managix provides the following set of commands/operations:</p>
+<div class="section">
+<div class="section">
+<h4>Managix Commands<a name="Managix_Commands"></a></h4>
+
+<table border="0" class="table table-striped">
+
+<tr class="a">
+<td>Command</td>  
+<td>Description</td></tr>
+
+<tr class="b">
+<td><a href="#Creating_an_AsterixDB_instance">create</a></td>   
+<td>Creates a new asterix instance.</td></tr>
+
+<tr class="a">
+<td><a href="#Describe_Command">describe</a></td> 
+<td>Describes an existing asterix instance.</td></tr>
+
+<tr class="b">
+<td><a href="#Stop_Command">stop</a></td>     
+<td>Stops an asterix instance that is in the ACTIVE state.</td></tr>
+
+<tr class="a">
+<td><a href="#Start_Command">start</a></td>    
+<td>Starts an AsterixDB instance.</td></tr>
+
+<tr class="b">
+<td><a href="#Backup_Command">backup</a></td>   
+<td>Creates a backup for an existing AsterixDB instance.</td></tr>
+
+<tr class="a">
+<td><a href="#Restore_Command">restore</a></td>  
+<td>Restores an AsterixDB instance.</td></tr>
+
+<tr class="b">
+<td><a href="#Delete_Command">delete</a></td>   
+<td>Deletes an AsterixDB instance.</td></tr>
+
+<tr class="a">
+<td><a href="#Configuring_Managix">validate</a></td> 
+<td>Validates the installer/cluster configuration.</td></tr>
+
+<tr class="b">
+<td><a href="#Configuring_Managix">configure</a></td>
+<td>Auto generates a configuration for an AsterixDB instance.</td></tr>
+
+<tr class="a">
+<td><a href="#Log_Command">log</a></td>
+<td>Produces a zip archive containing log files from each node in an AsterixDB instance.</td></tr>
+
+<tr class="b">
+<td><a href="#Shutdown_Command">shutdown</a></td> 
+<td>Shuts down the installer service.</td></tr>
+</table>
+<p>You may obtain the above listing by simply executing &#x2018;managix&#x2019; :</p>
+
+<div class="source">
+<pre>    $ managix
+</pre></div>
+<p>We already talked about <tt>create</tt> and <tt>validate</tt> commands. We shall next explain the rest of the commands listed above. We also provide sample output messages of these commands assuming we are running an AsterixDB instance on a single machine.</p>
+<div class="section">
+<h5>Describe Command<a name="Describe_Command"></a></h5>
+<p>The <tt>describe</tt> command provides information about an AsterixDB instance. The usage can be looked up by executing the following:</p>
+
+<div class="source">
+<pre>     $ managix help -cmd describe
+
+        Provides information about an AsterixDB instance.
+        The following options are available:
+        [-n]      Name of the AsterixDB instance.
+        [-admin]  Provides a detailed description
+</pre></div>
+<p>The brackets indicate optional flags.</p>
+<p>The output of the <tt>describe</tt> command when used without the <tt>admin</tt> flag contains minimal information and is similar to the output of the <tt>create</tt> command. Let us try running the describe command in &#x201c;admin&#x201d; mode.</p>
+
+<div class="source">
+<pre>     $ managix describe -n my_asterix -admin
+     INFO: Name:my_asterix
+     Created:Thu Mar 07 19:07:00 PST 2013
+     Web-Url:http://127.0.0.1:19001
+     State:ACTIVE
+     Master node:master:127.0.0.1
+     node1:127.0.0.1
+
+     Asterix version:0.0.5
+     Asterix Configuration
+     output_dir = /tmp/asterix_output/
+     Metadata Node:node1
+     Processes
+     NC at 127.0.0.1 [ 22195 ]
+     CC at 127.0.0.1 [ 22161 ]
+
+     Asterix Configuration
+       nc.java.opts                             :-Xmx1024m
+       cc.java.opts                             :-Xmx1024m
+       storage.buffercache.pagesize             :32768
+       storage.buffercache.size                 :33554432
+       storage.buffercache.maxopenfiles         :214748364
+       storage.memorycomponent.pagesize         :32768
+       storage.memorycomponent.numpages         :1024
+       storage.memorycomponent.globalbudget     :536870192
+       storage.lsm.mergethreshold               :3
+       storage.lsm.bloomfilter.falsepositiverate:0.01
+       txn.log.buffer.numpages                  :8
+       txn.log.buffer.pagesize                  :131072
+       txn.log.partitionsize                    :2147483648
+       txn.log.disksectorsize                   :4096
+       txn.log.groupcommitinterval              :1
+       txn.log.checkpoint.lsnthreshold          :67108864
+       txn.log.checkpoint.pollfrequency         :120
+       txn.log.checkpoint.history               :0
+       txn.lock.escalationthreshold             :1000
+       txn.lock.shrinktimer                     :5000
+       txn.lock.timeout.waitthreshold           :60000
+       txn.lock.timeout.sweepthreshold          :10000
+       compiler.sortmemory                      :33554432
+       compiler.joinmemory                      :33554432
+       compiler.framesize                       :32768
+       web.port                                 :19001
+       api.port                                 :19002
+       log.level                                :INFO
+</pre></div>
+<p>As seen above, the instance &#x2018;my_asterix&#x2019; is configured such that all processes running at the localhost (127.0.0.1). The process id for each process (JVM) is shown next to it.</p></div>
+<div class="section">
+<h5>Stop Command<a name="Stop_Command"></a></h5>
+<p>The <tt>stop</tt> command can be used for shutting down an AsterixDB instance. After that, the instance is unavailable for executing queries. The usage can be looked up by executing the following.</p>
+
+<div class="source">
+<pre>     $ managix help -cmd stop
+
+     Shuts an AsterixDB instance that is in ACTIVE state. After executing the stop command, the AsterixDB instance transits
+     to the INACTIVE state, indicating that it is no longer available for executing queries.
+
+     Available arguments/options
+     -n name of the AsterixDB instance.
+</pre></div>
+<p>To stop the AsterixDB instance.</p>
+
+<div class="source">
+<pre>     $ managix stop -n my_asterix
+       INFO: Stopped AsterixDB instance: my_asterix
+
+
+     $ managix describe -n my_asterix
+       INFO: Name: my_asterix
+       Created:Thu Mar 07 19:07:00 PST 2013
+       Web-Url:http://127.0.0.1:19001
+       State:INACTIVE (Fri Mar 08 09:49:00 PST 2013)
+</pre></div></div>
+<div class="section">
+<h5>Start Command<a name="Start_Command"></a></h5>
+<p>The <tt>start</tt> command starts an AsterixDB instance that is in the INACTIVE state. The usage can be looked up by executing the following:</p>
+
+<div class="source">
+<pre>     $ managix help -cmd start
+
+     Starts an AsterixDB instance that is in INACTIVE state. After executing the start command, the AsterixDB instance transits to the ACTIVE state,  indicating that it is now available for executing statements/queries.
+
+     Available arguments/options
+     -n name of the AsterixDB instance.
+</pre></div>
+<p>Let us now start the AsterixDB instance.</p>
+
+<div class="source">
+<pre>     $ managix start -n my_asterix
+       INFO: Name:my_asterix
+       Created:Thu Mar 07 19:07:00 PST 2013
+       Web-Url:http://127.0.0.1:19001
+       State:ACTIVE (Fri Mar 08 09:49:00 PST 2013)
+</pre></div></div>
+<div class="section">
+<h5>Backup Command<a name="Backup_Command"></a></h5>
+<p>The backup command allows you to take a backup of the data stored with an AsterixDB instance. The backup can be taken on the local file system or on an HDFS instance. In either case, the snapshots are stored under a backup directory. You need to make sure the backup directory has appropriate read/write permissions. Configuring settings for backup can be found inside the Managix&#x2019;s configuration file located at <tt>$MANAGIX_HOME/conf/managix-conf.xml</tt>.</p>
+<p><i>Configuring backup on the local file system</i></p>
+<p>We need to provide a path to a backup directory on the local file system. The backup directory can be configured be editing the Managix configuration XML, found at <tt>$MANAGIX_HOME/conf/managix-conf.xml</tt>.</p>
+
+<div class="source">
+<pre>    &lt;backup&gt;
+      &lt;backupDir&gt;Provide path to the backup directory here&lt;/backupDir&gt;
+    &lt;/backup&gt;
+</pre></div>
+<p>Prior to taking a backup of an AsterixDB instance, it is required for the instance to be in the INACTIVE state. We do so by using the <tt>stop</tt> command, as shown below:</p>
+
+<div class="source">
+<pre>    $ managix stop -n my_asterix
+      INFO: Stopped AsterixDB instance: my_asterix
+</pre></div>
+<p>We can now take the backup by executing the following:</p>
+
+<div class="source">
+<pre>    $ managix backup -n my_asterix
+      INFO: my_asterix backed up 0_Fri Mar 08 16:16:34 PST 2013 (LOCAL)
+</pre></div>
+<p><i>Configuring backup on an HDFS instance</i></p>
+<p>To configure a backup to be taken on an HDFS instance, we need to provide required information about the running HDFS instance. This information includes the HDFS version and the HDFS url. Simply edit the Managix configuration file and provide the required information.</p>
+
+<div class="source">
+<pre>    &lt;backup&gt;
+       &lt;backupDir&gt;Provide path to the backup directory here&lt;/backupDir&gt;
+       &lt;hdfs&gt;
+           &lt;version&gt;0.20.2&lt;/version&gt;
+           &lt;url&gt;&lt;/url&gt;
+       &lt;/hdfs&gt;
+    &lt;/backup&gt;
+</pre></div>
+<p>A sample output when a backup is taken on an HDFS is shown below:</p>
+
+<div class="source">
+<pre>    $ managix backup -n my_asterix
+      INFO: my_asterix backed up 1_Fri Mar 08 17:10:38 PST 2013 (HDFS)
+</pre></div>
+<p>Each time we take a backup, we are provided with a unique id (a monotonically increasing value starting with 0). This id is required when we need to restore from a previously taken backup. Information about all available backup snapshots can be obtained by using the <tt>describe</tt> command in the admin mode, as shown below:</p>
+
+<div class="source">
+<pre>     $ managix describe -n my_asterix -admin
+     INFO: Name:my_asterix
+     Created:Fri Mar 08 15:11:12 PST 2013
+     Web-Url:http://127.0.0.1:19001
+     State:INACTIVE (Fri Mar 08 16:14:20 PST 2013)
+     Master node:master:127.0.0.1
+     node1:127.0.0.1
+
+     Backup:0 created at Fri Mar 08 16:16:34 PST 2013 (LOCAL)
+     Backup:1 created at Fri Mar 08 17:10:38 PST 2013 (HDFS)
+
+     Asterix version:0.0.5
+     Asterix Configuration
+     Metadata Node:node1
+     Processes
+</pre></div>
+<p>The above output shows the available backup identified by it&#x2019;s id (0). We shall next describe the method for restoring an AsterixDB instance from a backup snapshot.</p></div>
+<div class="section">
+<h5>Restore Command<a name="Restore_Command"></a></h5>
+<p>The <tt>restore</tt> command allows you to restore an AsterixDB instance&#x2019;s data from a previously taken backup. The usage description can be obtained as follows:</p>
+
+<div class="source">
+<pre>      $ managix help -cmd restore
+
+      Restores an AsterixDB instance's data from a previously taken backup.
+      Available arguments/options
+
+      -n name of the AsterixDB instance
+      -b id of the backup snapshot
+</pre></div>
+<p>The following command restores our AsterixDB instance from the backup snapshot identified by the id (0). Prior to restoring an instance from a backup, it is required that the instance is in the INACTIVE state.</p>
+
+<div class="source">
+<pre>     $ managix restore -n my_asterix -b 0
+     INFO: AsterixDB instance: my_asterix has been restored from backup
+</pre></div>
+<p>You can start the AsterixDB instance by using the start command.</p></div>
+<div class="section">
+<h5>Log Command<a name="Log_Command"></a></h5>
+<p>The <tt>log</tt> command allows you to collect the log files coresponding to each node of an AsterixDB instance into a zip archive. The zip archive is produced on the local file system of the machine running managix. </p>
+
+<div class="source">
+<pre>      $ managix help -cmd log
+
+      Creates a zip archive containing log files corresponding to each worker node (NC) and the master (CC)  for an AsterixDB instance
+
+      Available arguments/options
+      -n name of the AsterixDB instance. 
+      -d destination directory for producing the zip archive. Defaults to $MANAGIX_HOME/logdump.
+</pre></div>
+<p>The following is an example showing the use of the log command. </p>
+
+<div class="source">
+<pre>     $ managix log -n my_asterix -d  /Users/joe/logdump
+     INFO: Log zip archive created at /Users/joe/logdump/log_Thu_Jun_06_00:53:51_PDT_2013.zip
+</pre></div></div>
+<div class="section">
+<h5>Delete Command<a name="Delete_Command"></a></h5>
+<p>As the name suggests, the <tt>delete</tt> command permanently removes an AsterixDB instance by cleaning up all associated data/artifacts. The usage can be looked up by executing the following:</p>
+
+<div class="source">
+<pre>      $ managix help -cmd delete
+      Permanently deletes an AsterixDB instance. The instance must be in the INACTIVE state.
+
+      Available arguments/options
+      -n name of the AsterixDB instance.
+
+
+      $ managix delete -n my_asterix
+       INFO: AsterixDB instance my_asterix deleted.
+</pre></div></div>
+<div class="section">
+<h5>Shutdown Command<a name="Shutdown_Command"></a></h5>
+<p>Managix uses Zookeeper service for storing all information about created AsterixDB instances. The Zookeeper service runs in the background and can be shut down using the <tt>shutdown</tt> command.</p>
+
+<div class="source">
+<pre>      $ managix shutdown
+</pre></div></div>
+<div class="section">
+<h5>Help Command<a name="Help_Command"></a></h5>
+<p>The <tt>help</tt> command provides a usage description of a Managix command.</p>
+
+<div class="source">
+<pre>    $ managix help -cmd &lt;command name&gt;
+</pre></div>
+<p>As an example, for looking up the help for the <tt>configure</tt> command, execute the following</p>
+
+<div class="source">
+<pre>    $ managix help -cmd configure
+
+    Auto-generates the AsterixDB installer configruation settings and AsterixDB cluster
+    configuration settings for a single node setup.
+</pre></div></div></div></div></div>
+<div class="section">
+<h2><a name="Section5FAQ" id="Section5FAQ">Section 5: Frequently Asked Questions</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Section_5:_Frequently_Asked_Questions_Back_to_TOC"></a></h2>
+<div class="section">
+<div class="section">
+<div class="section">
+<h5>Question<a name="Question"></a></h5>
+<p>What happens if a machine acting as a node in the Asterix cluster becomes unreachable for some reason (network partition/machine failure) ?</p></div>
+<div class="section">
+<h5>Answer<a name="Answer"></a></h5>
+<p>When a node leaves the Asterix cluster, the AsterixDB instance transits to an &#x2018;UNUSABLE&#x2019; state, indicating that it is no longer available for serving queries. To know which set of node(s) left the cluster, run the describe command with -admin flag. </p>
+
+<div class="source">
+<pre>    $ $MANAGIX_HOME/bin/managix describe -n &lt;name of the AsterixDB instance&gt;-admin
+</pre></div>
+<p>Above command will show the state of AsterixDB instance and list the set of nodes that have left the cluster. </p>
+<p>The failed node must be brought back to re-join the cluster. Once done, you may bring back the instance to an &#x2018;ACTIVE&#x2019; state by executing the following sequence. </p>
+<p>1) Get rid of the Asterix processes running on the nodes in the cluster:-</p>
+
+<div class="source">
+<pre>    managix stop -n my_asterix
+</pre></div>
+<p>The processes associated with the instance are terminated and the instance moves to the INACTIVE state.</p>
+<p>2) Start the AsterixDB instance using the start command.</p>
+
+<div class="source">
+<pre>    managix start -n &lt;name of your AsterixDB instance&gt;
+</pre></div></div>
+<div class="section">
+<h5>Question<a name="Question"></a></h5>
+<p>Do I need to create all the directories/paths I put into the cluster configuration XML ?</p></div>
+<div class="section">
+<h5>Answer<a name="Answer"></a></h5>
+<p>Managix will create a path if it is not existing. It does so using the user account mentioned in the cluster configuration xml. Please ensure that the user account has appropriate permissions for creating the missing paths. </p></div>
+<div class="section">
+<h5>Question<a name="Question"></a></h5>
+<p>Should MANAGIX_HOME be on the network file system (NFS) ?</p></div>
+<div class="section">
+<h5>Answer<a name="Answer"></a></h5>
+<p>It is recommended that MANAGIX_HOME is not on the NFS. Managix produces artifacts/logs on disk which are not required to be shared. As such an overhead in creating the artifacts/logs on the NFS should be avoided.</p></div>
+<div class="section">
+<h5>Question<a name="Question"></a></h5>
+<p>How do we change the underlying code (apply a code patch) for an &#x2018;active&#x2019; asterix instance?</p></div>
+<div class="section">
+<h5>Answer<a name="Answer"></a></h5>
+<p>At times, end-user (particularly asterix developer) may run into the need to altering the underlying code that is being run by an asterix instance. In the current version of managix, this can be achieved as follows:-</p>
+<p>Assume that you have an &#x2018;active&#x2019; instance by the name a1 that is running version v1 of asterix. You have a revised version of asterix - v2 that fixes some bug(s).</p>
+<p>To upgrade asterix from v1 to v2:-</p>
+<p>step 1) managix stop -n a1</p>
+<p>step 2) managix shutdown</p>
+<p>step 3) copy asterix-server zip (version v2) to asterix/</p>
+<p>step 4) managix start -n a1</p>
+<p>a1 now is running on version v2.</p>
+<p>Limitations:-</p>
+<p>a) Obviously this wont work in a situation where v2 has made a change that is incompatible with earlier version, such altering schema.</p>
+<p>b) A change in asterix zip applies to all existing instances (after a restart) and subsequent instances that user creates.</p></div></div></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>


[09/13] incubator-asterixdb-site git commit: Initial commit with Till's changes

Posted by im...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/aql/manual.html
----------------------------------------------------------------------
diff --git a/aql/manual.html b/aql/manual.html
new file mode 100644
index 0000000..8f8d35b
--- /dev/null
+++ b/aql/manual.html
@@ -0,0 +1,925 @@
+<!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 class="active">
+    
+            <a href="#"><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>The Asterix Query Language, Version 1.0</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="#Introduction">1. Introduction</a></li>
+  
+<li><a href="#Expressions">2. Expressions</a></li>
+  
+<li><a href="#Statements">3. Statements</a></li>
+</ul></div>
+<div class="section">
+<h2><a name="Introduction" id="Introduction">1. Introduction</a><font size="4"> <a href="#toc">[Back to TOC]</a></font><a name="a1._Introduction_Back_to_TOC"></a></h2>
+<p>This document is intended as a reference guide to the full syntax and semantics of the Asterix Query Language (AQL), the language for talking to AsterixDB. This guide covers both the data manipulation language (DML) aspects of AQL, including its support for queries and data modification, as well as its data definition language (DDL) aspects.  New AsterixDB users are encouraged to read and work through the (friendlier) guide &#x201c;AsterixDB 101: An ADM and AQL Primer&#x201d; before attempting to make use of this document. In addition, readers are advised to read and understand the Asterix Data Model (ADM) reference guide since a basic understanding of ADM concepts is a prerequisite to understanding AQL.<br />In what follows, we detail the features of the AQL language in a grammar-guided manner: We list and briefly explain each of the productions in the AQL grammar, offering examples for clarity in cases where doing so seems needed or helpful.</p></div>
+<div class="section">
+<h2><a name="Expressions" id="Expressions">2. Expressions</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="a2._Expressions_Back_to_TOC"></a></h2>
+
+<div class="source">
+<pre>Query ::= Expression
+</pre></div>
+<p>An AQL query can be any legal AQL expression.</p>
+
+<div class="source">
+<pre>Expression ::= ( OperatorExpr | IfThenElse | FLWOR | QuantifiedExpression )
+</pre></div>
+<p>AQL is a fully composable expression language. Each AQL expression returns zero or more Asterix Data Model (ADM) instances. There are four major kinds of expressions in AQL. At the topmost level, an AQL expression can be an OperatorExpr (similar to a mathematical expression), an IfThenElse (to choose between two alternative values), a FLWOR expression (the heart of AQL, pronounced &#x201c;flower expression&#x201d;), or a QuantifiedExpression (which yields a boolean value). Each will be detailed as we explore the full AQL grammar.</p>
+<div class="section">
+<h3>Primary Expressions<a name="Primary_Expressions"></a></h3>
+
+<div class="source">
+<pre>PrimaryExpr ::= Literal
+              | VariableRef
+              | ParenthesizedExpression
+              | FunctionCallExpr
+              | DatasetAccessExpression
+              | ListConstructor
+              | RecordConstructor
+</pre></div>
+<p>The most basic building block for any AQL expression is the PrimaryExpr. This can be a simple literal (constant) value, a reference to a query variable that is in scope, a parenthesized expression, a function call, an expression accessing the ADM contents of a dataset, a newly constructed list of ADM instances, or a newly constructed ADM record.</p>
+<div class="section">
+<h4>Literals<a name="Literals"></a></h4>
+
+<div class="source">
+<pre>Literal        ::= StringLiteral
+                 | IntegerLiteral
+                 | FloatLiteral
+                 | DoubleLiteral
+                 | &quot;null&quot;
+                 | &quot;true&quot;
+                 | &quot;false&quot;
+StringLiteral  ::= (&quot;\&quot;&quot; (&lt;ESCAPE_QUOT&gt; | ~[&quot;\&quot;&quot;])* &quot;\&quot;&quot;)
+                 | (&quot;\'&quot; (&lt;ESCAPE_APOS&gt; | ~[&quot;\'&quot;])* &quot;\'&quot;)
+&lt;ESCAPE_QUOT&gt;  ::= &quot;\\\&quot;&quot;
+&lt;ESCAPE_APOS&gt;  ::= &quot;\\\'&quot;
+IntegerLiteral ::= &lt;DIGITS&gt;
+&lt;DIGITS&gt;       ::= [&quot;0&quot; - &quot;9&quot;]+
+FloatLiteral   ::= &lt;DIGITS&gt; ( &quot;f&quot; | &quot;F&quot; )
+                 | &lt;DIGITS&gt; ( &quot;.&quot; &lt;DIGITS&gt; ( &quot;f&quot; | &quot;F&quot; ) )?
+                 | &quot;.&quot; &lt;DIGITS&gt; ( &quot;f&quot; | &quot;F&quot; )
+DoubleLiteral  ::= &lt;DIGITS&gt;
+                 | &lt;DIGITS&gt; ( &quot;.&quot; &lt;DIGITS&gt; )?
+                 | &quot;.&quot; &lt;DIGITS&gt;                      
+</pre></div>
+<p>Literals (constants) in AQL can be strings, integers, floating point values, double values, boolean constants, or the constant value null. The null value in AQL has &#x201c;unknown&#x201d; or &#x201c;missing&#x201d; value semantics, similar to (though not identical to) nulls in the relational query language SQL.</p>
+<p>The following are some simple examples of AQL literals. Since AQL is an expression language, each example is also a complete, legal AQL query (!).</p>
+<div class="section">
+<h5>Examples<a name="Examples"></a></h5>
+
+<div class="source">
+<pre>&quot;a string&quot;
+42
+</pre></div></div></div>
+<div class="section">
+<h4>Variable References<a name="Variable_References"></a></h4>
+
+<div class="source">
+<pre>VariableRef ::= &lt;VARIABLE&gt;
+&lt;VARIABLE&gt;  ::= &quot;$&quot; &lt;LETTER&gt; (&lt;LETTER&gt; | &lt;DIGIT&gt; | &quot;_&quot;)*
+&lt;LETTER&gt;    ::= [&quot;A&quot; - &quot;Z&quot;, &quot;a&quot; - &quot;z&quot;]
+</pre></div>
+<p>A variable in AQL can be bound to any legal ADM value. A variable reference refers to the value to which an in-scope variable is bound. (E.g., a variable binding may originate from one of the for or let clauses of a FLWOR expression or from an input parameter in the context of an AQL function body.)</p>
+<div class="section">
+<h5>Examples<a name="Examples"></a></h5>
+
+<div class="source">
+<pre>$tweet
+$id
+</pre></div></div></div>
+<div class="section">
+<h4>Parenthesized Expressions<a name="Parenthesized_Expressions"></a></h4>
+
+<div class="source">
+<pre>ParenthesizedExpression ::= &quot;(&quot; Expression &quot;)&quot;
+</pre></div>
+<p>As in most languages, an expression may be parenthesized.</p>
+<p>Since AQL is an expression language, the following example expression is actually also a complete, legal AQL query whose result is the value 2. (As such, you can have Big Fun explaining to your boss how AsterixDB and AQL can turn your 1000-node shared-nothing Big Data cluster into a $5M calculator in its spare time.)</p>
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>( 1 + 1 )
+</pre></div></div></div>
+<div class="section">
+<h4>Function Calls<a name="Function_Calls"></a></h4>
+
+<div class="source">
+<pre>FunctionCallExpr ::= FunctionOrTypeName &quot;(&quot; ( Expression ( &quot;,&quot; Expression )* )? &quot;)&quot;
+</pre></div>
+<p>Functions are included in AQL, like most languages, as a way to package useful functionality or to componentize complicated or reusable AQL computations. A function call is a legal AQL query expression that represents the ADM value resulting from the evaluation of its body expression with the given parameter bindings; the parameter value bindings can themselves be any AQL expressions.</p>
+<p>The following example is a (built-in) function call expression whose value is 8.</p>
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>string-length(&quot;a string&quot;)
+</pre></div></div></div>
+<div class="section">
+<h4>Dataset Access<a name="Dataset_Access"></a></h4>
+
+<div class="source">
+<pre>DatasetAccessExpression ::= &quot;dataset&quot; ( ( Identifier ( &quot;.&quot; Identifier )? )
+                          | ( &quot;(&quot; Expression &quot;)&quot; ) )
+Identifier              ::= &lt;IDENTIFIER&gt; | StringLiteral
+&lt;IDENTIFIER&gt;            ::= &lt;LETTER&gt; (&lt;LETTER&gt; | &lt;DIGIT&gt; | &lt;SPECIALCHARS&gt;)*
+&lt;SPECIALCHARS&gt;          ::= [&quot;$&quot;, &quot;_&quot;, &quot;-&quot;]
+</pre></div>
+<p>Querying Big Data is the main point of AsterixDB and AQL. Data in AsterixDB reside in datasets (collections of ADM records), each of which in turn resides in some namespace known as a dataverse (data universe). Data access in a query expression is accomplished via a DatasetAccessExpression. Dataset access expressions are most commonly used in FLWOR expressions, where variables are bound to their contents.</p>
+<p>Note that the Identifier that identifies a dataset (or any other Identifier in AQL) can also be a StringLiteral. This is especially useful to avoid conficts with AQL keywords (e.g. &#x201c;dataset&#x201d;, &#x201c;null&#x201d;, or &#x201c;type&#x201d;).</p>
+<p>The following are three examples of legal dataset access expressions. The first one accesses a dataset called Customers in the dataverse called SalesDV. The second one accesses the Customers dataverse in whatever the current dataverse is. The third one does the same thing as the second but uses a slightly older AQL syntax.</p>
+<div class="section">
+<h5>Examples<a name="Examples"></a></h5>
+
+<div class="source">
+<pre>dataset SalesDV.Customers
+dataset Customers
+dataset(&quot;Customers&quot;)
+</pre></div></div></div>
+<div class="section">
+<h4>Constructors<a name="Constructors"></a></h4>
+
+<div class="source">
+<pre>ListConstructor          ::= ( OrderedListConstructor | UnorderedListConstructor )
+OrderedListConstructor   ::= &quot;[&quot; ( Expression ( &quot;,&quot; Expression )* )? &quot;]&quot;
+UnorderedListConstructor ::= &quot;{{&quot; ( Expression ( &quot;,&quot; Expression )* )? &quot;}}&quot;
+RecordConstructor        ::= &quot;{&quot; ( FieldBinding ( &quot;,&quot; FieldBinding )* )? &quot;}&quot;
+FieldBinding             ::= Expression &quot;:&quot; Expression
+</pre></div>
+<p>A major feature of AQL is its ability to construct new ADM data instances. This is accomplished using its constructors for each of the major ADM complex object structures, namely lists (ordered or unordered) and records. Ordered lists are like JSON arrays, while unordered lists have bag (multiset) semantics. Records are built from attributes that are field-name/field-value pairs, again like JSON. (See the AsterixDB Data Model document for more details on each.)</p>
+<p>The following examples illustrate how to construct a new ordered list with 3 items, a new unordered list with 4 items, and a new record with 2 fields, respectively. List elements can be homogeneous (as in the first example), which is the common case, or they may be heterogeneous (as in the second example). The data values and field name values used to construct lists and records in constructors are all simply AQL expressions. Thus the list elements, field names, and field values used in constructors can be simple literals (as in these three examples) or they can come from query variable references or even arbitrarily complex AQL expressions.</p>
+<div class="section">
+<h5>Examples<a name="Examples"></a></h5>
+
+<div class="source">
+<pre>[ &quot;a&quot;, &quot;b&quot;, &quot;c&quot; ]
+
+{{ 42, &quot;forty-two&quot;, &quot;AsterixDB!&quot;, 3.14f }}
+
+{
+  &quot;project name&quot;: &quot;AsterixDB&quot;
+  &quot;project members&quot;: {{ &quot;vinayakb&quot;, &quot;dtabass&quot;, &quot;chenli&quot; }}
+}
+</pre></div></div>
+<div class="section">
+<h5>Note<a name="Note"></a></h5>
+<p>When constructing nested records there needs to be a space between the closing braces to avoid confusion with the <tt>}}</tt> token that ends an unordered list constructor: <tt>{ &quot;a&quot; : { &quot;b&quot; : &quot;c&quot; }}</tt> will fail to parse while <tt>{ &quot;a&quot; : { &quot;b&quot; : &quot;c&quot; } }</tt> will work.</p></div></div></div>
+<div class="section">
+<h3>Path Expressions<a name="Path_Expressions"></a></h3>
+
+<div class="source">
+<pre>ValueExpr ::= PrimaryExpr ( Field | Index )*
+Field     ::= &quot;.&quot; Identifier
+Index     ::= &quot;[&quot; ( Expression | &quot;?&quot; ) &quot;]&quot;
+</pre></div>
+<p>Components of complex types in ADM are accessed via path expressions. Path access can be applied to the result of an AQL expression that yields an instance of such a type, e.g., a record or list instance. For records, path access is based on field names. For ordered lists, path access is based on (zero-based) array-style indexing. AQL also supports an &#x201c;I&#x2019;m feeling lucky&#x201d; style index accessor, [?], for selecting an arbitrary element from an ordered list. Attempts to access non-existent fields or list elements produce a null (i.e., missing information) result as opposed to signaling a runtime error.</p>
+<p>The following examples illustrate field access for a record, index-based element access for an ordered list, and also a composition thereof.</p>
+<div class="section">
+<div class="section">
+<h5>Examples<a name="Examples"></a></h5>
+
+<div class="source">
+<pre>({&quot;list&quot;: [ &quot;a&quot;, &quot;b&quot;, &quot;c&quot;]}).list
+
+([&quot;a&quot;, &quot;b&quot;, &quot;c&quot;])[2]
+
+({ &quot;list&quot;: [ &quot;a&quot;, &quot;b&quot;, &quot;c&quot;]}).list[2]
+</pre></div></div></div></div>
+<div class="section">
+<h3>Logical Expressions<a name="Logical_Expressions"></a></h3>
+
+<div class="source">
+<pre>OperatorExpr ::= AndExpr ( &quot;or&quot; AndExpr )*
+AndExpr      ::= RelExpr ( &quot;and&quot; RelExpr )*
+</pre></div>
+<p>As in most languages, boolean expressions can be built up from smaller expressions by combining them with the logical connectives and/or. Legal boolean values in AQL are true, false, and null. (Nulls in AQL are treated much like SQL treats its unknown truth value in boolean expressions.)</p>
+<p>The following is an example of a conjuctive range predicate in AQL. It will yield true if $a is bound to 4, null if $a is bound to null, and false otherwise.</p>
+<div class="section">
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>$a &gt; 3 and $a &lt; 5
+</pre></div></div></div></div>
+<div class="section">
+<h3>Comparison Expressions<a name="Comparison_Expressions"></a></h3>
+
+<div class="source">
+<pre>RelExpr ::= AddExpr ( ( &quot;&lt;&quot; | &quot;&gt;&quot; | &quot;&lt;=&quot; | &quot;&gt;=&quot; | &quot;=&quot; | &quot;!=&quot; | &quot;~=&quot; ) AddExpr )?
+</pre></div>
+<p>AQL has the usual list of suspects, plus one, for comparing pairs of atomic values. The &#x201c;plus one&#x201d; is the last operator listed above, which is the &#x201c;roughly equal&#x201d; operator provided for similarity queries. (See the separate document on <a href="similarity.html">AsterixDB Similarity Queries</a> for more details on similarity matching.)</p>
+<p>An example comparison expression (which yields the boolean value true) is shown below.</p>
+<div class="section">
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>5 &gt; 3
+</pre></div></div></div></div>
+<div class="section">
+<h3>Arithmetic Expressions<a name="Arithmetic_Expressions"></a></h3>
+
+<div class="source">
+<pre>AddExpr  ::= MultExpr ( ( &quot;+&quot; | &quot;-&quot; ) MultExpr )*
+MultExpr ::= UnaryExpr ( ( &quot;*&quot; | &quot;/&quot; | &quot;%&quot; | &quot;^&quot;| &quot;idiv&quot; ) UnaryExpr )*
+UnaryExpr ::= ( ( &quot;+&quot; | &quot;-&quot; ) )? ValueExpr
+</pre></div>
+<p>AQL also supports the usual cast of characters for arithmetic expressions. The example below evaluates to 25.</p>
+<div class="section">
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>3 ^ 2 + 4 ^ 2
+</pre></div></div></div></div>
+<div class="section">
+<h3>FLWOR Expression<a name="FLWOR_Expression"></a></h3>
+
+<div class="source">
+<pre>FLWOR         ::= ( ForClause | LetClause ) ( Clause )* (&quot;return&quot;|&quot;select&quot;) Expression
+Clause         ::= ForClause | LetClause | WhereClause | OrderbyClause
+                 | GroupClause | LimitClause | DistinctClause
+ForClause      ::= (&quot;for&quot;|&quot;from&quot;) Variable ( &quot;at&quot; Variable )? &quot;in&quot; ( Expression )
+LetClause      ::= (&quot;let&quot;|&quot;with&quot;) Variable &quot;:=&quot; Expression
+WhereClause    ::= &quot;where&quot; Expression
+OrderbyClause  ::= &quot;order&quot; &quot;by&quot; Expression ( ( &quot;asc&quot; ) | ( &quot;desc&quot; ) )? 
+                   ( &quot;,&quot; Expression ( ( &quot;asc&quot; ) | ( &quot;desc&quot; ) )? )*
+GroupClause    ::= &quot;group&quot; &quot;by&quot; ( Variable &quot;:=&quot; )? Expression ( &quot;,&quot; ( Variable &quot;:=&quot; )? Expression )*
+                   (&quot;with&quot;|&quot;keeping&quot;) VariableRef ( &quot;,&quot; VariableRef )*
+LimitClause    ::= &quot;limit&quot; Expression ( &quot;offset&quot; Expression )?
+DistinctClause ::= &quot;distinct&quot; &quot;by&quot; Expression ( &quot;,&quot; Expression )*
+Variable       ::= &lt;VARIABLE&gt;
+</pre></div>
+<p>The heart of AQL is the FLWOR (for-let-where-orderby-return) expression. The roots of this expression were borrowed from the expression of the same name in XQuery. A FLWOR expression starts with one or more clauses that establish variable bindings. A <tt>for</tt> clause binds a variable incrementally to each element of its associated expression; it includes an optional positional variable for counting/numbering the bindings. By default no ordering is implied or assumed by a <tt>for</tt> clause. A <tt>let</tt> clause binds a variable to the collection of elements computed by its associated expression.</p>
+<p>Following the initial <tt>for</tt> or <tt>let</tt> clause(s), a FLWOR expression may contain an arbitrary sequence of other clauses. The <tt>where</tt> clause in a FLWOR expression filters the preceding bindings via a boolean expression, much like a <tt>where</tt> clause does in a SQL query. The <tt>order by</tt> clause in a FLWOR expression induces an ordering on the data. The <tt>group by</tt> clause, discussed further below, forms groups based on its group by expressions, optionally naming the expressions&#x2019; values (which together form the grouping key for the expression). The <tt>with</tt> subclause of a <tt>group by</tt> clause specifies the variable(s) whose values should be grouped based on the grouping key(s); following the grouping clause, only the grouping key(s) and the variables named in the with subclause remain in scope, and the named grouping variables now contain lists formed from their input values. The <tt>limit</tt> clause caps the number of values returne
 d, optionally starting its result count from a specified offset. (Web applications can use this feature for doing pagination.) The <tt>distinct</tt> clause is similar to the <tt>group-by</tt> clause, but it forms no groups; it serves only to eliminate duplicate values. As indicated by the grammar, the clauses in an AQL query can appear in any order. To interpret a query, one can think of data as flowing down through the query from the first clause to the <tt>return</tt> clause.</p>
+<p>The following example shows a FLWOR expression that selects and returns one user from the dataset FacebookUsers.</p>
+<div class="section">
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>for $user in dataset FacebookUsers
+where $user.id = 8
+return $user
+</pre></div>
+<p>The next example shows a FLWOR expression that joins two datasets, FacebookUsers and FacebookMessages, returning user/message pairs. The results contain one record per pair, with result records containing the user&#x2019;s name and an entire message.</p></div>
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>for $user in dataset FacebookUsers
+for $message in dataset FacebookMessages
+where $message.author-id = $user.id
+return
+  {
+    &quot;uname&quot;: $user.name,
+    &quot;message&quot;: $message.message
+  };
+</pre></div>
+<p>In the next example, a <tt>let</tt> clause is used to bind a variable to all of a user&#x2019;s FacebookMessages. The query returns one record per user, with result records containing the user&#x2019;s name and the set of all messages by that user.</p></div>
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>for $user in dataset FacebookUsers
+let $messages := 
+  for $message in dataset FacebookMessages
+  where $message.author-id = $user.id
+  return $message.message
+return
+  {
+    &quot;uname&quot;: $user.name,
+    &quot;messages&quot;: $messages
+  };
+</pre></div>
+<p>The following example returns all TwitterUsers ordered by their followers count (most followers first) and language. When ordering <tt>null</tt> is treated as being smaller than any other value if <tt>null</tt>s are encountered in the ordering key(s).</p></div>
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>  for $user in dataset TwitterUsers
+  order by $user.followers_count desc, $user.lang asc
+  return $user
+</pre></div>
+<p>The next example illustrates the use of the <tt>group by</tt> clause in AQL. After the <tt>group by</tt> clause in the query, only variables that are either in the <tt>group by</tt> list or in the <tt>with</tt> list are in scope. The variables in the clause&#x2019;s <tt>with</tt> list will each contain a collection of items following the <tt>group by</tt> clause; the collected items are the values that the source variable was bound to in the tuples that formed the group. For grouping <tt>null</tt> is handled as a single value.</p></div>
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>  for $x in dataset FacebookMessages
+  let $messages := $x.message
+  group by $loc := $x.sender-location with $messages
+  return
+    {
+      &quot;location&quot; : $loc,
+      &quot;message&quot; : $messages
+    }
+</pre></div>
+<p>The use of the <tt>limit</tt> clause is illustrated in the next example.</p></div>
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>  for $user in dataset TwitterUsers
+  order by $user.followers_count desc
+  limit 2
+  return $user
+</pre></div>
+<p>The final example shows how AQL&#x2019;s <tt>distinct by</tt> clause works. Each variable in scope before the distinct clause is also in scope after the <tt>distinct by</tt> clause. This clause works similarly to <tt>group by</tt>, but for each variable that contains more than one value after the <tt>distinct by</tt> clause, one value is picked nondeterministically. (If the variable is in the <tt>distinct by</tt> list, then its value will be deterministic.) Nulls are treated as a single value when they occur in a grouping field.</p></div>
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>  for $x in dataset FacebookMessages
+  distinct by $x.sender-location
+  return
+    {
+      &quot;location&quot; : $x.sender-location,
+      &quot;message&quot; : $x.message
+    }
+</pre></div>
+<p>In order to allow SQL fans to write queries in their favored ways, AQL provides synonyms: <i>from</i> for <i>for</i>, <i>select</i> for <i>return</i>, <i>with</i> for <i>let</i>, and <i>keeping</i> for <i>with</i> in the group by clause. The following query is such an example.</p></div>
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>  from $x in dataset FacebookMessages
+  with $messages := $x.message
+  group by $loc := $x.sender-location keeping $messages
+  select
+    {
+      &quot;location&quot; : $loc,
+      &quot;message&quot; : $messages
+    }
+</pre></div></div></div></div>
+<div class="section">
+<h3>Conditional Expression<a name="Conditional_Expression"></a></h3>
+
+<div class="source">
+<pre>IfThenElse ::= &quot;if&quot; &quot;(&quot; Expression &quot;)&quot; &quot;then&quot; Expression &quot;else&quot; Expression
+</pre></div>
+<p>A conditional expression is useful for choosing between two alternative values based on a boolean condition. If its first (<tt>if</tt>) expression is true, its second (<tt>then</tt>) expression&#x2019;s value is returned, and otherwise its third (<tt>else</tt>) expression is returned.</p>
+<p>The following example illustrates the form of a conditional expression.</p>
+<div class="section">
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>if (2 &lt; 3) then &quot;yes&quot; else &quot;no&quot;
+</pre></div></div></div></div>
+<div class="section">
+<h3>Quantified Expressions<a name="Quantified_Expressions"></a></h3>
+
+<div class="source">
+<pre>QuantifiedExpression ::= ( ( &quot;some&quot; ) | ( &quot;every&quot; ) ) Variable &quot;in&quot; Expression
+                         ( &quot;,&quot; Variable &quot;in&quot; Expression )* &quot;satisfies&quot; Expression
+</pre></div>
+<p>Quantified expressions are used for expressing existential or universal predicates involving the elements of a collection.</p>
+<p>The following pair of examples illustrate the use of a quantified expression to test that every (or some) element in the set [1, 2, 3] of integers is less than three. The first example yields <tt>false</tt> and second example yields <tt>true</tt>.</p>
+<p>It is useful to note that if the set were instead the empty set, the first expression would yield <tt>true</tt> (&#x201c;every&#x201d; value in an empty set satisfies the condition) while the second expression would yield <tt>false</tt> (since there isn&#x2019;t &#x201c;some&#x201d; value, as there are no values in the set, that satisfies the condition).</p>
+<div class="section">
+<div class="section">
+<h5>Examples<a name="Examples"></a></h5>
+
+<div class="source">
+<pre>every $x in [ 1, 2, 3 ] satisfies $x &lt; 3
+some $x in [ 1, 2, 3 ] satisfies $x &lt; 3
+</pre></div></div></div></div></div>
+<div class="section">
+<h2><a name="Statements" id="Statements">3. Statements</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="a3._Statements_Back_to_TOC"></a></h2>
+
+<div class="source">
+<pre>Statement ::= ( SingleStatement ( &quot;;&quot; )? )* &lt;EOF&gt;
+SingleStatement ::= DataverseDeclaration
+                  | FunctionDeclaration
+                  | CreateStatement
+                  | DropStatement
+                  | LoadStatement
+                  | SetStatement
+                  | InsertStatement
+                  | DeleteStatement
+                  | Query                      
+</pre></div>
+<p>In addition to expresssions for queries, AQL supports a variety of statements for data definition and manipulation purposes as well as controlling the context to be used in evaluating AQL expressions. AQL supports record-level ACID transactions that begin and terminate implicitly for each record inserted, deleted, or searched while a given AQL statement is being executed.</p>
+<p>This section details the statements supported in the AQL language.</p>
+<div class="section">
+<h3>Declarations<a name="Declarations"></a></h3>
+
+<div class="source">
+<pre>DataverseDeclaration ::= &quot;use&quot; &quot;dataverse&quot; Identifier
+</pre></div>
+<p>The world of data in an AsterixDB cluster is organized into data namespaces called dataverses. To set the default dataverse for a series of statements, the use dataverse statement is provided.</p>
+<p>As an example, the following statement sets the default dataverse to be TinySocial.</p>
+<div class="section">
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>use dataverse TinySocial;
+</pre></div>
+<p>The set statement in AQL is used to control aspects of the expression evalation context for queries.</p>
+
+<div class="source">
+<pre>SetStatement ::= &quot;set&quot; Identifier StringLiteral
+</pre></div>
+<p>As an example, the following set statements request that Jaccard similarity with a similarity threshold 0.6 be used for set similarity matching when the ~= operator is used in a query expression.</p></div>
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>set simfunction &quot;jaccard&quot;;
+set simthreshold &quot;0.6f&quot;; 
+</pre></div>
+<p>When writing a complex AQL query, it can sometimes be helpful to define one or more auxilliary functions that each address a sub-piece of the overall query. The declare function statement supports the creation of such helper functions.</p>
+
+<div class="source">
+<pre>FunctionDeclaration  ::= &quot;declare&quot; &quot;function&quot; Identifier ParameterList &quot;{&quot; Expression &quot;}&quot;
+ParameterList        ::= &quot;(&quot; ( &lt;VARIABLE&gt; ( &quot;,&quot; &lt;VARIABLE&gt; )* )? &quot;)&quot;
+</pre></div>
+<p>The following is a very simple example of a temporary AQL function definition.</p></div>
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>declare function add($a, $b) {
+  $a + $b
+};
+</pre></div></div></div></div>
+<div class="section">
+<h3>Lifecycle Management Statements<a name="Lifecycle_Management_Statements"></a></h3>
+
+<div class="source">
+<pre>CreateStatement ::= &quot;create&quot; ( DataverseSpecification
+                             | TypeSpecification
+                             | DatasetSpecification
+                             | IndexSpecification
+                             | FunctionSpecification )
+
+QualifiedName       ::= Identifier ( &quot;.&quot; Identifier )?
+DoubleQualifiedName ::= Identifier &quot;.&quot; Identifier ( &quot;.&quot; Identifier )?
+</pre></div>
+<p>The create statement in AQL is used for creating persistent artifacts in the context of dataverses. It can be used to create new dataverses, datatypes, datasets, indexes, and user-defined AQL functions.</p>
+<div class="section">
+<h4>Dataverses<a name="Dataverses"></a></h4>
+
+<div class="source">
+<pre>DataverseSpecification ::= &quot;dataverse&quot; Identifier IfNotExists ( &quot;with format&quot; StringLiteral )?
+</pre></div>
+<p>The create dataverse statement is used to create new dataverses. To ease the authoring of reusable AQL scripts, its optional IfNotExists clause allows creation to be requested either unconditionally or only if the the dataverse does not already exist. If this clause is absent, an error will be returned if the specified dataverse already exists. The <tt>with format</tt> clause is a placeholder for future functionality that can safely be ignored.</p>
+<p>The following example creates a dataverse named TinySocial.</p>
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>create dataverse TinySocial;
+</pre></div></div></div>
+<div class="section">
+<h4>Types<a name="Types"></a></h4>
+
+<div class="source">
+<pre>TypeSpecification    ::= &quot;type&quot; FunctionOrTypeName IfNotExists &quot;as&quot; TypeExpr
+FunctionOrTypeName   ::= QualifiedName
+IfNotExists          ::= ( &quot;if not exists&quot; )?
+TypeExpr             ::= RecordTypeDef | TypeReference | OrderedListTypeDef | UnorderedListTypeDef
+RecordTypeDef        ::= ( &quot;closed&quot; | &quot;open&quot; )? &quot;{&quot; ( RecordField ( &quot;,&quot; RecordField )* )? &quot;}&quot;
+RecordField          ::= Identifier &quot;:&quot; ( TypeExpr ) ( &quot;?&quot; )?
+NestedField          ::= Identifier ( &quot;.&quot; Identifier )*
+OpenField            ::= NestedField ( &quot;:&quot; TypeReference )?
+TypeReference        ::= Identifier
+OrderedListTypeDef   ::= &quot;[&quot; ( TypeExpr ) &quot;]&quot;
+UnorderedListTypeDef ::= &quot;{{&quot; ( TypeExpr ) &quot;}}&quot;
+</pre></div>
+<p>The create type statement is used to create a new named ADM datatype. This type can then be used to create datasets or utilized when defining one or more other ADM datatypes. Much more information about the Asterix Data Model (ADM) is available in the <a href="datamodel.html">data model reference guide</a> to ADM. A new type can be a record type, a renaming of another type, an ordered list type, or an unordered list type. A record type can be defined as being either open or closed. Instances of a closed record type are not permitted to contain fields other than those specified in the create type statement. Instances of an open record type may carry additional fields, and open is the default for a new type (if neither option is specified).</p>
+<p>The following example creates a new ADM record type called FacebookUser type. Since it is closed, its instances will contain only what is specified in the type definition. The first four fields are traditional typed name/value pairs. The friend-ids field is an unordered list of 32-bit integers. The employment field is an ordered list of instances of another named record type, EmploymentType.</p>
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>create type FacebookUserType as closed {
+  &quot;id&quot; :         int32,
+  &quot;alias&quot; :      string,
+  &quot;name&quot; :       string,
+  &quot;user-since&quot; : datetime,
+  &quot;friend-ids&quot; : {{ int32 }},
+  &quot;employment&quot; : [ EmploymentType ]
+}
+</pre></div></div></div>
+<div class="section">
+<h4>Datasets<a name="Datasets"></a></h4>
+
+<div class="source">
+<pre>DatasetSpecification ::= &quot;internal&quot;? &quot;dataset&quot; QualifiedName &quot;(&quot; Identifier &quot;)&quot; IfNotExists
+                         PrimaryKey ( &quot;on&quot; Identifier )? ( &quot;hints&quot; Properties )?
+                         ( &quot;using&quot; &quot;compaction&quot; &quot;policy&quot; CompactionPolicy ( Configuration )? )? 
+                         ( &quot;with filter on&quot; Identifier )?
+                       | &quot;external&quot; &quot;dataset&quot; QualifiedName &quot;(&quot; Identifier &quot;)&quot; IfNotExists 
+                         &quot;using&quot; AdapterName Configuration ( &quot;hints&quot; Properties )?
+                         ( &quot;using&quot; &quot;compaction&quot; &quot;policy&quot; CompactionPolicy ( Configuration )? )? 
+AdapterName          ::= Identifier
+Configuration        ::= &quot;(&quot; ( KeyValuePair ( &quot;,&quot; KeyValuePair )* )? &quot;)&quot;
+KeyValuePair         ::= &quot;(&quot; StringLiteral &quot;=&quot; StringLiteral &quot;)&quot;
+Properties           ::= ( &quot;(&quot; Property ( &quot;,&quot; Property )* &quot;)&quot; )?
+Property             ::= Identifier &quot;=&quot; ( StringLiteral | IntegerLiteral )
+FunctionSignature    ::= FunctionOrTypeName &quot;@&quot; IntegerLiteral
+PrimaryKey           ::= &quot;primary&quot; &quot;key&quot; NestedField ( &quot;,&quot; NestedField )*
+CompactionPolicy     ::= Identifier
+PrimaryKey           ::= &quot;primary&quot; &quot;key&quot; Identifier ( &quot;,&quot; Identifier )*
+</pre></div>
+<p>The create dataset statement is used to create a new dataset. Datasets are named, unordered collections of ADM record instances; they are where data lives persistently and are the targets for queries in AsterixDB. Datasets are typed, and AsterixDB will ensure that their contents conform to their type definitions. An Internal dataset (the default) is a dataset that is stored in and managed by AsterixDB. It must have a specified unique primary key that can be used to partition data across nodes of an AsterixDB cluster. The primary key is also used in secondary indexes to uniquely identify the indexed primary data records. Optionally, a filter can be created on a field to further optimize range queries with predicates on the filter&#x2019;s field. (Refer to <a href="filters.html">Filter-Based LSM Index Acceleration</a> for more information about filters.)</p>
+<p>An External dataset is stored outside of AsterixDB (currently datasets in HDFS or on the local filesystem(s) of the cluster&#x2019;s nodes are supported). External dataset support allows AQL queries to treat external data as though it were stored in AsterixDB, making it possible to query &#x201c;legacy&#x201d; file data (e.g., Hive data) without having to physically import it into AsterixDB. For an external dataset, an appropriate adapter must be selected to handle the nature of the desired external data. (See the <a href="externaldata.html">guide to external data</a> for more information on the available adapters.)</p>
+<p>When creating a dataset, it is possible to choose a merge policy that controls which of the underlaying LSM storage components to be merged. Currently, AsterixDB provides four different merge policies that can be configured per dataset: no-merge, constant, prefix, and correlated-prefix. The no-merge policy simply never merges disk components. While the constant policy merges disk components when the number of components reaches some constant number k, which can be configured by the user. The prefix policy relies on component sizes and the number of components to decide which components to merge. Specifically, it works by first trying to identify the smallest ordered (oldest to newest) sequence of components such that the sequence does not contain a single component that exceeds some threshold size M and that either the sum of the component&#x2019;s sizes exceeds M or the number of components in the sequence exceeds another threshold C. If such a sequence of components exists, the
 n each of the components in the sequence are merged together to form a single component. Finally, the correlated-prefix is similar to the prefix policy but it delegates the decision of merging the disk components of all the indexes in a dataset to the primary index. When the policy decides that the primary index needs to be merged (using the same decision criteria as for the prefix policy), then it will issue successive merge requests on behalf of all other indexes associated with the same dataset. The default policy for AsterixDB is the prefix policy except when there is a filter on a dataset, where the preferred policy for filters is the correlated-prefix.</p>
+<p>The following example creates an internal dataset for storing FacefookUserType records. It specifies that their id field is their primary key.</p>
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>create internal dataset FacebookUsers(FacebookUserType) primary key id;
+</pre></div>
+<p>The next example creates an external dataset for storing LineitemType records. The choice of the <tt>hdfs</tt> adapter means that its data will reside in HDFS. The create statement provides parameters used by the hdfs adapter: the URL and path needed to locate the data in HDFS and a description of the data format.</p></div>
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>create external dataset Lineitem('LineitemType) using hdfs (
+  (&quot;hdfs&quot;=&quot;hdfs://HOST:PORT&quot;),
+  (&quot;path&quot;=&quot;HDFS_PATH&quot;),
+  (&quot;input-format&quot;=&quot;text-input-format&quot;),
+  (&quot;format&quot;=&quot;delimited-text&quot;),
+  (&quot;delimiter&quot;=&quot;|&quot;));
+</pre></div></div></div>
+<div class="section">
+<h4>Indices<a name="Indices"></a></h4>
+
+<div class="source">
+<pre>IndexSpecification ::= &quot;index&quot; Identifier IfNotExists &quot;on&quot; QualifiedName 
+                       &quot;(&quot; ( OpenField ) ( &quot;,&quot; OpenField )* &quot;)&quot; ( &quot;type&quot; IndexType )? ( &quot;enforced&quot; )?
+IndexType          ::= &quot;btree&quot;
+                     | &quot;rtree&quot;
+                     | &quot;keyword&quot;
+                     | &quot;ngram&quot; &quot;(&quot; IntegerLiteral &quot;)&quot;
+</pre></div>
+<p>The create index statement creates a secondary index on one or more fields of a specified dataset. Supported index types include <tt>btree</tt> for totally ordered datatypes, <tt>rtree</tt> for spatial data, and <tt>keyword</tt> and <tt>ngram</tt> for textual (string) data. Index could be created on arbitrary nested fields by providing valid path expression as an indexed field identifier. An index field is not required to be part of the datatype associated with a dataset if that datatype is declared as open, field type is provided along with it&#x2019;s type and <tt>enforced</tt> keyword is specified in the end of index definition. <tt>Enforcing</tt> an open field will introduce a load-time check, which will make sure that the actual type of an indexed field (if such field exists in the record) matches the specified field type.</p>
+<p>The following example creates a btree index called fbAuthorIdx on the author-id field of the FacebookMessages dataset. This index can be useful for accelerating exact-match queries, range search queries, and joins involving the author-id field.</p>
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>create index fbAuthorIdx on FacebookMessages(author-id) type btree enforced;
+</pre></div>
+<p>The following example creates an open btree index called fbSendTimeIdx on the open send-time field of the FacebookMessages dataset having datetime type. This index can be useful for accelerating exact-match queries, range search queries, and joins involving the send-time field.</p></div>
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>create index fbSendTimeIdx on FacebookMessages(send-time:datetime) type btree;
+</pre></div>
+<p>The following example creates a btree index called twUserScrNameIdx on the screen-name field, which is a nested field of the user field in the TweetMessages dataset. This index can be useful for accelerating exact-match queries, range search queries, and joins involving the screen-name field.</p></div>
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>create index twUserScrNameIdx on TweetMessages(user.screen-name) type btree;
+</pre></div>
+<p>The following example creates an rtree index called fbSenderLocIdx on the sender-location field of the FacebookMessages dataset. This index can be useful for accelerating queries that use the <a href="functions.html#spatial-intersect"><tt>spatial-intersect</tt> function</a> in a predicate involving the sender-location field.</p></div>
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>create index fbSenderLocIndex on FacebookMessages(sender-location) type rtree;
+</pre></div>
+<p>The following example creates a 3-gram index called fbUserIdx on the name field of the FacebookUsers dataset. This index can be used to accelerate some similarity or substring maching queries on the name field. For details refer to the <a href="similarity.html#NGram_Index">document on similarity queries</a>.</p></div>
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>create index fbUserIdx on FacebookUsers(name) type ngram(3);
+</pre></div>
+<p>The following example creates a keyword index called fbMessageIdx on the message field of the FacebookMessages dataset. This keyword index can be used to optimize queries with token-based similarity predicates on the message field. For details refer to the <a href="similarity.html#Keyword_Index">document on similarity queries</a>.</p></div>
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>create index fbMessageIdx on FacebookMessages(message) type keyword;
+</pre></div></div></div>
+<div class="section">
+<h4>Functions<a name="Functions"></a></h4>
+<p>The create function statement creates a named function that can then be used and reused in AQL queries. The body of a function can be any AQL expression involving the function&#x2019;s parameters.</p>
+
+<div class="source">
+<pre>FunctionSpecification ::= &quot;function&quot; FunctionOrTypeName IfNotExists ParameterList &quot;{&quot; Expression &quot;}&quot;
+</pre></div>
+<p>The following is a very simple example of a create function statement. It differs from the declare function example shown previously in that it results in a function that is persistently registered by name in the specified dataverse.</p>
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>create function add($a, $b) {
+  $a + $b
+};
+</pre></div></div></div>
+<div class="section">
+<h4>Removal<a name="Removal"></a></h4>
+
+<div class="source">
+<pre>DropStatement       ::= &quot;drop&quot; ( &quot;dataverse&quot; Identifier IfExists
+                               | &quot;type&quot; FunctionOrTypeName IfExists
+                               | &quot;dataset&quot; QualifiedName IfExists
+                               | &quot;index&quot; DoubleQualifiedName IfExists
+                               | &quot;function&quot; FunctionSignature IfExists )
+IfExists            ::= ( &quot;if&quot; &quot;exists&quot; )?
+</pre></div>
+<p>The drop statement in AQL is the inverse of the create statement. It can be used to drop dataverses, datatypes, datasets, indexes, and functions.</p>
+<p>The following examples illustrate uses of the drop statement.</p>
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>drop dataset FacebookUsers if exists;
+
+drop index fbSenderLocIndex;
+
+drop type FacebookUserType;
+
+drop dataverse TinySocial;
+
+drop function add;
+</pre></div></div></div></div>
+<div class="section">
+<h3>Import/Export Statements<a name="ImportExport_Statements"></a></h3>
+
+<div class="source">
+<pre>LoadStatement  ::= &quot;load&quot; &quot;dataset&quot; QualifiedName &quot;using&quot; AdapterName Configuration ( &quot;pre-sorted&quot; )?
+</pre></div>
+<p>The load statement is used to initially populate a dataset via bulk loading of data from an external file. An appropriate adapter must be selected to handle the nature of the desired external data. The load statement accepts the same adapters and the same parameters as external datasets. (See the <a href="externaldata.html">guide to external data</a> for more information on the available adapters.)</p>
+<p>The following example shows how to bulk load the FacebookUsers dataset from an external file containing data that has been prepared in ADM format.</p>
+<div class="section">
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>load dataset FacebookUsers using localfs
+((&quot;path&quot;=&quot;localhost:///Users/zuck/AsterixDB/load/fbu.adm&quot;),(&quot;format&quot;=&quot;adm&quot;));
+</pre></div></div></div></div>
+<div class="section">
+<h3>Modification Statements<a name="Modification_Statements"></a></h3>
+<div class="section">
+<h4>Insert<a name="Insert"></a></h4>
+
+<div class="source">
+<pre>InsertStatement ::= &quot;insert&quot; &quot;into&quot; &quot;dataset&quot; QualifiedName Query
+</pre></div>
+<p>The AQL insert statement is used to insert data into a dataset. The data to be inserted comes from an AQL query expression. The expression can be as simple as a constant expression, or in general it can be any legal AQL query. Inserts in AsterixDB are processed transactionally, with the scope of each insert transaction being the insertion of a single object plus its affiliated secondary index entries (if any). If the query part of an insert returns a single object, then the insert statement itself will be a single, atomic transaction. If the query part returns multiple objects, then each object inserted will be handled independently as a tranaction.</p>
+<p>The following example illustrates a query-based insertion.</p>
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>insert into dataset UsersCopy (for $user in dataset FacebookUsers return $user)
+</pre></div></div></div>
+<div class="section">
+<h4>Delete<a name="Delete"></a></h4>
+
+<div class="source">
+<pre>DeleteStatement ::= &quot;delete&quot; Variable &quot;from&quot; &quot;dataset&quot; QualifiedName ( &quot;where&quot; Expression )?
+</pre></div>
+<p>The AQL delete statement is used to delete data from a target dataset. The data to be deleted is identified by a boolean expression involving the variable bound to the target dataset in the delete statement. Deletes in AsterixDB are processed transactionally, with the scope of each delete transaction being the deletion of a single object plus its affiliated secondary index entries (if any). If the boolean expression for a delete identifies a single object, then the delete statement itself will be a single, atomic transaction. If the expression identifies multiple objects, then each object deleted will be handled independently as a transaction.</p>
+<p>The following example illustrates a single-object deletion.</p>
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>delete $user from dataset FacebookUsers where $user.id = 8;
+</pre></div>
+<p>We close this guide to AQL with one final example of a query expression.</p></div>
+<div class="section">
+<h5>Example<a name="Example"></a></h5>
+
+<div class="source">
+<pre>for $praise in {{ &quot;great&quot;, &quot;brilliant&quot;, &quot;awesome&quot; }}
+return
+   string-concat([&quot;AsterixDB is &quot;, $praise])
+</pre></div></div></div></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>


[02/13] incubator-asterixdb-site git commit: Initial commit with Till's changes

Posted by im...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/js/apache-maven-fluido-1.3.0.min.js
----------------------------------------------------------------------
diff --git a/js/apache-maven-fluido-1.3.0.min.js b/js/apache-maven-fluido-1.3.0.min.js
new file mode 100644
index 0000000..677e611
--- /dev/null
+++ b/js/apache-maven-fluido-1.3.0.min.js
@@ -0,0 +1,21 @@
+/*!
+ * jQuery JavaScript Library v1.8.0
+ * http://jquery.com/
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ *
+ * Copyright 2012 jQuery Foundation and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ *
+ * Date: Thu Aug 09 2012 16:24:48 GMT-0400 (Eastern Daylight Time)
+ */
+(function(a2,aB){var x,af,o=a2.document,aI=a2.location,d=a2.navigator,bg=a2.jQuery,I=a2.$,am=Array.prototype.push,a4=Array.prototype.slice,aK=Array.prototype.indexOf,A=Object.prototype.toString,V=Object.prototype.hasOwnProperty,aN=String.prototype.trim,bG=function(e,bZ){return new bG.fn.init(e,bZ,x)},bx=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,aa=/\S/,aV=/\s+/,D=aa.test("\xA0")?(/^[\s\xA0]+|[\s\xA0]+$/g):/^\s+|\s+$/g,bo=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,a=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,bf=/^[\],:{}\s]*$/,bi=/(?:^|:|,)(?:\s*\[)+/g,bD=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,a0=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,bP=/^-ms-/,aU=/-([\da-z])/gi,N=function(e,bZ){return(bZ+"").toUpperCase()},aF=function(){if(o.addEventListener){o.removeEventListener("DOMContentLoaded",aF,false);bG.ready()}else{if(o.readyState==="complete"){o.detachEvent("onreadystatechange",aF);bG.ready()}}},Z={};bG.fn=bG.prototype={constructor:bG,init:function(e,b2,b1){var b0,b3,b
 Z,b4;if(!e){return this}if(e.nodeType){this.context=this[0]=e;this.length=1;return this}if(typeof e==="string"){if(e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3){b0=[null,e,null]}else{b0=bo.exec(e)}if(b0&&(b0[1]||!b2)){if(b0[1]){b2=b2 instanceof bG?b2[0]:b2;b4=(b2&&b2.nodeType?b2.ownerDocument||b2:o);e=bG.parseHTML(b0[1],b4,true);if(a.test(b0[1])&&bG.isPlainObject(b2)){this.attr.call(e,b2,true)}return bG.merge(this,e)}else{b3=o.getElementById(b0[2]);if(b3&&b3.parentNode){if(b3.id!==b0[2]){return b1.find(e)}this.length=1;this[0]=b3}this.context=o;this.selector=e;return this}}else{if(!b2||b2.jquery){return(b2||b1).find(e)}else{return this.constructor(b2).find(e)}}}else{if(bG.isFunction(e)){return b1.ready(e)}}if(e.selector!==aB){this.selector=e.selector;this.context=e.context}return bG.makeArray(e,this)},selector:"",jquery:"1.8.0",length:0,size:function(){return this.length},toArray:function(){return a4.call(this)},get:function(e){return e==null?this.toArray():(e<0?this[t
 his.length+e]:this[e])},pushStack:function(bZ,b1,e){var b0=bG.merge(this.constructor(),bZ);b0.prevObject=this;b0.context=this.context;if(b1==="find"){b0.selector=this.selector+(this.selector?" ":"")+e}else{if(b1){b0.selector=this.selector+"."+b1+"("+e+")"}}return b0},each:function(bZ,e){return bG.each(this,bZ,e)},ready:function(e){bG.ready.promise().done(e);return this},eq:function(e){e=+e;return e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(a4.apply(this,arguments),"slice",a4.call(arguments).join(","))},map:function(e){return this.pushStack(bG.map(this,function(b0,bZ){return e.call(b0,bZ,b0)}))},end:function(){return this.prevObject||this.constructor(null)},push:am,sort:[].sort,splice:[].splice};bG.fn.init.prototype=bG.fn;bG.extend=bG.fn.extend=function(){var b7,b0,e,bZ,b4,b5,b3=arguments[0]||{},b2=1,b1=arguments.length,b6=false;if(typeof b3==="boolean"){b6=b3;b3=arguments[1]||{
 };b2=2}if(typeof b3!=="object"&&!bG.isFunction(b3)){b3={}}if(b1===b2){b3=this;--b2}for(;b2<b1;b2++){if((b7=arguments[b2])!=null){for(b0 in b7){e=b3[b0];bZ=b7[b0];if(b3===bZ){continue}if(b6&&bZ&&(bG.isPlainObject(bZ)||(b4=bG.isArray(bZ)))){if(b4){b4=false;b5=e&&bG.isArray(e)?e:[]}else{b5=e&&bG.isPlainObject(e)?e:{}}b3[b0]=bG.extend(b6,b5,bZ)}else{if(bZ!==aB){b3[b0]=bZ}}}}}return b3};bG.extend({noConflict:function(e){if(a2.$===bG){a2.$=I}if(e&&a2.jQuery===bG){a2.jQuery=bg}return bG},isReady:false,readyWait:1,holdReady:function(e){if(e){bG.readyWait++}else{bG.ready(true)}},ready:function(e){if(e===true?--bG.readyWait:bG.isReady){return}if(!o.body){return setTimeout(bG.ready,1)}bG.isReady=true;if(e!==true&&--bG.readyWait>0){return}af.resolveWith(o,[bG]);if(bG.fn.trigger){bG(o).trigger("ready").off("ready")}},isFunction:function(e){return bG.type(e)==="function"},isArray:Array.isArray||function(e){return bG.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:fu
 nction(e){return !isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):Z[A.call(e)]||"object"},isPlainObject:function(b1){if(!b1||bG.type(b1)!=="object"||b1.nodeType||bG.isWindow(b1)){return false}try{if(b1.constructor&&!V.call(b1,"constructor")&&!V.call(b1.constructor.prototype,"isPrototypeOf")){return false}}catch(b0){return false}var bZ;for(bZ in b1){}return bZ===aB||V.call(b1,bZ)},isEmptyObject:function(bZ){var e;for(e in bZ){return false}return true},error:function(e){throw new Error(e)},parseHTML:function(b1,b0,e){var bZ;if(!b1||typeof b1!=="string"){return null}if(typeof b0==="boolean"){e=b0;b0=0}b0=b0||o;if((bZ=a.exec(b1))){return[b0.createElement(bZ[1])]}bZ=bG.buildFragment([b1],b0,e?null:[]);return bG.merge([],(bZ.cacheable?bG.clone(bZ.fragment):bZ.fragment).childNodes)},parseJSON:function(e){if(!e||typeof e!=="string"){return null}e=bG.trim(e);if(a2.JSON&&a2.JSON.parse){return a2.JSON.parse(e)}if(bf.test(e.replace(bD,"@").replace(a0,"]").replace(bi
 ,""))){return(new Function("return "+e))()}bG.error("Invalid JSON: "+e)},parseXML:function(b1){var bZ,b0;if(!b1||typeof b1!=="string"){return null}try{if(a2.DOMParser){b0=new DOMParser();bZ=b0.parseFromString(b1,"text/xml")}else{bZ=new ActiveXObject("Microsoft.XMLDOM");bZ.async="false";bZ.loadXML(b1)}}catch(b2){bZ=aB}if(!bZ||!bZ.documentElement||bZ.getElementsByTagName("parsererror").length){bG.error("Invalid XML: "+b1)}return bZ},noop:function(){},globalEval:function(e){if(e&&aa.test(e)){(a2.execScript||function(bZ){a2["eval"].call(a2,bZ)})(e)}},camelCase:function(e){return e.replace(bP,"ms-").replace(aU,N)},nodeName:function(bZ,e){return bZ.nodeName&&bZ.nodeName.toUpperCase()===e.toUpperCase()},each:function(b3,b4,b0){var bZ,b1=0,b2=b3.length,e=b2===aB||bG.isFunction(b3);if(b0){if(e){for(bZ in b3){if(b4.apply(b3[bZ],b0)===false){break}}}else{for(;b1<b2;){if(b4.apply(b3[b1++],b0)===false){break}}}}else{if(e){for(bZ in b3){if(b4.call(b3[bZ],bZ,b3[bZ])===false){break}}}else{for(;b1<b
 2;){if(b4.call(b3[b1],b1,b3[b1++])===false){break}}}}return b3},trim:aN?function(e){return e==null?"":aN.call(e)}:function(e){return e==null?"":e.toString().replace(D,"")},makeArray:function(e,b0){var b1,bZ=b0||[];if(e!=null){b1=bG.type(e);if(e.length==null||b1==="string"||b1==="function"||b1==="regexp"||bG.isWindow(e)){am.call(bZ,e)}else{bG.merge(bZ,e)}}return bZ},inArray:function(b1,bZ,b0){var e;if(bZ){if(aK){return aK.call(bZ,b1,b0)}e=bZ.length;b0=b0?b0<0?Math.max(0,e+b0):b0:0;for(;b0<e;b0++){if(b0 in bZ&&bZ[b0]===b1){return b0}}}return -1},merge:function(b2,b0){var e=b0.length,b1=b2.length,bZ=0;if(typeof e==="number"){for(;bZ<e;bZ++){b2[b1++]=b0[bZ]}}else{while(b0[bZ]!==aB){b2[b1++]=b0[bZ++]}}b2.length=b1;return b2},grep:function(bZ,b4,e){var b3,b0=[],b1=0,b2=bZ.length;e=!!e;for(;b1<b2;b1++){b3=!!b4(bZ[b1],b1);if(e!==b3){b0.push(bZ[b1])}}return b0},map:function(e,b5,b6){var b3,b4,b2=[],b0=0,bZ=e.length,b1=e instanceof bG||bZ!==aB&&typeof bZ==="number"&&((bZ>0&&e[0]&&e[bZ-1])||bZ
 ===0||bG.isArray(e));if(b1){for(;b0<bZ;b0++){b3=b5(e[b0],b0,b6);if(b3!=null){b2[b2.length]=b3}}}else{for(b4 in e){b3=b5(e[b4],b4,b6);if(b3!=null){b2[b2.length]=b3}}}return b2.concat.apply([],b2)},guid:1,proxy:function(b2,b1){var b0,e,bZ;if(typeof b1==="string"){b0=b2[b1];b1=b2;b2=b0}if(!bG.isFunction(b2)){return aB}e=a4.call(arguments,2);bZ=function(){return b2.apply(b1,e.concat(a4.call(arguments)))};bZ.guid=b2.guid=b2.guid||bZ.guid||bG.guid++;return bZ},access:function(e,b4,b7,b5,b2,b8,b6){var b0,b3=b7==null,b1=0,bZ=e.length;if(b7&&typeof b7==="object"){for(b1 in b7){bG.access(e,b4,b1,b7[b1],1,b8,b5)}b2=1}else{if(b5!==aB){b0=b6===aB&&bG.isFunction(b5);if(b3){if(b0){b0=b4;b4=function(ca,b9,cb){return b0.call(bG(ca),cb)}}else{b4.call(e,b5);b4=null}}if(b4){for(;b1<bZ;b1++){b4(e[b1],b7,b0?b5.call(e[b1],b1,b4(e[b1],b7)):b5,b6)}}b2=1}}return b2?e:b3?b4.call(e):bZ?b4(e[0],b7):b8},now:function(){return(new Date()).getTime()}});bG.ready.promise=function(b2){if(!af){af=bG.Deferred();if(o.rea
 dyState==="complete"||(o.readyState!=="loading"&&o.addEventListener)){setTimeout(bG.ready,1)}else{if(o.addEventListener){o.addEventListener("DOMContentLoaded",aF,false);a2.addEventListener("load",bG.ready,false)}else{o.attachEvent("onreadystatechange",aF);a2.attachEvent("onload",bG.ready);var b1=false;try{b1=a2.frameElement==null&&o.documentElement}catch(b0){}if(b1&&b1.doScroll){(function bZ(){if(!bG.isReady){try{b1.doScroll("left")}catch(b3){return setTimeout(bZ,50)}bG.ready()}})()}}}}return af.promise(b2)};bG.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(bZ,e){Z["[object "+e+"]"]=e.toLowerCase()});x=bG(o);var bU={};function ac(bZ){var e=bU[bZ]={};bG.each(bZ.split(aV),function(b1,b0){e[b0]=true});return e}bG.Callbacks=function(b8){b8=typeof b8==="string"?(bU[b8]||ac(b8)):bG.extend({},b8);var b1,e,b2,b0,b3,b4,b5=[],b6=!b8.once&&[],bZ=function(b9){b1=b8.memory&&b9;e=true;b4=b0||0;b0=0;b3=b5.length;b2=true;for(;b5&&b4<b3;b4++){if(b5[b4].apply(b9[0]
 ,b9[1])===false&&b8.stopOnFalse){b1=false;break}}b2=false;if(b5){if(b6){if(b6.length){bZ(b6.shift())}}else{if(b1){b5=[]}else{b7.disable()}}}},b7={add:function(){if(b5){var ca=b5.length;(function b9(cb){bG.each(cb,function(cd,cc){if(bG.isFunction(cc)&&(!b8.unique||!b7.has(cc))){b5.push(cc)}else{if(cc&&cc.length){b9(cc)}}})})(arguments);if(b2){b3=b5.length}else{if(b1){b0=ca;bZ(b1)}}}return this},remove:function(){if(b5){bG.each(arguments,function(cb,b9){var ca;while((ca=bG.inArray(b9,b5,ca))>-1){b5.splice(ca,1);if(b2){if(ca<=b3){b3--}if(ca<=b4){b4--}}}})}return this},has:function(b9){return bG.inArray(b9,b5)>-1},empty:function(){b5=[];return this},disable:function(){b5=b6=b1=aB;return this},disabled:function(){return !b5},lock:function(){b6=aB;if(!b1){b7.disable()}return this},locked:function(){return !b6},fireWith:function(ca,b9){b9=b9||[];b9=[ca,b9.slice?b9.slice():b9];if(b5&&(!e||b6)){if(b2){b6.push(b9)}else{bZ(b9)}}return this},fire:function(){b7.fireWith(this,arguments);return th
 is},fired:function(){return !!e}};return b7};bG.extend({Deferred:function(b0){var bZ=[["resolve","done",bG.Callbacks("once memory"),"resolved"],["reject","fail",bG.Callbacks("once memory"),"rejected"],["notify","progress",bG.Callbacks("memory")]],b1="pending",b2={state:function(){return b1},always:function(){e.done(arguments).fail(arguments);return this},then:function(){var b3=arguments;return bG.Deferred(function(b4){bG.each(bZ,function(b6,b5){var b8=b5[0],b7=b3[b6];e[b5[1]](bG.isFunction(b7)?function(){var b9=b7.apply(this,arguments);if(b9&&bG.isFunction(b9.promise)){b9.promise().done(b4.resolve).fail(b4.reject).progress(b4.notify)}else{b4[b8+"With"](this===e?b4:this,[b9])}}:b4[b8])});b3=null}).promise()},promise:function(b3){return typeof b3==="object"?bG.extend(b3,b2):b2}},e={};b2.pipe=b2.then;bG.each(bZ,function(b4,b3){var b6=b3[2],b5=b3[3];b2[b3[1]]=b6.add;if(b5){b6.add(function(){b1=b5},bZ[b4^1][2].disable,bZ[2][2].lock)}e[b3[0]]=b6.fire;e[b3[0]+"With"]=b6.fireWith});b2.promi
 se(e);if(b0){b0.call(e,e)}return e},when:function(b2){var b0=0,b4=a4.call(arguments),e=b4.length,bZ=e!==1||(b2&&bG.isFunction(b2.promise))?e:0,b7=bZ===1?b2:bG.Deferred(),b1=function(b9,ca,b8){return function(cb){ca[b9]=this;b8[b9]=arguments.length>1?a4.call(arguments):cb;if(b8===b6){b7.notifyWith(ca,b8)}else{if(!(--bZ)){b7.resolveWith(ca,b8)}}}},b6,b3,b5;if(e>1){b6=new Array(e);b3=new Array(e);b5=new Array(e);for(;b0<e;b0++){if(b4[b0]&&bG.isFunction(b4[b0].promise)){b4[b0].promise().done(b1(b0,b5,b4)).fail(b7.reject).progress(b1(b0,b3,b6))}else{--bZ}}}if(!bZ){b7.resolveWith(b5,b4)}return b7.promise()}});bG.support=(function(){var cb,ca,b8,b9,b2,b7,b6,b4,b3,b1,bZ,b0=o.createElement("div");b0.setAttribute("className","t");b0.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";ca=b0.getElementsByTagName("*");b8=b0.getElementsByTagName("a")[0];b8.style.cssText="top:1px;float:left;opacity:.5";if(!ca||!ca.length||!b8){return{}}b9=o.createElement("select");b2=b9.
 appendChild(o.createElement("option"));b7=b0.getElementsByTagName("input")[0];cb={leadingWhitespace:(b0.firstChild.nodeType===3),tbody:!b0.getElementsByTagName("tbody").length,htmlSerialize:!!b0.getElementsByTagName("link").length,style:/top/.test(b8.getAttribute("style")),hrefNormalized:(b8.getAttribute("href")==="/a"),opacity:/^0.5/.test(b8.style.opacity),cssFloat:!!b8.style.cssFloat,checkOn:(b7.value==="on"),optSelected:b2.selected,getSetAttribute:b0.className!=="t",enctype:!!o.createElement("form").enctype,html5Clone:o.createElement("nav").cloneNode(true).outerHTML!=="<:nav></:nav>",boxModel:(o.compatMode==="CSS1Compat"),submitBubbles:true,changeBubbles:true,focusinBubbles:false,deleteExpando:true,noCloneEvent:true,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableMarginRight:true,boxSizingReliable:true,pixelPosition:false};b7.checked=true;cb.noCloneChecked=b7.cloneNode(true).checked;b9.disabled=true;cb.optDisabled=!b2.disabled;try{delete b0.test}catch(b5){cb.deleteExp
 ando=false}if(!b0.addEventListener&&b0.attachEvent&&b0.fireEvent){b0.attachEvent("onclick",bZ=function(){cb.noCloneEvent=false});b0.cloneNode(true).fireEvent("onclick");b0.detachEvent("onclick",bZ)}b7=o.createElement("input");b7.value="t";b7.setAttribute("type","radio");cb.radioValue=b7.value==="t";b7.setAttribute("checked","checked");b7.setAttribute("name","t");b0.appendChild(b7);b6=o.createDocumentFragment();b6.appendChild(b0.lastChild);cb.checkClone=b6.cloneNode(true).cloneNode(true).lastChild.checked;cb.appendChecked=b7.checked;b6.removeChild(b7);b6.appendChild(b0);if(b0.attachEvent){for(b3 in {submit:true,change:true,focusin:true}){b4="on"+b3;b1=(b4 in b0);if(!b1){b0.setAttribute(b4,"return;");b1=(typeof b0[b4]==="function")}cb[b3+"Bubbles"]=b1}}bG(function(){var cc,cg,ce,cf,cd="padding:0;margin:0;border:0;display:block;overflow:hidden;",e=o.getElementsByTagName("body")[0];if(!e){return}cc=o.createElement("div");cc.style.cssText="visibility:hidden;border:0;width:0;height:0;posi
 tion:static;top:0;margin-top:1px";e.insertBefore(cc,e.firstChild);cg=o.createElement("div");cc.appendChild(cg);cg.innerHTML="<table><tr><td></td><td>t</td></tr></table>";ce=cg.getElementsByTagName("td");ce[0].style.cssText="padding:0;margin:0;border:0;display:none";b1=(ce[0].offsetHeight===0);ce[0].style.display="";ce[1].style.display="none";cb.reliableHiddenOffsets=b1&&(ce[0].offsetHeight===0);cg.innerHTML="";cg.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";cb.boxSizing=(cg.offsetWidth===4);cb.doesNotIncludeMarginInBodyOffset=(e.offsetTop!==1);if(a2.getComputedStyle){cb.pixelPosition=(a2.getComputedStyle(cg,null)||{}).top!=="1%";cb.boxSizingReliable=(a2.getComputedStyle(cg,null)||{width:"4px"}).width==="4px";cf=o.createElement("div");cf.style.cssText=cg.style.cssText=cd;cf.style.marginRight=cf.style.width="0";cg.style.width="1px";cg.appendChild(cf)
 ;cb.reliableMarginRight=!parseFloat((a2.getComputedStyle(cf,null)||{}).marginRight)}if(typeof cg.style.zoom!=="undefined"){cg.innerHTML="";cg.style.cssText=cd+"width:1px;padding:1px;display:inline;zoom:1";cb.inlineBlockNeedsLayout=(cg.offsetWidth===3);cg.style.display="block";cg.style.overflow="visible";cg.innerHTML="<div></div>";cg.firstChild.style.width="5px";cb.shrinkWrapBlocks=(cg.offsetWidth!==3);cc.style.zoom=1}e.removeChild(cc);cc=cg=ce=cf=null});b6.removeChild(b0);ca=b8=b9=b2=b7=b6=b0=null;return cb})();var bt=/^(?:\{.*\}|\[.*\])$/,aL=/([A-Z])/g;bG.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(bG.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},hasData:function(e){e=e.nodeType?bG.cache[e[bG.expando]]:e[bG.expando];return !!e&&!O(e)},data:function(b1,bZ,b3,b2){if(!bG.acceptData(b1)){return}var b4,b6,b7=bG.expando,b5=typeof bZ==="string",b8=b1.nodeType,e=b8?bG.cache:b1,b0=b8?b1[b7]:b1[b7]&&
 b7;if((!b0||!e[b0]||(!b2&&!e[b0].data))&&b5&&b3===aB){return}if(!b0){if(b8){b1[b7]=b0=bG.deletedIds.pop()||++bG.uuid}else{b0=b7}}if(!e[b0]){e[b0]={};if(!b8){e[b0].toJSON=bG.noop}}if(typeof bZ==="object"||typeof bZ==="function"){if(b2){e[b0]=bG.extend(e[b0],bZ)}else{e[b0].data=bG.extend(e[b0].data,bZ)}}b4=e[b0];if(!b2){if(!b4.data){b4.data={}}b4=b4.data}if(b3!==aB){b4[bG.camelCase(bZ)]=b3}if(b5){b6=b4[bZ];if(b6==null){b6=b4[bG.camelCase(bZ)]}}else{b6=b4}return b6},removeData:function(b1,bZ,b2){if(!bG.acceptData(b1)){return}var b5,b4,b3,b6=b1.nodeType,e=b6?bG.cache:b1,b0=b6?b1[bG.expando]:bG.expando;if(!e[b0]){return}if(bZ){b5=b2?e[b0]:e[b0].data;if(b5){if(!bG.isArray(bZ)){if(bZ in b5){bZ=[bZ]}else{bZ=bG.camelCase(bZ);if(bZ in b5){bZ=[bZ]}else{bZ=bZ.split(" ")}}}for(b4=0,b3=bZ.length;b4<b3;b4++){delete b5[bZ[b4]]}if(!(b2?O:bG.isEmptyObject)(b5)){return}}}if(!b2){delete e[b0].data;if(!O(e[b0])){return}}if(b6){bG.cleanData([b1],true)}else{if(bG.support.deleteExpando||e!=e.window){delete
  e[b0]}else{e[b0]=null}}},_data:function(bZ,e,b0){return bG.data(bZ,e,b0,true)},acceptData:function(bZ){var e=bZ.nodeName&&bG.noData[bZ.nodeName.toLowerCase()];return !e||e!==true&&bZ.getAttribute("classid")===e}});bG.fn.extend({data:function(b7,b6){var b2,bZ,b5,e,b1,b0=this[0],b4=0,b3=null;if(b7===aB){if(this.length){b3=bG.data(b0);if(b0.nodeType===1&&!bG._data(b0,"parsedAttrs")){b5=b0.attributes;for(b1=b5.length;b4<b1;b4++){e=b5[b4].name;if(e.indexOf("data-")===0){e=bG.camelCase(e.substring(5));bv(b0,e,b3[e])}}bG._data(b0,"parsedAttrs",true)}}return b3}if(typeof b7==="object"){return this.each(function(){bG.data(this,b7)})}b2=b7.split(".",2);b2[1]=b2[1]?"."+b2[1]:"";bZ=b2[1]+"!";return bG.access(this,function(b8){if(b8===aB){b3=this.triggerHandler("getData"+bZ,[b2[0]]);if(b3===aB&&b0){b3=bG.data(b0,b7);b3=bv(b0,b7,b3)}return b3===aB&&b2[1]?this.data(b2[0]):b3}b2[1]=b8;this.each(function(){var b9=bG(this);b9.triggerHandler("setData"+bZ,b2);bG.data(this,b7,b8);b9.triggerHandler("cha
 ngeData"+bZ,b2)})},null,b6,arguments.length>1,null,false)},removeData:function(e){return this.each(function(){bG.removeData(this,e)})}});function bv(b1,b0,b2){if(b2===aB&&b1.nodeType===1){var bZ="data-"+b0.replace(aL,"-$1").toLowerCase();b2=b1.getAttribute(bZ);if(typeof b2==="string"){try{b2=b2==="true"?true:b2==="false"?false:b2==="null"?null:+b2+""===b2?+b2:bt.test(b2)?bG.parseJSON(b2):b2}catch(b3){}bG.data(b1,b0,b2)}else{b2=aB}}return b2}function O(bZ){var e;for(e in bZ){if(e==="data"&&bG.isEmptyObject(bZ[e])){continue}if(e!=="toJSON"){return false}}return true}bG.extend({queue:function(b0,bZ,b1){var e;if(b0){bZ=(bZ||"fx")+"queue";e=bG._data(b0,bZ);if(b1){if(!e||bG.isArray(b1)){e=bG._data(b0,bZ,bG.makeArray(b1))}else{e.push(b1)}}return e||[]}},dequeue:function(b3,b2){b2=b2||"fx";var bZ=bG.queue(b3,b2),b1=bZ.shift(),e=bG._queueHooks(b3,b2),b0=function(){bG.dequeue(b3,b2)};if(b1==="inprogress"){b1=bZ.shift()}if(b1){if(b2==="fx"){bZ.unshift("inprogress")}delete e.stop;b1.call(b3,b0,
 e)}if(!bZ.length&&e){e.empty.fire()}},_queueHooks:function(b0,bZ){var e=bZ+"queueHooks";return bG._data(b0,e)||bG._data(b0,e,{empty:bG.Callbacks("once memory").add(function(){bG.removeData(b0,bZ+"queue",true);bG.removeData(b0,e,true)})})}});bG.fn.extend({queue:function(e,bZ){var b0=2;if(typeof e!=="string"){bZ=e;e="fx";b0--}if(arguments.length<b0){return bG.queue(this[0],e)}return bZ===aB?this:this.each(function(){var b1=bG.queue(this,e,bZ);bG._queueHooks(this,e);if(e==="fx"&&b1[0]!=="inprogress"){bG.dequeue(this,e)}})},dequeue:function(e){return this.each(function(){bG.dequeue(this,e)})},delay:function(bZ,e){bZ=bG.fx?bG.fx.speeds[bZ]||bZ:bZ;e=e||"fx";return this.queue(e,function(b1,b0){var b2=setTimeout(b1,bZ);b0.stop=function(){clearTimeout(b2)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(b0,b4){var bZ,b1=1,b5=bG.Deferred(),b3=this,e=this.length,b2=function(){if(!(--b1)){b5.resolveWith(b3,[b3])}};if(typeof b0!=="string"){b4=b0;b0=aB}b0=b0||"fx";while(
 e--){if((bZ=bG._data(b3[e],b0+"queueHooks"))&&bZ.empty){b1++;bZ.empty.add(b2)}}b2();return b5.promise(b4)}});var a7,bV,n,bJ=/[\t\r\n]/g,ai=/\r/g,j=/^(?:button|input)$/i,aA=/^(?:button|input|object|select|textarea)$/i,E=/^a(?:rea|)$/i,M=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,bL=bG.support.getSetAttribute;bG.fn.extend({attr:function(e,bZ){return bG.access(this,bG.attr,e,bZ,arguments.length>1)},removeAttr:function(e){return this.each(function(){bG.removeAttr(this,e)})},prop:function(e,bZ){return bG.access(this,bG.prop,e,bZ,arguments.length>1)},removeProp:function(e){e=bG.propFix[e]||e;return this.each(function(){try{this[e]=aB;delete this[e]}catch(bZ){}})},addClass:function(b2){var b4,b0,bZ,b1,b3,b5,e;if(bG.isFunction(b2)){return this.each(function(b6){bG(this).addClass(b2.call(this,b6,this.className))})}if(b2&&typeof b2==="string"){b4=b2.split(aV);for(b0=0,bZ=this.length;b0<bZ;b0++){b1=this[b0];if(b
 1.nodeType===1){if(!b1.className&&b4.length===1){b1.className=b2}else{b3=" "+b1.className+" ";for(b5=0,e=b4.length;b5<e;b5++){if(!~b3.indexOf(" "+b4[b5]+" ")){b3+=b4[b5]+" "}}b1.className=bG.trim(b3)}}}}return this},removeClass:function(b4){var b1,b2,b3,b5,bZ,b0,e;if(bG.isFunction(b4)){return this.each(function(b6){bG(this).removeClass(b4.call(this,b6,this.className))})}if((b4&&typeof b4==="string")||b4===aB){b1=(b4||"").split(aV);for(b0=0,e=this.length;b0<e;b0++){b3=this[b0];if(b3.nodeType===1&&b3.className){b2=(" "+b3.className+" ").replace(bJ," ");for(b5=0,bZ=b1.length;b5<bZ;b5++){while(b2.indexOf(" "+b1[b5]+" ")>-1){b2=b2.replace(" "+b1[b5]+" "," ")}}b3.className=b4?bG.trim(b2):""}}}return this},toggleClass:function(b1,bZ){var b0=typeof b1,e=typeof bZ==="boolean";if(bG.isFunction(b1)){return this.each(function(b2){bG(this).toggleClass(b1.call(this,b2,this.className,bZ),bZ)})}return this.each(function(){if(b0==="string"){var b4,b3=0,b2=bG(this),b5=bZ,b6=b1.split(aV);while((b4=b6[
 b3++])){b5=e?b5:!b2.hasClass(b4);b2[b5?"addClass":"removeClass"](b4)}}else{if(b0==="undefined"||b0==="boolean"){if(this.className){bG._data(this,"__className__",this.className)}this.className=this.className||b1===false?"":bG._data(this,"__className__")||""}}})},hasClass:function(e){var b1=" "+e+" ",b0=0,bZ=this.length;for(;b0<bZ;b0++){if(this[b0].nodeType===1&&(" "+this[b0].className+" ").replace(bJ," ").indexOf(b1)>-1){return true}}return false},val:function(b1){var e,bZ,b2,b0=this[0];if(!arguments.length){if(b0){e=bG.valHooks[b0.type]||bG.valHooks[b0.nodeName.toLowerCase()];if(e&&"get" in e&&(bZ=e.get(b0,"value"))!==aB){return bZ}bZ=b0.value;return typeof bZ==="string"?bZ.replace(ai,""):bZ==null?"":bZ}return}b2=bG.isFunction(b1);return this.each(function(b4){var b5,b3=bG(this);if(this.nodeType!==1){return}if(b2){b5=b1.call(this,b4,b3.val())}else{b5=b1}if(b5==null){b5=""}else{if(typeof b5==="number"){b5+=""}else{if(bG.isArray(b5)){b5=bG.map(b5,function(b6){return b6==null?"":b6+""}
 )}}}e=bG.valHooks[this.type]||bG.valHooks[this.nodeName.toLowerCase()];if(!e||!("set" in e)||e.set(this,b5,"value")===aB){this.value=b5}})}});bG.extend({valHooks:{option:{get:function(e){var bZ=e.attributes.value;return !bZ||bZ.specified?e.value:e.text}},select:{get:function(e){var b4,bZ,b3,b1,b2=e.selectedIndex,b5=[],b6=e.options,b0=e.type==="select-one";if(b2<0){return null}bZ=b0?b2:0;b3=b0?b2+1:b6.length;for(;bZ<b3;bZ++){b1=b6[bZ];if(b1.selected&&(bG.support.optDisabled?!b1.disabled:b1.getAttribute("disabled")===null)&&(!b1.parentNode.disabled||!bG.nodeName(b1.parentNode,"optgroup"))){b4=bG(b1).val();if(b0){return b4}b5.push(b4)}}if(b0&&!b5.length&&b6.length){return bG(b6[b2]).val()}return b5},set:function(bZ,b0){var e=bG.makeArray(b0);bG(bZ).find("option").each(function(){this.selected=bG.inArray(bG(this).val(),e)>=0});if(!e.length){bZ.selectedIndex=-1}return e}}},attrFn:{},attr:function(b4,b1,b5,b3){var b0,e,b2,bZ=b4.nodeType;if(!b4||bZ===3||bZ===8||bZ===2){return}if(b3&&bG.isF
 unction(bG.fn[b1])){return bG(b4)[b1](b5)}if(typeof b4.getAttribute==="undefined"){return bG.prop(b4,b1,b5)}b2=bZ!==1||!bG.isXMLDoc(b4);if(b2){b1=b1.toLowerCase();e=bG.attrHooks[b1]||(M.test(b1)?bV:a7)}if(b5!==aB){if(b5===null){bG.removeAttr(b4,b1);return}else{if(e&&"set" in e&&b2&&(b0=e.set(b4,b5,b1))!==aB){return b0}else{b4.setAttribute(b1,""+b5);return b5}}}else{if(e&&"get" in e&&b2&&(b0=e.get(b4,b1))!==null){return b0}else{b0=b4.getAttribute(b1);return b0===null?aB:b0}}},removeAttr:function(b1,b3){var b2,b4,bZ,e,b0=0;if(b3&&b1.nodeType===1){b4=b3.split(aV);for(;b0<b4.length;b0++){bZ=b4[b0];if(bZ){b2=bG.propFix[bZ]||bZ;e=M.test(bZ);if(!e){bG.attr(b1,bZ,"")}b1.removeAttribute(bL?bZ:b2);if(e&&b2 in b1){b1[b2]=false}}}}},attrHooks:{type:{set:function(e,bZ){if(j.test(e.nodeName)&&e.parentNode){bG.error("type property can't be changed")}else{if(!bG.support.radioValue&&bZ==="radio"&&bG.nodeName(e,"input")){var b0=e.value;e.setAttribute("type",bZ);if(b0){e.value=b0}return bZ}}}},value:{
 get:function(bZ,e){if(a7&&bG.nodeName(bZ,"button")){return a7.get(bZ,e)}return e in bZ?bZ.value:null},set:function(bZ,b0,e){if(a7&&bG.nodeName(bZ,"button")){return a7.set(bZ,b0,e)}bZ.value=b0}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(b3,b1,b4){var b0,e,b2,bZ=b3.nodeType;if(!b3||bZ===3||bZ===8||bZ===2){return}b2=bZ!==1||!bG.isXMLDoc(b3);if(b2){b1=bG.propFix[b1]||b1;e=bG.propHooks[b1]}if(b4!==aB){if(e&&"set" in e&&(b0=e.set(b3,b4,b1))!==aB){return b0}else{return(b3[b1]=b4)}}else{if(e&&"get" in e&&(b0=e.get(b3,b1))!==null){return b0}else{return b3[b1]}}},propHooks:{tabIndex:{get:function(bZ){var e=bZ.getAttributeNode("tabindex");return e&&e.specified?parseInt(e.value,10):aA.test(bZ.nodeName)||E.test(bZ.nodeName)&&bZ.href?0:aB}}}});bV={get:func
 tion(bZ,e){var b1,b0=bG.prop(bZ,e);return b0===true||typeof b0!=="boolean"&&(b1=bZ.getAttributeNode(e))&&b1.nodeValue!==false?e.toLowerCase():aB},set:function(bZ,b1,e){var b0;if(b1===false){bG.removeAttr(bZ,e)}else{b0=bG.propFix[e]||e;if(b0 in bZ){bZ[b0]=true}bZ.setAttribute(e,e.toLowerCase())}return e}};if(!bL){n={name:true,id:true,coords:true};a7=bG.valHooks.button={get:function(b0,bZ){var e;e=b0.getAttributeNode(bZ);return e&&(n[bZ]?e.value!=="":e.specified)?e.value:aB},set:function(b0,b1,bZ){var e=b0.getAttributeNode(bZ);if(!e){e=o.createAttribute(bZ);b0.setAttributeNode(e)}return(e.value=b1+"")}};bG.each(["width","height"],function(bZ,e){bG.attrHooks[e]=bG.extend(bG.attrHooks[e],{set:function(b0,b1){if(b1===""){b0.setAttribute(e,"auto");return b1}}})});bG.attrHooks.contenteditable={get:a7.get,set:function(bZ,b0,e){if(b0===""){b0="false"}a7.set(bZ,b0,e)}}}if(!bG.support.hrefNormalized){bG.each(["href","src","width","height"],function(bZ,e){bG.attrHooks[e]=bG.extend(bG.attrHooks[
 e],{get:function(b1){var b0=b1.getAttribute(e,2);return b0===null?aB:b0}})})}if(!bG.support.style){bG.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||aB},set:function(e,bZ){return(e.style.cssText=""+bZ)}}}if(!bG.support.optSelected){bG.propHooks.selected=bG.extend(bG.propHooks.selected,{get:function(bZ){var e=bZ.parentNode;if(e){e.selectedIndex;if(e.parentNode){e.parentNode.selectedIndex}}return null}})}if(!bG.support.enctype){bG.propFix.enctype="encoding"}if(!bG.support.checkOn){bG.each(["radio","checkbox"],function(){bG.valHooks[this]={get:function(e){return e.getAttribute("value")===null?"on":e.value}}})}bG.each(["radio","checkbox"],function(){bG.valHooks[this]=bG.extend(bG.valHooks[this],{set:function(e,bZ){if(bG.isArray(bZ)){return(e.checked=bG.inArray(bG(e).val(),bZ)>=0)}}})});var bE=/^(?:textarea|input|select)$/i,br=/^([^\.]*|)(?:\.(.+)|)$/,ba=/(?:^|\s)hover(\.\S+|)\b/,a3=/^key/,bK=/^(?:mouse|contextmenu)|click/,by=/^(?:focusinfocus|focusoutblur)$/,aq=f
 unction(e){return bG.event.special.hover?e:e.replace(ba,"mouseenter$1 mouseleave$1")};bG.event={add:function(b1,b5,cc,b3,b2){var b6,b4,cd,cb,ca,b8,e,b9,bZ,b0,b7;if(b1.nodeType===3||b1.nodeType===8||!b5||!cc||!(b6=bG._data(b1))){return}if(cc.handler){bZ=cc;cc=bZ.handler;b2=bZ.selector}if(!cc.guid){cc.guid=bG.guid++}cd=b6.events;if(!cd){b6.events=cd={}}b4=b6.handle;if(!b4){b6.handle=b4=function(ce){return typeof bG!=="undefined"&&(!ce||bG.event.triggered!==ce.type)?bG.event.dispatch.apply(b4.elem,arguments):aB};b4.elem=b1}b5=bG.trim(aq(b5)).split(" ");for(cb=0;cb<b5.length;cb++){ca=br.exec(b5[cb])||[];b8=ca[1];e=(ca[2]||"").split(".").sort();b7=bG.event.special[b8]||{};b8=(b2?b7.delegateType:b7.bindType)||b8;b7=bG.event.special[b8]||{};b9=bG.extend({type:b8,origType:ca[1],data:b3,handler:cc,guid:cc.guid,selector:b2,namespace:e.join(".")},bZ);b0=cd[b8];if(!b0){b0=cd[b8]=[];b0.delegateCount=0;if(!b7.setup||b7.setup.call(b1,b3,e,b4)===false){if(b1.addEventListener){b1.addEventListener(b8
 ,b4,false)}else{if(b1.attachEvent){b1.attachEvent("on"+b8,b4)}}}}if(b7.add){b7.add.call(b1,b9);if(!b9.handler.guid){b9.handler.guid=cc.guid}}if(b2){b0.splice(b0.delegateCount++,0,b9)}else{b0.push(b9)}bG.event.global[b8]=true}b1=null},global:{},remove:function(b1,b6,cc,b2,b5){var cd,ce,b9,b0,bZ,b3,b4,cb,b8,e,ca,b7=bG.hasData(b1)&&bG._data(b1);if(!b7||!(cb=b7.events)){return}b6=bG.trim(aq(b6||"")).split(" ");for(cd=0;cd<b6.length;cd++){ce=br.exec(b6[cd])||[];b9=b0=ce[1];bZ=ce[2];if(!b9){for(b9 in cb){bG.event.remove(b1,b9+b6[cd],cc,b2,true)}continue}b8=bG.event.special[b9]||{};b9=(b2?b8.delegateType:b8.bindType)||b9;e=cb[b9]||[];b3=e.length;bZ=bZ?new RegExp("(^|\\.)"+bZ.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(b4=0;b4<e.length;b4++){ca=e[b4];if((b5||b0===ca.origType)&&(!cc||cc.guid===ca.guid)&&(!bZ||bZ.test(ca.namespace))&&(!b2||b2===ca.selector||b2==="**"&&ca.selector)){e.splice(b4--,1);if(ca.selector){e.delegateCount--}if(b8.remove){b8.remove.call(b1,ca)}}}if(e.le
 ngth===0&&b3!==e.length){if(!b8.teardown||b8.teardown.call(b1,bZ,b7.handle)===false){bG.removeEvent(b1,b9,b7.handle)}delete cb[b9]}}if(bG.isEmptyObject(cb)){delete b7.handle;bG.removeData(b1,"events",true)}},customEvent:{getData:true,setData:true,changeData:true},trigger:function(bZ,b6,b4,cd){if(b4&&(b4.nodeType===3||b4.nodeType===8)){return}var e,b1,b7,cb,b3,b2,b9,b8,b5,cc,ca=bZ.type||bZ,b0=[];if(by.test(ca+bG.event.triggered)){return}if(ca.indexOf("!")>=0){ca=ca.slice(0,-1);b1=true}if(ca.indexOf(".")>=0){b0=ca.split(".");ca=b0.shift();b0.sort()}if((!b4||bG.event.customEvent[ca])&&!bG.event.global[ca]){return}bZ=typeof bZ==="object"?bZ[bG.expando]?bZ:new bG.Event(ca,bZ):new bG.Event(ca);bZ.type=ca;bZ.isTrigger=true;bZ.exclusive=b1;bZ.namespace=b0.join(".");bZ.namespace_re=bZ.namespace?new RegExp("(^|\\.)"+b0.join("\\.(?:.*\\.|)")+"(\\.|$)"):null;b2=ca.indexOf(":")<0?"on"+ca:"";if(!b4){e=bG.cache;for(b7 in e){if(e[b7].events&&e[b7].events[ca]){bG.event.trigger(bZ,b6,e[b7].handle.ele
 m,true)}}return}bZ.result=aB;if(!bZ.target){bZ.target=b4}b6=b6!=null?bG.makeArray(b6):[];b6.unshift(bZ);b9=bG.event.special[ca]||{};if(b9.trigger&&b9.trigger.apply(b4,b6)===false){return}b5=[[b4,b9.bindType||ca]];if(!cd&&!b9.noBubble&&!bG.isWindow(b4)){cc=b9.delegateType||ca;cb=by.test(cc+ca)?b4:b4.parentNode;for(b3=b4;cb;cb=cb.parentNode){b5.push([cb,cc]);b3=cb}if(b3===(b4.ownerDocument||o)){b5.push([b3.defaultView||b3.parentWindow||a2,cc])}}for(b7=0;b7<b5.length&&!bZ.isPropagationStopped();b7++){cb=b5[b7][0];bZ.type=b5[b7][1];b8=(bG._data(cb,"events")||{})[bZ.type]&&bG._data(cb,"handle");if(b8){b8.apply(cb,b6)}b8=b2&&cb[b2];if(b8&&bG.acceptData(cb)&&b8.apply(cb,b6)===false){bZ.preventDefault()}}bZ.type=ca;if(!cd&&!bZ.isDefaultPrevented()){if((!b9._default||b9._default.apply(b4.ownerDocument,b6)===false)&&!(ca==="click"&&bG.nodeName(b4,"a"))&&bG.acceptData(b4)){if(b2&&b4[ca]&&((ca!=="focus"&&ca!=="blur")||bZ.target.offsetWidth!==0)&&!bG.isWindow(b4)){b3=b4[b2];if(b3){b4[b2]=null}bG
 .event.triggered=ca;b4[ca]();bG.event.triggered=aB;if(b3){b4[b2]=b3}}}}return bZ.result},dispatch:function(cb){cb=bG.event.fix(cb||a2.event);var cd,ca,b2,b4,ce,cc,b5,b0,e,b9,cf,b7=((bG._data(this,"events")||{})[cb.type]||[]),b6=b7.delegateCount,b1=[].slice.call(arguments),b8=!cb.exclusive&&!cb.namespace,b3=bG.event.special[cb.type]||{},bZ=[];b1[0]=cb;cb.delegateTarget=this;if(b3.preDispatch&&b3.preDispatch.call(this,cb)===false){return}if(b6&&!(cb.button&&cb.type==="click")){b4=bG(this);b4.context=this;for(b2=cb.target;b2!=this;b2=b2.parentNode||this){if(b2.disabled!==true||cb.type!=="click"){cc={};b0=[];b4[0]=b2;for(cd=0;cd<b6;cd++){e=b7[cd];b9=e.selector;if(cc[b9]===aB){cc[b9]=b4.is(b9)}if(cc[b9]){b0.push(e)}}if(b0.length){bZ.push({elem:b2,matches:b0})}}}}if(b7.length>b6){bZ.push({elem:this,matches:b7.slice(b6)})}for(cd=0;cd<bZ.length&&!cb.isPropagationStopped();cd++){b5=bZ[cd];cb.currentTarget=b5.elem;for(ca=0;ca<b5.matches.length&&!cb.isImmediatePropagationStopped();ca++){e=b5.m
 atches[ca];if(b8||(!cb.namespace&&!e.namespace)||cb.namespace_re&&cb.namespace_re.test(e.namespace)){cb.data=e.data;cb.handleObj=e;ce=((bG.event.special[e.origType]||{}).handle||e.handler).apply(b5.elem,b1);if(ce!==aB){cb.result=ce;if(ce===false){cb.preventDefault();cb.stopPropagation()}}}}}if(b3.postDispatch){b3.postDispatch.call(this,cb)}return cb.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(bZ,e){if(bZ.which==null){bZ.which=e.charCode!=null?e.charCode:e.keyCode}return bZ}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(b1,b0){var b2,b3,e,bZ=b0.button,b4=b0.fromElement;if(b1.pageX==null&&b0.clientX!=null){b2=b1.target.ownerDocument||o;b3=b2.documentElement;e=b2.bo
 dy;b1.pageX=b0.clientX+(b3&&b3.scrollLeft||e&&e.scrollLeft||0)-(b3&&b3.clientLeft||e&&e.clientLeft||0);b1.pageY=b0.clientY+(b3&&b3.scrollTop||e&&e.scrollTop||0)-(b3&&b3.clientTop||e&&e.clientTop||0)}if(!b1.relatedTarget&&b4){b1.relatedTarget=b4===b1.target?b0.toElement:b4}if(!b1.which&&bZ!==aB){b1.which=(bZ&1?1:(bZ&2?3:(bZ&4?2:0)))}return b1}},fix:function(b0){if(b0[bG.expando]){return b0}var bZ,b3,e=b0,b1=bG.event.fixHooks[b0.type]||{},b2=b1.props?this.props.concat(b1.props):this.props;b0=bG.Event(e);for(bZ=b2.length;bZ;){b3=b2[--bZ];b0[b3]=e[b3]}if(!b0.target){b0.target=e.srcElement||o}if(b0.target.nodeType===3){b0.target=b0.target.parentNode}b0.metaKey=!!b0.metaKey;return b1.filter?b1.filter(b0,e):b0},special:{ready:{setup:bG.bindReady},load:{noBubble:true},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(b0,bZ,e){if(bG.isWindow(this)){this.onbeforeunload=e}},teardown:function(bZ,e){if(this.onbeforeunload===e){this.onbeforeunload=null}}}}
 ,simulate:function(b0,b2,b1,bZ){var b3=bG.extend(new bG.Event(),b1,{type:b0,isSimulated:true,originalEvent:{}});if(bZ){bG.event.trigger(b3,null,b2)}else{bG.event.dispatch.call(b2,b3)}if(b3.isDefaultPrevented()){b1.preventDefault()}}};bG.event.handle=bG.event.dispatch;bG.removeEvent=o.removeEventListener?function(bZ,e,b0){if(bZ.removeEventListener){bZ.removeEventListener(e,b0,false)}}:function(b0,bZ,b1){var e="on"+bZ;if(b0.detachEvent){if(typeof b0[e]==="undefined"){b0[e]=null}b0.detachEvent(e,b1)}};bG.Event=function(bZ,e){if(!(this instanceof bG.Event)){return new bG.Event(bZ,e)}if(bZ&&bZ.type){this.originalEvent=bZ;this.type=bZ.type;this.isDefaultPrevented=(bZ.defaultPrevented||bZ.returnValue===false||bZ.getPreventDefault&&bZ.getPreventDefault())?R:X}else{this.type=bZ}if(e){bG.extend(this,e)}this.timeStamp=bZ&&bZ.timeStamp||bG.now();this[bG.expando]=true};function X(){return false}function R(){return true}bG.Event.prototype={preventDefault:function(){this.isDefaultPrevented=R;var b
 Z=this.originalEvent;if(!bZ){return}if(bZ.preventDefault){bZ.preventDefault()}else{bZ.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=R;var bZ=this.originalEvent;if(!bZ){return}if(bZ.stopPropagation){bZ.stopPropagation()}bZ.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=R;this.stopPropagation()},isDefaultPrevented:X,isPropagationStopped:X,isImmediatePropagationStopped:X};bG.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(bZ,e){bG.event.special[bZ]={delegateType:e,bindType:e,handle:function(b3){var b1,b5=this,b4=b3.relatedTarget,b2=b3.handleObj,b0=b2.selector;if(!b4||(b4!==b5&&!bG.contains(b5,b4))){b3.type=b2.origType;b1=b2.handler.apply(this,arguments);b3.type=e}return b1}}});if(!bG.support.submitBubbles){bG.event.special.submit={setup:function(){if(bG.nodeName(this,"form")){return false}bG.event.add(this,"click._submit keypress._submit",function(b1){var b0=b1.target,bZ=bG.nodeName(b0,"input")||bG.nodeN
 ame(b0,"button")?b0.form:aB;if(bZ&&!bG._data(bZ,"_submit_attached")){bG.event.add(bZ,"submit._submit",function(e){e._submit_bubble=true});bG._data(bZ,"_submit_attached",true)}})},postDispatch:function(e){if(e._submit_bubble){delete e._submit_bubble;if(this.parentNode&&!e.isTrigger){bG.event.simulate("submit",this.parentNode,e,true)}}},teardown:function(){if(bG.nodeName(this,"form")){return false}bG.event.remove(this,"._submit")}}}if(!bG.support.changeBubbles){bG.event.special.change={setup:function(){if(bE.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio"){bG.event.add(this,"propertychange._change",function(e){if(e.originalEvent.propertyName==="checked"){this._just_changed=true}});bG.event.add(this,"click._change",function(e){if(this._just_changed&&!e.isTrigger){this._just_changed=false}bG.event.simulate("change",this,e,true)})}return false}bG.event.add(this,"beforeactivate._change",function(b0){var bZ=b0.target;if(bE.test(bZ.nodeName)&&!bG._data(bZ,"_change_attach
 ed")){bG.event.add(bZ,"change._change",function(e){if(this.parentNode&&!e.isSimulated&&!e.isTrigger){bG.event.simulate("change",this.parentNode,e,true)}});bG._data(bZ,"_change_attached",true)}})},handle:function(bZ){var e=bZ.target;if(this!==e||bZ.isSimulated||bZ.isTrigger||(e.type!=="radio"&&e.type!=="checkbox")){return bZ.handleObj.handler.apply(this,arguments)}},teardown:function(){bG.event.remove(this,"._change");return bE.test(this.nodeName)}}}if(!bG.support.focusinBubbles){bG.each({focus:"focusin",blur:"focusout"},function(b1,e){var bZ=0,b0=function(b2){bG.event.simulate(e,b2.target,bG.event.fix(b2),true)};bG.event.special[e]={setup:function(){if(bZ++===0){o.addEventListener(b1,b0,true)}},teardown:function(){if(--bZ===0){o.removeEventListener(b1,b0,true)}}}})}bG.fn.extend({on:function(b0,e,b3,b2,bZ){var b4,b1;if(typeof b0==="object"){if(typeof e!=="string"){b3=b3||e;e=aB}for(b1 in b0){this.on(b1,e,b3,b0[b1],bZ)}return this}if(b3==null&&b2==null){b2=e;b3=e=aB}else{if(b2==null){
 if(typeof e==="string"){b2=b3;b3=aB}else{b2=b3;b3=e;e=aB}}}if(b2===false){b2=X}else{if(!b2){return this}}if(bZ===1){b4=b2;b2=function(b5){bG().off(b5);return b4.apply(this,arguments)};b2.guid=b4.guid||(b4.guid=bG.guid++)}return this.each(function(){bG.event.add(this,b0,b2,b3,e)})},one:function(bZ,e,b1,b0){return this.on(bZ,e,b1,b0,1)},off:function(b0,e,b2){var bZ,b1;if(b0&&b0.preventDefault&&b0.handleObj){bZ=b0.handleObj;bG(b0.delegateTarget).off(bZ.namespace?bZ.origType+"."+bZ.namespace:bZ.origType,bZ.selector,bZ.handler);return this}if(typeof b0==="object"){for(b1 in b0){this.off(b1,e,b0[b1])}return this}if(e===false||typeof e==="function"){b2=e;e=aB}if(b2===false){b2=X}return this.each(function(){bG.event.remove(this,b0,b2,e)})},bind:function(e,b0,bZ){return this.on(e,null,b0,bZ)},unbind:function(e,bZ){return this.off(e,null,bZ)},live:function(e,b0,bZ){bG(this.context).on(e,this.selector,b0,bZ);return this},die:function(e,bZ){bG(this.context).off(e,this.selector||"**",bZ);return 
 this},delegate:function(e,bZ,b1,b0){return this.on(bZ,e,b1,b0)},undelegate:function(e,bZ,b0){return arguments.length==1?this.off(e,"**"):this.off(bZ,e||"**",b0)},trigger:function(e,bZ){return this.each(function(){bG.event.trigger(e,bZ,this)})},triggerHandler:function(e,bZ){if(this[0]){return bG.event.trigger(e,bZ,this[0],true)}},toggle:function(b1){var bZ=arguments,e=b1.guid||bG.guid++,b0=0,b2=function(b3){var b4=(bG._data(this,"lastToggle"+b1.guid)||0)%b0;bG._data(this,"lastToggle"+b1.guid,b4+1);b3.preventDefault();return bZ[b4].apply(this,arguments)||false};b2.guid=e;while(b0<bZ.length){bZ[b0++].guid=e}return this.click(b2)},hover:function(e,bZ){return this.mouseenter(e).mouseleave(bZ||e)}});bG.each(("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu").split(" "),function(bZ,e){bG.fn[e]=function(b1,b0){if(b0==null){b0=b1;b1=null}retu
 rn arguments.length>0?this.on(e,null,b1,b0):this.trigger(e)};if(a3.test(e)){bG.event.fixHooks[e]=bG.event.keyHooks}if(bK.test(e)){bG.event.fixHooks[e]=bG.event.mouseHooks}});
+/*!
+ * Sizzle CSS Selector Engine
+ *  Copyright 2012 jQuery Foundation and other contributors
+ *  Released under the MIT license
+ *  http://sizzlejs.com/
+ */
+(function(cO,cg){var cT,co,cf,b2,b8,b6=cO.document,b9=b6.documentElement,cw="undefined",ca=false,b7=true,ce=0,cj=[].slice,cS=[].push,cW=("sizcache"+Math.random()).replace(".",""),cz="[\\x20\\t\\r\\n\\f]",ci="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",ch=ci.replace("w","w#"),c1="([*^$|!~]?=)",cL="\\["+cz+"*("+ci+")"+cz+"*(?:"+c1+cz+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+ch+")|)|)"+cz+"*\\]",c2=":("+ci+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|((?:[^,]|\\\\,|(?:,(?=[^\\[]*\\]))|(?:,(?=[^\\(]*\\))))*))\\)|)",cB=":(nth|eq|gt|lt|first|last|even|odd)(?:\\((\\d*)\\)|)(?=[^-]|$)",cd=cz+"*([\\x20\\t\\r\\n\\f>+~])"+cz+"*",cc="(?=[^\\x20\\t\\r\\n\\f])(?:\\\\.|"+cL+"|"+c2.replace(2,7)+"|[^\\\\(),])+",cU=new RegExp("^"+cz+"+|((?:^|[^\\\\])(?:\\\\.)*)"+cz+"+$","g"),cF=new RegExp("^"+cd),ct=new RegExp(cc+"?(?="+cz+"*,|$)","g"),cJ=new RegExp("^(?:(?!,)(?:(?:^|,)"+cz+"*"+cc+")*?|"+cz+"*(.*?))(\\)|$)"),cZ=new RegExp(cc.slice(19,-6)+"\\x20\\t\\r\\n\\f>+~])+|"+cd,"g"),cK=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,c
 P=/[\x20\t\r\n\f]*[+~]/,cX=/:not\($/,cp=/h\d/i,cM=/input|select|textarea|button/i,cs=/\\(?!\\)/g,cE={ID:new RegExp("^#("+ci+")"),CLASS:new RegExp("^\\.("+ci+")"),NAME:new RegExp("^\\[name=['\"]?("+ci+")['\"]?\\]"),TAG:new RegExp("^("+ci.replace("[-","[-\\*")+")"),ATTR:new RegExp("^"+cL),PSEUDO:new RegExp("^"+c2),CHILD:new RegExp("^:(only|nth|last|first)-child(?:\\("+cz+"*(even|odd|(([+-]|)(\\d*)n|)"+cz+"*(?:([+-]|)"+cz+"*(\\d+)|))"+cz+"*\\)|)","i"),POS:new RegExp(cB,"ig"),needsContext:new RegExp("^"+cz+"*[>+~]|"+cB,"i")},cR={},cq=[],cl={},cu=[],cY=function(e){e.sizzleFilter=true;return e},b3=function(e){return function(c3){return c3.nodeName.toLowerCase()==="input"&&c3.type===e}},cr=function(e){return function(c4){var c3=c4.nodeName.toLowerCase();return(c3==="input"||c3==="button")&&c4.type===e}},cH=function(c3){var c4=false,c6=b6.createElement("div");try{c4=c3(c6)}catch(c5){}c6=null;return c4},cn=cH(function(c3){c3.innerHTML="<select></select>";var e=typeof c3.lastChild.getAttribut
 e("multiple");return e!=="boolean"&&e!=="string"}),b0=cH(function(c3){c3.id=cW+0;c3.innerHTML="<a name='"+cW+"'></a><div name='"+cW+"'></div>";b9.insertBefore(c3,b9.firstChild);var e=b6.getElementsByName&&b6.getElementsByName(cW).length===2+b6.getElementsByName(cW+0).length;b8=!b6.getElementById(cW);b9.removeChild(c3);return e}),b5=cH(function(e){e.appendChild(b6.createComment(""));return e.getElementsByTagName("*").length===0}),cD=cH(function(e){e.innerHTML="<a href='#'></a>";return e.firstChild&&typeof e.firstChild.getAttribute!==cw&&e.firstChild.getAttribute("href")==="#"}),cC=cH(function(e){e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return false}e.lastChild.className="e";return e.getElementsByClassName("e").length!==1});var cN=function(c5,e,c7,da){c7=c7||[];e=e||b6;var c8,c3,c9,c4,c6=e.nodeType;if(c6!==1&&c6!==9){return[]}if(!c5||typeof c5!=="string"){return c7}c9=ck(e);if(!c9&&!da)
 {if((c8=cK.exec(c5))){if((c4=c8[1])){if(c6===9){c3=e.getElementById(c4);if(c3&&c3.parentNode){if(c3.id===c4){c7.push(c3);return c7}}else{return c7}}else{if(e.ownerDocument&&(c3=e.ownerDocument.getElementById(c4))&&cA(e,c3)&&c3.id===c4){c7.push(c3);return c7}}}else{if(c8[2]){cS.apply(c7,cj.call(e.getElementsByTagName(c5),0));return c7}else{if((c4=c8[3])&&cC&&e.getElementsByClassName){cS.apply(c7,cj.call(e.getElementsByClassName(c4),0));return c7}}}}}return cV(c5,e,c7,da,c9)};var cG=cN.selectors={cacheLength:50,match:cE,order:["ID","TAG"],attrHandle:{},createPseudo:cY,find:{ID:b8?function(c5,c4,c3){if(typeof c4.getElementById!==cw&&!c3){var e=c4.getElementById(c5);return e&&e.parentNode?[e]:[]}}:function(c5,c4,c3){if(typeof c4.getElementById!==cw&&!c3){var e=c4.getElementById(c5);return e?e.id===c5||typeof e.getAttributeNode!==cw&&e.getAttributeNode("id").value===c5?[e]:cg:[]}},TAG:b5?function(e,c3){if(typeof c3.getElementsByTagName!==cw){return c3.getElementsByTagName(e)}}:function(e
 ,c6){var c5=c6.getElementsByTagName(e);if(e==="*"){var c7,c4=[],c3=0;for(;(c7=c5[c3]);c3++){if(c7.nodeType===1){c4.push(c7)}}return c4}return c5}},relative:{">":{dir:"parentNode",first:true}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:true},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){e[1]=e[1].replace(cs,"");e[3]=(e[4]||e[5]||"").replace(cs,"");if(e[2]==="~="){e[3]=" "+e[3]+" "}return e.slice(0,4)},CHILD:function(e){e[1]=e[1].toLowerCase();if(e[1]==="nth"){if(!e[2]){cN.error(e[0])}e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd"));e[4]=+((e[6]+e[7])||e[2]==="odd")}else{if(e[2]){cN.error(e[0])}}return e},PSEUDO:function(e){var c3,c4=e[4];if(cE.CHILD.test(e[0])){return null}if(c4&&(c3=cJ.exec(c4))&&c3.pop()){e[0]=e[0].slice(0,c3[0].length-c4.length-1);c4=c3[0].slice(0,-1)}e.splice(2,3,c4||e[3]);return e}},filter:{ID:b8?function(e){e=e.replace(cs,"");return function(c3){return c3.getAttribute("id")===e}}:function(e){e=e.replace(cs,"");return function(c
 4){var c3=typeof c4.getAttributeNode!==cw&&c4.getAttributeNode("id");return c3&&c3.value===e}},TAG:function(e){if(e==="*"){return function(){return true}}e=e.replace(cs,"").toLowerCase();return function(c3){return c3.nodeName&&c3.nodeName.toLowerCase()===e}},CLASS:function(e){var c3=cR[e];if(!c3){c3=cR[e]=new RegExp("(^|"+cz+")"+e+"("+cz+"|$)");cq.push(e);if(cq.length>cG.cacheLength){delete cR[cq.shift()]}}return function(c4){return c3.test(c4.className||(typeof c4.getAttribute!==cw&&c4.getAttribute("class"))||"")}},ATTR:function(c4,c3,e){if(!c3){return function(c5){return cN.attr(c5,c4)!=null}}return function(c6){var c5=cN.attr(c6,c4),c7=c5+"";if(c5==null){return c3==="!="}switch(c3){case"=":return c7===e;case"!=":return c7!==e;case"^=":return e&&c7.indexOf(e)===0;case"*=":return e&&c7.indexOf(e)>-1;case"$=":return e&&c7.substr(c7.length-e.length)===e;case"~=":return(" "+c7+" ").indexOf(e)>-1;case"|=":return c7===e||c7.substr(0,e.length+1)===e+"-"}}},CHILD:function(c3,c5,c6,c4){if(
 c3==="nth"){var e=ce++;return function(da){var c7,db,c9=0,c8=da;if(c6===1&&c4===0){return true}c7=da.parentNode;if(c7&&(c7[cW]!==e||!da.sizset)){for(c8=c7.firstChild;c8;c8=c8.nextSibling){if(c8.nodeType===1){c8.sizset=++c9;if(c8===da){break}}}c7[cW]=e}db=da.sizset-c4;if(c6===0){return db===0}else{return(db%c6===0&&db/c6>=0)}}}return function(c8){var c7=c8;switch(c3){case"only":case"first":while((c7=c7.previousSibling)){if(c7.nodeType===1){return false}}if(c3==="first"){return true}c7=c8;case"last":while((c7=c7.nextSibling)){if(c7.nodeType===1){return false}}return true}}},PSEUDO:function(c6,c5,c3,e){var c4=cG.pseudos[c6]||cG.pseudos[c6.toLowerCase()];if(!c4){cN.error("unsupported pseudo: "+c6)}if(!c4.sizzleFilter){return c4}return c4(c5,c3,e)}},pseudos:{not:cY(function(e,c4,c3){var c5=cb(e.replace(cU,"$1"),c4,c3);return function(c6){return !c5(c6)}}),enabled:function(e){return e.disabled===false},disabled:function(e){return e.disabled===true},checked:function(e){var c3=e.nodeName.to
 LowerCase();return(c3==="input"&&!!e.checked)||(c3==="option"&&!!e.selected)},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !cG.pseudos.empty(e)},empty:function(c3){var e;c3=c3.firstChild;while(c3){if(c3.nodeName>"@"||(e=c3.nodeType)===3||e===4){return false}c3=c3.nextSibling}return true},contains:cY(function(e){return function(c3){return(c3.textContent||c3.innerText||bZ(c3)).indexOf(e)>-1}}),has:cY(function(e){return function(c3){return cN(e,c3).length>0}}),header:function(e){return cp.test(e.nodeName)},text:function(c4){var c3,e;return c4.nodeName.toLowerCase()==="input"&&(c3=c4.type)==="text"&&((e=c4.getAttribute("type"))==null||e.toLowerCase()===c3)},radio:b3("radio"),checkbox:b3("checkbox"),file:b3("file"),password:b3("password"),image:b3("image"),submit:cr("submit"),reset:cr("reset"),button:function(c3){var e=c3.nodeName.toLowerCase();return e==="input"&&c3.type==="button"||e==="button"},input:function(e){r
 eturn cM.test(e.nodeName)},focus:function(e){var c3=e.ownerDocument;return e===c3.activeElement&&(!c3.hasFocus||c3.hasFocus())&&!!(e.type||e.href)},active:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(c4,c3,e){return e?c4.slice(1):[c4[0]]},last:function(c5,c4,c3){var e=c5.pop();return c3?c5:[e]},even:function(c7,c6,c5){var c4=[],c3=c5?1:0,e=c7.length;for(;c3<e;c3=c3+2){c4.push(c7[c3])}return c4},odd:function(c7,c6,c5){var c4=[],c3=c5?0:1,e=c7.length;for(;c3<e;c3=c3+2){c4.push(c7[c3])}return c4},lt:function(c4,c3,e){return e?c4.slice(+c3):c4.slice(0,+c3)},gt:function(c4,c3,e){return e?c4.slice(0,+c3+1):c4.slice(+c3+1)},eq:function(c5,c4,c3){var e=c5.splice(+c4,1);return c3?c5:e}}};cG.setFilters.nth=cG.setFilters.eq;cG.filters=cG.pseudos;if(!cD){cG.attrHandle={href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}}}if(b0){cG.order.push("NAME");cG.find.NAME=function(e,c3){if(typeof c3.getElementsByName!==cw)
 {return c3.getElementsByName(e)}}}if(cC){cG.order.splice(1,0,"CLASS");cG.find.CLASS=function(c4,c3,e){if(typeof c3.getElementsByClassName!==cw&&!e){return c3.getElementsByClassName(c4)}}}try{cj.call(b9.childNodes,0)[0].nodeType}catch(c0){cj=function(c3){var c4,e=[];for(;(c4=this[c3]);c3++){e.push(c4)}return e}}var ck=cN.isXML=function(e){var c3=e&&(e.ownerDocument||e).documentElement;return c3?c3.nodeName!=="HTML":false};var cA=cN.contains=b9.compareDocumentPosition?function(c3,e){return !!(c3.compareDocumentPosition(e)&16)}:b9.contains?function(c3,e){var c5=c3.nodeType===9?c3.documentElement:c3,c4=e.parentNode;return c3===c4||!!(c4&&c4.nodeType===1&&c5.contains&&c5.contains(c4))}:function(c3,e){while((e=e.parentNode)){if(e===c3){return true}}return false};var bZ=cN.getText=function(c6){var c5,c3="",c4=0,e=c6.nodeType;if(e){if(e===1||e===9||e===11){if(typeof c6.textContent==="string"){return c6.textContent}else{for(c6=c6.firstChild;c6;c6=c6.nextSibling){c3+=bZ(c6)}}}else{if(e===3||e
 ===4){return c6.nodeValue}}}else{for(;(c5=c6[c4]);c4++){c3+=bZ(c5)}}return c3};cN.attr=function(c5,c4){var e,c3=ck(c5);if(!c3){c4=c4.toLowerCase()}if(cG.attrHandle[c4]){return cG.attrHandle[c4](c5)}if(cn||c3){return c5.getAttribute(c4)}e=c5.getAttributeNode(c4);return e?typeof c5[c4]==="boolean"?c5[c4]?c4:null:e.specified?e.value:null:null};cN.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)};[0,0].sort(function(){return(b7=0)});if(b9.compareDocumentPosition){cf=function(c3,e){if(c3===e){ca=true;return 0}return(!c3.compareDocumentPosition||!e.compareDocumentPosition?c3.compareDocumentPosition:c3.compareDocumentPosition(e)&4)?-1:1}}else{cf=function(da,c9){if(da===c9){ca=true;return 0}else{if(da.sourceIndex&&c9.sourceIndex){return da.sourceIndex-c9.sourceIndex}}var c7,c3,c4=[],e=[],c6=da.parentNode,c8=c9.parentNode,db=c6;if(c6===c8){return b2(da,c9)}else{if(!c6){return -1}else{if(!c8){return 1}}}while(db){c4.unshift(db);db=db.parentNode}db=c8;while(db){e.
 unshift(db);db=db.parentNode}c7=c4.length;c3=e.length;for(var c5=0;c5<c7&&c5<c3;c5++){if(c4[c5]!==e[c5]){return b2(c4[c5],e[c5])}}return c5===c7?b2(da,e[c5],-1):b2(c4[c5],c9,1)};b2=function(c3,e,c4){if(c3===e){return c4}var c5=c3.nextSibling;while(c5){if(c5===e){return -1}c5=c5.nextSibling}return 1}}cN.uniqueSort=function(c3){var c4,e=1;if(cf){ca=b7;c3.sort(cf);if(ca){for(;(c4=c3[e]);e++){if(c4===c3[e-1]){c3.splice(e--,1)}}}}return c3};function cm(c3,c7,c6,c4){var c5=0,e=c7.length;for(;c5<e;c5++){cN(c3,c7[c5],c6,c4)}}function cI(e,c4,c8,c9,c3,c7){var c5,c6=cG.setFilters[c4.toLowerCase()];if(!c6){cN.error(c4)}if(e||!(c5=c3)){cm(e||"*",c9,(c5=[]),c3)}return c5.length>0?c6(c5,c8,c7):[]}function cQ(dc,e,da,c4,dg){var c7,c3,c6,di,c9,dh,db,df,dd=0,de=dg.length,c5=cE.POS,c8=new RegExp("^"+c5.source+"(?!"+cz+")","i"),dj=function(){var dl=1,dk=arguments.length-2;for(;dl<dk;dl++){if(arguments[dl]===cg){c7[dl]=cg}}};for(;dd<de;dd++){c5.exec("");dc=dg[dd];di=[];c6=0;c9=c4;while((c7=c5.exec(dc))
 ){df=c5.lastIndex=c7.index+c7[0].length;if(df>c6){db=dc.slice(c6,c7.index);c6=df;dh=[e];if(cF.test(db)){if(c9){dh=c9}c9=c4}if((c3=cX.test(db))){db=db.slice(0,-5).replace(cF,"$&*")}if(c7.length>1){c7[0].replace(c8,dj)}c9=cI(db,c7[1],c7[2],dh,c9,c3)}}if(c9){di=di.concat(c9);if((db=dc.slice(c6))&&db!==")"){if(cF.test(db)){cm(db,di,da,c4)}else{cN(db,e,da,c4?c4.concat(c9):c9)}}else{cS.apply(da,di)}}else{cN(dc,e,da,c4)}}return de===1?da:cN.uniqueSort(da)}function b1(c8,c4,db){var dd,dc,de,c6=[],c9=0,da=cJ.exec(c8),c3=!da.pop()&&!da.pop(),df=c3&&c8.match(ct)||[""],e=cG.preFilter,c5=cG.filter,c7=!db&&c4!==b6;for(;(dc=df[c9])!=null&&c3;c9++){c6.push(dd=[]);if(c7){dc=" "+dc}while(dc){c3=false;if((da=cF.exec(dc))){dc=dc.slice(da[0].length);c3=dd.push({part:da.pop().replace(cU," "),captures:da})}for(de in c5){if((da=cE[de].exec(dc))&&(!e[de]||(da=e[de](da,c4,db)))){dc=dc.slice(da.shift().length);c3=dd.push({part:de,captures:da})}}if(!c3){break}}}if(!c3){cN.error(c8)}return c6}function cx(c6,c5,
 c4){var e=c5.dir,c3=ce++;if(!c6){c6=function(c7){return c7===c4}}return c5.first?function(c8,c7){while((c8=c8[e])){if(c8.nodeType===1){return c6(c8,c7)&&c8}}}:function(c9,c8){var c7,da=c3+"."+co,db=da+"."+cT;while((c9=c9[e])){if(c9.nodeType===1){if((c7=c9[cW])===db){return c9.sizset}else{if(typeof c7==="string"&&c7.indexOf(da)===0){if(c9.sizset){return c9}}else{c9[cW]=db;if(c6(c9,c8)){c9.sizset=true;return c9}c9.sizset=false}}}}}}function cv(e,c3){return e?function(c6,c5){var c4=c3(c6,c5);return c4&&e(c4===true?c6:c4,c5)}:c3}function cy(c7,c5,e){var c4,c6,c3=0;for(;(c4=c7[c3]);c3++){if(cG.relative[c4.part]){c6=cx(c6,cG.relative[c4.part],c5)}else{c4.captures.push(c5,e);c6=cv(c6,cG.filter[c4.part].apply(null,c4.captures))}}return c6}function b4(e){return function(c5,c4){var c6,c3=0;for(;(c6=e[c3]);c3++){if(c6(c5,c4)){return true}}return false}}var cb=cN.compile=function(e,c5,c3){var c8,c7,c4,c6=cl[e];if(c6&&c6.context===c5){return c6}c7=b1(e,c5,c3);for(c4=0;(c8=c7[c4]);c4++){c7[c4]=cy
 (c8,c5,c3)}c6=cl[e]=b4(c7);c6.context=c5;c6.runs=c6.dirruns=0;cu.push(e);if(cu.length>cG.cacheLength){delete cl[cu.shift()]}return c6};cN.matches=function(c3,e){return cN(c3,null,null,e)};cN.matchesSelector=function(e,c3){return cN(c3,null,null,[e]).length>0};var cV=function(c6,c3,c8,dc,db){c6=c6.replace(cU,"$1");var e,dd,c9,de,c4,c5,dg,dh,c7,da=c6.match(ct),df=c6.match(cZ),di=c3.nodeType;if(cE.POS.test(c6)){return cQ(c6,c3,c8,dc,da)}if(dc){e=cj.call(dc,0)}else{if(da&&da.length===1){if(df.length>1&&di===9&&!db&&(da=cE.ID.exec(df[0]))){c3=cG.find.ID(da[1],c3,db)[0];if(!c3){return c8}c6=c6.slice(df.shift().length)}dh=((da=cP.exec(df[0]))&&!da.index&&c3.parentNode)||c3;c7=df.pop();c5=c7.split(":not")[0];for(c9=0,de=cG.order.length;c9<de;c9++){dg=cG.order[c9];if((da=cE[dg].exec(c5))){e=cG.find[dg]((da[1]||"").replace(cs,""),dh,db);if(e==null){continue}if(c5===c7){c6=c6.slice(0,c6.length-c7.length)+c5.replace(cE[dg],"");if(!c6){cS.apply(c8,cj.call(e,0))}}break}}}}if(c6){dd=cb(c6,c3,db);c
 o=dd.dirruns++;if(e==null){e=cG.find.TAG("*",(cP.test(c6)&&c3.parentNode)||c3)}for(c9=0;(c4=e[c9]);c9++){cT=dd.runs++;if(dd(c4,c3)){c8.push(c4)}}}return c8};if(b6.querySelectorAll){(function(){var c7,c8=cV,c6=/'|\\/g,c4=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,c3=[],e=[":active"],c5=b9.matchesSelector||b9.mozMatchesSelector||b9.webkitMatchesSelector||b9.oMatchesSelector||b9.msMatchesSelector;cH(function(c9){c9.innerHTML="<select><option selected></option></select>";if(!c9.querySelectorAll("[selected]").length){c3.push("\\["+cz+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)")}if(!c9.querySelectorAll(":checked").length){c3.push(":checked")}});cH(function(c9){c9.innerHTML="<p test=''></p>";if(c9.querySelectorAll("[test^='']").length){c3.push("[*^$]="+cz+"*(?:\"\"|'')")}c9.innerHTML="<input type='hidden'>";if(!c9.querySelectorAll(":enabled").length){c3.push(":enabled",":disabled")}});c3=c3.length&&new RegExp(c3.join("|"));cV=function(de,da,df,dh,dg){if(!dh&&!dg&&(!
 c3||!c3.test(de))){if(da.nodeType===9){try{cS.apply(df,cj.call(da.querySelectorAll(de),0));return df}catch(dd){}}else{if(da.nodeType===1&&da.nodeName.toLowerCase()!=="object"){var dc=da.getAttribute("id"),c9=dc||cW,db=cP.test(de)&&da.parentNode||da;if(dc){c9=c9.replace(c6,"\\$&")}else{da.setAttribute("id",c9)}try{cS.apply(df,cj.call(db.querySelectorAll(de.replace(ct,"[id='"+c9+"'] $&")),0));return df}catch(dd){}finally{if(!dc){da.removeAttribute("id")}}}}}return c8(de,da,df,dh,dg)};if(c5){cH(function(da){c7=c5.call(da,"div");try{c5.call(da,"[test!='']:sizzle");e.push(cG.match.PSEUDO)}catch(c9){}});e=new RegExp(e.join("|"));cN.matchesSelector=function(da,dc){dc=dc.replace(c4,"='$1']");if(!ck(da)&&!e.test(dc)&&(!c3||!c3.test(dc))){try{var c9=c5.call(da,dc);if(c9||c7||da.document&&da.document.nodeType!==11){return c9}}catch(db){}}return cN(dc,null,null,[da]).length>0}}})()}cN.attr=bG.attr;bG.find=cN;bG.expr=cN.selectors;bG.expr[":"]=bG.expr.pseudos;bG.unique=cN.uniqueSort;bG.text=cN.ge
 tText;bG.isXMLDoc=cN.isXML;bG.contains=cN.contains})(a2);var ag=/Until$/,bq=/^(?:parents|prev(?:Until|All))/,al=/^.[^:#\[\.,]*$/,z=bG.expr.match.needsContext,bu={children:true,contents:true,next:true,prev:true};bG.fn.extend({find:function(e){var b2,bZ,b4,b5,b3,b1,b0=this;if(typeof e!=="string"){return bG(e).filter(function(){for(b2=0,bZ=b0.length;b2<bZ;b2++){if(bG.contains(b0[b2],this)){return true}}})}b1=this.pushStack("","find",e);for(b2=0,bZ=this.length;b2<bZ;b2++){b4=b1.length;bG.find(e,this[b2],b1);if(b2>0){for(b5=b4;b5<b1.length;b5++){for(b3=0;b3<b4;b3++){if(b1[b3]===b1[b5]){b1.splice(b5--,1);break}}}}}return b1},has:function(b1){var b0,bZ=bG(b1,this),e=bZ.length;return this.filter(function(){for(b0=0;b0<e;b0++){if(bG.contains(this,bZ[b0])){return true}}})},not:function(e){return this.pushStack(aM(this,e,false),"not",e)},filter:function(e){return this.pushStack(aM(this,e,true),"filter",e)},is:function(e){return !!e&&(typeof e==="string"?z.test(e)?bG(e,this.context).index(this[
 0])>=0:bG.filter(e,this).length>0:this.filter(e).length>0)},closest:function(b2,b1){var b3,b0=0,e=this.length,bZ=[],b4=z.test(b2)||typeof b2!=="string"?bG(b2,b1||this.context):0;for(;b0<e;b0++){b3=this[b0];while(b3&&b3.ownerDocument&&b3!==b1&&b3.nodeType!==11){if(b4?b4.index(b3)>-1:bG.find.matchesSelector(b3,b2)){bZ.push(b3);break}b3=b3.parentNode}}bZ=bZ.length>1?bG.unique(bZ):bZ;return this.pushStack(bZ,"closest",b2)},index:function(e){if(!e){return(this[0]&&this[0].parentNode)?this.prevAll().length:-1}if(typeof e==="string"){return bG.inArray(this[0],bG(e))}return bG.inArray(e.jquery?e[0]:e,this)},add:function(e,bZ){var b1=typeof e==="string"?bG(e,bZ):bG.makeArray(e&&e.nodeType?[e]:e),b0=bG.merge(this.get(),b1);return this.pushStack(aR(b1[0])||aR(b0[0])?b0:bG.unique(b0))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}});bG.fn.andSelf=bG.fn.addBack;function aR(e){return !e||!e.parentNode||e.parentNode.nodeType===11}function aY(bZ,e){do{bZ=bZ
 [e]}while(bZ&&bZ.nodeType!==1);return bZ}bG.each({parent:function(bZ){var e=bZ.parentNode;return e&&e.nodeType!==11?e:null},parents:function(e){return bG.dir(e,"parentNode")},parentsUntil:function(bZ,e,b0){return bG.dir(bZ,"parentNode",b0)},next:function(e){return aY(e,"nextSibling")},prev:function(e){return aY(e,"previousSibling")},nextAll:function(e){return bG.dir(e,"nextSibling")},prevAll:function(e){return bG.dir(e,"previousSibling")},nextUntil:function(bZ,e,b0){return bG.dir(bZ,"nextSibling",b0)},prevUntil:function(bZ,e,b0){return bG.dir(bZ,"previousSibling",b0)},siblings:function(e){return bG.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return bG.sibling(e.firstChild)},contents:function(e){return bG.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:bG.merge([],e.childNodes)}},function(e,bZ){bG.fn[e]=function(b2,b0){var b1=bG.map(this,bZ,b2);if(!ag.test(e)){b0=b2}if(b0&&typeof b0==="string"){b1=bG.filter(b0,b1)}b1=this.length>1&&!bu[e]?bG.unique
 (b1):b1;if(this.length>1&&bq.test(e)){b1=b1.reverse()}return this.pushStack(b1,e,a4.call(arguments).join(","))}});bG.extend({filter:function(b0,e,bZ){if(bZ){b0=":not("+b0+")"}return e.length===1?bG.find.matchesSelector(e[0],b0)?[e[0]]:[]:bG.find.matches(b0,e)},dir:function(b0,bZ,b2){var e=[],b1=b0[bZ];while(b1&&b1.nodeType!==9&&(b2===aB||b1.nodeType!==1||!bG(b1).is(b2))){if(b1.nodeType===1){e.push(b1)}b1=b1[bZ]}return e},sibling:function(b0,bZ){var e=[];for(;b0;b0=b0.nextSibling){if(b0.nodeType===1&&b0!==bZ){e.push(b0)}}return e}});function aM(b1,b0,e){b0=b0||0;if(bG.isFunction(b0)){return bG.grep(b1,function(b3,b2){var b4=!!b0.call(b3,b2,b3);return b4===e})}else{if(b0.nodeType){return bG.grep(b1,function(b3,b2){return(b3===b0)===e})}else{if(typeof b0==="string"){var bZ=bG.grep(b1,function(b2){return b2.nodeType===1});if(al.test(b0)){return bG.filter(b0,bZ,!e)}else{b0=bG.filter(b0,bZ)}}}}return bG.grep(b1,function(b3,b2){return(bG.inArray(b3,b0)>=0)===e})}function B(e){var b0=c.spli
 t("|"),bZ=e.createDocumentFragment();if(bZ.createElement){while(b0.length){bZ.createElement(b0.pop())}}return bZ}var c="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",av=/ jQuery\d+="(?:null|\d+)"/g,bY=/^\s+/,ay=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,p=/<([\w:]+)/,bT=/<tbody/i,J=/<|&#?\w+;/,aj=/<(?:script|style|link)/i,ap=/<(?:script|object|embed|option|style)/i,K=new RegExp("<(?:"+c+")[\\s/>]","i"),aE=/^(?:checkbox|radio)$/,bR=/checked\s*(?:[^=]|=\s*.checked.)/i,bw=/\/(java|ecma)script/i,aH=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,T={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_
 default:[0,"",""]},aQ=B(o),l=aQ.appendChild(o.createElement("div"));T.optgroup=T.option;T.tbody=T.tfoot=T.colgroup=T.caption=T.thead;T.th=T.td;if(!bG.support.htmlSerialize){T._default=[1,"X<div>","</div>"]}bG.fn.extend({text:function(e){return bG.access(this,function(bZ){return bZ===aB?bG.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(bZ))},null,e,arguments.length)},wrapAll:function(e){if(bG.isFunction(e)){return this.each(function(b0){bG(this).wrapAll(e.call(this,b0))})}if(this[0]){var bZ=bG(e,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){bZ.insertBefore(this[0])}bZ.map(function(){var b0=this;while(b0.firstChild&&b0.firstChild.nodeType===1){b0=b0.firstChild}return b0}).append(this)}return this},wrapInner:function(e){if(bG.isFunction(e)){return this.each(function(bZ){bG(this).wrapInner(e.call(this,bZ))})}return this.each(function(){var bZ=bG(this),b0=bZ.contents();if(b0.length){b0.wrapAll(e)}else{bZ.append(e)}})},wrap:function(e){
 var bZ=bG.isFunction(e);return this.each(function(b0){bG(this).wrapAll(bZ?e.call(this,b0):e)})},unwrap:function(){return this.parent().each(function(){if(!bG.nodeName(this,"body")){bG(this).replaceWith(this.childNodes)}}).end()},append:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1||this.nodeType===11){this.appendChild(e)}})},prepend:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1||this.nodeType===11){this.insertBefore(e,this.firstChild)}})},before:function(){if(!aR(this[0])){return this.domManip(arguments,false,function(bZ){this.parentNode.insertBefore(bZ,this)})}if(arguments.length){var e=bG.clean(arguments);return this.pushStack(bG.merge(e,this),"before",this.selector)}},after:function(){if(!aR(this[0])){return this.domManip(arguments,false,function(bZ){this.parentNode.insertBefore(bZ,this.nextSibling)})}if(arguments.length){var e=bG.clean(arguments);return this.pushStack(bG.merge(this,e),"after",this.selector)}},re
 move:function(e,b1){var b0,bZ=0;for(;(b0=this[bZ])!=null;bZ++){if(!e||bG.filter(e,[b0]).length){if(!b1&&b0.nodeType===1){bG.cleanData(b0.getElementsByTagName("*"));bG.cleanData([b0])}if(b0.parentNode){b0.parentNode.removeChild(b0)}}}return this},empty:function(){var bZ,e=0;for(;(bZ=this[e])!=null;e++){if(bZ.nodeType===1){bG.cleanData(bZ.getElementsByTagName("*"))}while(bZ.firstChild){bZ.removeChild(bZ.firstChild)}}return this},clone:function(bZ,e){bZ=bZ==null?false:bZ;e=e==null?bZ:e;return this.map(function(){return bG.clone(this,bZ,e)})},html:function(e){return bG.access(this,function(b2){var b1=this[0]||{},b0=0,bZ=this.length;if(b2===aB){return b1.nodeType===1?b1.innerHTML.replace(av,""):aB}if(typeof b2==="string"&&!aj.test(b2)&&(bG.support.htmlSerialize||!K.test(b2))&&(bG.support.leadingWhitespace||!bY.test(b2))&&!T[(p.exec(b2)||["",""])[1].toLowerCase()]){b2=b2.replace(ay,"<$1></$2>");try{for(;b0<bZ;b0++){b1=this[b0]||{};if(b1.nodeType===1){bG.cleanData(b1.getElementsByTagName("
 *"));b1.innerHTML=b2}}b1=0}catch(b3){}}if(b1){this.empty().append(b2)}},null,e,arguments.length)},replaceWith:function(e){if(!aR(this[0])){if(bG.isFunction(e)){return this.each(function(b1){var b0=bG(this),bZ=b0.html();b0.replaceWith(e.call(this,b1,bZ))})}if(typeof e!=="string"){e=bG(e).detach()}return this.each(function(){var b0=this.nextSibling,bZ=this.parentNode;bG(this).remove();if(b0){bG(b0).before(e)}else{bG(bZ).append(e)}})}return this.length?this.pushStack(bG(bG.isFunction(e)?e():e),"replaceWith",e):this},detach:function(e){return this.remove(e,true)},domManip:function(b4,b8,b7){b4=[].concat.apply([],b4);var b0,b2,b3,b6,b1=0,b5=b4[0],bZ=[],e=this.length;if(!bG.support.checkClone&&e>1&&typeof b5==="string"&&bR.test(b5)){return this.each(function(){bG(this).domManip(b4,b8,b7)})}if(bG.isFunction(b5)){return this.each(function(ca){var b9=bG(this);b4[0]=b5.call(this,ca,b8?b9.html():aB);b9.domManip(b4,b8,b7)})}if(this[0]){b0=bG.buildFragment(b4,this,bZ);b3=b0.fragment;b2=b3.firstC
 hild;if(b3.childNodes.length===1){b3=b2}if(b2){b8=b8&&bG.nodeName(b2,"tr");for(b6=b0.cacheable||e-1;b1<e;b1++){b7.call(b8&&bG.nodeName(this[b1],"table")?y(this[b1],"tbody"):this[b1],b1===b6?b3:bG.clone(b3,true,true))}}b3=b2=null;if(bZ.length){bG.each(bZ,function(b9,ca){if(ca.src){if(bG.ajax){bG.ajax({url:ca.src,type:"GET",dataType:"script",async:false,global:false,"throws":true})}else{bG.error("no ajax")}}else{bG.globalEval((ca.text||ca.textContent||ca.innerHTML||"").replace(aH,""))}if(ca.parentNode){ca.parentNode.removeChild(ca)}})}}return this}});function y(bZ,e){return bZ.getElementsByTagName(e)[0]||bZ.appendChild(bZ.ownerDocument.createElement(e))}function ao(b5,bZ){if(bZ.nodeType!==1||!bG.hasData(b5)){return}var b2,b1,e,b4=bG._data(b5),b3=bG._data(bZ,b4),b0=b4.events;if(b0){delete b3.handle;b3.events={};for(b2 in b0){for(b1=0,e=b0[b2].length;b1<e;b1++){bG.event.add(bZ,b2,b0[b2][b1])}}}if(b3.data){b3.data=bG.extend({},b3.data)}}function G(bZ,e){var b0;if(e.nodeType!==1){return}i
 f(e.clearAttributes){e.clearAttributes()}if(e.mergeAttributes){e.mergeAttributes(bZ)}b0=e.nodeName.toLowerCase();if(b0==="object"){if(e.parentNode){e.outerHTML=bZ.outerHTML}if(bG.support.html5Clone&&(bZ.innerHTML&&!bG.trim(e.innerHTML))){e.innerHTML=bZ.innerHTML}}else{if(b0==="input"&&aE.test(bZ.type)){e.defaultChecked=e.checked=bZ.checked;if(e.value!==bZ.value){e.value=bZ.value}}else{if(b0==="option"){e.selected=bZ.defaultSelected}else{if(b0==="input"||b0==="textarea"){e.defaultValue=bZ.defaultValue}else{if(b0==="script"&&e.text!==bZ.text){e.text=bZ.text}}}}}e.removeAttribute(bG.expando)}bG.buildFragment=function(b1,b2,bZ){var b0,e,b3,b4=b1[0];b2=b2||o;b2=(b2[0]||b2).ownerDocument||b2[0]||b2;if(typeof b2.createDocumentFragment==="undefined"){b2=o}if(b1.length===1&&typeof b4==="string"&&b4.length<512&&b2===o&&b4.charAt(0)==="<"&&!ap.test(b4)&&(bG.support.checkClone||!bR.test(b4))&&(bG.support.html5Clone||!K.test(b4))){e=true;b0=bG.fragments[b4];b3=b0!==aB}if(!b0){b0=b2.createDocumen
 tFragment();bG.clean(b1,b2,b0,bZ);if(e){bG.fragments[b4]=b3&&b0}}return{fragment:b0,cacheable:e}};bG.fragments={};bG.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,bZ){bG.fn[e]=function(b0){var b2,b4=0,b3=[],b6=bG(b0),b1=b6.length,b5=this.length===1&&this[0].parentNode;if((b5==null||b5&&b5.nodeType===11&&b5.childNodes.length===1)&&b1===1){b6[bZ](this[0]);return this}else{for(;b4<b1;b4++){b2=(b4>0?this.clone(true):this).get();bG(b6[b4])[bZ](b2);b3=b3.concat(b2)}return this.pushStack(b3,e,b6.selector)}}});function m(e){if(typeof e.getElementsByTagName!=="undefined"){return e.getElementsByTagName("*")}else{if(typeof e.querySelectorAll!=="undefined"){return e.querySelectorAll("*")}else{return[]}}}function bS(e){if(aE.test(e.type)){e.defaultChecked=e.checked}}bG.extend({clone:function(b2,b4,b0){var e,bZ,b1,b3;if(bG.support.html5Clone||bG.isXMLDoc(b2)||!K.test("<"+b2.nodeName+">")){b3=b2.cloneNode(true)}else{l.inn
 erHTML=b2.outerHTML;l.removeChild(b3=l.firstChild)}if((!bG.support.noCloneEvent||!bG.support.noCloneChecked)&&(b2.nodeType===1||b2.nodeType===11)&&!bG.isXMLDoc(b2)){G(b2,b3);e=m(b2);bZ=m(b3);for(b1=0;e[b1];++b1){if(bZ[b1]){G(e[b1],bZ[b1])}}}if(b4){ao(b2,b3);if(b0){e=m(b2);bZ=m(b3);for(b1=0;e[b1];++b1){ao(e[b1],bZ[b1])}}}e=bZ=null;return b3},clean:function(cb,b0,e,b1){var b7,b3,ca,cf,b4,ce,b5,b2,bZ,b9,cd,b6,b8=0,cc=[];if(!b0||typeof b0.createDocumentFragment==="undefined"){b0=o}for(b3=b0===o&&aQ;(ca=cb[b8])!=null;b8++){if(typeof ca==="number"){ca+=""}if(!ca){continue}if(typeof ca==="string"){if(!J.test(ca)){ca=b0.createTextNode(ca)}else{b3=b3||B(b0);b5=b5||b3.appendChild(b0.createElement("div"));ca=ca.replace(ay,"<$1></$2>");cf=(p.exec(ca)||["",""])[1].toLowerCase();b4=T[cf]||T._default;ce=b4[0];b5.innerHTML=b4[1]+ca+b4[2];while(ce--){b5=b5.lastChild}if(!bG.support.tbody){b2=bT.test(ca);bZ=cf==="table"&&!b2?b5.firstChild&&b5.firstChild.childNodes:b4[1]==="<table>"&&!b2?b5.childNodes:
 [];for(b7=bZ.length-1;b7>=0;--b7){if(bG.nodeName(bZ[b7],"tbody")&&!bZ[b7].childNodes.length){bZ[b7].parentNode.removeChild(bZ[b7])}}}if(!bG.support.leadingWhitespace&&bY.test(ca)){b5.insertBefore(b0.createTextNode(bY.exec(ca)[0]),b5.firstChild)}ca=b5.childNodes;b5=b3.lastChild}}if(ca.nodeType){cc.push(ca)}else{cc=bG.merge(cc,ca)}}if(b5){b3.removeChild(b5);ca=b5=b3=null}if(!bG.support.appendChecked){for(b8=0;(ca=cc[b8])!=null;b8++){if(bG.nodeName(ca,"input")){bS(ca)}else{if(typeof ca.getElementsByTagName!=="undefined"){bG.grep(ca.getElementsByTagName("input"),bS)}}}}if(e){cd=function(cg){if(!cg.type||bw.test(cg.type)){return b1?b1.push(cg.parentNode?cg.parentNode.removeChild(cg):cg):e.appendChild(cg)}};for(b8=0;(ca=cc[b8])!=null;b8++){if(!(bG.nodeName(ca,"script")&&cd(ca))){e.appendChild(ca);if(typeof ca.getElementsByTagName!=="undefined"){b6=bG.grep(bG.merge([],ca.getElementsByTagName("script")),cd);cc.splice.apply(cc,[b8+1,0].concat(b6));b8+=b6.length}}}}return cc},cleanData:functi
 on(bZ,b7){var b2,b0,b1,b6,b3=0,b8=bG.expando,e=bG.cache,b4=bG.support.deleteExpando,b5=bG.event.special;for(;(b1=bZ[b3])!=null;b3++){if(b7||bG.acceptData(b1)){b0=b1[b8];b2=b0&&e[b0];if(b2){if(b2.events){for(b6 in b2.events){if(b5[b6]){bG.event.remove(b1,b6)}else{bG.removeEvent(b1,b6,b2.handle)}}}if(e[b0]){delete e[b0];if(b4){delete b1[b8]}else{if(b1.removeAttribute){b1.removeAttribute(b8)}else{b1[b8]=null}}bG.deletedIds.push(b0)}}}}}});(function(){var e,bZ;bG.uaMatch=function(b1){b1=b1.toLowerCase();var b0=/(chrome)[ \/]([\w.]+)/.exec(b1)||/(webkit)[ \/]([\w.]+)/.exec(b1)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(b1)||/(msie) ([\w.]+)/.exec(b1)||b1.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(b1)||[];return{browser:b0[1]||"",version:b0[2]||"0"}};e=bG.uaMatch(d.userAgent);bZ={};if(e.browser){bZ[e.browser]=true;bZ.version=e.version}if(bZ.webkit){bZ.safari=true}bG.browser=bZ;bG.sub=function(){function b0(b3,b4){return new b0.fn.init(b3,b4)}bG.extend(true,b0,this);b0.s
 uperclass=this;b0.fn=b0.prototype=this();b0.fn.constructor=b0;b0.sub=this.sub;b0.fn.init=function b2(b3,b4){if(b4&&b4 instanceof bG&&!(b4 instanceof b0)){b4=b0(b4)}return bG.fn.init.call(this,b3,b4,b1)};b0.fn.init.prototype=b0.fn;var b1=b0(o);return b0}})();var F,az,aW,be=/alpha\([^)]*\)/i,aS=/opacity=([^)]*)/,bk=/^(top|right|bottom|left)$/,aZ=/^margin/,a8=new RegExp("^("+bx+")(.*)$","i"),W=new RegExp("^("+bx+")(?!px)[a-z%]+$","i"),S=new RegExp("^([-+])=("+bx+")","i"),bh={},a9={position:"absolute",visibility:"hidden",display:"block"},bA={letterSpacing:0,fontWeight:400,lineHeight:1},bQ=["Top","Right","Bottom","Left"],ar=["Webkit","O","Moz","ms"],aJ=bG.fn.toggle;function b(b1,bZ){if(bZ in b1){return bZ}var b2=bZ.charAt(0).toUpperCase()+bZ.slice(1),e=bZ,b0=ar.length;while(b0--){bZ=ar[b0]+b2;if(bZ in b1){return bZ}}return e}function Q(bZ,e){bZ=e||bZ;return bG.css(bZ,"display")==="none"||!bG.contains(bZ.ownerDocument,bZ)}function t(b3,e){var b2,b4,bZ=[],b0=0,b1=b3.length;for(;b0<b1;b0++)
 {b2=b3[b0];if(!b2.style){continue}bZ[b0]=bG._data(b2,"olddisplay");if(e){if(!bZ[b0]&&b2.style.display==="none"){b2.style.display=""}if(b2.style.display===""&&Q(b2)){bZ[b0]=bG._data(b2,"olddisplay",bC(b2.nodeName))}}else{b4=F(b2,"display");if(!bZ[b0]&&b4!=="none"){bG._data(b2,"olddisplay",b4)}}}for(b0=0;b0<b1;b0++){b2=b3[b0];if(!b2.style){continue}if(!e||b2.style.display==="none"||b2.style.display===""){b2.style.display=e?bZ[b0]||"":"none"}}return b3}bG.fn.extend({css:function(e,bZ){return bG.access(this,function(b1,b0,b2){return b2!==aB?bG.style(b1,b0,b2):bG.css(b1,b0)},e,bZ,arguments.length>1)},show:function(){return t(this,true)},hide:function(){return t(this)},toggle:function(b0,bZ){var e=typeof b0==="boolean";if(bG.isFunction(b0)&&bG.isFunction(bZ)){return aJ.apply(this,arguments)}return this.each(function(){if(e?b0:Q(this)){bG(this).show()}else{bG(this).hide()}})}});bG.extend({cssHooks:{opacity:{get:function(b0,bZ){if(bZ){var e=F(b0,"opacity");return e===""?"1":e}}}},cssNumber:
 {fillOpacity:true,fontWeight:true,lineHeight:true,opacity:true,orphans:true,widows:true,zIndex:true,zoom:true},cssProps:{"float":bG.support.cssFloat?"cssFloat":"styleFloat"},style:function(b1,b0,b7,b2){if(!b1||b1.nodeType===3||b1.nodeType===8||!b1.style){return}var b5,b6,b8,b3=bG.camelCase(b0),bZ=b1.style;b0=bG.cssProps[b3]||(bG.cssProps[b3]=b(bZ,b3));b8=bG.cssHooks[b0]||bG.cssHooks[b3];if(b7!==aB){b6=typeof b7;if(b6==="string"&&(b5=S.exec(b7))){b7=(b5[1]+1)*b5[2]+parseFloat(bG.css(b1,b0));b6="number"}if(b7==null||b6==="number"&&isNaN(b7)){return}if(b6==="number"&&!bG.cssNumber[b3]){b7+="px"}if(!b8||!("set" in b8)||(b7=b8.set(b1,b7,b2))!==aB){try{bZ[b0]=b7}catch(b4){}}}else{if(b8&&"get" in b8&&(b5=b8.get(b1,false,b2))!==aB){return b5}return bZ[b0]}},css:function(b4,b2,b3,bZ){var b5,b1,e,b0=bG.camelCase(b2);b2=bG.cssProps[b0]||(bG.cssProps[b0]=b(b4.style,b0));e=bG.cssHooks[b2]||bG.cssHooks[b0];if(e&&"get" in e){b5=e.get(b4,true,bZ)}if(b5===aB){b5=F(b4,b2)}if(b5==="normal"&&b2 in bA){
 b5=bA[b2]}if(b3||bZ!==aB){b1=parseFloat(b5);return b3||bG.isNumeric(b1)?b1||0:b5}return b5},swap:function(b2,b1,b3){var b0,bZ,e={};for(bZ in b1){e[bZ]=b2.style[bZ];b2.style[bZ]=b1[bZ]}b0=b3.call(b2);for(bZ in b1){b2.style[bZ]=e[bZ]}return b0}});if(a2.getComputedStyle){F=function(b5,bZ){var e,b2,b1,b4,b3=getComputedStyle(b5,null),b0=b5.style;if(b3){e=b3[bZ];if(e===""&&!bG.contains(b5.ownerDocument.documentElement,b5)){e=bG.style(b5,bZ)}if(W.test(e)&&aZ.test(bZ)){b2=b0.width;b1=b0.minWidth;b4=b0.maxWidth;b0.minWidth=b0.maxWidth=b0.width=e;e=b3.width;b0.width=b2;b0.minWidth=b1;b0.maxWidth=b4}}return e}}else{if(o.documentElement.currentStyle){F=function(b2,b0){var b3,e,bZ=b2.currentStyle&&b2.currentStyle[b0],b1=b2.style;if(bZ==null&&b1&&b1[b0]){bZ=b1[b0]}if(W.test(bZ)&&!bk.test(b0)){b3=b1.left;e=b2.runtimeStyle&&b2.runtimeStyle.left;if(e){b2.runtimeStyle.left=b2.currentStyle.left}b1.left=b0==="fontSize"?"1em":bZ;bZ=b1.pixelLeft+"px";b1.left=b3;if(e){b2.runtimeStyle.left=e}}return bZ==="
 "?"auto":bZ}}}function aG(e,b0,b1){var bZ=a8.exec(b0);return bZ?Math.max(0,bZ[1]-(b1||0))+(bZ[2]||"px"):b0}function at(b1,bZ,e,b3){var b0=e===(b3?"border":"content")?4:bZ==="width"?1:0,b2=0;for(;b0<4;b0+=2){if(e==="margin"){b2+=bG.css(b1,e+bQ[b0],true)}if(b3){if(e==="content"){b2-=parseFloat(F(b1,"padding"+bQ[b0]))||0}if(e!=="margin"){b2-=parseFloat(F(b1,"border"+bQ[b0]+"Width"))||0}}else{b2+=parseFloat(F(b1,"padding"+bQ[b0]))||0;if(e!=="padding"){b2+=parseFloat(F(b1,"border"+bQ[b0]+"Width"))||0}}}return b2}function v(b1,bZ,e){var b2=bZ==="width"?b1.offsetWidth:b1.offsetHeight,b0=true,b3=bG.support.boxSizing&&bG.css(b1,"boxSizing")==="border-box";if(b2<=0){b2=F(b1,bZ);if(b2<0||b2==null){b2=b1.style[bZ]}if(W.test(b2)){return b2}b0=b3&&(bG.support.boxSizingReliable||b2===b1.style[bZ]);b2=parseFloat(b2)||0}return(b2+at(b1,bZ,e||(b3?"border":"content"),b0))+"px"}function bC(b0){if(bh[b0]){return bh[b0]}var e=bG("<"+b0+">").appendTo(o.body),bZ=e.css("display");e.remove();if(bZ==="none"||
 bZ===""){az=o.body.appendChild(az||bG.extend(o.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!aW||!az.createElement){aW=(az.contentWindow||az.contentDocument).document;aW.write("<!doctype html><html><body>");aW.close()}e=aW.body.appendChild(aW.createElement(b0));bZ=F(e,"display");o.body.removeChild(az)}bh[b0]=bZ;return bZ}bG.each(["height","width"],function(bZ,e){bG.cssHooks[e]={get:function(b2,b1,b0){if(b1){if(b2.offsetWidth!==0||F(b2,"display")!=="none"){return v(b2,e,b0)}else{return bG.swap(b2,a9,function(){return v(b2,e,b0)})}}},set:function(b1,b2,b0){return aG(b1,b2,b0?at(b1,e,b0,bG.support.boxSizing&&bG.css(b1,"boxSizing")==="border-box"):0)}}});if(!bG.support.opacity){bG.cssHooks.opacity={get:function(bZ,e){return aS.test((e&&bZ.currentStyle?bZ.currentStyle.filter:bZ.style.filter)||"")?(0.01*parseFloat(RegExp.$1))+"":e?"1":""},set:function(b2,b3){var b1=b2.style,bZ=b2.currentStyle,e=bG.isNumeric(b3)?"alpha(opacity="+b3*100+")":"",b0=bZ&&bZ.filter||b1.filter||"
 ";b1.zoom=1;if(b3>=1&&bG.trim(b0.replace(be,""))===""&&b1.removeAttribute){b1.removeAttribute("filter");if(bZ&&!bZ.filter){return}}b1.filter=be.test(b0)?b0.replace(be,e):b0+" "+e}}}bG(function(){if(!bG.support.reliableMarginRight){bG.cssHooks.marginRight={get:function(bZ,e){return bG.swap(bZ,{display:"inline-block"},function(){if(e){return F(bZ,"marginRight")}})}}}if(!bG.support.pixelPosition&&bG.fn.position){bG.each(["top","left"],function(e,bZ){bG.cssHooks[bZ]={get:function(b2,b1){if(b1){var b0=F(b2,bZ);return W.test(b0)?bG(b2).position()[bZ]+"px":b0}}}})}});if(bG.expr&&bG.expr.filters){bG.expr.filters.hidden=function(e){return(e.offsetWidth===0&&e.offsetHeight===0)||(!bG.support.reliableHiddenOffsets&&((e.style&&e.style.display)||F(e,"display"))==="none")};bG.expr.filters.visible=function(e){return !bG.expr.filters.hidden(e)}}bG.each({margin:"",padding:"",border:"Width"},function(e,bZ){bG.cssHooks[e+bZ]={expand:function(b2){var b1,b3=typeof b2==="string"?b2.split(" "):[b2],b0={};
 for(b1=0;b1<4;b1++){b0[e+bQ[b1]+bZ]=b3[b1]||b3[b1-2]||b3[0]}return b0}};if(!aZ.test(e)){bG.cssHooks[e+bZ].set=aG}});var bs=/%20/g,aP=/\[\]$/,U=/\r?\n/g,bz=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,aD=/^(?:select|textarea)/i;bG.fn.extend({serialize:function(){return bG.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?bG.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||aD.test(this.nodeName)||bz.test(this.type))}).map(function(e,bZ){var b0=bG(this).val();return b0==null?null:bG.isArray(b0)?bG.map(b0,function(b2,b1){return{name:bZ.name,value:b2.replace(U,"\r\n")}}):{name:bZ.name,value:b0.replace(U,"\r\n")}}).get()}});bG.param=function(e,b0){var b1,bZ=[],b2=function(b3,b4){b4=bG.isFunction(b4)?b4():(b4==null?"":b4);bZ[bZ.length]=encodeURIComponent(b3)+"="+encodeURIComponent(b4)};if(b0===aB){b0=bG.ajaxSettings&&b
 G.ajaxSettings.traditional}if(bG.isArray(e)||(e.jquery&&!bG.isPlainObject(e))){bG.each(e,function(){b2(this.name,this.value)})}else{for(b1 in e){k(b1,e[b1],b0,b2)}}return bZ.join("&").replace(bs,"+")};function k(b0,b2,bZ,b1){var e;if(bG.isArray(b2)){bG.each(b2,function(b4,b3){if(bZ||aP.test(b0)){b1(b0,b3)}else{k(b0+"["+(typeof b3==="object"?b4:"")+"]",b3,bZ,b1)}})}else{if(!bZ&&bG.type(b2)==="object"){for(e in b2){k(b0+"["+e+"]",b2[e],bZ,b1)}}else{b1(b0,b2)}}}var Y,bX,an=/#.*$/,ad=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,C=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,s=/^(?:GET|HEAD)$/,aC=/^\/\//,bN=/\?/,g=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,P=/([?&])_=[^&]*/,aT=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,bW=bG.fn.load,w={},a6={},aX=["*/"]+["*"];try{Y=aI.href}catch(bd){Y=o.createElement("a");Y.href="";Y=Y.href}bX=aT.exec(Y.toLowerCase())||[];function bI(e){return function(b2,b4){if(typeof b2!=="string"){b4=b2;b2="*"}var bZ,b5,b6,b1=b2.toLowerCase().spli
 t(aV),b0=0,b3=b1.length;if(bG.isFunction(b4)){for(;b0<b3;b0++){bZ=b1[b0];b6=/^\+/.test(bZ);if(b6){bZ=bZ.substr(1)||"*"}b5=e[bZ]=e[bZ]||[];b5[b6?"unshift":"push"](b4)}}}}function r(bZ,b8,b3,b6,b5,b1){b5=b5||b8.dataTypes[0];b1=b1||{};b1[b5]=true;var b7,b4=bZ[b5],b0=0,e=b4?b4.length:0,b2=(bZ===w);for(;b0<e&&(b2||!b7);b0++){b7=b4[b0](b8,b3,b6);if(typeof b7==="string"){if(!b2||b1[b7]){b7=aB}else{b8.dataTypes.unshift(b7);b7=r(bZ,b8,b3,b6,b7,b1)}}}if((b2||!b7)&&!b1["*"]){b7=r(bZ,b8,b3,b6,"*",b1)}return b7}function u(b0,b1){var bZ,e,b2=bG.ajaxSettings.flatOptions||{};for(bZ in b1){if(b1[bZ]!==aB){(b2[bZ]?b0:(e||(e={})))[bZ]=b1[bZ]}}if(e){bG.extend(true,b0,e)}}bG.fn.load=function(b1,b4,b5){if(typeof b1!=="string"&&bW){return bW.apply(this,arguments)}if(!this.length){return this}var e,b2,b0,bZ=this,b3=b1.indexOf(" ");if(b3>=0){e=b1.slice(b3,b1.length);b1=b1.slice(0,b3)}if(bG.isFunction(b4)){b5=b4;b4=aB}else{if(typeof b4==="object"){b2="POST"}}bG.ajax({url:b1,type:b2,dataType:"html",data:b4,co
 mplete:function(b7,b6){if(b5){bZ.each(b5,b0||[b7.responseText,b6,b7])}}}).done(function(b6){b0=arguments;bZ.html(e?bG("<div>").append(b6.replace(g,"")).find(e):b6)});return this};bG.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,bZ){bG.fn[bZ]=function(b0){return this.on(bZ,b0)}});bG.each(["get","post"],function(e,bZ){bG[bZ]=function(b0,b2,b3,b1){if(bG.isFunction(b2)){b1=b1||b3;b3=b2;b2=aB}return bG.ajax({type:bZ,url:b0,data:b2,success:b3,dataType:b1})}});bG.extend({getScript:function(e,bZ){return bG.get(e,aB,bZ,"script")},getJSON:function(e,bZ,b0){return bG.get(e,bZ,b0,"json")},ajaxSetup:function(bZ,e){if(e){u(bZ,bG.ajaxSettings)}else{e=bZ;bZ=bG.ajaxSettings}u(bZ,e);return bZ},ajaxSettings:{url:Y,isLocal:C.test(bX[1]),global:true,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:true,async:true,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javas
 cript","*":aX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a2.String,"text html":true,"text json":bG.parseJSON,"text xml":bG.parseXML},flatOptions:{context:true,url:true}},ajaxPrefilter:bI(w),ajaxTransport:bI(a6),ajax:function(b4,b1){if(typeof b4==="object"){b1=b4;b4=aB}b1=b1||{};var b7,cl,b2,cg,b9,cd,b0,cf,b8=bG.ajaxSetup({},b1),cn=b8.context||b8,cb=cn!==b8&&(cn.nodeType||cn instanceof bG)?bG(cn):bG.event,cm=bG.Deferred(),ci=bG.Callbacks("once memory"),b5=b8.statusCode||{},cc={},cj={},b3=0,b6="canceled",ce={readyState:0,setRequestHeader:function(co,cp){if(!b3){var e=co.toLowerCase();co=cj[e]=cj[e]||co;cc[co]=cp}return this},getAllResponseHeaders:function(){return b3===2?cl:null},getResponseHeader:function(co){var e;if(b3===2){if(!b2){b2={};while((e=ad.exec(cl))){b2[e[1].toLowerCase()]=e[2]}}e=b2[co.toLowerCase()]}return e===aB?null:e},overrideMimeType:function(e){if(!b3){b8.mimeType=e}return this},abort:fu
 nction(e){e=e||b6;if(cg){cg.abort(e)}ca(0,e);return this}};function ca(cs,co,ct,cq){var e,cw,cu,cr,cv,cp=co;if(b3===2){return}b3=2;if(b9){clearTimeout(b9)}cg=aB;cl=cq||"";ce.readyState=cs>0?4:0;if(ct){cr=h(b8,ce,ct)}if(cs>=200&&cs<300||cs===304){if(b8.ifModified){cv=ce.getResponseHeader("Last-Modified");if(cv){bG.lastModified[b7]=cv}cv=ce.getResponseHeader("Etag");if(cv){bG.etag[b7]=cv}}if(cs===304){cp="notmodified";e=true}else{e=ae(b8,cr);cp=e.state;cw=e.data;cu=e.error;e=!cu}}else{cu=cp;if(!cp||cs){cp="error";if(cs<0){cs=0}}}ce.status=cs;ce.statusText=""+(co||cp);if(e){cm.resolveWith(cn,[cw,cp,ce])}else{cm.rejectWith(cn,[ce,cp,cu])}ce.statusCode(b5);b5=aB;if(b0){cb.trigger("ajax"+(e?"Success":"Error"),[ce,b8,e?cw:cu])}ci.fireWith(cn,[ce,cp]);if(b0){cb.trigger("ajaxComplete",[ce,b8]);if(!(--bG.active)){bG.event.trigger("ajaxStop")}}}cm.promise(ce);ce.success=ce.done;ce.error=ce.fail;ce.complete=ci.add;ce.statusCode=function(co){if(co){var e;if(b3<2){for(e in co){b5[e]=[b5[e],co[e]]
 }}else{e=co[ce.status];ce.always(e)}}return this};b8.url=((b4||b8.url)+"").replace(an,"").replace(aC,bX[1]+"//");b8.dataTypes=bG.trim(b8.dataType||"*").toLowerCase().split(aV);if(b8.crossDomain==null){cd=aT.exec(b8.url.toLowerCase());b8.crossDomain=!!(cd&&(cd[1]!=bX[1]||cd[2]!=bX[2]||(cd[3]||(cd[1]==="http:"?80:443))!=(bX[3]||(bX[1]==="http:"?80:443))))}if(b8.data&&b8.processData&&typeof b8.data!=="string"){b8.data=bG.param(b8.data,b8.traditional)}r(w,b8,b1,ce);if(b3===2){return ce}b0=b8.global;b8.type=b8.type.toUpperCase();b8.hasContent=!s.test(b8.type);if(b0&&bG.active++===0){bG.event.trigger("ajaxStart")}if(!b8.hasContent){if(b8.data){b8.url+=(bN.test(b8.url)?"&":"?")+b8.data;delete b8.data}b7=b8.url;if(b8.cache===false){var bZ=bG.now(),ck=b8.url.replace(P,"$1_="+bZ);b8.url=ck+((ck===b8.url)?(bN.test(b8.url)?"&":"?")+"_="+bZ:"")}}if(b8.data&&b8.hasContent&&b8.contentType!==false||b1.contentType){ce.setRequestHeader("Content-Type",b8.contentType)}if(b8.ifModified){b7=b7||b8.url;if
 (bG.lastModified[b7]){ce.setRequestHeader("If-Modified-Since",bG.lastModified[b7])}if(bG.etag[b7]){ce.setRequestHeader("If-None-Match",bG.etag[b7])}}ce.setRequestHeader("Accept",b8.dataTypes[0]&&b8.accepts[b8.dataTypes[0]]?b8.accepts[b8.dataTypes[0]]+(b8.dataTypes[0]!=="*"?", "+aX+"; q=0.01":""):b8.accepts["*"]);for(cf in b8.headers){ce.setRequestHeader(cf,b8.headers[cf])}if(b8.beforeSend&&(b8.beforeSend.call(cn,ce,b8)===false||b3===2)){return ce.abort()}b6="abort";for(cf in {success:1,error:1,complete:1}){ce[cf](b8[cf])}cg=r(a6,b8,b1,ce);if(!cg){ca(-1,"No Transport")}else{ce.readyState=1;if(b0){cb.trigger("ajaxSend",[ce,b8])}if(b8.async&&b8.timeout>0){b9=setTimeout(function(){ce.abort("timeout")},b8.timeout)}try{b3=1;cg.send(cc,ca)}catch(ch){if(b3<2){ca(-1,ch)}else{throw ch}}}return ce},active:0,lastModified:{},etag:{}});function h(b7,b6,b3){var b2,b4,b1,e,bZ=b7.contents,b5=b7.dataTypes,b0=b7.responseFields;for(b4 in b0){if(b4 in b3){b6[b0[b4]]=b3[b4]}}while(b5[0]==="*"){b5.shift()
 ;if(b2===aB){b2=b7.mimeType||b6.getResponseHeader("content-type")}}if(b2){for(b4 in bZ){if(bZ[b4]&&bZ[b4].test(b2)){b5.unshift(b4);break}}}if(b5[0] in b3){b1=b5[0]}else{for(b4 in b3){if(!b5[0]||b7.converters[b4+" "+b5[0]]){b1=b4;break}if(!e){e=b4}}b1=b1||e}if(b1){if(b1!==b5[0]){b5.unshift(b1)}return b3[b1]}}function ae(b9,b1){var b7,bZ,b5,b3,b6=b9.dataTypes.slice(),b0=b6[0],b8={},b2=0;if(b9.dataFilter){b1=b9.dataFilter(b1,b9.dataType)}if(b6[1]){for(b7 in b9.converters){b8[b7.toLowerCase()]=b9.converters[b7]}}for(;(b5=b6[++b2]);){if(b5!=="*"){if(b0!=="*"&&b0!==b5){b7=b8[b0+" "+b5]||b8["* "+b5];if(!b7){for(bZ in b8){b3=bZ.split(" ");if(b3[1]===b5){b7=b8[b0+" "+b3[0]]||b8["* "+b3[0]];if(b7){if

<TRUNCATED>


[07/13] incubator-asterixdb-site git commit: Initial commit with Till's changes

Posted by im...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/aql/primer.html
----------------------------------------------------------------------
diff --git a/aql/primer.html b/aql/primer.html
new file mode 100644
index 0000000..47245e7
--- /dev/null
+++ b/aql/primer.html
@@ -0,0 +1,842 @@
+<!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 class="active">
+    
+            <a href="#"><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>
+    
+                          <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 101: An ADM and AQL Primer</h1>
+<div class="section">
+<h2>Welcome to AsterixDB!<a name="Welcome_to_AsterixDB"></a></h2>
+<p>This document introduces the main features of AsterixDB&#x2019;s data model (ADM) and query language (AQL) by example. The example is a simple scenario involving (synthetic) sample data modeled after data from the social domain. This document describes a set of sample ADM datasets, together with a set of illustrative AQL queries, to introduce you to the &#x201c;AsterixDB user experience&#x201d;. The complete set of steps required to create and load a handful of sample datasets, along with runnable queries and the expected results for each query, are included.</p>
+<p>This document assumes that you are at least vaguely familiar with AsterixDB and why you might want to use it. Most importantly, it assumes you already have a running instance of AsterixDB and that you know how to query it using AsterixDB&#x2019;s basic web interface. For more information on these topics, you should go through the steps in <a href="../install.html">Installing Asterix Using Managix</a> before reading this document and make sure that you have a running AsterixDB instance ready to go. To get your feet wet, you should probably start with a simple local installation of AsterixDB on your favorite machine, accepting all of the default settings that Managix offers. Later you can graduate to trying AsterixDB on a cluster, its real intended home (since it targets Big Data). (Note: With the exception of specifying the correct locations where you put the source data for this example, there should no changes needed in your ADM or AQL statements to run the examples locally and/
 or to run them on a cluster when you are ready to take that step.)</p>
+<p>As you read through this document, you should try each step for yourself on your own AsterixDB instance. Once you have reached the end, you will be fully armed and dangerous, with all the basic AsterixDB knowledge that you&#x2019;ll need to start down the path of modeling, storing, and querying your own semistructured data.</p>
+<p>&#x2014;-</p></div>
+<div class="section">
+<h2>ADM: Modeling Semistructed Data in AsterixDB<a name="ADM:_Modeling_Semistructed_Data_in_AsterixDB"></a></h2>
+<p>In this section you will learn all about modeling Big Data using ADM, the data model of the AsterixDB BDMS.</p>
+<div class="section">
+<h3>Dataverses, Datatypes, and Datasets<a name="Dataverses_Datatypes_and_Datasets"></a></h3>
+<p>The top-level organizing concept in the AsterixDB world is the <i>dataverse</i>. A dataverse&#x2014;short for &#x201c;data universe&#x201d;&#x2014;is a place (similar to a database in a relational DBMS) in which to create and manage the types, datasets, functions, and other artifacts for a given AsterixDB application. When you start using an AsterixDB instance for the first time, it starts out &#x201c;empty&#x201d;; it contains no data other than the AsterixDB system catalogs (which live in a special dataverse called the Metadata dataverse). To store your data in AsterixDB, you will first create a dataverse and then you use it for the <i>datatypes</i> and <i>datasets</i> for managing your own data. A datatype tells AsterixDB what you know (or more accurately, what you want it to know) a priori about one of the kinds of data instances that you want AsterixDB to hold for you. A dataset is a collection of data instances of a datatype, and AsterixDB makes sure that the data instances
  that you put in it conform to its specified type. Since AsterixDB targets semistructured data, you can use <i>open</i> datatypes and tell it as little or as much as you wish about your data up front; the more you tell it up front, the less information it will have to store repeatedly in the individual data instances that you give it. Instances of open datatypes are permitted to have additional content, beyond what the datatype says, as long as they at least contain the information prescribed by the datatype definition. Open typing allows data to vary from one instance to another and it leaves wiggle room for application evolution in terms of what might need to be stored in the future. If you want to restrict data instances in a dataset to have only what the datatype says, and nothing extra, you can define a <i>closed</i> datatype for that dataset and AsterixDB will keep users from storing objects that have extra data in them. Datatypes are open by default unless you tell AsterixDB 
 otherwise. Let&#x2019;s put these concepts to work</p>
+<p>Our little sample scenario involves hypothetical information about users of two popular social networks, Facebook and Twitter, and their messages. We&#x2019;ll start by defining a dataverse called &#x201c;TinySocial&#x201d; to hold our datatypes and datasets. The AsterixDB data model (ADM) is essentially a superset of JSON&#x2014;it&#x2019;s what you get by extending JSON with more data types and additional data modeling constructs borrowed from object databases. The following is how we can create the TinySocial dataverse plus a set of ADM types for modeling Twitter users, their Tweets, Facebook users, their users&#x2019; employment information, and their messages. (Note: Keep in mind that this is just a tiny and somewhat silly example intended for illustrating some of the key features of AsterixDB. :-))</p>
+
+<div class="source">
+<pre>    drop dataverse TinySocial if exists;
+    create dataverse TinySocial;
+    use dataverse TinySocial;
+
+    create type TwitterUserType as open {
+        screen-name: string,
+        lang: string,
+        friends_count: int64,
+        statuses_count: int64,
+        name: string,
+        followers_count: int64
+    }
+
+    create type TweetMessageType as closed {
+        tweetid: string,
+        user: TwitterUserType,
+        sender-location: point?,
+        send-time: datetime,
+        referred-topics: {{ string }},
+        message-text: string
+    }
+
+    create type EmploymentType as open {
+        organization-name: string,
+        start-date: date,
+        end-date: date?
+    }
+
+    create type FacebookUserType as closed {
+        id: int64,
+        alias: string,
+        name: string,
+        user-since: datetime,
+        friend-ids: {{ int64 }},
+        employment: [EmploymentType]
+    }
+
+    create type FacebookMessageType as closed {
+        message-id: int64,
+        author-id: int64,
+        in-response-to: int64?,
+        sender-location: point?,
+        message: string
+    }
+</pre></div>
+<p>The first three lines above tell AsterixDB to drop the old TinySocial dataverse, if one already exists, and then to create a brand new one and make it the focus of the statements that follow. The first type creation statement creates a datatype for holding information about Twitter users. It is a record type with a mix of integer and string data, very much like a (flat) relational tuple. The indicated fields are all mandatory, but because the type is open, additional fields are welcome. The second statement creates a datatype for Twitter messages; this shows how to specify a closed type. Interestingly (based on one of Twitter&#x2019;s APIs), each Twitter message actually embeds an instance of the sending user&#x2019;s information (current as of when the message was sent), so this is an example of a nested record in ADM. Twitter messages can optionally contain the sender&#x2019;s location, which is modeled via the sender-location field of spatial type <i>point</i>; the question ma
 rk following the field type indicates its optionality. An optional field is like a nullable field in SQL&#x2014;it may be present or missing, but when it&#x2019;s present, its data type will conform to the datatype&#x2019;s specification. The send-time field illustrates the use of a temporal primitive type, <i>datetime</i>. Lastly, the referred-topics field illustrates another way that ADM is richer than the relational model; this field holds a bag (a.k.a. an unordered list) of strings. Since the overall datatype definition for Twitter messages says &#x201c;closed&#x201d;, the fields that it lists are the only fields that instances of this type will be allowed to contain. The next two create type statements create a record type for holding information about one component of the employment history of a Facebook user and then a record type for holding the user information itself. The Facebook user type highlights a few additional ADM data model features. Its friend-ids field is a bag 
 of integers, presumably the Facebook user ids for this user&#x2019;s friends, and its employment field is an ordered list of employment records. The final create type statement defines a type for handling the content of a Facebook message in our hypothetical social data storage scenario.</p>
+<p>Before going on, we need to once again emphasize the idea that AsterixDB is aimed at storing and querying not just Big Data, but Big <i>Semistructured</i> Data. This means that most of the fields listed in the create type statements above could have been omitted without changing anything other than the resulting size of stored data instances on disk. AsterixDB stores its information about the fields defined a priori as separate metadata, whereas the information about other fields that are &#x201c;just there&#x201d; in instances of open datatypes is stored with each instance&#x2014;making for more bits on disk and longer times for operations affected by data size (e.g., dataset scans). The only fields that <i>must</i> be specified a priori are the primary key. (AsterixDB does not yet support auto-generated keys). Indexes could be build on fields, which don&#x2019;t belong to fixed part of datatype&#x2019;s schema, as long as field&#x2019;s type is specified and <i>enforced</i> key
 word is provided in the end of index definition. Index fields could also be nested arbitrarily deep in datatype definition.</p></div>
+<div class="section">
+<h3>Creating Datasets and Indexes<a name="Creating_Datasets_and_Indexes"></a></h3>
+<p>Now that we have defined our datatypes, we can move on and create datasets to store the actual data. (If we wanted to, we could even have several named datasets based on any one of these datatypes.) We can do this as follows, utilizing the DDL capabilities of AsterixDB.</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    create dataset FacebookUsers(FacebookUserType)
+    primary key id;
+
+    create dataset FacebookMessages(FacebookMessageType)
+    primary key message-id;
+
+    create dataset TwitterUsers(TwitterUserType)
+    primary key screen-name;
+
+    create dataset TweetMessages(TweetMessageType)
+    primary key tweetid
+    hints(cardinality=100);
+
+    create index fbUserSinceIdx on FacebookUsers(user-since);
+    create index fbAuthorIdx on FacebookMessages(author-id) type btree;
+    create index fbSenderLocIndex on FacebookMessages(sender-location) type rtree;
+    create index fbMessageIdx on FacebookMessages(message) type keyword;
+
+    for $ds in dataset Metadata.Dataset return $ds;
+    for $ix in dataset Metadata.Index return $ix;
+</pre></div>
+<p>The ADM DDL statements above create four datasets for holding our social data in the TinySocial dataverse: FacebookUsers, FacebookMessages, TwitterUsers, and TweetMessages. The first statement creates the FacebookUsers data set. It specifies that this dataset will store data instances conforming to FacebookUserType and that it has a primary key which is the id field of each instance. The primary key information is used by AsterixDB to uniquely identify instances for the purpose of later lookup and for use in secondary indexes. Each AsterixDB dataset is stored (and indexed) in the form of a B+ tree on primary key; secondary indexes point to their indexed data by primary key. In AsterixDB clusters, the primary key is also used to hash-partition (a.k.a. shard) the dataset across the nodes of the cluster. The next three create dataset statements are similar. The last one illustrates an optional clause for providing useful hints to AsterixDB. In this case, the hint tells AsterixDB tha
 t the dataset definer is anticipating that the TweetMessages dataset will contain roughly 100 objects; knowing this can help AsterixDB to more efficiently manage and query this dataset. (AsterixDB does not yet gather and maintain data statistics; it will currently, abitrarily, assume a cardinality of one million objects per dataset in the absence of such an optional definition-time hint.)</p>
+<p>The create dataset statements above are followed by four more DDL statements, each of which creates a secondary index on a field of one of the datasets. The first one indexes the FacebookUsers dataset on its user-since field. This index will be a B+ tree index; its type is unspecified and <i>btree</i> is the default type. The other three illustrate how you can explicitly specify the desired type of index. In addition to btree, <i>rtree</i> and inverted <i>keyword</i> indexes are supported by AsterixDB. Indexes can also have composite keys, and more advanced text indexing is available as well (ngram(k), where k is the desired gram length).</p></div>
+<div class="section">
+<h3>Querying the Metadata Dataverse<a name="Querying_the_Metadata_Dataverse"></a></h3>
+<p>The last two statements above show how you can use queries in AQL to examine the AsterixDB system catalogs and tell what artifacts you have created. Just as relational DBMSs use their own tables to store their catalogs, AsterixDB uses its own datasets to persist descriptions of its datasets, datatypes, indexes, and so on. Running the first of the two queries above will list all of your newly created datasets, and it will also show you a full list of all the metadata datasets. (You can then explore from there on your own if you are curious) These last two queries also illustrate one other factoid worth knowing: AsterixDB allows queries to span dataverses by allowing the optional use of fully-qualified dataset names (i.e., <i>dataversename.datasetname</i>) to reference datasets that live in a dataverse other than the one that was named in the most recently executed <i>use dataverse</i> directive.</p>
+<p>&#x2014;-</p></div></div>
+<div class="section">
+<h2>Loading Data Into AsterixDB<a name="Loading_Data_Into_AsterixDB"></a></h2>
+<p>Okay, so far so good&#x2014;AsterixDB is now ready for data, so let&#x2019;s give it some data to store Our next task will be to load some sample data into the four datasets that we just defined. Here we will load a tiny set of records, defined in ADM format (a superset of JSON), into each dataset. In the boxes below you can see the actual data instances contained in each of the provided sample files. In order to load this data yourself, you should first store the four corresponding <tt>.adm</tt> files (whose URLs are indicated on top of each box below) into a filesystem directory accessible to your running AsterixDB instance. Take a few minutes to look carefully at each of the sample data sets. This will give you a better sense of the nature of the data that we are about to load and query. We should note that ADM format is a textual serialization of what AsterixDB will actually store; when persisted in AsterixDB, the data format will be binary and the data in the predefined fiel
 ds of the data instances will be stored separately from their associated field name and type metadata.</p>
+<p><a class="externalLink" href="http://asterixdb.googlecode.com/files/twu.adm">Twitter Users</a></p>
+
+<div class="source">
+<pre>    {&quot;screen-name&quot;:&quot;NathanGiesen@211&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:18,&quot;statuses_count&quot;:473,&quot;name&quot;:&quot;Nathan Giesen&quot;,&quot;followers_count&quot;:49416}
+    {&quot;screen-name&quot;:&quot;ColineGeyer@63&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:121,&quot;statuses_count&quot;:362,&quot;name&quot;:&quot;Coline Geyer&quot;,&quot;followers_count&quot;:17159}
+    {&quot;screen-name&quot;:&quot;NilaMilliron_tw&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:445,&quot;statuses_count&quot;:164,&quot;name&quot;:&quot;Nila Milliron&quot;,&quot;followers_count&quot;:22649}
+    {&quot;screen-name&quot;:&quot;ChangEwing_573&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:182,&quot;statuses_count&quot;:394,&quot;name&quot;:&quot;Chang Ewing&quot;,&quot;followers_count&quot;:32136}
+</pre></div>
+<p><a class="externalLink" href="http://asterixdb.googlecode.com/files/twm.adm">Tweet Messages</a></p>
+
+<div class="source">
+<pre>    {&quot;tweetid&quot;:&quot;1&quot;,&quot;user&quot;:{&quot;screen-name&quot;:&quot;NathanGiesen@211&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:39339,&quot;statuses_count&quot;:473,&quot;name&quot;:&quot;Nathan Giesen&quot;,&quot;followers_count&quot;:49416},&quot;sender-location&quot;:point(&quot;47.44,80.65&quot;),&quot;send-time&quot;:datetime(&quot;2008-04-26T10:10:00&quot;),&quot;referred-topics&quot;:{{&quot;t-mobile&quot;,&quot;customization&quot;}},&quot;message-text&quot;:&quot; love t-mobile its customization is good:)&quot;}
+    {&quot;tweetid&quot;:&quot;2&quot;,&quot;user&quot;:{&quot;screen-name&quot;:&quot;ColineGeyer@63&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:121,&quot;statuses_count&quot;:362,&quot;name&quot;:&quot;Coline Geyer&quot;,&quot;followers_count&quot;:17159},&quot;sender-location&quot;:point(&quot;32.84,67.14&quot;),&quot;send-time&quot;:datetime(&quot;2010-05-13T10:10:00&quot;),&quot;referred-topics&quot;:{{&quot;verizon&quot;,&quot;shortcut-menu&quot;}},&quot;message-text&quot;:&quot; like verizon its shortcut-menu is awesome:)&quot;}
+    {&quot;tweetid&quot;:&quot;3&quot;,&quot;user&quot;:{&quot;screen-name&quot;:&quot;NathanGiesen@211&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:39339,&quot;statuses_count&quot;:473,&quot;name&quot;:&quot;Nathan Giesen&quot;,&quot;followers_count&quot;:49416},&quot;sender-location&quot;:point(&quot;29.72,75.8&quot;),&quot;send-time&quot;:datetime(&quot;2006-11-04T10:10:00&quot;),&quot;referred-topics&quot;:{{&quot;motorola&quot;,&quot;speed&quot;}},&quot;message-text&quot;:&quot; like motorola the speed is good:)&quot;}
+    {&quot;tweetid&quot;:&quot;4&quot;,&quot;user&quot;:{&quot;screen-name&quot;:&quot;NathanGiesen@211&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:39339,&quot;statuses_count&quot;:473,&quot;name&quot;:&quot;Nathan Giesen&quot;,&quot;followers_count&quot;:49416},&quot;sender-location&quot;:point(&quot;39.28,70.48&quot;),&quot;send-time&quot;:datetime(&quot;2011-12-26T10:10:00&quot;),&quot;referred-topics&quot;:{{&quot;sprint&quot;,&quot;voice-command&quot;}},&quot;message-text&quot;:&quot; like sprint the voice-command is mind-blowing:)&quot;}
+    {&quot;tweetid&quot;:&quot;5&quot;,&quot;user&quot;:{&quot;screen-name&quot;:&quot;NathanGiesen@211&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:39339,&quot;statuses_count&quot;:473,&quot;name&quot;:&quot;Nathan Giesen&quot;,&quot;followers_count&quot;:49416},&quot;sender-location&quot;:point(&quot;40.09,92.69&quot;),&quot;send-time&quot;:datetime(&quot;2006-08-04T10:10:00&quot;),&quot;referred-topics&quot;:{{&quot;motorola&quot;,&quot;speed&quot;}},&quot;message-text&quot;:&quot; can't stand motorola its speed is terrible:(&quot;}
+    {&quot;tweetid&quot;:&quot;6&quot;,&quot;user&quot;:{&quot;screen-name&quot;:&quot;ColineGeyer@63&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:121,&quot;statuses_count&quot;:362,&quot;name&quot;:&quot;Coline Geyer&quot;,&quot;followers_count&quot;:17159},&quot;sender-location&quot;:point(&quot;47.51,83.99&quot;),&quot;send-time&quot;:datetime(&quot;2010-05-07T10:10:00&quot;),&quot;referred-topics&quot;:{{&quot;iphone&quot;,&quot;voice-clarity&quot;}},&quot;message-text&quot;:&quot; like iphone the voice-clarity is good:)&quot;}
+    {&quot;tweetid&quot;:&quot;7&quot;,&quot;user&quot;:{&quot;screen-name&quot;:&quot;ChangEwing_573&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:182,&quot;statuses_count&quot;:394,&quot;name&quot;:&quot;Chang Ewing&quot;,&quot;followers_count&quot;:32136},&quot;sender-location&quot;:point(&quot;36.21,72.6&quot;),&quot;send-time&quot;:datetime(&quot;2011-08-25T10:10:00&quot;),&quot;referred-topics&quot;:{{&quot;samsung&quot;,&quot;platform&quot;}},&quot;message-text&quot;:&quot; like samsung the platform is good&quot;}
+    {&quot;tweetid&quot;:&quot;8&quot;,&quot;user&quot;:{&quot;screen-name&quot;:&quot;NathanGiesen@211&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:39339,&quot;statuses_count&quot;:473,&quot;name&quot;:&quot;Nathan Giesen&quot;,&quot;followers_count&quot;:49416},&quot;sender-location&quot;:point(&quot;46.05,93.34&quot;),&quot;send-time&quot;:datetime(&quot;2005-10-14T10:10:00&quot;),&quot;referred-topics&quot;:{{&quot;t-mobile&quot;,&quot;shortcut-menu&quot;}},&quot;message-text&quot;:&quot; like t-mobile the shortcut-menu is awesome:)&quot;}
+    {&quot;tweetid&quot;:&quot;9&quot;,&quot;user&quot;:{&quot;screen-name&quot;:&quot;NathanGiesen@211&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:39339,&quot;statuses_count&quot;:473,&quot;name&quot;:&quot;Nathan Giesen&quot;,&quot;followers_count&quot;:49416},&quot;sender-location&quot;:point(&quot;36.86,74.62&quot;),&quot;send-time&quot;:datetime(&quot;2012-07-21T10:10:00&quot;),&quot;referred-topics&quot;:{{&quot;verizon&quot;,&quot;voicemail-service&quot;}},&quot;message-text&quot;:&quot; love verizon its voicemail-service is awesome&quot;}
+    {&quot;tweetid&quot;:&quot;10&quot;,&quot;user&quot;:{&quot;screen-name&quot;:&quot;ColineGeyer@63&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:121,&quot;statuses_count&quot;:362,&quot;name&quot;:&quot;Coline Geyer&quot;,&quot;followers_count&quot;:17159},&quot;sender-location&quot;:point(&quot;29.15,76.53&quot;),&quot;send-time&quot;:datetime(&quot;2008-01-26T10:10:00&quot;),&quot;referred-topics&quot;:{{&quot;verizon&quot;,&quot;voice-clarity&quot;}},&quot;message-text&quot;:&quot; hate verizon its voice-clarity is OMG:(&quot;}
+    {&quot;tweetid&quot;:&quot;11&quot;,&quot;user&quot;:{&quot;screen-name&quot;:&quot;NilaMilliron_tw&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:445,&quot;statuses_count&quot;:164,&quot;name&quot;:&quot;Nila Milliron&quot;,&quot;followers_count&quot;:22649},&quot;sender-location&quot;:point(&quot;37.59,68.42&quot;),&quot;send-time&quot;:datetime(&quot;2008-03-09T10:10:00&quot;),&quot;referred-topics&quot;:{{&quot;iphone&quot;,&quot;platform&quot;}},&quot;message-text&quot;:&quot; can't stand iphone its platform is terrible&quot;}
+    {&quot;tweetid&quot;:&quot;12&quot;,&quot;user&quot;:{&quot;screen-name&quot;:&quot;OliJackson_512&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:445,&quot;statuses_count&quot;:164,&quot;name&quot;:&quot;Oli Jackson&quot;,&quot;followers_count&quot;:22649},&quot;sender-location&quot;:point(&quot;24.82,94.63&quot;),&quot;send-time&quot;:datetime(&quot;2010-02-13T10:10:00&quot;),&quot;referred-topics&quot;:{{&quot;samsung&quot;,&quot;voice-command&quot;}},&quot;message-text&quot;:&quot; like samsung the voice-command is amazing:)&quot;}
+</pre></div>
+<p><a class="externalLink" href="http://asterixdb.googlecode.com/files/fbu.adm">Facebook Users</a></p>
+
+<div class="source">
+<pre>    {&quot;id&quot;:1,&quot;alias&quot;:&quot;Margarita&quot;,&quot;name&quot;:&quot;MargaritaStoddard&quot;,&quot;user-since&quot;:datetime(&quot;2012-08-20T10:10:00&quot;),&quot;friend-ids&quot;:{{2,3,6,10}},&quot;employment&quot;:[{&quot;organization-name&quot;:&quot;Codetechno&quot;,&quot;start-date&quot;:date(&quot;2006-08-06&quot;)}]}
+    {&quot;id&quot;:2,&quot;alias&quot;:&quot;Isbel&quot;,&quot;name&quot;:&quot;IsbelDull&quot;,&quot;user-since&quot;:datetime(&quot;2011-01-22T10:10:00&quot;),&quot;friend-ids&quot;:{{1,4}},&quot;employment&quot;:[{&quot;organization-name&quot;:&quot;Hexviafind&quot;,&quot;start-date&quot;:date(&quot;2010-04-27&quot;)}]}
+    {&quot;id&quot;:3,&quot;alias&quot;:&quot;Emory&quot;,&quot;name&quot;:&quot;EmoryUnk&quot;,&quot;user-since&quot;:datetime(&quot;2012-07-10T10:10:00&quot;),&quot;friend-ids&quot;:{{1,5,8,9}},&quot;employment&quot;:[{&quot;organization-name&quot;:&quot;geomedia&quot;,&quot;start-date&quot;:date(&quot;2010-06-17&quot;),&quot;end-date&quot;:date(&quot;2010-01-26&quot;)}]}
+    {&quot;id&quot;:4,&quot;alias&quot;:&quot;Nicholas&quot;,&quot;name&quot;:&quot;NicholasStroh&quot;,&quot;user-since&quot;:datetime(&quot;2010-12-27T10:10:00&quot;),&quot;friend-ids&quot;:{{2}},&quot;employment&quot;:[{&quot;organization-name&quot;:&quot;Zamcorporation&quot;,&quot;start-date&quot;:date(&quot;2010-06-08&quot;)}]}
+    {&quot;id&quot;:5,&quot;alias&quot;:&quot;Von&quot;,&quot;name&quot;:&quot;VonKemble&quot;,&quot;user-since&quot;:datetime(&quot;2010-01-05T10:10:00&quot;),&quot;friend-ids&quot;:{{3,6,10}},&quot;employment&quot;:[{&quot;organization-name&quot;:&quot;Kongreen&quot;,&quot;start-date&quot;:date(&quot;2010-11-27&quot;)}]}
+    {&quot;id&quot;:6,&quot;alias&quot;:&quot;Willis&quot;,&quot;name&quot;:&quot;WillisWynne&quot;,&quot;user-since&quot;:datetime(&quot;2005-01-17T10:10:00&quot;),&quot;friend-ids&quot;:{{1,3,7}},&quot;employment&quot;:[{&quot;organization-name&quot;:&quot;jaydax&quot;,&quot;start-date&quot;:date(&quot;2009-05-15&quot;)}]}
+    {&quot;id&quot;:7,&quot;alias&quot;:&quot;Suzanna&quot;,&quot;name&quot;:&quot;SuzannaTillson&quot;,&quot;user-since&quot;:datetime(&quot;2012-08-07T10:10:00&quot;),&quot;friend-ids&quot;:{{6}},&quot;employment&quot;:[{&quot;organization-name&quot;:&quot;Labzatron&quot;,&quot;start-date&quot;:date(&quot;2011-04-19&quot;)}]}
+    {&quot;id&quot;:8,&quot;alias&quot;:&quot;Nila&quot;,&quot;name&quot;:&quot;NilaMilliron&quot;,&quot;user-since&quot;:datetime(&quot;2008-01-01T10:10:00&quot;),&quot;friend-ids&quot;:{{3}},&quot;employment&quot;:[{&quot;organization-name&quot;:&quot;Plexlane&quot;,&quot;start-date&quot;:date(&quot;2010-02-28&quot;)}]}
+    {&quot;id&quot;:9,&quot;alias&quot;:&quot;Woodrow&quot;,&quot;name&quot;:&quot;WoodrowNehling&quot;,&quot;user-since&quot;:datetime(&quot;2005-09-20T10:10:00&quot;),&quot;friend-ids&quot;:{{3,10}},&quot;employment&quot;:[{&quot;organization-name&quot;:&quot;Zuncan&quot;,&quot;start-date&quot;:date(&quot;2003-04-22&quot;),&quot;end-date&quot;:date(&quot;2009-12-13&quot;)}]}
+    {&quot;id&quot;:10,&quot;alias&quot;:&quot;Bram&quot;,&quot;name&quot;:&quot;BramHatch&quot;,&quot;user-since&quot;:datetime(&quot;2010-10-16T10:10:00&quot;),&quot;friend-ids&quot;:{{1,5,9}},&quot;employment&quot;:[{&quot;organization-name&quot;:&quot;physcane&quot;,&quot;start-date&quot;:date(&quot;2007-06-05&quot;),&quot;end-date&quot;:date(&quot;2011-11-05&quot;)}]}
+</pre></div>
+<p><a class="externalLink" href="http://asterixdb.googlecode.com/files/fbm.adm">Facebook Messages</a></p>
+
+<div class="source">
+<pre>    {&quot;message-id&quot;:1,&quot;author-id&quot;:3,&quot;in-response-to&quot;:2,&quot;sender-location&quot;:point(&quot;47.16,77.75&quot;),&quot;message&quot;:&quot; love sprint its shortcut-menu is awesome:)&quot;}
+    {&quot;message-id&quot;:2,&quot;author-id&quot;:1,&quot;in-response-to&quot;:4,&quot;sender-location&quot;:point(&quot;41.66,80.87&quot;),&quot;message&quot;:&quot; dislike iphone its touch-screen is horrible&quot;}
+    {&quot;message-id&quot;:3,&quot;author-id&quot;:2,&quot;in-response-to&quot;:4,&quot;sender-location&quot;:point(&quot;48.09,81.01&quot;),&quot;message&quot;:&quot; like samsung the plan is amazing&quot;}
+    {&quot;message-id&quot;:4,&quot;author-id&quot;:1,&quot;in-response-to&quot;:2,&quot;sender-location&quot;:point(&quot;37.73,97.04&quot;),&quot;message&quot;:&quot; can't stand at&amp;t the network is horrible:(&quot;}
+    {&quot;message-id&quot;:5,&quot;author-id&quot;:6,&quot;in-response-to&quot;:2,&quot;sender-location&quot;:point(&quot;34.7,90.76&quot;),&quot;message&quot;:&quot; love sprint the customization is mind-blowing&quot;}
+    {&quot;message-id&quot;:6,&quot;author-id&quot;:2,&quot;in-response-to&quot;:1,&quot;sender-location&quot;:point(&quot;31.5,75.56&quot;),&quot;message&quot;:&quot; like t-mobile its platform is mind-blowing&quot;}
+    {&quot;message-id&quot;:7,&quot;author-id&quot;:5,&quot;in-response-to&quot;:15,&quot;sender-location&quot;:point(&quot;32.91,85.05&quot;),&quot;message&quot;:&quot; dislike sprint the speed is horrible&quot;}
+    {&quot;message-id&quot;:8,&quot;author-id&quot;:1,&quot;in-response-to&quot;:11,&quot;sender-location&quot;:point(&quot;40.33,80.87&quot;),&quot;message&quot;:&quot; like verizon the 3G is awesome:)&quot;}
+    {&quot;message-id&quot;:9,&quot;author-id&quot;:3,&quot;in-response-to&quot;:12,&quot;sender-location&quot;:point(&quot;34.45,96.48&quot;),&quot;message&quot;:&quot; love verizon its wireless is good&quot;}
+    {&quot;message-id&quot;:10,&quot;author-id&quot;:1,&quot;in-response-to&quot;:12,&quot;sender-location&quot;:point(&quot;42.5,70.01&quot;),&quot;message&quot;:&quot; can't stand motorola the touch-screen is terrible&quot;}
+    {&quot;message-id&quot;:11,&quot;author-id&quot;:1,&quot;in-response-to&quot;:1,&quot;sender-location&quot;:point(&quot;38.97,77.49&quot;),&quot;message&quot;:&quot; can't stand at&amp;t its plan is terrible&quot;}
+    {&quot;message-id&quot;:12,&quot;author-id&quot;:10,&quot;in-response-to&quot;:6,&quot;sender-location&quot;:point(&quot;42.26,77.76&quot;),&quot;message&quot;:&quot; can't stand t-mobile its voicemail-service is OMG:(&quot;}
+    {&quot;message-id&quot;:13,&quot;author-id&quot;:10,&quot;in-response-to&quot;:4,&quot;sender-location&quot;:point(&quot;42.77,78.92&quot;),&quot;message&quot;:&quot; dislike iphone the voice-command is bad:(&quot;}
+    {&quot;message-id&quot;:14,&quot;author-id&quot;:9,&quot;in-response-to&quot;:12,&quot;sender-location&quot;:point(&quot;41.33,85.28&quot;),&quot;message&quot;:&quot; love at&amp;t its 3G is good:)&quot;}
+    {&quot;message-id&quot;:15,&quot;author-id&quot;:7,&quot;in-response-to&quot;:11,&quot;sender-location&quot;:point(&quot;44.47,67.11&quot;),&quot;message&quot;:&quot; like iphone the voicemail-service is awesome&quot;}
+</pre></div>
+<p>It&#x2019;s loading time! We can use AQL <i>load</i> statements to populate our datasets with the sample records shown above. The following shows how loading can be done for data stored in <tt>.adm</tt> files in your local filesystem. <i>Note:</i> You <i>MUST</i> replace the <tt>&lt;Host Name&gt;</tt> and <tt>&lt;Absolute File Path&gt;</tt> placeholders in each load statement below with valid values based on the host IP address (or host name) for the machine and directory that you have downloaded the provided <tt>.adm</tt> files to. As you do so, be very, very careful to retain the two slashes in the load statements, i.e., do not delete the two slashes that appear in front of the absolute path to your <tt>.adm</tt> files. (This will lead to a three-slash character sequence at the start of each load statement&#x2019;s file input path specification.)</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    load dataset FacebookUsers using localfs
+    ((&quot;path&quot;=&quot;&lt;Host Name&gt;://&lt;Absolute File Path&gt;/fbu.adm&quot;),(&quot;format&quot;=&quot;adm&quot;));
+
+    load dataset FacebookMessages using localfs
+    ((&quot;path&quot;=&quot;&lt;Host Name&gt;://&lt;Absolute File Path&gt;/fbm.adm&quot;),(&quot;format&quot;=&quot;adm&quot;));
+
+    load dataset TwitterUsers using localfs
+    ((&quot;path&quot;=&quot;&lt;Host Name&gt;://&lt;Absolute File Path&gt;/twu.adm&quot;),(&quot;format&quot;=&quot;adm&quot;));
+
+    load dataset TweetMessages using localfs
+    ((&quot;path&quot;=&quot;&lt;Host Name&gt;://&lt;Absolute File Path&gt;/twm.adm&quot;),(&quot;format&quot;=&quot;adm&quot;));
+</pre></div>
+<p>&#x2014;-</p></div>
+<div class="section">
+<h2>AQL: Querying Your AsterixDB Data<a name="AQL:_Querying_Your_AsterixDB_Data"></a></h2>
+<p>Congratulations! You now have sample social data stored (and indexed) in AsterixDB. (You are part of an elite and adventurous group of individuals. :-)) Now that you have successfully loaded the provided sample data into the datasets that we defined, you can start running queries against them.</p>
+<p>The query language for AsterixDB is AQL&#x2014;the Asterix Query Language. AQL is loosely based on XQuery, the language developed and standardized in the early to mid 2000&#x2019;s by the World Wide Web Consortium (W3C) for querying semistructured data stored in their XML format. We have tossed all of the &#x201c;XML cruft&#x201d; out of their language but retained many of its core ideas. We did this because its design was developed over a period of years by a diverse committee of smart and experienced language designers, including &#x201c;SQL people&#x201d;, &#x201c;functional programming people&#x201d;, and &#x201c;XML people&#x201d;, all of whom were focused on how to design a new query language that operates well over semistructured data. (We decided to stand on their shoulders instead of starting from scratch and revisiting many of the same issues.) Note that AQL is not SQL and not based on SQL: In other words, AsterixDB is fully &#x201c;NoSQL compliant&#x201d;. :-)</p>
+<p>In this section we introduce AQL via a set of example queries, along with their expected results, based on the data above, to help you get started. Many of the most important features of AQL are presented in this set of representative queries. You can find more details in the document on the <a href="datamodel.html">Asterix Data Model (ADM)</a>, in the <a href="manual.html">AQL Reference Manual</a>, and a complete list of built-in functions is available in the <a href="functions.html">Asterix Functions</a> document.</p>
+<p>AQL is an expression language. Even the expression 1+1 is a valid AQL query that evaluates to 2. (Try it for yourself! Okay, maybe that&#x2019;s <i>not</i> the best use of a 512-node shared-nothing compute cluster.) Most useful AQL queries will be based on the <i>FLWOR</i> (pronounced &#x201c;flower&#x201d;) expression structure that AQL has borrowed from XQuery ((<a class="externalLink" href="http://en.wikipedia.org/wiki/FLWOR))">http://en.wikipedia.org/wiki/FLWOR))</a>. The FLWOR expression syntax supports both the incremental binding (<i>for</i>) of variables to ADM data instances in a dataset (or in the result of any AQL expression, actually) and the full binding (<i>let</i>) of variables to entire intermediate results in a fashion similar to temporary views in the SQL world. FLWOR is an acronym that is short for <i>for</i>-<i>let</i>-<i>where</i>-<i>order by</i>-<i>return</i>, naming five of the most frequently used clauses from the syntax of a full AQL query. AQL also inclu
 des <i>group by</i> and <i>limit</i> clauses, as you will see shortly. Roughly speaking, for SQL afficiandos, the <i>for</i> clause in AQL is like the <i>from</i> clause in SQL, the <i>return</i> clause in AQL is like the <i>select</i> clause in SQL (but appears at the end instead of the beginning of a query), the <i>let</i> clause in AQL is like SQL&#x2019;s <i>with</i> clause, and the <i>where</i> and <i>order by</i> clauses in both languages are similar.</p>
+<p>Enough talk! Let&#x2019;s go ahead and try writing some queries and see about learning AQL by example.</p>
+<div class="section">
+<h3>Query 0-A - Exact-Match Lookup<a name="Query_0-A_-_Exact-Match_Lookup"></a></h3>
+<p>For our first query, let&#x2019;s find a Facebook user based on his or her user id. Suppose the user we want is the user whose id is 8:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    for $user in dataset FacebookUsers
+    where $user.id = 8
+    return $user;
+</pre></div>
+<p>The query&#x2019;s <i>for</i> clause binds the variable <tt>$user</tt> incrementally to the data instances residing in the dataset named FacebookUsers. Its <i>where</i> clause selects only those bindings having a user id of interest, filtering out the rest. The <i>return</i> clause returns the (entire) data instance for each binding that satisfies the predicate. Since this dataset is indexed on user id (its primary key), this query will be done via a quick index lookup.</p>
+<p>The expected result for our sample data is as follows:</p>
+
+<div class="source">
+<pre>    { &quot;id&quot;: 8, &quot;alias&quot;: &quot;Nila&quot;, &quot;name&quot;: &quot;NilaMilliron&quot;, &quot;user-since&quot;: datetime(&quot;2008-01-01T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 3 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;Plexlane&quot;, &quot;start-date&quot;: date(&quot;2010-02-28&quot;), &quot;end-date&quot;: null } ] }
+</pre></div></div>
+<div class="section">
+<h3>Query 0-B - Range Scan<a name="Query_0-B_-_Range_Scan"></a></h3>
+<p>AQL, like SQL, supports a variety of different predicates. For example, for our next query, let&#x2019;s find the Facebook users whose ids are in the range between 2 and 4:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    for $user in dataset FacebookUsers
+    where $user.id &gt;= 2 and $user.id &lt;= 4
+    return $user;
+</pre></div>
+<p>This query&#x2019;s expected result, also evaluable using the primary index on user id, is:</p>
+
+<div class="source">
+<pre>    { &quot;id&quot;: 2, &quot;alias&quot;: &quot;Isbel&quot;, &quot;name&quot;: &quot;IsbelDull&quot;, &quot;user-since&quot;: datetime(&quot;2011-01-22T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 1, 4 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;Hexviafind&quot;, &quot;start-date&quot;: date(&quot;2010-04-27&quot;), &quot;end-date&quot;: null } ] }
+    { &quot;id&quot;: 3, &quot;alias&quot;: &quot;Emory&quot;, &quot;name&quot;: &quot;EmoryUnk&quot;, &quot;user-since&quot;: datetime(&quot;2012-07-10T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 1, 5, 8, 9 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;geomedia&quot;, &quot;start-date&quot;: date(&quot;2010-06-17&quot;), &quot;end-date&quot;: date(&quot;2010-01-26&quot;) } ] }
+    { &quot;id&quot;: 4, &quot;alias&quot;: &quot;Nicholas&quot;, &quot;name&quot;: &quot;NicholasStroh&quot;, &quot;user-since&quot;: datetime(&quot;2010-12-27T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 2 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;Zamcorporation&quot;, &quot;start-date&quot;: date(&quot;2010-06-08&quot;), &quot;end-date&quot;: null } ] }
+</pre></div></div>
+<div class="section">
+<h3>Query 1 - Other Query Filters<a name="Query_1_-_Other_Query_Filters"></a></h3>
+<p>AQL can do range queries on any data type that supports the appropriate set of comparators. As an example, this next query retrieves the Facebook users who joined between July 22, 2010 and July 29, 2012:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    for $user in dataset FacebookUsers
+    where $user.user-since &gt;= datetime('2010-07-22T00:00:00')
+      and $user.user-since &lt;= datetime('2012-07-29T23:59:59')
+    return $user;
+</pre></div>
+<p>The expected result for this query, also an indexable query, is as follows:</p>
+
+<div class="source">
+<pre>    { &quot;id&quot;: 2, &quot;alias&quot;: &quot;Isbel&quot;, &quot;name&quot;: &quot;IsbelDull&quot;, &quot;user-since&quot;: datetime(&quot;2011-01-22T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 1, 4 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;Hexviafind&quot;, &quot;start-date&quot;: date(&quot;2010-04-27&quot;), &quot;end-date&quot;: null } ] }
+    { &quot;id&quot;: 3, &quot;alias&quot;: &quot;Emory&quot;, &quot;name&quot;: &quot;EmoryUnk&quot;, &quot;user-since&quot;: datetime(&quot;2012-07-10T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 1, 5, 8, 9 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;geomedia&quot;, &quot;start-date&quot;: date(&quot;2010-06-17&quot;), &quot;end-date&quot;: date(&quot;2010-01-26&quot;) } ] }
+    { &quot;id&quot;: 4, &quot;alias&quot;: &quot;Nicholas&quot;, &quot;name&quot;: &quot;NicholasStroh&quot;, &quot;user-since&quot;: datetime(&quot;2010-12-27T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 2 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;Zamcorporation&quot;, &quot;start-date&quot;: date(&quot;2010-06-08&quot;), &quot;end-date&quot;: null } ] }
+    { &quot;id&quot;: 10, &quot;alias&quot;: &quot;Bram&quot;, &quot;name&quot;: &quot;BramHatch&quot;, &quot;user-since&quot;: datetime(&quot;2010-10-16T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 1, 5, 9 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;physcane&quot;, &quot;start-date&quot;: date(&quot;2007-06-05&quot;), &quot;end-date&quot;: date(&quot;2011-11-05&quot;) } ] }
+</pre></div></div>
+<div class="section">
+<h3>Query 2-A - Equijoin<a name="Query_2-A_-_Equijoin"></a></h3>
+<p>In addition to simply binding variables to data instances and returning them &#x201c;whole&#x201d;, an AQL query can construct new ADM instances to return based on combinations of its variable bindings. This gives AQL the power to do joins much like those done using multi-table <i>from</i> clauses in SQL. For example, suppose we wanted a list of all Facebook users paired with their associated messages, with the list enumerating the author name and the message text associated with each Facebook message. We could do this as follows in AQL:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    for $user in dataset FacebookUsers
+    for $message in dataset FacebookMessages
+    where $message.author-id = $user.id
+    return {
+    &quot;uname&quot;: $user.name,
+    &quot;message&quot;: $message.message
+    };
+</pre></div>
+<p>The result of this query is a sequence of new ADM instances, one for each author/message pair. Each instance in the result will be an ADM record containing two fields, &#x201c;uname&#x201d; and &#x201c;message&#x201d;, containing the user&#x2019;s name and the message text, respectively, for each author/message pair. (Note that &#x201c;uname&#x201d; and &#x201c;message&#x201d; are both simple AQL expressions themselves&#x2014;so in the most general case, even the resulting field names can be computed as part of the query, making AQL a very powerful tool for slicing and dicing semistructured data.)</p>
+<p>The expected result of this example AQL join query for our sample data set is:</p>
+
+<div class="source">
+<pre>    { &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;message&quot;: &quot; dislike iphone its touch-screen is horrible&quot; }
+    { &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;message&quot;: &quot; can't stand at&amp;t the network is horrible:(&quot; }
+    { &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;message&quot;: &quot; like verizon the 3G is awesome:)&quot; }
+    { &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;message&quot;: &quot; can't stand motorola the touch-screen is terrible&quot; }
+    { &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;message&quot;: &quot; can't stand at&amp;t its plan is terrible&quot; }
+    { &quot;uname&quot;: &quot;IsbelDull&quot;, &quot;message&quot;: &quot; like samsung the plan is amazing&quot; }
+    { &quot;uname&quot;: &quot;IsbelDull&quot;, &quot;message&quot;: &quot; like t-mobile its platform is mind-blowing&quot; }
+    { &quot;uname&quot;: &quot;EmoryUnk&quot;, &quot;message&quot;: &quot; love sprint its shortcut-menu is awesome:)&quot; }
+    { &quot;uname&quot;: &quot;EmoryUnk&quot;, &quot;message&quot;: &quot; love verizon its wireless is good&quot; }
+    { &quot;uname&quot;: &quot;VonKemble&quot;, &quot;message&quot;: &quot; dislike sprint the speed is horrible&quot; }
+    { &quot;uname&quot;: &quot;WillisWynne&quot;, &quot;message&quot;: &quot; love sprint the customization is mind-blowing&quot; }
+    { &quot;uname&quot;: &quot;SuzannaTillson&quot;, &quot;message&quot;: &quot; like iphone the voicemail-service is awesome&quot; }
+    { &quot;uname&quot;: &quot;WoodrowNehling&quot;, &quot;message&quot;: &quot; love at&amp;t its 3G is good:)&quot; }
+    { &quot;uname&quot;: &quot;BramHatch&quot;, &quot;message&quot;: &quot; can't stand t-mobile its voicemail-service is OMG:(&quot; }
+    { &quot;uname&quot;: &quot;BramHatch&quot;, &quot;message&quot;: &quot; dislike iphone the voice-command is bad:(&quot; }
+</pre></div></div>
+<div class="section">
+<h3>Query 2-B - Index join<a name="Query_2-B_-_Index_join"></a></h3>
+<p>By default, AsterixDB evaluates equijoin queries using hash-based join methods that work well for doing ad hoc joins of very large data sets (<a class="externalLink" href="http://en.wikipedia.org/wiki/Hash_join">http://en.wikipedia.org/wiki/Hash_join</a>). On a cluster, hash partitioning is employed as AsterixDB&#x2019;s divide-and-conquer strategy for computing large parallel joins. AsterixDB includes other join methods, but in the absence of data statistics and selectivity estimates, it doesn&#x2019;t (yet) have the know-how to intelligently choose among its alternatives. We therefore asked ourselves the classic question&#x2014;WWOD?&#x2014;What Would Oracle Do?&#x2014;and in the interim, AQL includes a clunky (but useful) hint-based mechanism for addressing the occasional need to suggest to AsterixDB which join method it should use for a particular AQL query.</p>
+<p>The following query is similar to Query 2-A but includes a suggestion to AsterixDB that it should consider employing an index-based nested-loop join technique to process the query:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    for $user in dataset FacebookUsers
+    for $message in dataset FacebookMessages
+    where $message.author-id /*+ indexnl */  = $user.id
+    return {
+    &quot;uname&quot;: $user.name,
+    &quot;message&quot;: $message.message
+    };
+</pre></div>
+<p>The expected result is (of course) the same as before, modulo the order of the instances. Result ordering is (intentionally) undefined in AQL in the absence of an <i>order by</i> clause. The query result for our sample data in this case is:</p>
+
+<div class="source">
+<pre>    { &quot;uname&quot;: &quot;EmoryUnk&quot;, &quot;message&quot;: &quot; love sprint its shortcut-menu is awesome:)&quot; }
+    { &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;message&quot;: &quot; dislike iphone its touch-screen is horrible&quot; }
+    { &quot;uname&quot;: &quot;IsbelDull&quot;, &quot;message&quot;: &quot; like samsung the plan is amazing&quot; }
+    { &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;message&quot;: &quot; can't stand at&amp;t the network is horrible:(&quot; }
+    { &quot;uname&quot;: &quot;WillisWynne&quot;, &quot;message&quot;: &quot; love sprint the customization is mind-blowing&quot; }
+    { &quot;uname&quot;: &quot;IsbelDull&quot;, &quot;message&quot;: &quot; like t-mobile its platform is mind-blowing&quot; }
+    { &quot;uname&quot;: &quot;VonKemble&quot;, &quot;message&quot;: &quot; dislike sprint the speed is horrible&quot; }
+    { &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;message&quot;: &quot; like verizon the 3G is awesome:)&quot; }
+    { &quot;uname&quot;: &quot;EmoryUnk&quot;, &quot;message&quot;: &quot; love verizon its wireless is good&quot; }
+    { &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;message&quot;: &quot; can't stand motorola the touch-screen is terrible&quot; }
+    { &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;message&quot;: &quot; can't stand at&amp;t its plan is terrible&quot; }
+    { &quot;uname&quot;: &quot;BramHatch&quot;, &quot;message&quot;: &quot; can't stand t-mobile its voicemail-service is OMG:(&quot; }
+    { &quot;uname&quot;: &quot;BramHatch&quot;, &quot;message&quot;: &quot; dislike iphone the voice-command is bad:(&quot; }
+    { &quot;uname&quot;: &quot;WoodrowNehling&quot;, &quot;message&quot;: &quot; love at&amp;t its 3G is good:)&quot; }
+    { &quot;uname&quot;: &quot;SuzannaTillson&quot;, &quot;message&quot;: &quot; like iphone the voicemail-service is awesome&quot; }
+</pre></div>
+<p>(It is worth knowing, with respect to influencing AsterixDB&#x2019;s query evaluation, that nested <i>for</i> clauses&#x2014;a.k.a. joins&#x2014; are currently evaluated with the &#x201c;outer&#x201d; clause probing the data of the &#x201c;inner&#x201d; clause.)</p></div>
+<div class="section">
+<h3>Query 3 - Nested Outer Join<a name="Query_3_-_Nested_Outer_Join"></a></h3>
+<p>In order to support joins between tables with missing/dangling join tuples, the designers of SQL ended up shoe-horning a subset of the relational algebra into SQL&#x2019;s <i>from</i> clause syntax&#x2014;and providing a variety of join types there for users to choose from. Left outer joins are particularly important in SQL, e.g., to print a summary of customers and orders, grouped by customer, without omitting those customers who haven&#x2019;t placed any orders yet.</p>
+<p>The AQL language supports nesting, both of queries and of query results, and the combination allows for an arguably cleaner/more natural approach to such queries. As an example, supposed we wanted, for each Facebook user, to produce a record that has his/her name plus a list of the messages written by that user. In SQL, this would involve a left outer join between users and messages, grouping by user, and having the user name repeated along side each message. In AQL, this sort of use case can be handled (more naturally) as follows:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    for $user in dataset FacebookUsers
+    return {
+    &quot;uname&quot;: $user.name,
+    &quot;messages&quot;: for $message in dataset FacebookMessages
+            where $message.author-id = $user.id
+            return $message.message
+    };
+</pre></div>
+<p>This AQL query binds the variable <tt>$user</tt> to the data instances in FacebookUsers; for each user, it constructs a result record containing a &#x201c;uname&#x201d; field with the user&#x2019;s name and a &#x201c;messages&#x201d; field with a nested collection of all messages for that user. The nested collection for each user is specified by using a correlated subquery. (Note: While it looks like nested loops could be involved in computing the result, AsterixDB recogizes the equivalence of such a query to an outerjoin, and it will use an efficient hash-based strategy when actually computing the query&#x2019;s result.)</p>
+<p>Here is this example query&#x2019;s expected output:</p>
+
+<div class="source">
+<pre>    { &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;messages&quot;: [ &quot; dislike iphone its touch-screen is horrible&quot;, &quot; can't stand at&amp;t the network is horrible:(&quot;, &quot; like verizon the 3G is awesome:)&quot;, &quot; can't stand motorola the touch-screen is terrible&quot;, &quot; can't stand at&amp;t its plan is terrible&quot; ] }
+    { &quot;uname&quot;: &quot;IsbelDull&quot;, &quot;messages&quot;: [ &quot; like samsung the plan is amazing&quot;, &quot; like t-mobile its platform is mind-blowing&quot; ] }
+    { &quot;uname&quot;: &quot;EmoryUnk&quot;, &quot;messages&quot;: [ &quot; love sprint its shortcut-menu is awesome:)&quot;, &quot; love verizon its wireless is good&quot; ] }
+    { &quot;uname&quot;: &quot;NicholasStroh&quot;, &quot;messages&quot;: [  ] }
+    { &quot;uname&quot;: &quot;VonKemble&quot;, &quot;messages&quot;: [ &quot; dislike sprint the speed is horrible&quot; ] }
+    { &quot;uname&quot;: &quot;WillisWynne&quot;, &quot;messages&quot;: [ &quot; love sprint the customization is mind-blowing&quot; ] }
+    { &quot;uname&quot;: &quot;SuzannaTillson&quot;, &quot;messages&quot;: [ &quot; like iphone the voicemail-service is awesome&quot; ] }
+    { &quot;uname&quot;: &quot;NilaMilliron&quot;, &quot;messages&quot;: [  ] }
+    { &quot;uname&quot;: &quot;WoodrowNehling&quot;, &quot;messages&quot;: [ &quot; love at&amp;t its 3G is good:)&quot; ] }
+    { &quot;uname&quot;: &quot;BramHatch&quot;, &quot;messages&quot;: [ &quot; dislike iphone the voice-command is bad:(&quot;, &quot; can't stand t-mobile its voicemail-service is OMG:(&quot; ] }
+</pre></div></div>
+<div class="section">
+<h3>Query 4 - Theta Join<a name="Query_4_-_Theta_Join"></a></h3>
+<p>Not all joins are expressible as equijoins and computable using equijoin-oriented algorithms. The join predicates for some use cases involve predicates with functions; AsterixDB supports the expression of such queries and will still evaluate them as best it can using nested loop based techniques (and broadcast joins in the parallel case).</p>
+<p>As an example of such a use case, suppose that we wanted, for each tweet T, to find all of the other tweets that originated from within a circle of radius of 1 surrounding tweet T&#x2019;s location. In AQL, this can be specified in a manner similar to the previous query using one of the built-in functions on the spatial data type instead of id equality in the correlated query&#x2019;s <i>where</i> clause:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    for $t in dataset TweetMessages
+    return {
+    &quot;message&quot;: $t.message-text,
+    &quot;nearby-messages&quot;: for $t2 in dataset TweetMessages
+                where spatial-distance($t.sender-location, $t2.sender-location) &lt;= 1
+                return { &quot;msgtxt&quot;:$t2.message-text}
+    };
+</pre></div>
+<p>Here is the expected result for this query:</p>
+
+<div class="source">
+<pre>    { &quot;message&quot;: &quot; love t-mobile its customization is good:)&quot;, &quot;nearby-messages&quot;: [ { &quot;msgtxt&quot;: &quot; love t-mobile its customization is good:)&quot; } ] }
+    { &quot;message&quot;: &quot; hate verizon its voice-clarity is OMG:(&quot;, &quot;nearby-messages&quot;: [ { &quot;msgtxt&quot;: &quot; like motorola the speed is good:)&quot; }, { &quot;msgtxt&quot;: &quot; hate verizon its voice-clarity is OMG:(&quot; } ] }
+    { &quot;message&quot;: &quot; can't stand iphone its platform is terrible&quot;, &quot;nearby-messages&quot;: [ { &quot;msgtxt&quot;: &quot; can't stand iphone its platform is terrible&quot; } ] }
+    { &quot;message&quot;: &quot; like samsung the voice-command is amazing:)&quot;, &quot;nearby-messages&quot;: [ { &quot;msgtxt&quot;: &quot; like samsung the voice-command is amazing:)&quot; } ] }
+    { &quot;message&quot;: &quot; like verizon its shortcut-menu is awesome:)&quot;, &quot;nearby-messages&quot;: [ { &quot;msgtxt&quot;: &quot; like verizon its shortcut-menu is awesome:)&quot; } ] }
+    { &quot;message&quot;: &quot; like motorola the speed is good:)&quot;, &quot;nearby-messages&quot;: [ { &quot;msgtxt&quot;: &quot; hate verizon its voice-clarity is OMG:(&quot; }, { &quot;msgtxt&quot;: &quot; like motorola the speed is good:)&quot; } ] }
+    { &quot;message&quot;: &quot; like sprint the voice-command is mind-blowing:)&quot;, &quot;nearby-messages&quot;: [ { &quot;msgtxt&quot;: &quot; like sprint the voice-command is mind-blowing:)&quot; } ] }
+    { &quot;message&quot;: &quot; can't stand motorola its speed is terrible:(&quot;, &quot;nearby-messages&quot;: [ { &quot;msgtxt&quot;: &quot; can't stand motorola its speed is terrible:(&quot; } ] }
+    { &quot;message&quot;: &quot; like iphone the voice-clarity is good:)&quot;, &quot;nearby-messages&quot;: [ { &quot;msgtxt&quot;: &quot; like iphone the voice-clarity is good:)&quot; } ] }
+    { &quot;message&quot;: &quot; like samsung the platform is good&quot;, &quot;nearby-messages&quot;: [ { &quot;msgtxt&quot;: &quot; like samsung the platform is good&quot; } ] }
+    { &quot;message&quot;: &quot; like t-mobile the shortcut-menu is awesome:)&quot;, &quot;nearby-messages&quot;: [ { &quot;msgtxt&quot;: &quot; like t-mobile the shortcut-menu is awesome:)&quot; } ] }
+    { &quot;message&quot;: &quot; love verizon its voicemail-service is awesome&quot;, &quot;nearby-messages&quot;: [ { &quot;msgtxt&quot;: &quot; love verizon its voicemail-service is awesome&quot; } ] }
+</pre></div></div>
+<div class="section">
+<h3>Query 5 - Fuzzy Join<a name="Query_5_-_Fuzzy_Join"></a></h3>
+<p>As another example of a non-equijoin use case, we could ask AsterixDB to find, for each Facebook user, all Twitter users with names &#x201c;similar&#x201d; to their name. AsterixDB supports a variety of &#x201c;fuzzy match&#x201d; functions for use with textual and set-based data. As one example, we could choose to use edit distance with a threshold of 3 as the definition of name similarity, in which case we could write the following query using AQL&#x2019;s operator-based syntax (~=) for testing whether or not two values are similar:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    set simfunction &quot;edit-distance&quot;;
+    set simthreshold &quot;3&quot;;
+
+    for $fbu in dataset FacebookUsers
+    return {
+        &quot;id&quot;: $fbu.id,
+        &quot;name&quot;: $fbu.name,
+        &quot;similar-users&quot;: for $t in dataset TweetMessages
+                let $tu := $t.user
+                where $tu.name ~= $fbu.name
+                return {
+                &quot;twitter-screenname&quot;: $tu.screen-name,
+                &quot;twitter-name&quot;: $tu.name
+                }
+    };
+</pre></div>
+<p>The expected result for this query against our sample data is:</p>
+
+<div class="source">
+<pre>    { &quot;id&quot;: 1, &quot;name&quot;: &quot;MargaritaStoddard&quot;, &quot;similar-users&quot;: [  ] }
+    { &quot;id&quot;: 2, &quot;name&quot;: &quot;IsbelDull&quot;, &quot;similar-users&quot;: [  ] }
+    { &quot;id&quot;: 3, &quot;name&quot;: &quot;EmoryUnk&quot;, &quot;similar-users&quot;: [  ] }
+    { &quot;id&quot;: 4, &quot;name&quot;: &quot;NicholasStroh&quot;, &quot;similar-users&quot;: [  ] }
+    { &quot;id&quot;: 5, &quot;name&quot;: &quot;VonKemble&quot;, &quot;similar-users&quot;: [  ] }
+    { &quot;id&quot;: 6, &quot;name&quot;: &quot;WillisWynne&quot;, &quot;similar-users&quot;: [  ] }
+    { &quot;id&quot;: 7, &quot;name&quot;: &quot;SuzannaTillson&quot;, &quot;similar-users&quot;: [  ] }
+    { &quot;id&quot;: 8, &quot;name&quot;: &quot;NilaMilliron&quot;, &quot;similar-users&quot;: [ { &quot;twitter-screenname&quot;: &quot;NilaMilliron_tw&quot;, &quot;twitter-name&quot;: &quot;Nila Milliron&quot; } ] }
+    { &quot;id&quot;: 9, &quot;name&quot;: &quot;WoodrowNehling&quot;, &quot;similar-users&quot;: [  ] }
+    { &quot;id&quot;: 10, &quot;name&quot;: &quot;BramHatch&quot;, &quot;similar-users&quot;: [  ] }
+</pre></div></div>
+<div class="section">
+<h3>Query 6 - Existential Quantification<a name="Query_6_-_Existential_Quantification"></a></h3>
+<p>The expressive power of AQL includes support for queries involving &#x201c;some&#x201d; (existentially quantified) and &#x201c;all&#x201d; (universally quantified) query semantics. As an example of an existential AQL query, here we show a query to list the Facebook users who are currently employed. Such employees will have an employment history containing a record with a null end-date value, which leads us to the following AQL query:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    for $fbu in dataset FacebookUsers
+    where (some $e in $fbu.employment satisfies is-null($e.end-date))
+    return $fbu;
+</pre></div>
+<p>The expected result in this case is:</p>
+
+<div class="source">
+<pre>    { &quot;id&quot;: 1, &quot;alias&quot;: &quot;Margarita&quot;, &quot;name&quot;: &quot;MargaritaStoddard&quot;, &quot;user-since&quot;: datetime(&quot;2012-08-20T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 2, 3, 6, 10 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;Codetechno&quot;, &quot;start-date&quot;: date(&quot;2006-08-06&quot;), &quot;end-date&quot;: null } ] }
+    { &quot;id&quot;: 2, &quot;alias&quot;: &quot;Isbel&quot;, &quot;name&quot;: &quot;IsbelDull&quot;, &quot;user-since&quot;: datetime(&quot;2011-01-22T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 1, 4 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;Hexviafind&quot;, &quot;start-date&quot;: date(&quot;2010-04-27&quot;), &quot;end-date&quot;: null } ] }
+    { &quot;id&quot;: 4, &quot;alias&quot;: &quot;Nicholas&quot;, &quot;name&quot;: &quot;NicholasStroh&quot;, &quot;user-since&quot;: datetime(&quot;2010-12-27T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 2 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;Zamcorporation&quot;, &quot;start-date&quot;: date(&quot;2010-06-08&quot;), &quot;end-date&quot;: null } ] }
+    { &quot;id&quot;: 5, &quot;alias&quot;: &quot;Von&quot;, &quot;name&quot;: &quot;VonKemble&quot;, &quot;user-since&quot;: datetime(&quot;2010-01-05T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 3, 6, 10 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;Kongreen&quot;, &quot;start-date&quot;: date(&quot;2010-11-27&quot;), &quot;end-date&quot;: null } ] }
+    { &quot;id&quot;: 6, &quot;alias&quot;: &quot;Willis&quot;, &quot;name&quot;: &quot;WillisWynne&quot;, &quot;user-since&quot;: datetime(&quot;2005-01-17T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 1, 3, 7 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;jaydax&quot;, &quot;start-date&quot;: date(&quot;2009-05-15&quot;), &quot;end-date&quot;: null } ] }
+    { &quot;id&quot;: 7, &quot;alias&quot;: &quot;Suzanna&quot;, &quot;name&quot;: &quot;SuzannaTillson&quot;, &quot;user-since&quot;: datetime(&quot;2012-08-07T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 6 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;Labzatron&quot;, &quot;start-date&quot;: date(&quot;2011-04-19&quot;), &quot;end-date&quot;: null } ] }
+    { &quot;id&quot;: 8, &quot;alias&quot;: &quot;Nila&quot;, &quot;name&quot;: &quot;NilaMilliron&quot;, &quot;user-since&quot;: datetime(&quot;2008-01-01T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 3 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;Plexlane&quot;, &quot;start-date&quot;: date(&quot;2010-02-28&quot;), &quot;end-date&quot;: null } ] }
+</pre></div></div>
+<div class="section">
+<h3>Query 7 - Universal Quantification<a name="Query_7_-_Universal_Quantification"></a></h3>
+<p>As an example of a universal AQL query, here we show a query to list the Facebook users who are currently unemployed. Such employees will have an employment history containing no records with null end-date values, leading us to the following AQL query:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    for $fbu in dataset FacebookUsers
+    where (every $e in $fbu.employment satisfies not(is-null($e.end-date)))
+    return $fbu;
+</pre></div>
+<p>Here is the expected result for our sample data:</p>
+
+<div class="source">
+<pre>    { &quot;id&quot;: 3, &quot;alias&quot;: &quot;Emory&quot;, &quot;name&quot;: &quot;EmoryUnk&quot;, &quot;user-since&quot;: datetime(&quot;2012-07-10T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 1, 5, 8, 9 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;geomedia&quot;, &quot;start-date&quot;: date(&quot;2010-06-17&quot;), &quot;end-date&quot;: date(&quot;2010-01-26&quot;) } ] }
+    { &quot;id&quot;: 9, &quot;alias&quot;: &quot;Woodrow&quot;, &quot;name&quot;: &quot;WoodrowNehling&quot;, &quot;user-since&quot;: datetime(&quot;2005-09-20T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 3, 10 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;Zuncan&quot;, &quot;start-date&quot;: date(&quot;2003-04-22&quot;), &quot;end-date&quot;: date(&quot;2009-12-13&quot;) } ] }
+    { &quot;id&quot;: 10, &quot;alias&quot;: &quot;Bram&quot;, &quot;name&quot;: &quot;BramHatch&quot;, &quot;user-since&quot;: datetime(&quot;2010-10-16T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 1, 5, 9 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;physcane&quot;, &quot;start-date&quot;: date(&quot;2007-06-05&quot;), &quot;end-date&quot;: date(&quot;2011-11-05&quot;) } ] }
+</pre></div></div>
+<div class="section">
+<h3>Query 8 - Simple Aggregation<a name="Query_8_-_Simple_Aggregation"></a></h3>
+<p>Like SQL, the AQL language of AsterixDB provides support for computing aggregates over large amounts of data. As a very simple example, the following AQL query computes the total number of Facebook users:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    count(for $fbu in dataset FacebookUsers return $fbu);
+</pre></div>
+<p>In AQL, aggregate functions can be applied to arbitrary subquery results; in this case, the count function is applied to the result of a query that enumerates the Facebook users. The expected result here is:</p>
+
+<div class="source">
+<pre>    10
+</pre></div></div>
+<div class="section">
+<h3>Query 9-A - Grouping and Aggregation<a name="Query_9-A_-_Grouping_and_Aggregation"></a></h3>
+<p>Also like SQL, AQL supports grouped aggregation. For every Twitter user, the following group-by/aggregate query counts the number of tweets sent by that user:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    for $t in dataset TweetMessages
+    group by $uid := $t.user.screen-name with $t
+    return {
+    &quot;user&quot;: $uid,
+    &quot;count&quot;: count($t)
+    };
+</pre></div>
+<p>The <i>for</i> clause incrementally binds $t to tweets, and the <i>group by</i> clause groups the tweets by its issuer&#x2019;s Twitter screen-name. Unlike SQL, where data is tabular&#x2014;flat&#x2014;the data model underlying AQL allows for nesting. Thus, following the <i>group by</i> clause, the <i>return</i> clause in this query sees a sequence of $t groups, with each such group having an associated $uid variable value (i.e., the tweeting user&#x2019;s screen name). In the context of the return clause, due to &#x201c;&#x2026; with $t &#x2026;&#x201d;, $uid is bound to the tweeter&#x2019;s id and $t is bound to the <i>set</i> of tweets issued by that tweeter. The return clause constructs a result record containing the tweeter&#x2019;s user id and the count of the items in the associated tweet set. The query result will contain one such record per screen name. This query also illustrates another feature of AQL; notice that each user&#x2019;s screen name is accessed via a path s
 yntax that traverses each tweet&#x2019;s nested record structure.</p>
+<p>Here is the expected result for this query over the sample data:</p>
+
+<div class="source">
+<pre>    { &quot;user&quot;: &quot;ChangEwing_573&quot;, &quot;count&quot;: 1 }
+    { &quot;user&quot;: &quot;ColineGeyer@63&quot;, &quot;count&quot;: 3 }
+    { &quot;user&quot;: &quot;NathanGiesen@211&quot;, &quot;count&quot;: 6 }
+    { &quot;user&quot;: &quot;NilaMilliron_tw&quot;, &quot;count&quot;: 1 }
+    { &quot;user&quot;: &quot;OliJackson_512&quot;, &quot;count&quot;: 1 }
+</pre></div></div>
+<div class="section">
+<h3>Query 9-B - (Hash-Based) Grouping and Aggregation<a name="Query_9-B_-_Hash-Based_Grouping_and_Aggregation"></a></h3>
+<p>As for joins, AsterixDB has multiple evaluation strategies available for processing grouped aggregate queries. For grouped aggregation, the system knows how to employ both sort-based and hash-based aggregation methods, with sort-based methods being used by default and a hint being available to suggest that a different approach be used in processing a particular AQL query.</p>
+<p>The following query is similar to Query 9-A, but adds a hash-based aggregation hint:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    for $t in dataset TweetMessages
+    /*+ hash*/
+    group by $uid := $t.user.screen-name with $t
+    return {
+    &quot;user&quot;: $uid,
+    &quot;count&quot;: count($t)
+    };
+</pre></div>
+<p>Here is the expected result:</p>
+
+<div class="source">
+<pre>    { &quot;user&quot;: &quot;OliJackson_512&quot;, &quot;count&quot;: 1 }
+    { &quot;user&quot;: &quot;ColineGeyer@63&quot;, &quot;count&quot;: 3 }
+    { &quot;user&quot;: &quot;NathanGiesen@211&quot;, &quot;count&quot;: 6 }
+    { &quot;user&quot;: &quot;NilaMilliron_tw&quot;, &quot;count&quot;: 1 }
+    { &quot;user&quot;: &quot;ChangEwing_573&quot;, &quot;count&quot;: 1 }
+</pre></div></div>
+<div class="section">
+<h3>Query 10 - Grouping and Limits<a name="Query_10_-_Grouping_and_Limits"></a></h3>
+<p>In some use cases it is not necessary to compute the entire answer to a query. In some cases, just having the first <i>N</i> or top <i>N</i> results is sufficient. This is expressible in AQL using the <i>limit</i> clause combined with the <i>order by</i> clause.</p>
+<p>The following AQL query returns the top 3 Twitter users based on who has issued the most tweets:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    for $t in dataset TweetMessages
+    group by $uid := $t.user.screen-name with $t
+    let $c := count($t)
+    order by $c desc
+    limit 3
+    return {
+        &quot;user&quot;: $uid,
+        &quot;count&quot;: $c
+    };
+</pre></div>
+<p>The expected result for this query is:</p>
+
+<div class="source">
+<pre>    { &quot;user&quot;: &quot;NathanGiesen@211&quot;, &quot;count&quot;: 6 }
+    { &quot;user&quot;: &quot;ColineGeyer@63&quot;, &quot;count&quot;: 3 }
+    { &quot;user&quot;: &quot;NilaMilliron_tw&quot;, &quot;count&quot;: 1 }
+</pre></div></div>
+<div class="section">
+<h3>Query 11 - Left Outer Fuzzy Join<a name="Query_11_-_Left_Outer_Fuzzy_Join"></a></h3>
+<p>As a last example of AQL and its query power, the following query, for each tweet, finds all of the tweets that are similar based on the topics that they refer to:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    set simfunction &quot;jaccard&quot;;
+    set simthreshold &quot;0.3&quot;;
+
+    for $t in dataset TweetMessages
+    return {
+        &quot;tweet&quot;: $t,
+        &quot;similar-tweets&quot;: for $t2 in dataset TweetMessages
+                where  $t2.referred-topics ~= $t.referred-topics
+                and $t2.tweetid != $t.tweetid
+                return $t2.referred-topics
+    };
+</pre></div>
+<p>This query illustrates several things worth knowing in order to write fuzzy queries in AQL. First, as mentioned earlier, AQL offers an operator-based syntax for seeing whether two values are &#x201c;similar&#x201d; to one another or not. Second, recall that the referred-topics field of records of datatype TweetMessageType is a bag of strings. This query sets the context for its similarity join by requesting that Jaccard-based similarity semantics (<a class="externalLink" href="http://en.wikipedia.org/wiki/Jaccard_index">http://en.wikipedia.org/wiki/Jaccard_index</a>) be used for the query&#x2019;s similarity operator and that a similarity index of 0.3 be used as its similarity threshold.</p>
+<p>The expected result for this fuzzy join query is:</p>
+
+<div class="source">
+<pre>    { &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;1&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;NathanGiesen@211&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: 39339, &quot;statuses_count&quot;: 473, &quot;name&quot;: &quot;Nathan Giesen&quot;, &quot;followers_count&quot;: 49416 }, &quot;sender-location&quot;: point(&quot;47.44,80.65&quot;), &quot;send-time&quot;: datetime(&quot;2008-04-26T10:10:00.000Z&quot;), &quot;referred-topics&quot;: {{ &quot;t-mobile&quot;, &quot;customization&quot; }}, &quot;message-text&quot;: &quot; love t-mobile its customization is good:)&quot; }, &quot;similar-tweets&quot;: [ {{ &quot;t-mobile&quot;, &quot;shortcut-menu&quot; }} ] }
+    { &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;10&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;ColineGeyer@63&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: 121, &quot;statuses_count&quot;: 362, &quot;name&quot;: &quot;Coline Geyer&quot;, &quot;followers_count&quot;: 17159 }, &quot;sender-location&quot;: point(&quot;29.15,76.53&quot;), &quot;send-time&quot;: datetime(&quot;2008-01-26T10:10:00.000Z&quot;), &quot;referred-topics&quot;: {{ &quot;verizon&quot;, &quot;voice-clarity&quot; }}, &quot;message-text&quot;: &quot; hate verizon its voice-clarity is OMG:(&quot; }, &quot;similar-tweets&quot;: [ {{ &quot;iphone&quot;, &quot;voice-clarity&quot; }}, {{ &quot;verizon&quot;, &quot;voicemail-service&quot; }}, {{ &quot;verizon&quot;, &quot;shortcut-menu&quot; }} ] }
+    { &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;11&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;NilaMilliron_tw&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: 445, &quot;statuses_count&quot;: 164, &quot;name&quot;: &quot;Nila Milliron&quot;, &quot;followers_count&quot;: 22649 }, &quot;sender-location&quot;: point(&quot;37.59,68.42&quot;), &quot;send-time&quot;: datetime(&quot;2008-03-09T10:10:00.000Z&quot;), &quot;referred-topics&quot;: {{ &quot;iphone&quot;, &quot;platform&quot; }}, &quot;message-text&quot;: &quot; can't stand iphone its platform is terrible&quot; }, &quot;similar-tweets&quot;: [ {{ &quot;iphone&quot;, &quot;voice-clarity&quot; }}, {{ &quot;samsung&quot;, &quot;platform&quot; }} ] }
+    { &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;12&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;OliJackson_512&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: 445, &quot;statuses_count&quot;: 164, &quot;name&quot;: &quot;Oli Jackson&quot;, &quot;followers_count&quot;: 22649 }, &quot;sender-location&quot;: point(&quot;24.82,94.63&quot;), &quot;send-time&quot;: datetime(&quot;2010-02-13T10:10:00.000Z&quot;), &quot;referred-topics&quot;: {{ &quot;samsung&quot;, &quot;voice-command&quot; }}, &quot;message-text&quot;: &quot; like samsung the voice-command is amazing:)&quot; }, &quot;similar-tweets&quot;: [ {{ &quot;samsung&quot;, &quot;platform&quot; }}, {{ &quot;sprint&quot;, &quot;voice-command&quot; }} ] }
+    { &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;2&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;ColineGeyer@63&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: 121, &quot;statuses_count&quot;: 362, &quot;name&quot;: &quot;Coline Geyer&quot;, &quot;followers_count&quot;: 17159 }, &quot;sender-location&quot;: point(&quot;32.84,67.14&quot;), &quot;send-time&quot;: datetime(&quot;2010-05-13T10:10:00.000Z&quot;), &quot;referred-topics&quot;: {{ &quot;verizon&quot;, &quot;shortcut-menu&quot; }}, &quot;message-text&quot;: &quot; like verizon its shortcut-menu is awesome:)&quot; }, &quot;similar-tweets&quot;: [ {{ &quot;verizon&quot;, &quot;voicemail-service&quot; }}, {{ &quot;verizon&quot;, &quot;voice-clarity&quot; }}, {{ &quot;t-mobile&quot;, &quot;shortcut-menu&quot; }} ] }
+    { &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;3&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;NathanGiesen@211&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: 39339, &quot;statuses_count&quot;: 473, &quot;name&quot;: &quot;Nathan Giesen&quot;, &quot;followers_count&quot;: 49416 }, &quot;sender-location&quot;: point(&quot;29.72,75.8&quot;), &quot;send-time&quot;: datetime(&quot;2006-11-04T10:10:00.000Z&quot;), &quot;referred-topics&quot;: {{ &quot;motorola&quot;, &quot;speed&quot; }}, &quot;message-text&quot;: &quot; like motorola the speed is good:)&quot; }, &quot;similar-tweets&quot;: [ {{ &quot;motorola&quot;, &quot;speed&quot; }} ] }
+    { &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;4&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;NathanGiesen@211&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: 39339, &quot;statuses_count&quot;: 473, &quot;name&quot;: &quot;Nathan Giesen&quot;, &quot;followers_count&quot;: 49416 }, &quot;sender-location&quot;: point(&quot;39.28,70.48&quot;), &quot;send-time&quot;: datetime(&quot;2011-12-26T10:10:00.000Z&quot;), &quot;referred-topics&quot;: {{ &quot;sprint&quot;, &quot;voice-command&quot; }}, &quot;message-text&quot;: &quot; like sprint the voice-command is mind-blowing:)&quot; }, &quot;similar-tweets&quot;: [ {{ &quot;samsung&quot;, &quot;voice-command&quot; }} ] }
+    { &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;5&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;NathanGiesen@211&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: 39339, &quot;statuses_count&quot;: 473, &quot;name&quot;: &quot;Nathan Giesen&quot;, &quot;followers_count&quot;: 49416 }, &quot;sender-location&quot;: point(&quot;40.09,92.69&quot;), &quot;send-time&quot;: datetime(&quot;2006-08-04T10:10:00.000Z&quot;), &quot;referred-topics&quot;: {{ &quot;motorola&quot;, &quot;speed&quot; }}, &quot;message-text&quot;: &quot; can't stand motorola its speed is terrible:(&quot; }, &quot;similar-tweets&quot;: [ {{ &quot;motorola&quot;, &quot;speed&quot; }} ] }
+    { &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;6&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;ColineGeyer@63&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: 121, &quot;statuses_count&quot;: 362, &quot;name&quot;: &quot;Coline Geyer&quot;, &quot;followers_count&quot;: 17159 }, &quot;sender-location&quot;: point(&quot;47.51,83.99&quot;), &quot;send-time&quot;: datetime(&quot;2010-05-07T10:10:00.000Z&quot;), &quot;referred-topics&quot;: {{ &quot;iphone&quot;, &quot;voice-clarity&quot; }}, &quot;message-text&quot;: &quot; like iphone the voice-clarity is good:)&quot; }, &quot;similar-tweets&quot;: [ {{ &quot;verizon&quot;, &quot;voice-clarity&quot; }}, {{ &quot;iphone&quot;, &quot;platform&quot; }} ] }
+    { &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;7&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;ChangEwing_573&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: 182, &quot;statuses_count&quot;: 394, &quot;name&quot;: &quot;Chang Ewing&quot;, &quot;followers_count&quot;: 32136 }, &quot;sender-location&quot;: point(&quot;36.21,72.6&quot;), &quot;send-time&quot;: datetime(&quot;2011-08-25T10:10:00.000Z&quot;), &quot;referred-topics&quot;: {{ &quot;samsung&quot;, &quot;platform&quot; }}, &quot;message-text&quot;: &quot; like samsung the platform is good&quot; }, &quot;similar-tweets&quot;: [ {{ &quot;iphone&quot;, &quot;platform&quot; }}, {{ &quot;samsung&quot;, &quot;voice-command&quot; }} ] }
+    { &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;8&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;NathanGiesen@211&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: 39339, &quot;statuses_count&quot;: 473, &quot;name&quot;: &quot;Nathan Giesen&quot;, &quot;followers_count&quot;: 49416 }, &quot;sender-location&quot;: point(&quot;46.05,93.34&quot;), &quot;send-time&quot;: datetime(&quot;2005-10-14T10:10:00.000Z&quot;), &quot;referred-topics&quot;: {{ &quot;t-mobile&quot;, &quot;shortcut-menu&quot; }}, &quot;message-text&quot;: &quot; like t-mobile the shortcut-menu is awesome:)&quot; }, &quot;similar-tweets&quot;: [ {{ &quot;t-mobile&quot;, &quot;customization&quot; }}, {{ &quot;verizon&quot;, &quot;shortcut-menu&quot; }} ] }
+    { &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;9&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;NathanGiesen@211&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: 39339, &quot;statuses_count&quot;: 473, &quot;name&quot;: &quot;Nathan Giesen&quot;, &quot;followers_count&quot;: 49416 }, &quot;sender-location&quot;: point(&quot;36.86,74.62&quot;), &quot;send-time&quot;: datetime(&quot;2012-07-21T10:10:00.000Z&quot;), &quot;referred-topics&quot;: {{ &quot;verizon&quot;, &quot;voicemail-service&quot; }}, &quot;message-text&quot;: &quot; love verizon its voicemail-service is awesome&quot; }, &quot;similar-tweets&quot;: [ {{ &quot;verizon&quot;, &quot;voice-clarity&quot; }}, {{ &quot;verizon&quot;, &quot;shortcut-menu&quot; }} ] }
+</pre></div></div>
+<div class="section">
+<h3>Inserting New Data<a name="Inserting_New_Data"></a></h3>
+<p>In addition to loading and querying data, AsterixDB supports incremental additions to datasets via the AQL <i>insert</i> statement.</p>
+<p>The following example adds a new tweet by user &#x201c;<a class="externalLink" href="mailto:NathanGiesen@211">NathanGiesen@211</a>&#x201d; to the TweetMessages dataset. (An astute reader may notice that this tweet was issued a half an hour after his last tweet, so his counts have all gone up in the interim, although he appears not to have moved in the last half hour.)</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    insert into dataset TweetMessages
+    (
+       {&quot;tweetid&quot;:&quot;13&quot;,
+        &quot;user&quot;:
+            {&quot;screen-name&quot;:&quot;NathanGiesen@211&quot;,
+             &quot;lang&quot;:&quot;en&quot;,
+             &quot;friends_count&quot;:39345,
+             &quot;statuses_count&quot;:479,
+             &quot;name&quot;:&quot;Nathan Giesen&quot;,
+             &quot;followers_count&quot;:49420
+            },
+        &quot;sender-location&quot;:point(&quot;47.44,80.65&quot;),
+        &quot;send-time&quot;:datetime(&quot;2008-04-26T10:10:35&quot;),
+        &quot;referred-topics&quot;:{{&quot;tweeting&quot;}},
+        &quot;message-text&quot;:&quot;tweety tweet, my fellow tweeters!&quot;
+       }
+    );
+</pre></div>
+<p>In general, the data to be inserted may be specified using any valid AQL query expression. The insertion of a single object instance, as in this example, is just a special case where the query expression happens to be a record constructor involving only constants.</p></div>
+<div class="section">
+<h3>Deleting Exi

<TRUNCATED>


[10/13] incubator-asterixdb-site git commit: Initial commit with Till's changes

Posted by im...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/aql/js-sdk.html
----------------------------------------------------------------------
diff --git a/aql/js-sdk.html b/aql/js-sdk.html
new file mode 100644
index 0000000..af57a03
--- /dev/null
+++ b/aql/js-sdk.html
@@ -0,0 +1,897 @@
+<!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 class="active">
+    
+            <a href="#"><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>
+    
+                          <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 Javascript SDK</h1>
+<div class="section">
+<h2>Obtaining and Including<a name="Obtaining_and_Including"></a></h2>
+<p><a class="externalLink" href="http://asterixdb.ics.uci.edu/download/bindings/asterix-sdk-stable.js">Download</a> the javascript SDK and include it like any other javascript library by adding the following line in the appropriate HTML file:</p>
+
+<div class="source">
+<pre>&lt;script src=&quot;path/to/asterix-sdk-stable.js&quot;&gt;&lt;/script&gt;
+</pre></div></div>
+<div class="section">
+<h2>Interactive Demos<a name="Interactive_Demos"></a></h2>
+<p>There are two interactive demos that are available for download. Both of the demos illustrate how the javascript API would be used in an application:</p>
+
+<ul>
+  
+<li><a class="externalLink" href="http://asterixdb.ics.uci.edu/download/demos/tweetbook-demo.zip">Tweetbook Demo</a>: a contrived geo-spatial  application dealing with artificial Tweets allowing spatial, temporal, and  keyword-based filtering.</li>
+  
+<li><a class="externalLink" href="http://asterixdb.ics.uci.edu/download/demos/admaql101-demo.zip">ADM/AQL 101 Demo</a>: an interactive version of  all of the examples that are provided in the following section.</li>
+</ul></div>
+<div class="section">
+<h2>The javascript SDK: by example<a name="The_javascript_SDK:_by_example"></a></h2>
+<p>In this section, we explore how to form AQL queries using the javascript SDK. The queries from <a href="primer.html">AsterixDB 101: An ADM and AQL Primer</a> are used as examples here. For each AQL statement, the equivalent javascript expression is shown below it, followed by the results of executing the query.</p>
+<div class="section">
+<h3>Query 0-A - Exact-Match Lookup<a name="Query_0-A_-_Exact-Match_Lookup"></a></h3>
+<div class="section">
+<div class="section">
+<div class="section">
+<h6>AQL<a name="AQL"></a></h6>
+
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $user in dataset FacebookUsers
+where $user.id = 8
+return $user;
+</pre></div></div>
+<div class="section">
+<h6>JS<a name="JS"></a></h6>
+
+<div class="source">
+<pre>var expression0a = new FLWOGRExpression()
+    .ForClause(&quot;$user&quot;, new AExpression(&quot;dataset FacebookUsers&quot;))
+    .WhereClause(new AExpression(&quot;$user.id = 8&quot;))
+    .ReturnClause(&quot;$user&quot;);
+</pre></div></div>
+<div class="section">
+<h6>Results<a name="Results"></a></h6>
+
+<div class="source">
+<pre>{ &quot;id&quot;: { int32: 8 } , &quot;alias&quot;: &quot;Nila&quot;, &quot;name&quot;: &quot;NilaMilliron&quot;, &quot;user-since&quot;: { datetime: 1199182200000}, &quot;friend-ids&quot;: { unorderedlist: [{ int32: 3 } ]}, &quot;employment&quot;: { orderedlist: [{ &quot;organization-name&quot;: &quot;Plexlane&quot;, &quot;start-date&quot;: { date: 1267315200000}, &quot;end-date&quot;: null } ]} }
+</pre></div></div></div></div></div>
+<div class="section">
+<h3>Query 0-B - Range Scan<a name="Query_0-B_-_Range_Scan"></a></h3>
+<div class="section">
+<div class="section">
+<div class="section">
+<h6>AQL<a name="AQL"></a></h6>
+
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $user in dataset FacebookUsers
+where $user.id &gt;= 2 and $user.id &lt;= 4
+return $user;
+</pre></div></div>
+<div class="section">
+<h6>JS<a name="JS"></a></h6>
+
+<div class="source">
+<pre>var expression0b = new FLWOGRExpression()
+    .ForClause(&quot;$user&quot;, new AExpression(&quot;dataset FacebookUsers&quot;))
+    .WhereClause().and(new AExpression(&quot;$user.id &gt;= 2&quot;), new AExpression(&quot;$user.id &lt;= 4&quot;))
+    .ReturnClause(&quot;$user&quot;);
+</pre></div></div>
+<div class="section">
+<h6>Results<a name="Results"></a></h6>
+
+<div class="source">
+<pre>{ &quot;id&quot;: { int32: 2 } , &quot;alias&quot;: &quot;Isbel&quot;, &quot;name&quot;: &quot;IsbelDull&quot;, &quot;user-since&quot;: { datetime: 1295691000000}, &quot;friend-ids&quot;: { unorderedlist: [{ int32: 1 } , { int32: 4 } ]}, &quot;employment&quot;: { orderedlist: [{ &quot;organization-name&quot;: &quot;Hexviafind&quot;, &quot;start-date&quot;: { date: 1272326400000}, &quot;end-date&quot;: null } ]} }
+{ &quot;id&quot;: { int32: 3 } , &quot;alias&quot;: &quot;Emory&quot;, &quot;name&quot;: &quot;EmoryUnk&quot;, &quot;user-since&quot;: { datetime: 1341915000000}, &quot;friend-ids&quot;: { unorderedlist: [{ int32: 1 } , { int32: 5 } , { int32: 8 } , { int32: 9 } ]}, &quot;employment&quot;: { orderedlist: [{ &quot;organization-name&quot;: &quot;geomedia&quot;, &quot;start-date&quot;: { date: 1276732800000}, &quot;end-date&quot;: { date: 1264464000000} } ]} }
+{ &quot;id&quot;: { int32: 4 } , &quot;alias&quot;: &quot;Nicholas&quot;, &quot;name&quot;: &quot;NicholasStroh&quot;, &quot;user-since&quot;: { datetime: 1293444600000}, &quot;friend-ids&quot;: { unorderedlist: [{ int32: 2 } ]}, &quot;employment&quot;: { orderedlist: [{ &quot;organization-name&quot;: &quot;Zamcorporation&quot;, &quot;start-date&quot;: { date: 1275955200000}, &quot;end-date&quot;: null } ]} }
+</pre></div></div></div></div></div>
+<div class="section">
+<h3>Query 1 - Other Query Filters<a name="Query_1_-_Other_Query_Filters"></a></h3>
+<div class="section">
+<div class="section">
+<div class="section">
+<h6>AQL<a name="AQL"></a></h6>
+
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $user in dataset FacebookUsers
+where $user.user-since &gt;= datetime('2010-07-22T00:00:00')
+and $user.user-since &lt;= datetime('2012-07-29T23:59:59')
+return $user;
+</pre></div></div>
+<div class="section">
+<h6>JS<a name="JS"></a></h6>
+
+<div class="source">
+<pre>var expression1 = new FLWOGRExpression()
+    .ForClause(&quot;$user&quot;, new AExpression(&quot;dataset FacebookUsers&quot;))
+    .WhereClause().and(
+       new AExpression(&quot;$user.user-since &gt;= datetime('2010-07-22T00:00:00')&quot;),
+       new AExpression(&quot;$user.user-since &lt;= datetime('2012-07-29T23:59:59')&quot;)
+    ).ReturnClause(&quot;$user&quot;);
+</pre></div></div>
+<div class="section">
+<h6>Results<a name="Results"></a></h6>
+
+<div class="source">
+<pre>{ &quot;id&quot;: { int32: 2 } , &quot;alias&quot;: &quot;Isbel&quot;, &quot;name&quot;: &quot;IsbelDull&quot;, &quot;user-since&quot;: { datetime: 1295691000000}, &quot;friend-ids&quot;: { unorderedlist: [{ int32: 1 } , { int32: 4 } ]}, &quot;employment&quot;: { orderedlist: [{ &quot;organization-name&quot;: &quot;Hexviafind&quot;, &quot;start-date&quot;: { date: 1272326400000}, &quot;end-date&quot;: null } ]} }
+{ &quot;id&quot;: { int32: 10 } , &quot;alias&quot;: &quot;Bram&quot;, &quot;name&quot;: &quot;BramHatch&quot;, &quot;user-since&quot;: { datetime: 1287223800000}, &quot;friend-ids&quot;: { unorderedlist: [{ int32: 1 } , { int32: 5 } , { int32: 9 } ]}, &quot;employment&quot;: { orderedlist: [{ &quot;organization-name&quot;: &quot;physcane&quot;, &quot;start-date&quot;: { date: 1181001600000}, &quot;end-date&quot;: { date: 1320451200000} } ]} }
+{ &quot;id&quot;: { int32: 3 } , &quot;alias&quot;: &quot;Emory&quot;, &quot;name&quot;: &quot;EmoryUnk&quot;, &quot;user-since&quot;: { datetime: 1341915000000}, &quot;friend-ids&quot;: { unorderedlist: [{ int32: 1 } , { int32: 5 } , { int32: 8 } , { int32: 9 } ]}, &quot;employment&quot;: { orderedlist: [{ &quot;organization-name&quot;: &quot;geomedia&quot;, &quot;start-date&quot;: { date: 1276732800000}, &quot;end-date&quot;: { date: 1264464000000} } ]} }
+{ &quot;id&quot;: { int32: 4 } , &quot;alias&quot;: &quot;Nicholas&quot;, &quot;name&quot;: &quot;NicholasStroh&quot;, &quot;user-since&quot;: { datetime: 1293444600000}, &quot;friend-ids&quot;: { unorderedlist: [{ int32: 2 } ]}, &quot;employment&quot;: { orderedlist: [{ &quot;organization-name&quot;: &quot;Zamcorporation&quot;, &quot;start-date&quot;: { date: 1275955200000}, &quot;end-date&quot;: null } ]} }
+</pre></div></div></div></div></div>
+<div class="section">
+<h3>Query 2-A - Equijoin<a name="Query_2-A_-_Equijoin"></a></h3>
+<div class="section">
+<div class="section">
+<div class="section">
+<h6>AQL<a name="AQL"></a></h6>
+
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $user in dataset FacebookUsers
+for $message in dataset FacebookMessages
+where $message.author-id = $user.id
+return {
+    &quot;uname&quot;: $user.name,
+    &quot;message&quot;: $message.message
+};
+</pre></div></div>
+<div class="section">
+<h6>JS<a name="JS"></a></h6>
+
+<div class="source">
+<pre>var expression2a = new FLWOGRExpression()
+    .ForClause (&quot;$user&quot;, new AExpression(&quot;dataset FacebookUsers&quot;))
+    .ForClause (&quot;$message&quot;, new AExpression(&quot;dataset FacebookMessages&quot;))
+    .WhereClause(new AExpression(&quot;$message.author-id = $user.id&quot;))
+    .ReturnClause({
+       &quot;uname&quot; : &quot;$user.name&quot;,
+       &quot;message&quot; : &quot;$message.message&quot;
+    });
+</pre></div></div>
+<div class="section">
+<h6>Results<a name="Results"></a></h6>
+
+<div class="source">
+<pre>{ &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;message&quot;: &quot; dislike iphone its touch-screen is horrible&quot; }
+{ &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;message&quot;: &quot; like verizon the 3G is awesome:)&quot; }
+{ &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;message&quot;: &quot; can't stand motorola the touch-screen is terrible&quot; }
+{ &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;message&quot;: &quot; can't stand at&amp;t the network is horrible:(&quot; }
+{ &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;message&quot;: &quot; can't stand at&amp;t its plan is terrible&quot; }
+{ &quot;uname&quot;: &quot;IsbelDull&quot;, &quot;message&quot;: &quot; like samsung the plan is amazing&quot; }
+{ &quot;uname&quot;: &quot;IsbelDull&quot;, &quot;message&quot;: &quot; like t-mobile its platform is mind-blowing&quot; }
+{ &quot;uname&quot;: &quot;WoodrowNehling&quot;, &quot;message&quot;: &quot; love at&amp;t its 3G is good:)&quot; }
+{ &quot;uname&quot;: &quot;BramHatch&quot;, &quot;message&quot;: &quot; dislike iphone the voice-command is bad:(&quot; }
+{ &quot;uname&quot;: &quot;BramHatch&quot;, &quot;message&quot;: &quot; can't stand t-mobile its voicemail-service is OMG:(&quot; }
+{ &quot;uname&quot;: &quot;EmoryUnk&quot;, &quot;message&quot;: &quot; love sprint its shortcut-menu is awesome:)&quot; }
+{ &quot;uname&quot;: &quot;EmoryUnk&quot;, &quot;message&quot;: &quot; love verizon its wireless is good&quot; }
+{ &quot;uname&quot;: &quot;WillisWynne&quot;, &quot;message&quot;: &quot; love sprint the customization is mind-blowing&quot; }
+{ &quot;uname&quot;: &quot;SuzannaTillson&quot;, &quot;message&quot;: &quot; like iphone the voicemail-service is awesome&quot; }
+{ &quot;uname&quot;: &quot;VonKemble&quot;, &quot;message&quot;: &quot; dislike sprint the speed is horrible&quot; }
+</pre></div></div></div></div></div>
+<div class="section">
+<h3>Query 2-B - Index join<a name="Query_2-B_-_Index_join"></a></h3>
+<div class="section">
+<div class="section">
+<div class="section">
+<h6>AQL<a name="AQL"></a></h6>
+
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $user in dataset FacebookUsers
+for $message in dataset FacebookMessages
+where $message.author-id /*+ indexnl */  = $user.id
+return {
+    &quot;uname&quot;: $user.name,
+    &quot;message&quot;: $message.message
+};
+</pre></div></div>
+<div class="section">
+<h6>JS<a name="JS"></a></h6>
+
+<div class="source">
+<pre>var expression2b = new FLWOGRExpression()
+    .ForClause (&quot;$user&quot;, new AExpression(&quot;dataset FacebookUsers&quot;))
+    .ForClause (&quot;$message&quot;, new AExpression(&quot;dataset FacebookMessages&quot;))
+    .WhereClause(new AExpression(&quot;$message.author-id /*+ indexnl */  = $user.id&quot;))
+    .ReturnClause({
+       &quot;uname&quot; : &quot;$user.name&quot;,
+       &quot;message&quot; : &quot;$message.message&quot;
+    });
+</pre></div></div>
+<div class="section">
+<h6>Results<a name="Results"></a></h6>
+
+<div class="source">
+<pre>{ &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;message&quot;: &quot; dislike iphone its touch-screen is horrible&quot; }
+{ &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;message&quot;: &quot; like verizon the 3G is awesome:)&quot; }
+{ &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;message&quot;: &quot; can't stand motorola the touch-screen is terrible&quot; }
+{ &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;message&quot;: &quot; can't stand at&amp;t the network is horrible:(&quot; }
+{ &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;message&quot;: &quot; can't stand at&amp;t its plan is terrible&quot; }
+{ &quot;uname&quot;: &quot;IsbelDull&quot;, &quot;message&quot;: &quot; like samsung the plan is amazing&quot; }
+{ &quot;uname&quot;: &quot;IsbelDull&quot;, &quot;message&quot;: &quot; like t-mobile its platform is mind-blowing&quot; }
+{ &quot;uname&quot;: &quot;WoodrowNehling&quot;, &quot;message&quot;: &quot; love at&amp;t its 3G is good:)&quot; }
+{ &quot;uname&quot;: &quot;BramHatch&quot;, &quot;message&quot;: &quot; dislike iphone the voice-command is bad:(&quot; }
+{ &quot;uname&quot;: &quot;BramHatch&quot;, &quot;message&quot;: &quot; can't stand t-mobile its voicemail-service is OMG:(&quot; }
+{ &quot;uname&quot;: &quot;EmoryUnk&quot;, &quot;message&quot;: &quot; love sprint its shortcut-menu is awesome:)&quot; }
+{ &quot;uname&quot;: &quot;EmoryUnk&quot;, &quot;message&quot;: &quot; love verizon its wireless is good&quot; }
+{ &quot;uname&quot;: &quot;WillisWynne&quot;, &quot;message&quot;: &quot; love sprint the customization is mind-blowing&quot; }
+{ &quot;uname&quot;: &quot;SuzannaTillson&quot;, &quot;message&quot;: &quot; like iphone the voicemail-service is awesome&quot; }
+{ &quot;uname&quot;: &quot;VonKemble&quot;, &quot;message&quot;: &quot; dislike sprint the speed is horrible&quot; }
+</pre></div></div></div></div></div>
+<div class="section">
+<h3>Query 3 - Nested Outer Join<a name="Query_3_-_Nested_Outer_Join"></a></h3>
+<div class="section">
+<div class="section">
+<div class="section">
+<h6>AQL<a name="AQL"></a></h6>
+
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $user in dataset FacebookUsers
+return {
+    &quot;uname&quot;: $user.name,
+    &quot;messages&quot;: for $message in dataset FacebookMessages
+                where $message.author-id = $user.id
+                return $message.message
+};
+</pre></div></div>
+<div class="section">
+<h6>JS<a name="JS"></a></h6>
+
+<div class="source">
+<pre>var expression3messages = new FLWOGRExpression()
+    .ForClause(&quot;$message&quot;, new AExpression(&quot;dataset FacebookMessages&quot;))
+    .WhereClause(new AExpression(&quot;$message.author-id = $user.id&quot;))
+    .ReturnClause(&quot;$message.message&quot;);
+
+var expression3 = new FLWOGRExpression()
+    .ForClause (&quot;$user&quot;, new AExpression(&quot;dataset FacebookUsers&quot;))
+    .ReturnClause({
+        &quot;uname&quot;: &quot;$user.name&quot;,
+        &quot;messages&quot; : expression3messages
+    });
+</pre></div></div>
+<div class="section">
+<h6>Results<a name="Results"></a></h6>
+
+<div class="source">
+<pre>{ &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;messages&quot;: { orderedlist: [&quot; dislike iphone its touch-screen is horrible&quot;, &quot; like verizon the 3G is awesome:)&quot;, &quot; can't stand motorola the touch-screen is terrible&quot;, &quot; can't stand at&amp;t the network is horrible:(&quot;, &quot; can't stand at&amp;t its plan is terrible&quot; ]} }
+{ &quot;uname&quot;: &quot;IsbelDull&quot;, &quot;messages&quot;: { orderedlist: [&quot; like samsung the plan is amazing&quot;, &quot; like t-mobile its platform is mind-blowing&quot; ]} }
+{ &quot;uname&quot;: &quot;NilaMilliron&quot;, &quot;messages&quot;: { orderedlist: [ ]} }
+{ &quot;uname&quot;: &quot;WoodrowNehling&quot;, &quot;messages&quot;: { orderedlist: [&quot; love at&amp;t its 3G is good:)&quot; ]} }
+{ &quot;uname&quot;: &quot;BramHatch&quot;, &quot;messages&quot;: { orderedlist: [&quot; dislike iphone the voice-command is bad:(&quot;, &quot; can't stand t-mobile its voicemail-service is OMG:(&quot; ]} }
+{ &quot;uname&quot;: &quot;EmoryUnk&quot;, &quot;messages&quot;: { orderedlist: [&quot; love sprint its shortcut-menu is awesome:)&quot;, &quot; love verizon its wireless is good&quot; ]} }
+{ &quot;uname&quot;: &quot;WillisWynne&quot;, &quot;messages&quot;: { orderedlist: [&quot; love sprint the customization is mind-blowing&quot; ]} }
+{ &quot;uname&quot;: &quot;SuzannaTillson&quot;, &quot;messages&quot;: { orderedlist: [&quot; like iphone the voicemail-service is awesome&quot; ]} }
+{ &quot;uname&quot;: &quot;NicholasStroh&quot;, &quot;messages&quot;: { orderedlist: [ ]} }
+{ &quot;uname&quot;: &quot;VonKemble&quot;, &quot;messages&quot;: { orderedlist: [&quot; dislike sprint the speed is horrible&quot; ]} }
+</pre></div></div></div></div></div>
+<div class="section">
+<h3>Query 4 - Theta Join<a name="Query_4_-_Theta_Join"></a></h3>
+<div class="section">
+<div class="section">
+<div class="section">
+<h6>AQL<a name="AQL"></a></h6>
+
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $t in dataset TweetMessages
+return {
+    &quot;message&quot;: $t.message-text,
+    &quot;nearby-messages&quot;: for $t2 in dataset TweetMessages
+                       where spatial-distance($t.sender-location, $t2.sender-location) &lt;= 1
+                       return { &quot;msgtxt&quot;:$t2.message-text}
+};
+</pre></div></div>
+<div class="section">
+<h6>JS<a name="JS"></a></h6>
+
+<div class="source">
+<pre>var expression4messages = new FLWOGRExpression()
+    .ForClause( &quot;$t2&quot;, new AExpression(&quot;dataset TweetMessages&quot;))
+    .WhereClause( new AExpression(&quot;spatial-distance($t.sender-location, $t2.sender-location) &lt;= 1&quot;))
+    .ReturnClause({ &quot;msgtxt&quot; : &quot;$t2.message-text&quot; });
+
+var expression4 = new FLWOGRExpression()
+    .ForClause( &quot;$t&quot;, new AExpression(&quot;dataset TweetMessages&quot;))
+    .ReturnClause({
+        &quot;message&quot; : &quot;$t.message-text&quot;,
+        &quot;nearby-messages&quot; : expression4messages
+    });
+</pre></div></div>
+<div class="section">
+<h6>Results<a name="Results"></a></h6>
+
+<div class="source">
+<pre>{ &quot;message&quot;: &quot; hate verizon its voice-clarity is OMG:(&quot;, &quot;nearby-messages&quot;: { orderedlist: [{ &quot;msgtxt&quot;: &quot; hate verizon its voice-clarity is OMG:(&quot; }, { &quot;msgtxt&quot;: &quot; like motorola the speed is good:)&quot; } ]} }
+{ &quot;message&quot;: &quot; like iphone the voice-clarity is good:)&quot;, &quot;nearby-messages&quot;: { orderedlist: [{ &quot;msgtxt&quot;: &quot; like iphone the voice-clarity is good:)&quot; } ]} }
+{ &quot;message&quot;: &quot; like samsung the platform is good&quot;, &quot;nearby-messages&quot;: { orderedlist: [{ &quot;msgtxt&quot;: &quot; like samsung the platform is good&quot; } ]} }
+{ &quot;message&quot;: &quot; love t-mobile its customization is good:)&quot;, &quot;nearby-messages&quot;: { orderedlist: [{ &quot;msgtxt&quot;: &quot; love t-mobile its customization is good:)&quot; } ]} }
+{ &quot;message&quot;: &quot; like samsung the voice-command is amazing:)&quot;, &quot;nearby-messages&quot;: { orderedlist: [{ &quot;msgtxt&quot;: &quot; like samsung the voice-command is amazing:)&quot; } ]} }
+{ &quot;message&quot;: &quot; like motorola the speed is good:)&quot;, &quot;nearby-messages&quot;: { orderedlist: [{ &quot;msgtxt&quot;: &quot; hate verizon its voice-clarity is OMG:(&quot; }, { &quot;msgtxt&quot;: &quot; like motorola the speed is good:)&quot; } ]} }
+{ &quot;message&quot;: &quot; love verizon its voicemail-service is awesome&quot;, &quot;nearby-messages&quot;: { orderedlist: [{ &quot;msgtxt&quot;: &quot; love verizon its voicemail-service is awesome&quot; } ]} }
+{ &quot;message&quot;: &quot; can't stand motorola its speed is terrible:(&quot;, &quot;nearby-messages&quot;: { orderedlist: [{ &quot;msgtxt&quot;: &quot; can't stand motorola its speed is terrible:(&quot; } ]} }
+{ &quot;message&quot;: &quot; like t-mobile the shortcut-menu is awesome:)&quot;, &quot;nearby-messages&quot;: { orderedlist: [{ &quot;msgtxt&quot;: &quot; like t-mobile the shortcut-menu is awesome:)&quot; } ]} }
+{ &quot;message&quot;: &quot; can't stand iphone its platform is terrible&quot;, &quot;nearby-messages&quot;: { orderedlist: [{ &quot;msgtxt&quot;: &quot; can't stand iphone its platform is terrible&quot; } ]} }
+{ &quot;message&quot;: &quot; like verizon its shortcut-menu is awesome:)&quot;, &quot;nearby-messages&quot;: { orderedlist: [{ &quot;msgtxt&quot;: &quot; like verizon its shortcut-menu is awesome:)&quot; } ]} }
+{ &quot;message&quot;: &quot; like sprint the voice-command is mind-blowing:)&quot;, &quot;nearby-messages&quot;: { orderedlist: [{ &quot;msgtxt&quot;: &quot; like sprint the voice-command is mind-blowing:)&quot; } ]} }
+</pre></div></div></div></div></div>
+<div class="section">
+<h3>Query 5 - Fuzzy Join<a name="Query_5_-_Fuzzy_Join"></a></h3>
+<div class="section">
+<div class="section">
+<div class="section">
+<h6>AQL<a name="AQL"></a></h6>
+<p>use dataverse TinySocial;</p>
+
+<div class="source">
+<pre>set simfunction &quot;edit-distance&quot;;
+set simthreshold &quot;3&quot;;
+
+for $fbu in dataset FacebookUsers
+return {
+    &quot;id&quot;: $fbu.id,
+    &quot;name&quot;: $fbu.name,
+    &quot;similar-users&quot;: for $t in dataset TweetMessages
+                     let $tu := $t.user
+                     where $tu.name ~= $fbu.name
+                    return {
+                        &quot;twitter-screenname&quot;: $tu.screen-name,
+                        &quot;twitter-name&quot;: $tu.name
+                    }
+};
+</pre></div></div>
+<div class="section">
+<h6>JS<a name="JS"></a></h6>
+
+<div class="source">
+<pre>var similarUsersExpression = new FLWOGRExpression()
+    .ForClause(&quot;$t&quot;, new AExpression(&quot;dataset TweetMessages&quot;))
+    .LetClause (&quot;$tu&quot;, new AExpression(&quot;$t.user&quot;))
+    .WhereClause(new AExpression(&quot;$tu.name ~= $fbu.name&quot;))
+    .ReturnClause({
+        &quot;twitter-screenname&quot;: &quot;$tu.screen-name&quot;,
+        &quot;twitter-name&quot;: &quot;$tu.name&quot;
+    });
+
+var expression5 = new FLWOGRExpression()
+    .ForClause (&quot;$fbu&quot;, new AExpression(&quot;dataset FacebookUsers&quot;))
+    .ReturnClause(
+        {
+            &quot;id&quot; : &quot;$fbu.id&quot;,
+            &quot;name&quot; : &quot;$fbu.name&quot;,
+            &quot;similar-users&quot; : similarUsersExpression
+        }
+    );
+</pre></div></div>
+<div class="section">
+<h6>Results<a name="Results"></a></h6>
+
+<div class="source">
+<pre>{ &quot;id&quot;: { int32: 1 } , &quot;name&quot;: &quot;MargaritaStoddard&quot;, &quot;similar-users&quot;: { orderedlist: [ ]} }
+{ &quot;id&quot;: { int32: 2 } , &quot;name&quot;: &quot;IsbelDull&quot;, &quot;similar-users&quot;: { orderedlist: [ ]} }
+{ &quot;id&quot;: { int32: 8 } , &quot;name&quot;: &quot;NilaMilliron&quot;, &quot;similar-users&quot;: { orderedlist: [{ &quot;twitter-screenname&quot;: &quot;NilaMilliron_tw&quot;, &quot;twitter-name&quot;: &quot;Nila Milliron&quot; } ]} }
+{ &quot;id&quot;: { int32: 9 } , &quot;name&quot;: &quot;WoodrowNehling&quot;, &quot;similar-users&quot;: { orderedlist: [ ]} }
+{ &quot;id&quot;: { int32: 10 } , &quot;name&quot;: &quot;BramHatch&quot;, &quot;similar-users&quot;: { orderedlist: [ ]} }
+{ &quot;id&quot;: { int32: 3 } , &quot;name&quot;: &quot;EmoryUnk&quot;, &quot;similar-users&quot;: { orderedlist: [ ]} }
+{ &quot;id&quot;: { int32: 6 } , &quot;name&quot;: &quot;WillisWynne&quot;, &quot;similar-users&quot;: { orderedlist: [ ]} }
+{ &quot;id&quot;: { int32: 7 } , &quot;name&quot;: &quot;SuzannaTillson&quot;, &quot;similar-users&quot;: { orderedlist: [ ]} }
+{ &quot;id&quot;: { int32: 4 } , &quot;name&quot;: &quot;NicholasStroh&quot;, &quot;similar-users&quot;: { orderedlist: [ ]} }
+{ &quot;id&quot;: { int32: 5 } , &quot;name&quot;: &quot;VonKemble&quot;, &quot;similar-users&quot;: { orderedlist: [ ]} }
+</pre></div></div></div></div></div>
+<div class="section">
+<h3>Query 6 - Existential Quantification<a name="Query_6_-_Existential_Quantification"></a></h3>
+<div class="section">
+<div class="section">
+<div class="section">
+<h6>AQL<a name="AQL"></a></h6>
+
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $fbu in dataset FacebookUsers
+where (some $e in $fbu.employment satisfies is-null($e.end-date))
+return $fbu;
+</pre></div></div>
+<div class="section">
+<h6>JS<a name="JS"></a></h6>
+
+<div class="source">
+<pre>var expression6 = new FLWOGRExpression()
+    .ForClause (&quot;$fbu&quot;, new AQLClause().set(&quot;dataset FacebookUsers&quot;))
+    .WhereClause(
+        new QuantifiedExpression (
+            &quot;some&quot; ,
+            {&quot;$e&quot; : new AExpression(&quot;$fbu.employment&quot;) },
+            new FunctionExpression(&quot;is-null&quot;, new AExpression(&quot;$e.end-date&quot;))
+        )
+    )
+    .ReturnClause(&quot;$fbu&quot;);
+</pre></div></div>
+<div class="section">
+<h6>Results<a name="Results"></a></h6>
+
+<div class="source">
+<pre>{ &quot;id&quot;: { int32: 1 } , &quot;alias&quot;: &quot;Margarita&quot;, &quot;name&quot;: &quot;MargaritaStoddard&quot;, &quot;user-since&quot;: { datetime: 1345457400000}, &quot;friend-ids&quot;: { unorderedlist: [{ int32: 2 } , { int32: 3 } , { int32: 6 } , { int32: 10 } ]}, &quot;employment&quot;: { orderedlist: [{ &quot;organization-name&quot;: &quot;Codetechno&quot;, &quot;start-date&quot;: { date: 1154822400000}, &quot;end-date&quot;: null } ]} }
+{ &quot;id&quot;: { int32: 2 } , &quot;alias&quot;: &quot;Isbel&quot;, &quot;name&quot;: &quot;IsbelDull&quot;, &quot;user-since&quot;: { datetime: 1295691000000}, &quot;friend-ids&quot;: { unorderedlist: [{ int32: 1 } , { int32: 4 } ]}, &quot;employment&quot;: { orderedlist: [{ &quot;organization-name&quot;: &quot;Hexviafind&quot;, &quot;start-date&quot;: { date: 1272326400000}, &quot;end-date&quot;: null } ]} }
+{ &quot;id&quot;: { int32: 8 } , &quot;alias&quot;: &quot;Nila&quot;, &quot;name&quot;: &quot;NilaMilliron&quot;, &quot;user-since&quot;: { datetime: 1199182200000}, &quot;friend-ids&quot;: { unorderedlist: [{ int32: 3 } ]}, &quot;employment&quot;: { orderedlist: [{ &quot;organization-name&quot;: &quot;Plexlane&quot;, &quot;start-date&quot;: { date: 1267315200000}, &quot;end-date&quot;: null } ]} }
+{ &quot;id&quot;: { int32: 6 } , &quot;alias&quot;: &quot;Willis&quot;, &quot;name&quot;: &quot;WillisWynne&quot;, &quot;user-since&quot;: { datetime: 1105956600000}, &quot;friend-ids&quot;: { unorderedlist: [{ int32: 1 } , { int32: 3 } , { int32: 7 } ]}, &quot;employment&quot;: { orderedlist: [{ &quot;organization-name&quot;: &quot;jaydax&quot;, &quot;start-date&quot;: { date: 1242345600000}, &quot;end-date&quot;: null } ]} }
+{ &quot;id&quot;: { int32: 7 } , &quot;alias&quot;: &quot;Suzanna&quot;, &quot;name&quot;: &quot;SuzannaTillson&quot;, &quot;user-since&quot;: { datetime: 1344334200000}, &quot;friend-ids&quot;: { unorderedlist: [{ int32: 6 } ]}, &quot;employment&quot;: { orderedlist: [{ &quot;organization-name&quot;: &quot;Labzatron&quot;, &quot;start-date&quot;: { date: 1303171200000}, &quot;end-date&quot;: null } ]} }
+{ &quot;id&quot;: { int32: 4 } , &quot;alias&quot;: &quot;Nicholas&quot;, &quot;name&quot;: &quot;NicholasStroh&quot;, &quot;user-since&quot;: { datetime: 1293444600000}, &quot;friend-ids&quot;: { unorderedlist: [{ int32: 2 } ]}, &quot;employment&quot;: { orderedlist: [{ &quot;organization-name&quot;: &quot;Zamcorporation&quot;, &quot;start-date&quot;: { date: 1275955200000}, &quot;end-date&quot;: null } ]} }
+{ &quot;id&quot;: { int32: 5 } , &quot;alias&quot;: &quot;Von&quot;, &quot;name&quot;: &quot;VonKemble&quot;, &quot;user-since&quot;: { datetime: 1262686200000}, &quot;friend-ids&quot;: { unorderedlist: [{ int32: 3 } , { int32: 6 } , { int32: 10 } ]}, &quot;employment&quot;: { orderedlist: [{ &quot;organization-name&quot;: &quot;Kongreen&quot;, &quot;start-date&quot;: { date: 1290816000000}, &quot;end-date&quot;: null } ]} }
+</pre></div></div></div></div></div>
+<div class="section">
+<h3>Query 7 - Universal Quantification<a name="Query_7_-_Universal_Quantification"></a></h3>
+<div class="section">
+<div class="section">
+<div class="section">
+<h6>AQL<a name="AQL"></a></h6>
+
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $fbu in dataset FacebookUsers
+where (every $e in $fbu.employment satisfies not(is-null($e.end-date)))
+return $fbu;
+</pre></div></div>
+<div class="section">
+<h6>JS<a name="JS"></a></h6>
+
+<div class="source">
+<pre>var expression7 = new FLWOGRExpression()
+    .ForClause(&quot;$fbu&quot;, new AExpression(&quot;dataset FacebookUsers&quot;))
+    .WhereClause(
+        new QuantifiedExpression (
+            &quot;every&quot; ,
+            {&quot;$e&quot; : new AExpression(&quot;$fbu.employment&quot;) },
+            new FunctionExpression(&quot;not&quot;, new FunctionExpression(&quot;is-null&quot;, new AExpression(&quot;$e.end-date&quot;)))
+        )
+    )
+    .ReturnClause(&quot;$fbu&quot;);
+</pre></div></div>
+<div class="section">
+<h6>Results<a name="Results"></a></h6>
+
+<div class="source">
+<pre>{ &quot;id&quot;: { int32: 9 } , &quot;alias&quot;: &quot;Woodrow&quot;, &quot;name&quot;: &quot;WoodrowNehling&quot;, &quot;user-since&quot;: { datetime: 1127211000000}, &quot;friend-ids&quot;: { unorderedlist: [{ int32: 3 } , { int32: 10 } ]}, &quot;employment&quot;: { orderedlist: [{ &quot;organization-name&quot;: &quot;Zuncan&quot;, &quot;start-date&quot;: { date: 1050969600000}, &quot;end-date&quot;: { date: 1260662400000} } ]} }
+{ &quot;id&quot;: { int32: 10 } , &quot;alias&quot;: &quot;Bram&quot;, &quot;name&quot;: &quot;BramHatch&quot;, &quot;user-since&quot;: { datetime: 1287223800000}, &quot;friend-ids&quot;: { unorderedlist: [{ int32: 1 } , { int32: 5 } , { int32: 9 } ]}, &quot;employment&quot;: { orderedlist: [{ &quot;organization-name&quot;: &quot;physcane&quot;, &quot;start-date&quot;: { date: 1181001600000}, &quot;end-date&quot;: { date: 1320451200000} } ]} }
+{ &quot;id&quot;: { int32: 3 } , &quot;alias&quot;: &quot;Emory&quot;, &quot;name&quot;: &quot;EmoryUnk&quot;, &quot;user-since&quot;: { datetime: 1341915000000}, &quot;friend-ids&quot;: { unorderedlist: [{ int32: 1 } , { int32: 5 } , { int32: 8 } , { int32: 9 } ]}, &quot;employment&quot;: { orderedlist: [{ &quot;organization-name&quot;: &quot;geomedia&quot;, &quot;start-date&quot;: { date: 1276732800000}, &quot;end-date&quot;: { date: 1264464000000} } ]} }
+</pre></div></div></div></div></div>
+<div class="section">
+<h3>Query 8 - Simple Aggregation<a name="Query_8_-_Simple_Aggregation"></a></h3>
+<div class="section">
+<div class="section">
+<div class="section">
+<h6>AQL<a name="AQL"></a></h6>
+
+<div class="source">
+<pre>use dataverse TinySocial;
+
+count(for $fbu in dataset FacebookUsers return $fbu);
+</pre></div></div>
+<div class="section">
+<h6>JS<a name="JS"></a></h6>
+
+<div class="source">
+<pre>var expression8 = new FunctionExpression(
+    &quot;count&quot;,
+    new FLWOGRExpression()
+        .ForClause(&quot;$fbu&quot;, new AExpression(&quot;dataset FacebookUsers&quot;))
+        .ReturnClause(&quot;$fbu&quot;)
+);
+</pre></div></div>
+<div class="section">
+<h6>Results<a name="Results"></a></h6>
+
+<div class="source">
+<pre>{ int64: 10 }
+</pre></div></div></div></div></div>
+<div class="section">
+<h3>Query 9-A - Grouping and Aggregation<a name="Query_9-A_-_Grouping_and_Aggregation"></a></h3>
+<div class="section">
+<div class="section">
+<div class="section">
+<h6>AQL<a name="AQL"></a></h6>
+
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $t in dataset TweetMessages
+group by $uid := $t.user.screen-name with $t
+return {
+    &quot;user&quot;: $uid,
+    &quot;count&quot;: count($t)
+};
+</pre></div></div>
+<div class="section">
+<h6>JS<a name="JS"></a></h6>
+
+<div class="source">
+<pre>var expression9a = new FLWOGRExpression()
+    .ForClause(&quot;$t&quot;, new AExpression(&quot;dataset TweetMessages&quot;))
+    .GroupClause(&quot;$uid&quot;, new AExpression(&quot;$t.user.screen-name&quot;), &quot;with&quot;, &quot;$t&quot;)
+    .ReturnClause(
+        {
+            &quot;user&quot; : &quot;$uid&quot;,
+            &quot;count&quot; : new FunctionExpression(&quot;count&quot;, new AExpression(&quot;$t&quot;))
+        }
+    );
+</pre></div></div>
+<div class="section">
+<h6>Results<a name="Results"></a></h6>
+
+<div class="source">
+<pre>{ &quot;user&quot;: &quot;ColineGeyer@63&quot;, &quot;count&quot;: { int64: 3 } }
+{ &quot;user&quot;: &quot;OliJackson_512&quot;, &quot;count&quot;: { int64: 1 } }
+{ &quot;user&quot;: &quot;NilaMilliron_tw&quot;, &quot;count&quot;: { int64: 1 } }
+{ &quot;user&quot;: &quot;ChangEwing_573&quot;, &quot;count&quot;: { int64: 1 } }
+{ &quot;user&quot;: &quot;NathanGiesen@211&quot;, &quot;count&quot;: { int64: 6 } }
+</pre></div></div></div></div></div>
+<div class="section">
+<h3>Query 9-B - (Hash-Based) Grouping and Aggregation<a name="Query_9-B_-_Hash-Based_Grouping_and_Aggregation"></a></h3>
+<div class="section">
+<div class="section">
+<div class="section">
+<h6>AQL<a name="AQL"></a></h6>
+
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $t in dataset TweetMessages
+/*+ hash*/
+group by $uid := $t.user.screen-name with $t
+return {
+    &quot;user&quot;: $uid,
+    &quot;count&quot;: count($t)
+};
+</pre></div></div>
+<div class="section">
+<h6>JS<a name="JS"></a></h6>
+
+<div class="source">
+<pre>var expression9b = new FLWOGRExpression()
+    .ForClause(&quot;$t&quot;, new AExpression(&quot;dataset TweetMessages&quot;))
+    .AQLClause(&quot;/*+ hash*/&quot;)
+    .GroupClause(&quot;$uid&quot;, new AExpression(&quot;$t.user.screen-name&quot;), &quot;with&quot;, &quot;$t&quot;)
+    .ReturnClause(
+        {
+            &quot;user&quot; : &quot;$uid&quot;,
+            &quot;count&quot; : new FunctionExpression(&quot;count&quot;, new AExpression(&quot;$t&quot;))
+        }
+    );
+</pre></div></div>
+<div class="section">
+<h6>Results<a name="Results"></a></h6>
+
+<div class="source">
+<pre>{ &quot;user&quot;: &quot;ColineGeyer@63&quot;, &quot;count&quot;: { int64: 3 } }
+{ &quot;user&quot;: &quot;OliJackson_512&quot;, &quot;count&quot;: { int64: 1 } }
+{ &quot;user&quot;: &quot;NilaMilliron_tw&quot;, &quot;count&quot;: { int64: 1 } }
+{ &quot;user&quot;: &quot;ChangEwing_573&quot;, &quot;count&quot;: { int64: 1 } }
+{ &quot;user&quot;: &quot;NathanGiesen@211&quot;, &quot;count&quot;: { int64: 6 } }
+</pre></div></div></div></div></div>
+<div class="section">
+<h3>Query 10 - Grouping and Limits<a name="Query_10_-_Grouping_and_Limits"></a></h3>
+<div class="section">
+<div class="section">
+<div class="section">
+<h6>AQL<a name="AQL"></a></h6>
+
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $t in dataset TweetMessages
+group by $uid := $t.user.screen-name with $t
+let $c := count($t)
+order by $c desc
+limit 3
+return {
+    &quot;user&quot;: $uid,
+    &quot;count&quot;: $c
+};
+</pre></div></div>
+<div class="section">
+<h6>JS<a name="JS"></a></h6>
+
+<div class="source">
+<pre>var expression10 = new FLWOGRExpression()
+    .ForClause(&quot;$t&quot;, new AExpression(&quot;dataset TweetMessages&quot;))
+    .GroupClause(&quot;$uid&quot;, new AExpression(&quot;$t.user.screen-name&quot;), &quot;with&quot;, &quot;$t&quot;)
+    .LetClause(&quot;$c&quot;, new FunctionExpression(&quot;count&quot;, new AExpression(&quot;$t&quot;)))
+    .OrderbyClause( new AExpression(&quot;$c&quot;), &quot;desc&quot; )
+    .LimitClause(new AExpression(&quot;3&quot;))
+    .ReturnClause(
+        {
+            &quot;user&quot; : &quot;$uid&quot;,
+            &quot;count&quot; : &quot;$c&quot;
+        }
+    );
+</pre></div></div>
+<div class="section">
+<h6>Results<a name="Results"></a></h6>
+
+<div class="source">
+<pre>{ &quot;user&quot;: &quot;NathanGiesen@211&quot;, &quot;count&quot;: { int64: 6 } }
+{ &quot;user&quot;: &quot;ColineGeyer@63&quot;, &quot;count&quot;: { int64: 3 } }
+{ &quot;user&quot;: &quot;NilaMilliron_tw&quot;, &quot;count&quot;: { int64: 1 } }
+</pre></div></div></div></div></div>
+<div class="section">
+<h3>Query 11 - Left Outer Fuzzy Join<a name="Query_11_-_Left_Outer_Fuzzy_Join"></a></h3>
+<div class="section">
+<div class="section">
+<div class="section">
+<h6>AQL<a name="AQL"></a></h6>
+
+<div class="source">
+<pre>use dataverse TinySocial;
+
+set simfunction &quot;jaccard&quot;;
+set simthreshold &quot;0.3&quot;;
+
+for $t in dataset TweetMessages
+return {
+    &quot;tweet&quot;: $t,
+    &quot;similar-tweets&quot;: for $t2 in dataset TweetMessages
+    where  $t2.referred-topics ~= $t.referred-topics
+    and $t2.tweetid != $t.tweetid
+    return $t2.referred-topics
+};
+</pre></div></div>
+<div class="section">
+<h6>JS<a name="JS"></a></h6>
+
+<div class="source">
+<pre>var expression11 = new FLWOGRExpression()
+    .ForClause( &quot;$t&quot;, new AExpression(&quot;dataset TweetMessages&quot;))
+    .ReturnClause({
+        &quot;tweet&quot;         : new AExpression(&quot;$t&quot;),
+        &quot;similar-tweets&quot;: new FLWOGRExpression()
+                            .ForClause( &quot;$t2&quot;, new AExpression(&quot;dataset TweetMessages&quot;))
+                            .WhereClause().and(
+                                new AExpression(&quot;$t2.referred-topics ~= $t.referred-topics&quot;),
+                                new AExpression(&quot;$t2.tweetid != $t.tweetid&quot;)
+                             )
+                            .ReturnClause(&quot;$t2.referred-topics&quot;)
+    });
+</pre></div></div>
+<div class="section">
+<h6>Results<a name="Results"></a></h6>
+
+<div class="source">
+<pre>{ &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;10&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;ColineGeyer@63&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: { int32: 121 } , &quot;statuses_count&quot;: { int32: 362 } , &quot;name&quot;: &quot;Coline Geyer&quot;, &quot;followers_count&quot;: { int32: 17159 } }, &quot;sender-location&quot;: { point: [29.15, 76.53]}, &quot;send-time&quot;: { datetime: 1201342200000}, &quot;referred-topics&quot;: { unorderedlist: [&quot;verizon&quot;, &quot;voice-clarity&quot; ]}, &quot;message-text&quot;: &quot; hate verizon its voice-clarity is OMG:(&quot; }, &quot;similar-tweets&quot;: { orderedlist: [{ unorderedlist: [&quot;iphone&quot;, &quot;voice-clarity&quot; ]}, { unorderedlist: [&quot;verizon&quot;, &quot;shortcut-menu&quot; ]}, { unorderedlist: [&quot;verizon&quot;, &quot;voicemail-service&quot; ]} ]} }
+{ &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;6&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;ColineGeyer@63&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: { int32: 121 } , &quot;statuses_count&quot;: { int32: 362 } , &quot;name&quot;: &quot;Coline Geyer&quot;, &quot;followers_count&quot;: { int32: 17159 } }, &quot;sender-location&quot;: { point: [47.51, 83.99]}, &quot;send-time&quot;: { datetime: 1273227000000}, &quot;referred-topics&quot;: { unorderedlist: [&quot;iphone&quot;, &quot;voice-clarity&quot; ]}, &quot;message-text&quot;: &quot; like iphone the voice-clarity is good:)&quot; }, &quot;similar-tweets&quot;: { orderedlist: [{ unorderedlist: [&quot;verizon&quot;, &quot;voice-clarity&quot; ]}, { unorderedlist: [&quot;iphone&quot;, &quot;platform&quot; ]} ]} }
+{ &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;7&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;ChangEwing_573&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: { int32: 182 } , &quot;statuses_count&quot;: { int32: 394 } , &quot;name&quot;: &quot;Chang Ewing&quot;, &quot;followers_count&quot;: { int32: 32136 } }, &quot;sender-location&quot;: { point: [36.21, 72.6]}, &quot;send-time&quot;: { datetime: 1314267000000}, &quot;referred-topics&quot;: { unorderedlist: [&quot;samsung&quot;, &quot;platform&quot; ]}, &quot;message-text&quot;: &quot; like samsung the platform is good&quot; }, &quot;similar-tweets&quot;: { orderedlist: [{ unorderedlist: [&quot;iphone&quot;, &quot;platform&quot; ]}, { unorderedlist: [&quot;samsung&quot;, &quot;voice-command&quot; ]} ]} }
+{ &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;1&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;NathanGiesen@211&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: { int32: 39339 } , &quot;statuses_count&quot;: { int32: 473 } , &quot;name&quot;: &quot;Nathan Giesen&quot;, &quot;followers_count&quot;: { int32: 49416 } }, &quot;sender-location&quot;: { point: [47.44, 80.65]}, &quot;send-time&quot;: { datetime: 1209204600000}, &quot;referred-topics&quot;: { unorderedlist: [&quot;t-mobile&quot;, &quot;customization&quot; ]}, &quot;message-text&quot;: &quot; love t-mobile its customization is good:)&quot; }, &quot;similar-tweets&quot;: { orderedlist: [{ unorderedlist: [&quot;t-mobile&quot;, &quot;shortcut-menu&quot; ]} ]} }
+{ &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;12&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;OliJackson_512&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: { int32: 445 } , &quot;statuses_count&quot;: { int32: 164 } , &quot;name&quot;: &quot;Oli Jackson&quot;, &quot;followers_count&quot;: { int32: 22649 } }, &quot;sender-location&quot;: { point: [24.82, 94.63]}, &quot;send-time&quot;: { datetime: 1266055800000}, &quot;referred-topics&quot;: { unorderedlist: [&quot;samsung&quot;, &quot;voice-command&quot; ]}, &quot;message-text&quot;: &quot; like samsung the voice-command is amazing:)&quot; }, &quot;similar-tweets&quot;: { orderedlist: [{ unorderedlist: [&quot;samsung&quot;, &quot;platform&quot; ]}, { unorderedlist: [&quot;sprint&quot;, &quot;voice-command&quot; ]} ]} }
+{ &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;3&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;NathanGiesen@211&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: { int32: 39339 } , &quot;statuses_count&quot;: { int32: 473 } , &quot;name&quot;: &quot;Nathan Giesen&quot;, &quot;followers_count&quot;: { int32: 49416 } }, &quot;sender-location&quot;: { point: [29.72, 75.8]}, &quot;send-time&quot;: { datetime: 1162635000000}, &quot;referred-topics&quot;: { unorderedlist: [&quot;motorola&quot;, &quot;speed&quot; ]}, &quot;message-text&quot;: &quot; like motorola the speed is good:)&quot; }, &quot;similar-tweets&quot;: { orderedlist: [{ unorderedlist: [&quot;motorola&quot;, &quot;speed&quot; ]} ]} }
+{ &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;9&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;NathanGiesen@211&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: { int32: 39339 } , &quot;statuses_count&quot;: { int32: 473 } , &quot;name&quot;: &quot;Nathan Giesen&quot;, &quot;followers_count&quot;: { int32: 49416 } }, &quot;sender-location&quot;: { point: [36.86, 74.62]}, &quot;send-time&quot;: { datetime: 1342865400000}, &quot;referred-topics&quot;: { unorderedlist: [&quot;verizon&quot;, &quot;voicemail-service&quot; ]}, &quot;message-text&quot;: &quot; love verizon its voicemail-service is awesome&quot; }, &quot;similar-tweets&quot;: { orderedlist: [{ unorderedlist: [&quot;verizon&quot;, &quot;voice-clarity&quot; ]}, { unorderedlist: [&quot;verizon&quot;, &quot;shortcut-menu&quot; ]} ]} }
+{ &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;5&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;NathanGiesen@211&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: { int32: 39339 } , &quot;statuses_count&quot;: { int32: 473 } , &quot;name&quot;: &quot;Nathan Giesen&quot;, &quot;followers_count&quot;: { int32: 49416 } }, &quot;sender-location&quot;: { point: [40.09, 92.69]}, &quot;send-time&quot;: { datetime: 1154686200000}, &quot;referred-topics&quot;: { unorderedlist: [&quot;motorola&quot;, &quot;speed&quot; ]}, &quot;message-text&quot;: &quot; can't stand motorola its speed is terrible:(&quot; }, &quot;similar-tweets&quot;: { orderedlist: [{ unorderedlist: [&quot;motorola&quot;, &quot;speed&quot; ]} ]} }
+{ &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;8&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;NathanGiesen@211&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: { int32: 39339 } , &quot;statuses_count&quot;: { int32: 473 } , &quot;name&quot;: &quot;Nathan Giesen&quot;, &quot;followers_count&quot;: { int32: 49416 } }, &quot;sender-location&quot;: { point: [46.05, 93.34]}, &quot;send-time&quot;: { datetime: 1129284600000}, &quot;referred-topics&quot;: { unorderedlist: [&quot;t-mobile&quot;, &quot;shortcut-menu&quot; ]}, &quot;message-text&quot;: &quot; like t-mobile the shortcut-menu is awesome:)&quot; }, &quot;similar-tweets&quot;: { orderedlist: [{ unorderedlist: [&quot;verizon&quot;, &quot;shortcut-menu&quot; ]}, { unorderedlist: [&quot;t-mobile&quot;, &quot;customization&quot; ]} ]} }
+{ &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;11&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;NilaMilliron_tw&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: { int32: 445 } , &quot;statuses_count&quot;: { int32: 164 } , &quot;name&quot;: &quot;Nila Milliron&quot;, &quot;followers_count&quot;: { int32: 22649 } }, &quot;sender-location&quot;: { point: [37.59, 68.42]}, &quot;send-time&quot;: { datetime: 1205057400000}, &quot;referred-topics&quot;: { unorderedlist: [&quot;iphone&quot;, &quot;platform&quot; ]}, &quot;message-text&quot;: &quot; can't stand iphone its platform is terrible&quot; }, &quot;similar-tweets&quot;: { orderedlist: [{ unorderedlist: [&quot;iphone&quot;, &quot;voice-clarity&quot; ]}, { unorderedlist: [&quot;samsung&quot;, &quot;platform&quot; ]} ]} }
+{ &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;2&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;ColineGeyer@63&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: { int32: 121 } , &quot;statuses_count&quot;: { int32: 362 } , &quot;name&quot;: &quot;Coline Geyer&quot;, &quot;followers_count&quot;: { int32: 17159 } }, &quot;sender-location&quot;: { point: [32.84, 67.14]}, &quot;send-time&quot;: { datetime: 1273745400000}, &quot;referred-topics&quot;: { unorderedlist: [&quot;verizon&quot;, &quot;shortcut-menu&quot; ]}, &quot;message-text&quot;: &quot; like verizon its shortcut-menu is awesome:)&quot; }, &quot;similar-tweets&quot;: { orderedlist: [{ unorderedlist: [&quot;t-mobile&quot;, &quot;shortcut-menu&quot; ]}, { unorderedlist: [&quot;verizon&quot;, &quot;voice-clarity&quot; ]}, { unorderedlist: [&quot;verizon&quot;, &quot;voicemail-service&quot; ]} ]} }
+{ &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;4&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;NathanGiesen@211&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: { int32: 39339 } , &quot;statuses_count&quot;: { int32: 473 } , &quot;name&quot;: &quot;Nathan Giesen&quot;, &quot;followers_count&quot;: { int32: 49416 } }, &quot;sender-location&quot;: { point: [39.28, 70.48]}, &quot;send-time&quot;: { datetime: 1324894200000}, &quot;referred-topics&quot;: { unorderedlist: [&quot;sprint&quot;, &quot;voice-command&quot; ]}, &quot;message-text&quot;: &quot; like sprint the voice-command is mind-blowing:)&quot; }, &quot;similar-tweets&quot;: { orderedlist: [{ unorderedlist: [&quot;samsung&quot;, &quot;voice-command&quot; ]} ]} }
+</pre></div></div></div></div></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>


[11/13] incubator-asterixdb-site git commit: Initial commit with Till's changes

Posted by im...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/aql/functions.html
----------------------------------------------------------------------
diff --git a/aql/functions.html b/aql/functions.html
new file mode 100644
index 0000000..62df709
--- /dev/null
+++ b/aql/functions.html
@@ -0,0 +1,4740 @@
+<!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 class="active">
+    
+            <a href="#"><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: Using Functions</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="#NumericFunctions">Numeric Functions</a></li>
+  
+<li><a href="#StringFunctions">String Functions</a></li>
+  
+<li><a href="#AggregateFunctions">Aggregate Functions</a></li>
+  
+<li><a href="#SpatialFunctions">Spatial Functions</a></li>
+  
+<li><a href="#SimilarityFunctions">Similarity Functions</a></li>
+  
+<li><a href="#TokenizingFunctions">Tokenizing Functions</a></li>
+  
+<li><a href="#TemporalFunctions">Temporal Functions</a></li>
+  
+<li><a href="#OtherFunctions">Other Functions</a></li>
+</ul>
+<p>Asterix provides various classes of functions to support operations on numeric, string, spatial, and temporal data. This document explains how to use these functions.</p></div>
+<div class="section">
+<h2><a name="NumericFunctions" id="NumericFunctions">Numeric Functions</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Numeric_Functions_Back_to_TOC"></a></h2>
+<div class="section">
+<h3>abs<a name="abs"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>abs(numeric_expression)
+</pre></div></li>
+  
+<li>
+<p>Computes the absolute value of the argument.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>numeric_expression</tt>: A <tt>int8</tt>/<tt>int16</tt>/<tt>int32</tt>/<tt>int64</tt>/<tt>float</tt>/<tt>double</tt> value.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>The absolute value of the argument with the same type as the input argument, or <tt>null</tt> if the argument is a <tt>null</tt> value.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>let $v1 := abs(2013)
+let $v2 := abs(-4036)
+let $v3 := abs(0)
+let $v4 := abs(float(&quot;-2013.5&quot;))
+let $v5 := abs(double(&quot;-2013.593823748327284&quot;))
+return { &quot;v1&quot;: $v1, &quot;v2&quot;: $v2, &quot;v3&quot;: $v3, &quot;v4&quot;: $v4, &quot;v5&quot;: $v5 }
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;v1&quot;: 2013, &quot;v2&quot;: 4036, &quot;v3&quot;: 0, &quot;v4&quot;: 2013.5f, &quot;v5&quot;: 2013.5938237483274d }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>ceiling<a name="ceiling"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>ceiling(numeric_expression)
+</pre></div></li>
+  
+<li>
+<p>Computes the smallest (closest to negative infinity) number with no fractional part that is not less than the value of the argument. If the argument is already equal to mathematical integer, then the result is the same as the argument.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>numeric_expression</tt>: A <tt>int8</tt>/<tt>int16</tt>/<tt>int32</tt>/<tt>int64</tt>/<tt>float</tt>/<tt>double</tt> value.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>The ceiling value for the given number in the same type as the input argument, or <tt>null</tt> if the input is <tt>null</tt>.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>let $v1 := ceiling(2013)
+let $v2 := ceiling(-4036)
+let $v3 := ceiling(0.3)
+let $v4 := ceiling(float(&quot;-2013.2&quot;))
+let $v5 := ceiling(double(&quot;-2013.893823748327284&quot;))
+return { &quot;v1&quot;: $v1, &quot;v2&quot;: $v2, &quot;v3&quot;: $v3, &quot;v4&quot;: $v4, &quot;v5&quot;: $v5 }
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;v1&quot;: 2013, &quot;v2&quot;: -4036, &quot;v3&quot;: 1.0d, &quot;v4&quot;: -2013.0f, &quot;v5&quot;: -2013.0d }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>floor<a name="floor"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>floor(numeric_expression)
+</pre></div></li>
+  
+<li>
+<p>Computes the largest (closest to positive infinity) number with no fractional part that is not greater than the value. If the argument is already equal to mathematical integer, then the result is the same as the argument.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>numeric_expression</tt>: A <tt>int8</tt>/<tt>int16</tt>/<tt>int32</tt>/<tt>int64</tt>/<tt>float</tt>/<tt>double</tt> value.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>The floor value for the given number in the same type as the input argument, or <tt>null</tt> if the input is <tt>null</tt>.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>let $v1 := floor(2013)
+let $v2 := floor(-4036)
+let $v3 := floor(0.8)
+let $v4 := floor(float(&quot;-2013.2&quot;))
+let $v5 := floor(double(&quot;-2013.893823748327284&quot;))
+return { &quot;v1&quot;: $v1, &quot;v2&quot;: $v2, &quot;v3&quot;: $v3, &quot;v4&quot;: $v4, &quot;v5&quot;: $v5 }
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;v1&quot;: 2013, &quot;v2&quot;: -4036, &quot;v3&quot;: 0.0d, &quot;v4&quot;: -2014.0f, &quot;v5&quot;: -2014.0d }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>round<a name="round"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>round(numeric_expression)
+</pre></div></li>
+  
+<li>
+<p>Computes the number with no fractional part that is closest (and also closest to positive infinity) to the argument.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>numeric_expression</tt>: A <tt>int8</tt>/<tt>int16</tt>/<tt>int32</tt>/<tt>int64</tt>/<tt>float</tt>/<tt>double</tt> value.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>The rounded value for the given number in the same type as the input argument, or <tt>null</tt> if the input is <tt>null</tt>.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>let $v1 := round(2013)
+let $v2 := round(-4036)
+let $v3 := round(0.8)
+let $v4 := round(float(&quot;-2013.256&quot;))
+let $v5 := round(double(&quot;-2013.893823748327284&quot;))
+return { &quot;v1&quot;: $v1, &quot;v2&quot;: $v2, &quot;v3&quot;: $v3, &quot;v4&quot;: $v4, &quot;v5&quot;: $v5 }
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;v1&quot;: 2013, &quot;v2&quot;: -4036, &quot;v3&quot;: 1.0d, &quot;v4&quot;: -2013.0f, &quot;v5&quot;: -2014.0d }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>round-half-to-even<a name="round-half-to-even"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>round-half-to-even(numeric_expression, [precision])
+</pre></div></li>
+  
+<li>
+<p>Computes the closest numeric value to <tt>numeric_expression</tt> that is a multiple of ten to the power of minus <tt>precision</tt>. <tt>precision</tt> is optional and by default value <tt>0</tt> is used.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>numeric_expression</tt>: A <tt>int8</tt>/<tt>int16</tt>/<tt>int32</tt>/<tt>int64</tt>/<tt>float</tt>/<tt>double</tt> value.</li>
+    
+<li><tt>precision</tt>: An optional integer field representing the number of digits in the fraction of the the result</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>The rounded value for the given number in the same type as the input argument, or <tt>null</tt> if the input is <tt>null</tt>.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>let $v1 := round-half-to-even(2013)
+let $v2 := round-half-to-even(-4036)
+let $v3 := round-half-to-even(0.8)
+let $v4 := round-half-to-even(float(&quot;-2013.256&quot;))
+let $v5 := round-half-to-even(double(&quot;-2013.893823748327284&quot;))
+let $v6 := round-half-to-even(double(&quot;-2013.893823748327284&quot;), 2)
+let $v7 := round-half-to-even(2013, 4)
+let $v8 := round-half-to-even(float(&quot;-2013.256&quot;), 5)
+return { &quot;v1&quot;: $v1, &quot;v2&quot;: $v2, &quot;v3&quot;: $v3, &quot;v4&quot;: $v4, &quot;v5&quot;: $v5, &quot;v6&quot;: $v6, &quot;v7&quot;: $v7, &quot;v8&quot;: $v8 }
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;v1&quot;: 2013, &quot;v2&quot;: -4036, &quot;v3&quot;: 1.0d, &quot;v4&quot;: -2013.0f, &quot;v5&quot;: -2014.0d, &quot;v6&quot;: -2013.89d, &quot;v7&quot;: 2013, &quot;v8&quot;: -2013.256f }
+</pre></div></li>
+</ul></div></div>
+<div class="section">
+<h2><a name="StringFunctions" id="StringFunctions">String Functions</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="String_Functions_Back_to_TOC"></a></h2>
+<div class="section">
+<h3>string-to-codepoint<a name="string-to-codepoint"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>string-to-codepoint(string_expression)
+</pre></div></li>
+  
+<li>
+<p>Converts the string <tt>string_expression</tt> to its code-based representation.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>string_expression</tt> : A <tt>string</tt> that will be converted.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>An <tt>OrderedList</tt> of the code points for the string <tt>string_expression</tt>.</li>
+  </ul></li>
+</ul></div>
+<div class="section">
+<h3>codepoint-to-string<a name="codepoint-to-string"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>codepoint-to-string(list_expression)
+</pre></div></li>
+  
+<li>
+<p>Converts the ordered code-based representation <tt>list_expression</tt> to the corresponding string.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>list_expression</tt> : An <tt>OrderedList</tt> of code-points.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>A <tt>string</tt> representation of <tt>list_expression</tt>.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+let $s := &quot;Hello ASTERIX!&quot;
+let $l := string-to-codepoint($s)
+let $ss := codepoint-to-string($l)
+return {&quot;codes&quot;: $l, &quot;string&quot;: $ss}
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;codes&quot;: [ 72, 101, 108, 108, 111, 32, 65, 83, 84, 69, 82, 73, 88, 33 ], &quot;string&quot;: &quot;Hello ASTERIX!&quot; }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>contains<a name="contains"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>contains(string_expression, substring_to_contain)
+</pre></div></li>
+  
+<li>
+<p>Checks whether the string <tt>string_expression</tt> contains the string <tt>substring_to_contain</tt></p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>string_expression</tt> : A <tt>string</tt> that might contain the given substring.</li>
+    
+<li><tt>substring_to_contain</tt> : A target <tt>string</tt> that might be contained.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>A <tt>boolean</tt> value, <tt>true</tt> if <tt>string_expression</tt> contains <tt>substring_to_contain</tt>, and <tt>false</tt> otherwise.</li>
+  </ul></li>
+  
+<li>Note: An n-gram index can be utilized for this function.</li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $i in dataset('FacebookMessages')
+where contains($i.message, &quot;phone&quot;)
+return {&quot;mid&quot;: $i.message-id, &quot;message&quot;: $i.message}
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;mid&quot;: 2, &quot;message&quot;: &quot; dislike iphone its touch-screen is horrible&quot; }
+{ &quot;mid&quot;: 13, &quot;message&quot;: &quot; dislike iphone the voice-command is bad:(&quot; }
+{ &quot;mid&quot;: 15, &quot;message&quot;: &quot; like iphone the voicemail-service is awesome&quot; }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>like<a name="like"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>like(string_expression, string_pattern)
+</pre></div></li>
+  
+<li>
+<p>Checks whether the string <tt>string_expression</tt> contains the string pattern <tt>string_pattern</tt>. Compared to the <tt>contains</tt> function, the <tt>like</tt> function also supports regular expressions.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>string_expression</tt> : A <tt>string</tt> that might contain the pattern or <tt>null</tt>.</li>
+    
+<li><tt>string_pattern</tt> : A pattern <tt>string</tt> that might be contained or <tt>null</tt>.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>A <tt>boolean</tt> value, <tt>true</tt> if <tt>string_expression</tt> contains the pattern <tt>string_pattern</tt>, and <tt>false</tt> otherwise.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $i in dataset('FacebookMessages')
+where like($i.message, &quot;%at&amp;t%&quot;)
+return $i.message
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>&quot; can't stand at&amp;t the network is horrible:(&quot;
+&quot; can't stand at&amp;t its plan is terrible&quot;
+&quot; love at&amp;t its 3G is good:)&quot;
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>starts-with<a name="starts-with"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>starts-with(string_expression, substring_to_start_with)
+</pre></div></li>
+  
+<li>
+<p>Checks whether the string <tt>string_expression</tt> starts with the string <tt>substring_to_start_with</tt>.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>string_expression</tt> : A <tt>string</tt> that might start with the given string.</li>
+    
+<li><tt>substring_to_start_with</tt> : A <tt>string</tt> that might be contained as the starting substring.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>A <tt>boolean</tt>, returns <tt>true</tt> if <tt>string_expression</tt> starts with the string <tt>substring_to_start_with</tt>, and <tt>false</tt> otherwise.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $i in dataset('FacebookMessages')
+where starts-with($i.message, &quot; like&quot;)
+return $i.message
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>&quot; like samsung the plan is amazing&quot;
+&quot; like t-mobile its platform is mind-blowing&quot;
+&quot; like verizon the 3G is awesome:)&quot;
+&quot; like iphone the voicemail-service is awesome&quot;
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>ends-with<a name="ends-with"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>ends-with(string_expression, substring_to_end_with)
+</pre></div></li>
+  
+<li>
+<p>Checks whether the string <tt>string_expression</tt> ends with the string <tt>substring_to_end_with</tt>.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>string_expression</tt> : A <tt>string</tt> that might end with the given string.</li>
+    
+<li><tt>substring_to_end_with</tt> : A <tt>string</tt> that might be contained as the ending substring.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>A <tt>boolean</tt>, returns <tt>true</tt> if <tt>string_expression</tt> ends with the string <tt>substring_to_end_with</tt>, and <tt>false</tt> otherwise.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $i in dataset('FacebookMessages')
+where ends-with($i.message, &quot;:)&quot;)
+return $i.message
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>&quot; love sprint its shortcut-menu is awesome:)&quot;
+&quot; like verizon the 3G is awesome:)&quot;
+&quot; love at&amp;t its 3G is good:)&quot;
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>string-concat<a name="string-concat"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>string-concat(list_expression)
+</pre></div></li>
+  
+<li>
+<p>Concatenates a list of strings <tt>list_expression</tt> into a single string.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>list_expression</tt> : An <tt>OrderedList</tt> or <tt>UnorderedList</tt> of <tt>string</tt>s (could be <tt>null</tt>) to be concatenated.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>Returns the concatenated <tt>string</tt> value.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>let $i := &quot;ASTERIX&quot;
+let $j := &quot; &quot;
+let $k := &quot;ROCKS!&quot;
+return string-concat([$i, $j, $k])
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>&quot;ASTERIX ROCKS!&quot;
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>string-join<a name="string-join"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>string-join(list_expression, string_expression)
+</pre></div></li>
+  
+<li>
+<p>Joins a list of strings <tt>list_expression</tt> with the given separator <tt>string_expression</tt> into a single string.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>list_expression</tt> : An <tt>OrderedList</tt> or <tt>UnorderedList</tt> of strings (could be <tt>null</tt>) to be joined.</li>
+    
+<li><tt>string_expression</tt> : A <tt>string</tt> as the separator.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>Returns the joined <tt>String</tt>.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+let $i := [&quot;ASTERIX&quot;, &quot;ROCKS~&quot;]
+return string-join($i, &quot;!! &quot;)
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>&quot;ASTERIX!! ROCKS~&quot;
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>lowercase<a name="lowercase"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>lowercase(string_expression)
+</pre></div></li>
+  
+<li>
+<p>Converts a given string <tt>string_expression</tt> to its lowercase form.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>string_expression</tt> : A <tt>string</tt> to be converted.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>Returns a <tt>string</tt> as the lowercase form of the given <tt>string_expression</tt>.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+let $i := &quot;ASTERIX&quot;
+return lowercase($i)
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>asterix
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>uppercase<a name="uppercase"></a></h3>
+
+<ul>
+  
+<li>Syntax:</li>
+</ul>
+<p>uppercase(string_expression)</p>
+
+<ul>
+  
+<li>Converts a given string <tt>string_expression</tt> to its uppercase form.</li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>string_expression</tt> : A <tt>string</tt> to be converted.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>Returns a <tt>string</tt> as the uppercase form of the given <tt>string_expression</tt>.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+let $i := &quot;asterix&quot;
+return uppercase($i)
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>ASTERIX
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>uppercase<a name="uppercase"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>uppercase(string_expression)
+</pre></div></li>
+  
+<li>
+<p>Converts a given string <tt>string_expression</tt> to its uppercase form.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>string_expression</tt> : A <tt>string</tt> to be converted.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>Returns a <tt>string</tt> as the uppercase form of the given <tt>string_expression</tt>.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+let $i := &quot;asterix&quot;
+return uppercase($i)
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>ASTERIX
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>matches<a name="matches"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>matches(string_expression, string_pattern)
+</pre></div></li>
+  
+<li>
+<p>Checks whether the strings <tt>string_expression</tt> matches the given pattern <tt>string_pattern</tt> (A Java regular expression pattern).</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>string_expression</tt> : A <tt>string</tt> that might contain the pattern.</li>
+    
+<li><tt>string_pattern</tt> : A pattern <tt>string</tt> to be matched.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>A <tt>boolean</tt>, returns <tt>true</tt> if <tt>string_expression</tt> matches the pattern <tt>string_pattern</tt>, and <tt>false</tt> otherwise.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $i in dataset('FacebookMessages')
+where matches($i.message, &quot;dislike iphone&quot;)
+return $i.message
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>&quot; dislike iphone its touch-screen is horrible&quot;
+&quot; dislike iphone the voice-command is bad:(&quot;
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>replace<a name="replace"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>replace(string_expression, string_pattern, string_replacement[, string_flags])
+</pre></div></li>
+  
+<li>
+<p>Checks whether the string <tt>string_expression</tt> matches the given pattern <tt>string_pattern</tt>, and replace the matched pattern <tt>string_pattern</tt> with the new pattern <tt>string_replacement</tt>.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>string_expression</tt> : A <tt>string</tt> that might contain the pattern.</li>
+    
+<li><tt>string_pattern</tt> : A pattern <tt>string</tt> to be matched.</li>
+    
+<li><tt>string_replacement</tt> : A pattern <tt>string</tt> to be used as the replacement.</li>
+    
+<li><tt>string_flag</tt> : (Optional) A <tt>string</tt> with flags to be used during replace.</li>
+    
+<li>The following modes are enabled with these flags: dotall (s), multiline (m), case-insenitive (i), and comments and whitespace (x).</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>Returns a <tt>string</tt> that is obtained after the replacements.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $i in dataset('FacebookMessages')
+where matches($i.message, &quot; like iphone&quot;)
+return replace($i.message, &quot; like iphone&quot;, &quot;like android&quot;)
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>&quot;like android the voicemail-service is awesome&quot;
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>string-length<a name="string-length"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>string-length(string_expression)
+</pre></div></li>
+  
+<li>
+<p>Returns the length of the string <tt>string_expression</tt>.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>string_expression</tt> : A <tt>string</tt> or <tt>null</tt> that represents the string to be checked.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>An <tt>int64</tt> that represents the length of <tt>string_expression</tt>.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $i in dataset('FacebookMessages')
+return {&quot;mid&quot;: $i.message-id, &quot;message-len&quot;: string-length($i.message)}
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;mid&quot;: 1, &quot;message-len&quot;: 43 }
+{ &quot;mid&quot;: 2, &quot;message-len&quot;: 44 }
+{ &quot;mid&quot;: 3, &quot;message-len&quot;: 33 }
+{ &quot;mid&quot;: 4, &quot;message-len&quot;: 43 }
+{ &quot;mid&quot;: 5, &quot;message-len&quot;: 46 }
+{ &quot;mid&quot;: 6, &quot;message-len&quot;: 43 }
+{ &quot;mid&quot;: 7, &quot;message-len&quot;: 37 }
+{ &quot;mid&quot;: 8, &quot;message-len&quot;: 33 }
+{ &quot;mid&quot;: 9, &quot;message-len&quot;: 34 }
+{ &quot;mid&quot;: 10, &quot;message-len&quot;: 50 }
+{ &quot;mid&quot;: 11, &quot;message-len&quot;: 38 }
+{ &quot;mid&quot;: 12, &quot;message-len&quot;: 52 }
+{ &quot;mid&quot;: 13, &quot;message-len&quot;: 42 }
+{ &quot;mid&quot;: 14, &quot;message-len&quot;: 27 }
+{ &quot;mid&quot;: 15, &quot;message-len&quot;: 45 }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>substring<a name="substring"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>substring(string_expression, offset[, length])
+</pre></div></li>
+  
+<li>
+<p>Returns the substring from the given string <tt>string_expression</tt> based on the given start offset <tt>offset</tt> with the optional <tt>length</tt>.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>string_expression</tt> : A <tt>string</tt> to be extracted.</li>
+    
+<li><tt>offset</tt> : An <tt>int64</tt> as the starting offset of the substring in <tt>string_expression</tt>.</li>
+    
+<li><tt>length</tt> : (Optional) An <tt>int64</tt> as the length of the substring.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>A <tt>string</tt> that represents the substring.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $i in dataset('FacebookMessages')
+where string-length($i.message) &gt; 50
+return substring($i.message, 50)
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>&quot;G:(&quot;
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>substring-before<a name="substring-before"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>substring-before(string_expression, string_pattern)
+</pre></div></li>
+  
+<li>
+<p>Returns the substring from the given string <tt>string_expression</tt> before the given pattern <tt>string_pattern</tt>.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>string_expression</tt> : A <tt>string</tt> to be extracted.</li>
+    
+<li><tt>string_pattern</tt> : A <tt>string</tt> pattern to be searched.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>A <tt>string</tt> that represents the substring.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $i in dataset('FacebookMessages')
+where contains($i.message, &quot;iphone&quot;)
+return substring-before($i.message, &quot;iphone&quot;)
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>&quot; dislike &quot;
+&quot; dislike &quot;
+&quot; like &quot;
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>substring-after<a name="substring-after"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>substring-after(string_expression, string_pattern)
+</pre></div></li>
+  
+<li>
+<p>Returns the substring from the given string <tt>string_expression</tt> after the given pattern <tt>string_pattern</tt>.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>string_expression</tt> : A <tt>string</tt> to be extracted.</li>
+    
+<li><tt>string_pattern</tt> : A <tt>string</tt> pattern to be searched.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>A <tt>string</tt> that represents the substring.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $i in dataset('FacebookMessages')
+where contains($i.message, &quot;iphone&quot;)
+return substring-after($i.message, &quot;iphone&quot;)
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>&quot; its touch-screen is horrible&quot;
+&quot; the voice-command is bad:(&quot;
+&quot; the voicemail-service is awesome&quot;
+</pre></div></li>
+</ul></div></div>
+<div class="section">
+<h2><a name="AggregateFunctions" id="AggregateFunctions">Aggregate Functions</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Aggregate_Functions_Back_to_TOC"></a></h2>
+<div class="section">
+<h3>count<a name="count"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>count(list)
+</pre></div></li>
+  
+<li>
+<p>Gets the number of items in the given list.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>list</tt>: An <tt>orderedList</tt> or <tt>unorderedList</tt> containing the items to be counted, or a <tt>null</tt> value.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>An <tt>int64</tt> value representing the number of items in the given list. <tt>0i64</tt> is returned if the input is <tt>null</tt>.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+let $l1 := ['hello', 'world', 1, 2, 3]
+let $l2 := for $i in dataset TwitterUsers return $i
+return {&quot;count1&quot;: count($l1), &quot;count2&quot;: count($l2)}
+</pre></div></li>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;count1&quot;: 5i64, &quot;count2&quot;: 4i64 }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>avg<a name="avg"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>avg(num_list)
+</pre></div></li>
+  
+<li>
+<p>Gets the average value of the items in the given list.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>num_list</tt>: An <tt>orderedList</tt> or <tt>unorderedList</tt> containing numeric or null values, or a <tt>null</tt> value.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>An <tt>double</tt> value representing the average of the numbers in the given list. <tt>null</tt> is returned if the input is <tt>null</tt>, or the input list contains <tt>null</tt>. Non-numeric types in the input list will cause an error.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+let $l := for $i in dataset TwitterUsers return $i.friends_count
+return {&quot;avg_friend_count&quot;: avg($l)}
+</pre></div></li>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;avg_friend_count&quot;: 191.5d }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>sum<a name="sum"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>sum(num_list)
+</pre></div></li>
+  
+<li>
+<p>Gets the sum of the items in the given list.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>num_list</tt>: An <tt>orderedList</tt> or <tt>unorderedList</tt> containing numeric or null values, or a <tt>null</tt> value.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>The sum of the numbers in the given list. The returning type is decided by the item type with the highest order in the numeric type promotion order (<tt>int8</tt>-&gt; <tt>int16</tt>-&gt;<tt>int32</tt>-&gt;<tt>int64</tt>-&gt;<tt>float</tt>-&gt;<tt>double</tt>) among items. <tt>null</tt> is returned if the input is <tt>null</tt>, or the input list contains <tt>null</tt>. Non-numeric types in the input list will cause an error.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+let $l := for $i in dataset TwitterUsers return $i.friends_count
+return {&quot;sum_friend_count&quot;: sum($l)}
+</pre></div></li>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;sum_friend_count&quot;: 766 }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>min/max<a name="minmax"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>min(num_list), max(num_list)
+</pre></div></li>
+  
+<li>
+<p>Gets the min/max value of numeric items in the given list.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>num_list</tt>: An <tt>orderedList</tt> or <tt>unorderedList</tt> containing the items to be compared, or a <tt>null</tt> value.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>The min/max value of the given list. The returning type is decided by the item type with the highest order in the numeric type promotion order (<tt>int8</tt>-&gt; <tt>int16</tt>-&gt;<tt>int32</tt>-&gt;<tt>int64</tt>-&gt;<tt>float</tt>-&gt;<tt>double</tt>) among items. <tt>null</tt> is returned if the input is <tt>null</tt>, or the input list contains <tt>null</tt>. Non-numeric types in the input list will cause an error.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+let $l := for $i in dataset TwitterUsers return $i. friends_count
+return {&quot;min_friend_count&quot;: min($l), &quot;max_friend_count&quot;: max($l)}
+</pre></div></li>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;min_friend_count&quot;: 18, &quot;max_friend_count&quot;: 445 }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>sql-count<a name="sql-count"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>sql-count(list)
+</pre></div></li>
+  
+<li>
+<p>Gets the number of non-null items in the given list.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>list</tt>: An <tt>orderedList</tt> or <tt>unorderedList</tt> containing the items to be counted, or a <tt>null</tt> value.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>An <tt>int64</tt> value representing the number of non-null items in the given list. The value <tt>0i64</tt> is returned if the input is <tt>null</tt>.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p></li>
+</ul>
+
+<div class="source">
+<pre>    let $l1 := ['hello', 'world', 1, 2, 3, null]
+    return {&quot;count&quot;: sql-count($l1)}
+</pre></div>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;count&quot;: 5i64 }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>sql-avg<a name="sql-avg"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>sql-avg(num_list)
+</pre></div></li>
+  
+<li>
+<p>Gets the average value of the non-null items in the given list.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>num_list</tt>: An <tt>orderedList</tt> or <tt>unorderedList</tt> containing numeric or null values, or a <tt>null</tt> value.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>A <tt>double</tt> value representing the average of the non-null numbers in the given list. The <tt>null</tt> value is returned if the input is <tt>null</tt>. Non-numeric types in the input list will cause an error.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>let $l := [1.2, 2.3, 3.4, 0, null]
+return {&quot;avg&quot;: sql-avg($l)}
+</pre></div></li>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;avg&quot;: 1.725d }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>sql-sum<a name="sql-sum"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>sql-sum(num_list)
+</pre></div></li>
+  
+<li>
+<p>Gets the sum of the non-null items in the given list.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>num_list</tt>: An <tt>orderedList</tt> or <tt>unorderedList</tt> containing numeric or null values, or a <tt>null</tt> value.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>The sum of the non-null numbers in the given list. The returning type is decided by the item type with the highest order in the numeric type promotion order (<tt>int8</tt>-&gt; <tt>int16</tt>-&gt;<tt>int32</tt>-&gt;<tt>int64</tt>-&gt;<tt>float</tt>-&gt;<tt>double</tt>) among items. The value <tt>null</tt> is returned if the input is <tt>null</tt>. Non-numeric types in the input list will cause an error.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>let $l := [1.2, 2.3, 3.4, 0, null]
+return {&quot;sum&quot;: sql-sum($l)}
+</pre></div></li>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;sum&quot;: 6.9d }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>sql-min/max<a name="sql-minmax"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>sql-min(num_list), sql-max(num_list)
+</pre></div></li>
+  
+<li>
+<p>Gets the min/max value of the non-null numeric items in the given list.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>num_list</tt>: An <tt>orderedList</tt> or <tt>unorderedList</tt> containing the items to be compared, or a <tt>null</tt> value.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>The min/max value of the given list. The returning type is decided by the item type with the highest order in the numeric type promotion order (<tt>int8</tt>-&gt; <tt>int16</tt>-&gt;<tt>int32</tt>-&gt;<tt>int64</tt>-&gt;<tt>float</tt>-&gt;<tt>double</tt>) among items. The value <tt>null</tt> is returned if the input is <tt>null</tt>. Non-numeric types in the input list will cause an error.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>let $l := [1.2, 2.3, 3.4, 0, null]
+return {&quot;min&quot;: sql-min($l), &quot;max&quot;: sql-max($l)}
+</pre></div></li>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;min&quot;: 0.0d, &quot;max&quot;: 3.4d }
+</pre></div></li>
+</ul></div></div>
+<div class="section">
+<h2><a name="SpatialFunctions" id="SpatialFunctions">Spatial Functions</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Spatial_Functions_Back_to_TOC"></a></h2>
+<div class="section">
+<h3>create-point<a name="create-point"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>create-point(x, y)
+</pre></div></li>
+  
+<li>
+<p>Creates the primitive type <tt>point</tt> using an <tt>x</tt> and <tt>y</tt> value.</p></li>
+  
+<li>Arguments:</li>
+  
+<li><tt>x</tt> : A <tt>double</tt> that represents the x-coordinate.</li>
+  
+<li><tt>y</tt> : A <tt>double</tt> that represents the y-coordinate.</li>
+  
+<li>Return Value:</li>
+  
+<li>A <tt>point</tt> representing the ordered pair (<tt>x</tt>, <tt>y</tt>).</li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+let $c :=  create-point(30.0,70.0)
+return {&quot;point&quot;: $c}
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;point&quot;: point(&quot;30.0,70.0&quot;) }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>create-line<a name="create-line"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>create-line(point_expression1, point_expression2)
+</pre></div></li>
+  
+<li>
+<p>Creates the primitive type <tt>line</tt> using <tt>point_expression1</tt> and <tt>point_expression2</tt>.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>point_expression1</tt> : A <tt>point</tt> that represents the start point of the line.</li>
+    
+<li><tt>point_expression2</tt> : A <tt>point</tt> that represents the end point of the line.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>A spatial <tt>line</tt> created using the points provided in <tt>point_expression1</tt> and <tt>point_expression2</tt>.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+let $c :=  create-line(create-point(30.0,70.0), create-point(50.0,90.0))
+return {&quot;line&quot;: $c}
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;line&quot;: line(&quot;30.0,70.0 50.0,90.0&quot;) }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>create-rectangle<a name="create-rectangle"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>create-rectangle(point_expression1, point_expression2)
+</pre></div></li>
+  
+<li>
+<p>Creates the primitive type <tt>rectangle</tt> using <tt>point_expression1</tt> and <tt>point_expression2</tt>.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>point_expression1</tt> : A <tt>point</tt> that represents the lower-left point of the rectangle.</li>
+    
+<li><tt>point_expression2</tt> : A <tt>point</tt> that represents the upper-right point of the rectangle.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>A spatial <tt>rectangle</tt> created using the points provided in <tt>point_expression1</tt> and <tt>point_expression2</tt>.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+let $c :=  create-rectangle(create-point(30.0,70.0), create-point(50.0,90.0))
+return {&quot;rectangle&quot;: $c}
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;rectangle&quot;: rectangle(&quot;30.0,70.0 50.0,90.0&quot;) }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>create-circle<a name="create-circle"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>create-circle(point_expression, radius)
+</pre></div></li>
+  
+<li>
+<p>Creates the primitive type <tt>circle</tt> using <tt>point_expression</tt> and <tt>radius</tt>.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>point_expression</tt> : A <tt>point</tt> that represents the center of the circle.</li>
+    
+<li><tt>radius</tt> : A <tt>double</tt> that represents the radius of the circle.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>A spatial <tt>circle</tt> created using the center point and the radius provided in <tt>point_expression</tt> and <tt>radius</tt>.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+let $c :=  create-circle(create-point(30.0,70.0), 5.0)
+return {&quot;circle&quot;: $c}
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;circle&quot;: circle(&quot;30.0,70.0 5.0&quot;) }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>create-polygon<a name="create-polygon"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>create-polygon(list_expression)
+</pre></div></li>
+  
+<li>
+<p>Creates the primitive type <tt>polygon</tt> using the double values provided in the argument <tt>list_expression</tt>. Each two consecutive double values represent a point starting from the first double value in the list. Note that at least six double values should be specified, meaning a total of three points.</p></li>
+  
+<li>Arguments:</li>
+  
+<li><tt>list_expression</tt> : An OrderedList of doubles representing the points of the polygon.</li>
+  
+<li>Return Value:</li>
+  
+<li>A <tt>polygon</tt>, represents a spatial simple polygon created using the points provided in <tt>list_expression</tt>.</li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+let $c :=  create-polygon([1.0,1.0,2.0,2.0,3.0,3.0,4.0,4.0])
+return {&quot;polygon&quot;: $c}
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;polygon&quot;: polygon(&quot;1.0,1.0 2.0,2.0 3.0,3.0 4.0,4.0&quot;) }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>get-x/get-y<a name="get-xget-y"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>get-x(point_expression) or get-y(point_expression)
+</pre></div></li>
+  
+<li>
+<p>Returns the x or y coordinates of a point <tt>point_expression</tt>.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>point_expression</tt> : A <tt>point</tt>.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>A <tt>double</tt> representing the x or y coordinates of the point <tt>point_expression</tt>.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+let $point := create-point(2.3,5.0)
+return {&quot;x-coordinate&quot;: get-x($point), &quot;y-coordinate&quot;: get-y($point)}
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;x-coordinate&quot;: 2.3d, &quot;y-coordinate&quot;: 5.0d }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>get-points<a name="get-points"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>get-points(spatial_expression)
+</pre></div></li>
+  
+<li>
+<p>Returns an ordered list of the points forming the spatial object <tt>spatial_expression</tt>.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>spatial_expression</tt> : A <tt>point</tt>, <tt>line</tt>, <tt>rectangle</tt>, <tt>circle</tt>, or <tt>polygon</tt>.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>An <tt>OrderedList</tt> of the points forming the spatial object <tt>spatial_expression</tt>.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+let $line := create-line(create-point(100.6,99.4), create-point(-72.0,-76.9))
+let $rectangle := create-rectangle(create-point(9.2,49.0), create-point(77.8,111.1))
+let $polygon := create-polygon([1.0,1.0,2.0,2.0,3.0,3.0,4.0,4.0])
+let $line_list := get-points($line)
+let $rectangle_list := get-points($rectangle)
+let $polygon_list := get-points($polygon)
+return {&quot;line-first-point&quot;: $line_list[0], &quot;line-second-point&quot;: $line_list[1], &quot;rectangle-left-bottom-point&quot;: $rectangle_list[0], &quot;rectangle-top-upper-point&quot;: $rectangle_list[1], &quot;polygon-first-point&quot;: $polygon_list[0], &quot;polygon-second-point&quot;: $polygon_list[1], &quot;polygon-third-point&quot;: $polygon_list[2], &quot;polygon-forth-point&quot;: $polygon_list[3]}
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;line-first-point&quot;: point(&quot;100.6,99.4&quot;), &quot;line-second-point&quot;: point(&quot;-72.0,-76.9&quot;), &quot;rectangle-left-bottom-point&quot;: point(&quot;9.2,49.0&quot;), &quot;rectangle-top-upper-point&quot;: point(&quot;77.8,111.1&quot;), &quot;polygon-first-point&quot;: point(&quot;1.0,1.0&quot;), &quot;polygon-second-point&quot;: point(&quot;2.0,2.0&quot;), &quot;polygon-third-point&quot;: point(&quot;3.0,3.0&quot;), &quot;polygon-forth-point&quot;: point(&quot;4.0,4.0&quot;) }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>get-center/get-radius<a name="get-centerget-radius"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>get-center(circle_expression) or get-radius(circle_expression)
+</pre></div></li>
+  
+<li>
+<p>Returns the center and the radius of a circle <tt>circle_expression</tt>, respectively.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>circle_expression</tt> : A <tt>circle</tt>.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>A <tt>point</tt> or <tt>double</tt>, represent the center or radius of the circle <tt>circle_expression</tt>.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+let $circle := create-circle(create-point(6.0,3.0), 1.0)
+return {&quot;circle-radius&quot;: get-radius($circle), &quot;circle-center&quot;: get-center($circle)}
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;circle-radius&quot;: 1.0d, &quot;circle-center&quot;: point(&quot;6.0,3.0&quot;) }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>spatial-distance<a name="spatial-distance"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>spatial-distance(point_expression1, point_expression2)
+</pre></div></li>
+  
+<li>
+<p>Returns the Euclidean distance between <tt>point_expression1</tt> and <tt>point_expression2</tt>.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>point_expression1</tt> : A <tt>point</tt>.</li>
+    
+<li><tt>point_expression2</tt> : A <tt>point</tt>.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>A <tt>double</tt> as the Euclidean distance between <tt>point_expression1</tt> and <tt>point_expression2</tt>.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $t in dataset('TweetMessages')
+let $d :=  spatial-distance($t.sender-location, create-point(30.0,70.0))
+return {&quot;point&quot;: $t.sender-location, &quot;distance&quot;: $d}
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;point&quot;: point(&quot;47.44,80.65&quot;), &quot;distance&quot;: 20.434678857275934d }
+{ &quot;point&quot;: point(&quot;29.15,76.53&quot;), &quot;distance&quot;: 6.585089217315132d }
+{ &quot;point&quot;: point(&quot;37.59,68.42&quot;), &quot;distance&quot;: 7.752709203884797d }
+{ &quot;point&quot;: point(&quot;24.82,94.63&quot;), &quot;distance&quot;: 25.168816023007512d }
+{ &quot;point&quot;: point(&quot;32.84,67.14&quot;), &quot;distance&quot;: 4.030533463451212d }
+{ &quot;point&quot;: point(&quot;29.72,75.8&quot;), &quot;distance&quot;: 5.806754687430835d }
+{ &quot;point&quot;: point(&quot;39.28,70.48&quot;), &quot;distance&quot;: 9.292405501268227d }
+{ &quot;point&quot;: point(&quot;40.09,92.69&quot;), &quot;distance&quot;: 24.832321679617472d }
+{ &quot;point&quot;: point(&quot;47.51,83.99&quot;), &quot;distance&quot;: 22.41250097601782d }
+{ &quot;point&quot;: point(&quot;36.21,72.6&quot;), &quot;distance&quot;: 6.73231758015024d }
+{ &quot;point&quot;: point(&quot;46.05,93.34&quot;), &quot;distance&quot;: 28.325926286707734d }
+{ &quot;point&quot;: point(&quot;36.86,74.62&quot;), &quot;distance&quot;: 8.270671073135482d }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>spatial-area<a name="spatial-area"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>spatial-area(spatial_2d_expression)
+</pre></div></li>
+  
+<li>
+<p>Returns the spatial area of <tt>spatial_2d_expression</tt>.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>spatial_2d_expression</tt> : A <tt>rectangle</tt>, <tt>circle</tt>, or <tt>polygon</tt>.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>A <tt>double</tt> representing the area of <tt>spatial_2d_expression</tt>.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+let $circleArea := spatial-area(create-circle(create-point(0.0,0.0), 5.0))
+return {&quot;Area&quot;:$circleArea}
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;Area&quot;: 78.53981625d }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>spatial-intersect<a name="spatial-intersect"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>spatial-intersect(spatial_expression1, spatial_expression2)
+</pre></div></li>
+  
+<li>
+<p>Checks whether <tt>@arg1</tt> and <tt>@arg2</tt> spatially intersect each other.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>spatial_expression1</tt> : A <tt>point</tt>, <tt>line</tt>, <tt>rectangle</tt>, <tt>circle</tt>, or <tt>polygon</tt>.</li>
+    
+<li><tt>spatial_expression2</tt> : A <tt>point</tt>, <tt>line</tt>, <tt>rectangle</tt>, <tt>circle</tt>, or <tt>polygon</tt>.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>A <tt>boolean</tt> representing whether <tt>spatial_expression1</tt> and <tt>spatial_expression2</tt> spatially overlap with each other.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $t in dataset('TweetMessages')
+where spatial-intersect($t.sender-location, create-rectangle(create-point(30.0,70.0), create-point(40.0,80.0)))
+return $t
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;tweetid&quot;: &quot;4&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;NathanGiesen@211&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: 39339, &quot;statuses_count&quot;: 473, &quot;name&quot;: &quot;Nathan Giesen&quot;, &quot;followers_count&quot;: 49416 }, &quot;sender-location&quot;: point(&quot;39.28,70.48&quot;), &quot;send-time&quot;: datetime(&quot;2011-12-26T10:10:00.000Z&quot;), &quot;referred-topics&quot;: {{ &quot;sprint&quot;, &quot;voice-command&quot; }}, &quot;message-text&quot;: &quot; like sprint the voice-command is mind-blowing:)&quot; }
+{ &quot;tweetid&quot;: &quot;7&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;ChangEwing_573&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: 182, &quot;statuses_count&quot;: 394, &quot;name&quot;: &quot;Chang Ewing&quot;, &quot;followers_count&quot;: 32136 }, &quot;sender-location&quot;: point(&quot;36.21,72.6&quot;), &quot;send-time&quot;: datetime(&quot;2011-08-25T10:10:00.000Z&quot;), &quot;referred-topics&quot;: {{ &quot;samsung&quot;, &quot;platform&quot; }}, &quot;message-text&quot;: &quot; like samsung the platform is good&quot; }
+{ &quot;tweetid&quot;: &quot;9&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;NathanGiesen@211&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: 39339, &quot;statuses_count&quot;: 473, &quot;name&quot;: &quot;Nathan Giesen&quot;, &quot;followers_count&quot;: 49416 }, &quot;sender-location&quot;: point(&quot;36.86,74.62&quot;), &quot;send-time&quot;: datetime(&quot;2012-07-21T10:10:00.000Z&quot;), &quot;referred-topics&quot;: {{ &quot;verizon&quot;, &quot;voicemail-service&quot; }}, &quot;message-text&quot;: &quot; love verizon its voicemail-service is awesome&quot; }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>spatial-cell<a name="spatial-cell"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>spatial-cell(point_expression1, point_expression2, x_increment, y_increment)
+</pre></div></li>
+  
+<li>
+<p>Returns the grid cell that <tt>point_expression1</tt> belongs to.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>point_expression1</tt> : A <tt>point</tt> representing the point of interest that its grid cell will be returned.</li>
+    
+<li><tt>point_expression2</tt> : A <tt>point</tt> representing the origin of the grid.</li>
+    
+<li><tt>x_increment</tt> : A <tt>double</tt>, represents X increments.</li>
+    
+<li><tt>y_increment</tt> : A <tt>double</tt>, represents Y increments.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>A <tt>rectangle</tt> representing the grid cell that <tt>point_expression1</tt> belongs to.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $t in dataset('TweetMessages')
+group by $c :=  spatial-cell($t.sender-location, create-point(20.0,50.0), 5.5, 6.0) with $t
+let $num :=  count($t)
+return { &quot;cell&quot;: $c, &quot;count&quot;: $num}
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;cell&quot;: rectangle(&quot;20.0,92.0 25.5,98.0&quot;), &quot;count&quot;: 1i64 }
+{ &quot;cell&quot;: rectangle(&quot;25.5,74.0 31.0,80.0&quot;), &quot;count&quot;: 2i64 }
+{ &quot;cell&quot;: rectangle(&quot;31.0,62.0 36.5,68.0&quot;), &quot;count&quot;: 1i64 }
+{ &quot;cell&quot;: rectangle(&quot;31.0,68.0 36.5,74.0&quot;), &quot;count&quot;: 1i64 }
+{ &quot;cell&quot;: rectangle(&quot;36.5,68.0 42.0,74.0&quot;), &quot;count&quot;: 2i64 }
+{ &quot;cell&quot;: rectangle(&quot;36.5,74.0 42.0,80.0&quot;), &quot;count&quot;: 1i64 }
+{ &quot;cell&quot;: rectangle(&quot;36.5,92.0 42.0,98.0&quot;), &quot;count&quot;: 1i64 }
+{ &quot;cell&quot;: rectangle(&quot;42.0,80.0 47.5,86.0&quot;), &quot;count&quot;: 1i64 }
+{ &quot;cell&quot;: rectangle(&quot;42.0,92.0 47.5,98.0&quot;), &quot;count&quot;: 1i64 }
+{ &quot;cell&quot;: rectangle(&quot;47.5,80.0 53.0,86.0&quot;), &quot;count&quot;: 1i64 }
+</pre></div></li>
+</ul></div></div>
+<div class="section">
+<h2><a name="SimilarityFunctions" id="SimilarityFunctions">Similarity Functions</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Similarity_Functions_Back_to_TOC"></a></h2>
+<p>AsterixDB supports queries with different similarity functions, including edit distance and Jaccard.</p>
+<div class="section">
+<h3>edit-distance<a name="edit-distance"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>edit-distance(expression1, expression2)
+</pre></div></li>
+  
+<li>
+<p>Returns the <a class="externalLink" href="http://en.wikipedia.org/wiki/Levenshtein_distance">edit distance</a> of <tt>expression1</tt> and <tt>expression2</tt>.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>expression1</tt> : A <tt>string</tt> or a homogeneous <tt>OrderedList</tt> of a comparable item type.</li>
+    
+<li><tt>expression2</tt> : The same type as <tt>expression1</tt>.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>An <tt>int64</tt> that represents the edit distance between <tt>expression1</tt> and <tt>expression2</tt>.</li>
+  </ul></li>
+  
+<li>Note: An n-gram index can be utilized for this function.</li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $user in dataset('FacebookUsers')
+let $ed := edit-distance($user.name, &quot;Suzanna Tilson&quot;)
+where $ed &lt;= 2
+return $user
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{
+&quot;id&quot;: 7, &quot;alias&quot;: &quot;Suzanna&quot;, &quot;name&quot;: &quot;SuzannaTillson&quot;, &quot;user-since&quot;: datetime(&quot;2012-08-07T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 6 }},
+&quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;Labzatron&quot;, &quot;start-date&quot;: date(&quot;2011-04-19&quot;), &quot;end-date&quot;: null } ]
+}
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>edit-distance-check<a name="edit-distance-check"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>edit-distance-check(expression1, expression2, threshold)
+</pre></div></li>
+  
+<li>
+<p>Checks whether <tt>expression1</tt> and <tt>expression2</tt> have an <a class="externalLink" href="http://en.wikipedia.org/wiki/Levenshtein_distance">edit distance</a> within a given threshold. The &#x201c;check&#x201d; version of edit distance is faster than the &#x201c;non-check&#x201d; version because the former can detect whether two items satisfy a given threshold using early-termination techniques, as opposed to computing their real distance. Although possible, it is not necessary for the user to write queries using the &#x201c;check&#x201d; versions explicitly, since a rewrite rule can perform an appropriate transformation from a &#x201c;non-check&#x201d; version to a &#x201c;check&#x201d; version.</p></li>
+  
+<li>
+<p>Arguments:</p>
+  
+<ul>
+    
+<li><tt>expression1</tt> : A <tt>string</tt> or a homogeneous <tt>OrderedList</tt> of a comparable item type.</li>
+    
+<li><tt>expression2</tt> : The same type as <tt>expression1</tt>.</li>
+    
+<li><tt>threshold</tt> : An <tt>int64</tt> that represents the distance threshold.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>An <tt>OrderedList</tt> with two items:
+    
+<ul>
+      
+<li>The first item contains a <tt>boolean</tt> value representing whether <tt>expression1</tt> and <tt>expression2</tt> are similar.</li>
+      
+<li>The second item contains an <tt>int64</tt> that represents the edit distance of <tt>expression1</tt> and <tt>expression2</tt> if it is within the threshold, or 0 otherwise.</li>
+    </ul></li>
+  </ul></li>
+  
+<li>Note: An n-gram index can be utilized for this function.</li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $user in dataset('FacebookUsers')
+let $ed := edit-distance-check($user.name, &quot;Suzanna Tilson&quot;, 2)
+where $ed[0]
+return $ed[1]
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>2
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>edit-distance-contains<a name="edit-distance-contains"></a></h3>
+
+<ul>
+  
+<li>Syntax:</li>
+</ul>
+<p>edit-distance-contains(expression1, expression2, threshold)</p>
+
+<ul>
+  
+<li>
+<p>Checks whether <tt>expression1</tt> contains <tt>expression2</tt> with an <a class="externalLink" href="http://en.wikipedia.org/wiki/Levenshtein_distance">edit distance</a> within a given threshold.</p></li>
+  
+<li>
+<p>Arguments:</p>
+  
+<ul>
+    
+<li><tt>expression1</tt> : A <tt>string</tt> or a homogeneous <tt>OrderedList</tt> of a comparable item type.</li>
+    
+<li><tt>expression2</tt> : The same type as <tt>expression1</tt>.</li>
+    
+<li><tt>threshold</tt> : An <tt>int32</tt> that represents the distance threshold.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>An <tt>OrderedList</tt> with two items:
+    
+<ul>
+      
+<li>The first item contains a <tt>boolean</tt> value representing whether <tt>expression1</tt> can contain <tt>expression2</tt>.</li>
+      
+<li>The second item contains an <tt>int32</tt> that represents the required edit distance for <tt>expression1</tt> to contain <tt>expression2</tt> if the first item is true.</li>
+    </ul></li>
+  </ul></li>
+  
+<li>Note: An n-gram index can be utilized for this function.</li>
+  
+<li>Example:  let $i := edit-distance-contains(&#x201c;happy&#x201d;,&#x201c;hapr&#x201d;,2)  return $i;</li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>[ true, 1 ]
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>similarity-jaccard<a name="similarity-jaccard"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>similarity-jaccard(list_expression1, list_expression2)
+</pre></div></li>
+  
+<li>
+<p>Returns the <a class="externalLink" href="http://en.wikipedia.org/wiki/Jaccard_index">Jaccard similarity</a> of <tt>list_expression1</tt> and <tt>list_expression2</tt>.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>list_expression1</tt> : An <tt>UnorderedList</tt> or <tt>OrderedList</tt>.</li>
+    
+<li><tt>list_expression2</tt> : An <tt>UnorderedList</tt> or <tt>OrderedList</tt>.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>A <tt>float</tt> that represents the Jaccard similarity of <tt>list_expression1</tt> and <tt>list_expression2</tt>.</li>
+  </ul></li>
+  
+<li>Note: A keyword index can be utilized for this function.</li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $user in dataset('FacebookUsers')
+let $sim := similarity-jaccard($user.friend-ids, [1,5,9])
+where $sim &gt;= 0.6f
+return $user
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{
+&quot;id&quot;: 3, &quot;alias&quot;: &quot;Emory&quot;, &quot;name&quot;: &quot;EmoryUnk&quot;, &quot;user-since&quot;: datetime(&quot;2012-07-10T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 1, 5, 8, 9 }},
+&quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;geomedia&quot;, &quot;start-date&quot;: date(&quot;2010-06-17&quot;), &quot;end-date&quot;: date(&quot;2010-01-26&quot;) } ]
+}
+{
+&quot;id&quot;: 10, &quot;alias&quot;: &quot;Bram&quot;, &quot;name&quot;: &quot;BramHatch&quot;, &quot;user-since&quot;: datetime(&quot;2010-10-16T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 1, 5, 9 }},
+&quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;physcane&quot;, &quot;start-date&quot;: date(&quot;2007-06-05&quot;), &quot;end-date&quot;: date(&quot;2011-11-05&quot;) } ]
+}
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>similarity-jaccard-check<a name="similarity-jaccard-check"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>similarity-jaccard-check(list_expression1, list_expression2, threshold)
+</pre></div></li>
+  
+<li>
+<p>Checks whether <tt>list_expression1</tt> and <tt>list_expression2</tt> have a <a class="externalLink" href="http://en.wikipedia.org/wiki/Jaccard_index">Jaccard similarity</a> greater than or equal to threshold. Again, the &#x201c;check&#x201d; version of Jaccard is faster than the &#x201c;non-check&#x201d; version.</p></li>
+  
+<li>
+<p>Arguments:</p>
+  
+<ul>
+    
+<li><tt>list_expression1</tt> : An <tt>UnorderedList</tt> or <tt>OrderedList</tt>.</li>
+    
+<li><tt>list_expression2</tt> : An <tt>UnorderedList</tt> or <tt>OrderedList</tt>.</li>
+    
+<li><tt>threshold</tt> : A <tt>float</tt> that represents the similarity threshold.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>An <tt>OrderedList</tt> with two items:</li>
+    
+<li>The first item contains a <tt>boolean</tt> value representing whether <tt>list_expression1</tt> and <tt>list_expression2</tt> are similar.</li>
+    
+<li>The second item contains a <tt>float</tt> that represents the Jaccard similarity of <tt>list_expression1</tt> and <tt>list_expression2</tt> if it is greater than or equal to the threshold, or 0 otherwise.</li>
+  </ul></li>
+  
+<li>Note: A keyword index can be utilized for this function.</li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $user in dataset('FacebookUsers')
+let $sim := similarity-jaccard-check($user.friend-ids, [1,5,9], 0.6f)
+where $sim[0]
+return $sim[1]
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>0.75f
+1.0f
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>Similarity Operator ~#<a name="Similarity_Operator_"></a></h3>
+
+<ul>
+  
+<li>&#x201c;<tt>~=</tt>&#x201d; is syntactic sugar for expressing a similarity condition with a given similarity threshold.</li>
+  
+<li>The similarity function and threshold for &#x201c;<tt>~=</tt>&#x201d; are controlled via &#x201c;set&#x201d; directives.</li>
+  
+<li>The &#x201c;<tt>~=</tt>&#x201d; operator returns a <tt>boolean</tt> value that represents whether the operands are similar.</li>
+  
+<li>
+<p>Example for Jaccard similarity:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+set simfunction &quot;jaccard&quot;;
+set simthreshold &quot;0.6f&quot;;
+
+for $user in dataset('FacebookUsers')
+where $user.friend-ids ~= [1,5,9]
+return $user
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{
+&quot;id&quot;: 3, &quot;alias&quot;: &quot;Emory&quot;, &quot;name&quot;: &quot;EmoryUnk&quot;, &quot;user-since&quot;: datetime(&quot;2012-07-10T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 1, 5, 8, 9 }},
+&quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;geomedia&quot;, &quot;start-date&quot;: date(&quot;2010-06-17&quot;), &quot;end-date&quot;: date(&quot;2010-01-26&quot;) } ]
+}
+{
+&quot;id&quot;: 10, &quot;alias&quot;: &quot;Bram&quot;, &quot;name&quot;: &quot;BramHatch&quot;, &quot;user-since&quot;: datetime(&quot;2010-10-16T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 1, 5, 9 }},
+&quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;physcane&quot;, &quot;start-date&quot;: date(&quot;2007-06-05&quot;), &quot;end-date&quot;: date(&quot;2011-11-05&quot;) } ]
+}
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>Example for edit-distance similarity:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+set simfunction &quot;edit-distance&quot;;
+set simthreshold &quot;2&quot;;
+
+for $user in dataset('FacebookUsers')
+where $user.name ~= &quot;Suzanna Tilson&quot;
+return $user
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected output is:</p>
+  
+<div class="source">
+<pre>{
+&quot;id&quot;: 7, &quot;alias&quot;: &quot;Suzanna&quot;, &quot;name&quot;: &quot;SuzannaTillson&quot;, &quot;user-since&quot;: datetime(&quot;2012-08-07T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 6 }},
+&quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;Labzatron&quot;, &quot;start-date&quot;: date(&quot;2011-04-19&quot;), &quot;end-date&quot;: null } ]
+}
+</pre></div></li>
+</ul></div></div>
+<div class="section">
+<h2><a name="TokenizingFunctions" id="TokenizingFunctions">Tokenizing Functions</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Tokenizing_Functions_Back_to_TOC"></a></h2>
+<div class="section">
+<h3>word-tokens<a name="word-tokens"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>word-tokens(string_expression)
+</pre></div></li>
+  
+<li>
+<p>Returns a list of word tokens of <tt>string_expression</tt>.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>string_expression</tt> : A <tt>string</tt> that will be tokenized.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>An <tt>OrderedList</tt> of <tt>string</tt> word tokens.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $t in dataset('TweetMessages')
+let $tokens := word-tokens($t.message-text)
+where $t.send-time &gt;= datetime('2012-01-01T00:00:00')
+return {
+&quot;tweetid&quot;: $t.tweetid,
+&quot;word-tokens&quot;: $tokens
+}
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;tweetid&quot;: &quot;9&quot;, &quot;word-tokens&quot;: [ &quot;love&quot;, &quot;verizon&quot;, &quot;its&quot;, &quot;voicemail&quot;, &quot;service&quot;, &quot;is&quot;, &quot;awesome&quot; ] }
+</pre></div></li>
+</ul>
+<!-- ### hashed-word-tokens ###
+ * Syntax:
+
+        hashed-word-tokens(string_expression)
+
+ * Returns a list of hashed word tokens of `string_expression`.
+ * Arguments:
+    * `string_expression` : A `string` that will be tokenized.
+ * Return Value:
+   * An `OrderedList` of `int32` hashed tokens.
+
+ * Example:
+
+        use dataverse TinySocial;
+
+        for $t in dataset('TweetMessages')
+        let $tokens := hashed-word-tokens($t.message-text)
+        where $t.send-time >= datetime('2012-01-01T00:00:00')
+        return {
+        "tweetid": $t.tweetid,
+        "hashed-word-tokens": $tokens
+        }
+
+
+ * The expected result is:
+
+        { "tweetid": "9", "hashed-word-tokens": [ -1217719622, -447857469, -1884722688, -325178649, 210976949, 285049676, 1916743959 ] }
+
+
+### counthashed-word-tokens ###
+ * Syntax:
+
+        counthashed-word-tokens(string_expression)
+
+ * Returns a list of hashed word tokens of `string_expression`. The hashing mechanism gives duplicate tokens different hash values, based on the occurrence count of that token.
+ * Arguments:
+    * `string_expression` : A `String` that will be tokenized.
+ * Return Value:
+    * An `OrderedList` of `Int32` hashed tokens.
+ * Example:
+
+        use dataverse TinySocial;
+
+        for $t in dataset('TweetMessages')
+        let $tokens := counthashed-word-tokens($t.message-text)
+        where $t.send-time >= datetime('2012-01-01T00:00:00')
+        return {
+        "tweetid": $t.tweetid,
+        "counthashed-word-tokens": $tokens
+        }
+
+
+ * The expected result is:
+
+        { "tweetid": "9", "counthashed-word-tokens": [ -1217719622, -447857469, -1884722688, -325178649, 210976949, 285049676, 1916743959 ] }
+
+
+### gram-tokens ###
+ * Syntax:
+
+        gram-tokens(string_expression, gram_length, boolean_expression)
+
+ * Returns a list of gram tokens of `string_expression`, which can be obtained by scanning the characters using a sliding window of a fixed length.
+ * Arguments:
+    * `string_expression` : A `String` that will be tokenized.
+    * `gram_length` : An `Int32` as the length of grams.
+   * `boolean_expression` : A `Boolean` value to indicate whether to generate additional grams by pre- and postfixing `string_expression` with special characters.
+ * Return Value:
+    * An `OrderedList` of String gram tokens.
+
+ * Example:
+
+        use dataverse TinySocial;
+
+        for $t in dataset('TweetMessages')
+        let $tokens := gram-tokens($t.message-text, 3, true)
+        where $t.send-time >= datetime('2012-01-01T00:00:00')
+        return {
+        "tweetid": $t.tweetid,
+        "gram-tokens": $tokens
+        }
+
+
+ * The expected result is:
+
+        {
+        "tweetid": "9",
+        "gram-tokens": [ "## ", "# l", " lo", "lov", "ove", "ve ", "e v", " ve", "ver", "eri", "riz", "izo", "zon", "on ", "n i", " it", "its", "ts ", "s v", " vo", "voi", "oic", "ice",
+        "cem", "ema", "mai", "ail", "il-", "l-s", "-se", "ser", "erv", "rvi", "vic", "ice", "ce ", "e i", " is", "is ", "s a", " aw", "awe", "wes", "eso", "som", "ome", "me$", "e$$" ]
+        }
+
+
+### hashed-gram-tokens ###
+ * Syntax:
+
+        hashed-gram-tokens(string_expression, gram_length, boolean_expression)
+
+ * Returns a list of hashed gram tokens of `string_expression`.
+ * Arguments:
+    * `string_expression` : A `String` that will be tokenized.
+    * `gram_length` : An `Int32` as the length of grams.
+    * `boolean_expression` : A `Boolean` to indicate whether to generate additional grams by pre- and postfixing `string_expression` with special characters.
+ * Return Value:
+    * An `OrderedList` of `Int32` hashed gram tokens.
+
+ * Example:
+
+        use dataverse TinySocial;
+
+        for $t in dataset('TweetMessages')
+        let $tokens := hashed-gram-tokens($t.message-text, 3, true)
+        where $t.send-time >= datetime('2012-01-01T00:00:00')
+        return {
+        "tweetid": $t.tweetid,
+        "hashed-gram-tokens": $tokens
+        }
+
+
+ * The expected result is:
+
+        {
+        "tweetid": "9",
+        "hashed-gram-tokens": [ 40557178, -2002241593, 161665899, -856104603, -500544946, 693410611, 395674299, -1015235909, 1115608337, 1187999872, -31006095, -219180466, -1676061637,
+        1040194153, -1339307841, -1527110163, -1884722688, -179148713, -431014627, -1789789823, -1209719926, 684519765, -486734513, 1734740619, -1971673751, -932421915, -2064668066,
+        -937135958, -790946468, -69070309, 1561601454, 26169001, -160734571, 1330043462, -486734513, -18796768, -470303314, 113421364, 1615760212, 1688217556, 1223719184, 536568131,
+        1682609873, 2935161, -414769471, -1027490137, 1602276102, 1050490461 ]
+        }
+
+
+### counthashed-gram-tokens ###
+ * Syntax:
+
+        counthashed-gram-tokens(string_expression, gram_length, boolean_expression)
+
+ * Returns a list of hashed gram tokens of `string_expression`. The hashing mechanism gives duplicate tokens different hash values, based on the occurrence count of that token.
+ * Arguments:
+    * `string_expression` : A `String` that will be tokenized.
+    * `gram_length` : An `Int32`, length of grams to generate.
+    * `boolean_expression` : A `Boolean`, whether to generate additional grams by pre- and postfixing `string_expression` with special characters.
+ * Return Value:
+    * An `OrderedList` of `Int32` hashed gram tokens.
+
+ * Example:
+
+        use dataverse TinySocial;
+
+        for $t in dataset('TweetMessages')
+        let $tokens := counthashed-gram-tokens($t.message-text, 3, true)
+        where $t.send-time >= datetime('2012-01-01T00:00:00')
+        return {
+        "tweetid": $t.tweetid,
+        "counthashed-gram-tokens": $tokens
+        }
+
+
+ * The expected result is:
+
+        {
+        "tweetid": "9",
+        "counthashed-gram-tokens": [ 40557178, -2002241593, 161665899, -856104603, -500544946, 693410611, 395674299, -1015235909, 1115608337, 1187999872, -31006095, -219180466, -1676061637,
+        1040194153, -1339307841, -1527110163, -1884722688, -179148713, -431014627, -1789789823, -1209719926, 684519765, -486734513, 1734740619, -1971673751, -932421915, -2064668066, -937135958,
+        -790946468, -69070309, 1561601454, 26169001, -160734571, 1330043462, -486734512, -18796768, -470303314, 113421364, 1615760212, 1688217556, 1223719184, 536568131, 1682609873, 2935161,
+        -414769471, -1027490137, 1602276102, 1050490461 ]
+        } --></div></div>
+<div class="section">
+<h2><a name="TemporalFunctions" id="TemporalFunctions">Temporal Functions</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Temporal_Functions_Back_to_TOC"></a></h2>
+<div class="section">
+<h3>get-year/get-month/get-day/get-hour/get-minute/get-second/get-millisecond<a name="get-yearget-monthget-dayget-hourget-minuteget-secondget-millisecond"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>get-year/get-month/get-day/get-hour/get-minute/get-second/get-millisecond(temporal_expression)
+</pre></div></li>
+  
+<li>
+<p>Accessors for accessing fields in a temporal value</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>temporal_expression</tt> : a temporal value represented as one of the following types: <tt>date</tt>, <tt>datetime</tt>, <tt>time</tt>, and <tt>duration</tt>.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>An <tt>int64</tt> value representing the field to be extracted.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>let $c1 := date(&quot;2010-10-30&quot;)
+let $c2 := datetime(&quot;1987-11-19T23:49:23.938&quot;)
+let $c3 := time(&quot;12:23:34.930+07:00&quot;)
+let $c4 := duration(&quot;P3Y73M632DT49H743M3948.94S&quot;)
+
+return {&quot;year&quot;: get-year($c1), &quot;month&quot;: get-month($c2), &quot;day&quot;: get-day($c1), &quot;hour&quot;: get-hour($c3), &quot;min&quot;: get-minute($c4), &quot;second&quot;: get-second($c2), &quot;ms&quot;: get-millisecond($c4)}
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;year&quot;: 2010, &quot;month&quot;: 11, &quot;day&quot;: 30, &quot;hour&quot;: 5, &quot;min&quot;: 28, &quot;second&quot;: 23, &quot;ms&quot;: 94 }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>adjust-datetime-for-timezone<a name="adjust-datetime-for-timezone"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>adjust-datetime-for-timezone(datetime_expression, string_expression)
+</pre></div></li>
+  
+<li>
+<p>Adjusts the given datetime <tt>datetime_expression</tt> by applying the timezone information <tt>string_expression</tt>.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>datetime_expression</tt> : A <tt>datetime</tt> value to be adjusted.</li>
+    
+<li><tt>string_expression</tt> : A <tt>string</tt> representing the timezone information.</li>
+  </ul></li>
+  
+<li>Return Value:
+  
+<ul>
+    
+<li>A <tt>string</tt> value representing the new datetime after being adjusted by the timezone information.</li>
+  </ul></li>
+  
+<li>
+<p>Example:</p>
+  
+<div class="source">
+<pre>use dataverse TinySocial;
+
+for $i in dataset('TweetMessages')
+return {&quot;adjusted-send-time&quot;: adjust-datetime-for-timezone($i.send-time, &quot;+08:00&quot;), &quot;message&quot;: $i.message-text}
+</pre></div></li>
+</ul>
+
+<ul>
+  
+<li>
+<p>The expected result is:</p>
+  
+<div class="source">
+<pre>{ &quot;adjusted-send-time&quot;: &quot;2008-04-26T18:10:00.000+08:00&quot;, &quot;message&quot;: &quot; love t-mobile its customization is good:)&quot; }
+{ &quot;adjusted-send-time&quot;: &quot;2010-05-13T18:10:00.000+08:00&quot;, &quot;message&quot;: &quot; like verizon its shortcut-menu is awesome:)&quot; }
+{ &quot;adjusted-send-time&quot;: &quot;2006-11-04T18:10:00.000+08:00&quot;, &quot;message&quot;: &quot; like motorola the speed is good:)&quot; }
+{ &quot;adjusted-send-time&quot;: &quot;2011-12-26T18:10:00.000+08:00&quot;, &quot;message&quot;: &quot; like sprint the voice-command is mind-blowing:)&quot; }
+{ &quot;adjusted-send-time&quot;: &quot;2006-08-04T18:10:00.000+08:00&quot;, &quot;message&quot;: &quot; can't stand motorola its speed is terrible:(&quot; }
+{ &quot;adjusted-send-time&quot;: &quot;2010-05-07T18:10:00.000+08:00&quot;, &quot;message&quot;: &quot; like iphone the voice-clarity is good:)&quot; }
+{ &quot;adjusted-send-time&quot;: &quot;2011-08-25T18:10:00.000+08:00&quot;, &quot;message&quot;: &quot; like samsung the platform is good&quot; }
+{ &quot;adjusted-send-time&quot;: &quot;2005-10-14T18:10:00.000+08:00&quot;, &quot;message&quot;: &quot; like t-mobile the shortcut-menu is awesome:)&quot; }
+{ &quot;adjusted-send-time&quot;: &quot;2012-07-21T18:10:00.000+08:00&quot;, &quot;message&quot;: &quot; love verizon its voicemail-service is awesome&quot; }
+{ &quot;adjusted-send-time&quot;: &quot;2008-01-26T18:10:00.000+08:00&quot;, &quot;message&quot;: &quot; hate verizon its voice-clarity is OMG:(&quot; }
+{ &quot;adjusted-send-time&quot;: &quot;2008-03-09T18:10:00.000+08:00&quot;, &quot;message&quot;: &quot; can't stand iphone its platform is terrible&quot; }
+{ &quot;adjusted-send-time&quot;: &quot;2010-02-13T18:10:00.000+08:00&quot;, &quot;message&quot;: &quot; like samsung the voice-command is amazing:)&quot; }
+</pre></div></li>
+</ul></div>
+<div class="section">
+<h3>adjust-time-for-timezone<a name="adjust-time-for-timezone"></a></h3>
+
+<ul>
+  
+<li>
+<p>Syntax:</p>
+  
+<div class="source">
+<pre>adjust-time-for-timezone(time_expression, string_expression)
+</pre></div></li>
+  
+<li>
+<p>Adjusts the given time <tt>time_expression</tt> by applying the timezone information <tt>string_expression</tt>.</p></li>
+  
+<li>Arguments:
+  
+<ul>
+    
+<li><tt>time_expression</tt> : A <tt>time</tt> value to be adjusted.</li>
+    
+<li><tt>string_expression</tt> : A <tt>string</tt> representin

<TRUNCATED>


[12/13] incubator-asterixdb-site git commit: Initial commit with Till's changes

Posted by im...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/aql/externaldata.html
----------------------------------------------------------------------
diff --git a/aql/externaldata.html b/aql/externaldata.html
new file mode 100644
index 0000000..9ea42c5
--- /dev/null
+++ b/aql/externaldata.html
@@ -0,0 +1,443 @@
+<!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 class="active">
+    
+            <a href="#"><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>Accessing External Data in 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="#Introduction">Introduction</a></li>
+  
+<li><a href="#IntroductionAdapterForAnExternalDataset">Adapter for an External Dataset</a></li>
+  
+<li><a href="#IntroductionCreatingAnExternalDataset">Creating an External Dataset</a></li>
+  
+<li><a href="#WritingQueriesAgainstAnExternalDataset">Writing Queries against an External Dataset</a></li>
+</ul></div>
+<div class="section">
+<h2><a name="Introduction" id="Introduction">Introduction</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Introduction_Back_to_TOC"></a></h2>
+<p>Data that needs to be processed by ASTERIX could be residing outside ASTERIX storage. Examples include data files on a distributed file system such as HDFS or on the local file system of a machine that is part of an ASTERIX cluster. For ASTERIX to process such data, end-user may create a regular dataset in ASTERIX (a.k.a. internal dataset) and load the dataset with the data. ASTERIX supports &#x2018;&#x2018;external datasets&#x2019;&#x2019; so that it is not necessary to &#x201c;load&#x201d; all data prior to using it. This also avoids creating multiple copies of data and the need to keep the copies in sync.</p>
+<div class="section">
+<h3><a name="IntroductionAdapterForAnExternalDataset" id="IntroductionAdapterForAnExternalDataset">Adapter for an External Dataset</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Adapter_for_an_External_Dataset_Back_to_TOC"></a></h3>
+<p>External data is accessed using wrappers (adapters in ASTERIX) that abstract away the mechanism of connecting with an external service, receiving data and transforming the data into ADM records that are understood by ASTERIX. ASTERIX comes with built-in adapters for common storage systems such as HDFS or the local file system.</p></div>
+<div class="section">
+<h3><a name="IntroductionCreatingAnExternalDataset" id="IntroductionCreatingAnExternalDataset">Creating an External Dataset</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Creating_an_External_Dataset_Back_to_TOC"></a></h3>
+<p>As an example we consider the Lineitem dataset from <a class="externalLink" href="http://www.openlinksw.com/dataspace/doc/dav/wiki/Main/VOSTPCHLinkedData/tpch.sql">TPCH schema</a>.</p>
+<p>We assume that you have successfully created an ASTERIX instance following the instructions at <a href="../install.html">Installing Asterix Using Managix</a>. <i>For constructing an example, we assume a single machine setup.</i></p>
+<p>Similar to a regular dataset, an external dataset has an associated datatype. We shall first create the datatype associated with each record in Lineitem data. Paste the following in the query textbox on the webpage at <a class="externalLink" href="http://127.0.0.1:19001">http://127.0.0.1:19001</a> and hit &#x2018;Execute&#x2019;.</p>
+
+<div class="source">
+<pre>    create dataverse ExternalFileDemo;
+    use dataverse ExternalFileDemo;
+
+    create type LineitemType as closed {
+      l_orderkey:int32,
+      l_partkey: int32,
+      l_suppkey: int32,
+      l_linenumber: int32,
+      l_quantity: double,
+      l_extendedprice: double,
+      l_discount: double,
+      l_tax: double,
+      l_returnflag: string,
+      l_linestatus: string,
+      l_shipdate: string,
+      l_commitdate: string,
+      l_receiptdate: string,
+      l_shipinstruct: string,
+      l_shipmode: string,
+      l_comment: string}
+</pre></div>
+<p>We describe here two scenarios.</p>
+<div class="section">
+<h4>1) Data file resides on the local file system of a host<a name="a1_Data_file_resides_on_the_local_file_system_of_a_host"></a></h4>
+<p>Prerequisite: The host is a part of the ASTERIX cluster.</p>
+<p>Earlier, we assumed a single machine ASTERIX setup. To satisfy the prerequisite, log-in to the machine running ASTERIX.</p>
+
+<ul>
+  
+<li>Download the <a class="externalLink" href="https://code.google.com/p/asterixdb/downloads/detail?name=lineitem.tbl&amp;can=2&amp;q=">data file</a> to an appropriate location. We denote this location by SOURCE_PATH.</li>
+</ul>
+<p>ASTERIX provides a built-in adapter for data residing on the local file system. The adapter is referred by its alias- &#x2018;localfs&#x2019;. We create an external dataset named Lineitem and use the &#x2018;localfs&#x2019; adapter.</p>
+
+<div class="source">
+<pre>    create external dataset Lineitem(LineitemType)
+    using localfs
+</pre></div>
+<p>Above, the definition is not complete as we need to provide a set of parameters that are specific to the source file.</p>
+
+<table border="0" class="table table-striped">
+
+<tr class="a">
+  
+<td> Parameter </td>
+  
+<td> Description </td>
+</tr>
+
+<tr class="b">
+  
+<td> path </td>
+  
+<td> A fully qualified path of the form <tt>host://&lt;absolute path&gt;</tt>. 
+  Use a comma separated list if there are multiple files. 
+  E.g. <tt>host1://&lt;absolute path&gt;</tt>, <tt>host2://&lt;absolute path&gt;</tt> and so forth. </td>
+</tr>
+
+<tr class="a">
+  
+<td> format </td>
+  
+<td> The format for the content. Use 'adm' for data in ADM (ASTERIX Data Model) or <a class="externalLink" href="http://www.json.org/">JSON</a> format. Use 'delimited-text' if fields are separated by a delimiting character (eg., CSV). </td></tr>
+
+<tr class="b">
+<td>delimiter</td>
+<td>The delimiting character in the source file if format is 'delimited text'</td></tr>
+</table>
+<p>As we are using a single single machine ASTERIX instance, we use 127.0.0.1 as host in the path parameter. We <i>complete the create dataset statement</i> as follows.</p>
+
+<div class="source">
+<pre>    use dataverse ExternalFileDemo;
+
+    create external dataset Lineitem(LineitemType)
+    using localfs
+    ((&quot;path&quot;=&quot;127.0.0.1://SOURCE_PATH&quot;),
+    (&quot;format&quot;=&quot;delimited-text&quot;),
+    (&quot;delimiter&quot;=&quot;|&quot;));
+</pre></div>
+<p>Please substitute SOURCE_PATH with the absolute path to the source file on the local file system.</p></div>
+<div class="section">
+<h4>Common source of error<a name="Common_source_of_error"></a></h4>
+<p>An incorrect value for the path parameter will give the following exception message when the dataset is used in a query.</p>
+
+<div class="source">
+<pre>    edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException: edu.uci.ics.hyracks.api.exceptions.HyracksDataException: edu.uci.ics.hyracks.api.exceptions.HyracksDataException: Job failed.
+</pre></div>
+<p>Verify the correctness of the path parameter provided to the localfs adapter. Note that the path parameter must be an absolute path to the data file. For e.g. if you saved your file in your home directory (assume it to be /home/joe), then the path value should be</p>
+
+<div class="source">
+<pre>    127.0.0.1:///home/joe/lineitem.tbl.
+</pre></div>
+<p>In your web-browser, navigate to 127.0.0.1:19001 and paste the above to the query text box. Finally hit &#x2018;Execute&#x2019;.</p>
+<p>Next we move over to the the section <a href="#Writing_Queries_against_an_External_Dataset">Writing Queries against an External Dataset</a> and try a sample query against the external dataset.</p></div>
+<div class="section">
+<h4>2) Data file resides on an HDFS instance<a name="a2_Data_file_resides_on_an_HDFS_instance"></a></h4>
+<p>Pre-requisite: It is required that the Namenode and atleast one of the HDFS Datanodes are reachable from the hosts that form the ASTERIX cluster. ASTERIX provides a built-in adapter for data residing on HDFS. The HDFS adapter is referred (in AQL) by its alias - &#x2018;hdfs&#x2019;. We create an external dataset named Lineitem and associate the HDFS adapter with it.</p>
+
+<div class="source">
+<pre>    create external dataset Lineitem(LineitemType)
+    using hdfs
+</pre></div>
+<p>The above statement is <i>not complete</i> as we need to provide a set of parameters specific to the HDFS instance and the source file. These parameters are described below.</p>
+
+<table border="0" class="table table-striped">
+
+<tr class="a">
+  
+<td> Parameter </td>
+  
+<td> Description </td>
+</tr>
+
+<tr class="b">
+  
+<td> hdfs </td>
+  
+<td> The HDFS URL </td>
+</tr>
+
+<tr class="a">
+  
+<td> path </td>
+  
+<td> The absolute path to the source HDFS file. Use a comma separated list if there are multiple files. </td></tr>
+
+<tr class="b">
+  
+<td> input-format </td>
+  
+<td> The associated input format. Use 'text-input-format' for textual data or 'sequence-input-format' for binary data (sequence files). </td>
+</tr>
+
+<tr class="a">
+  
+<td> format </td>
+  
+<td> The format for the content. Use 'adm' for data in ADM (ASTERIX Data Model) or 
+  <a class="externalLink" href="http://www.json.org/">JSON</a> format and use 'delimited-text' for delimited data 
+  that has fields separated by a delimiting character. </td>
+</tr>
+
+<tr class="b">
+  
+<td> delimiter </td>
+  
+<td> The delimiting character in the source file if format is 'delimited text' </td>
+</tr>
+</table>
+<p><i>Difference between &#x2018;input-format&#x2019; and &#x2018;format&#x2019;</i></p>
+<p><i>input-format</i>: File stored under HDFS have an associated storage format For example, TextInputFormat represents plain text files. SequenceFileInputFormat indicates binary compressed file. The parameter &#x2018;input-format&#x2019; is used to distinguish between these two kind of files.</p>
+<p><i>format</i>: The parameter &#x2018;format&#x2019; refers to the type of the data contained in the file. For example data contained in a file could be in json, ADM format or could be delimited-text with fields separated by a delimiting character.</p>
+<p>As an example. consider the <a class="externalLink" href="https://code.google.com/p/asterixdb/downloads/detail?name=lineitem.tbl&amp;can=2&amp;q=">data file</a>. The file is a text file with each line representing a record. The fields in each record are separated by the &#x2018;|&#x2019; character.</p>
+<p>We assume the HDFS URL to be <a class="externalLink" href="hdfs://host:port">hdfs://host:port</a>. We further assume that the example data file is copied to the HDFS at a path denoted by HDFS_PATH.</p>
+<p>The complete set of parameters for our example file are as follows. ((&#x201c;hdfs&#x201d;=&#x201c;HDFS_URL&#x201d;,(&#x201c;path&#x201d;=&#x201c;HDFS_PATH&#x201d;),(&#x201c;input-format&#x201d;=&#x201c;text-input-format&#x201d;),(&#x201c;format&#x201d;=&#x201c;delimited-text&#x201d;),(&#x201c;delimiter&#x201d;=&#x201c;|&#x201d;))</p>
+<p>We modify the create external dataset statement as follows.</p>
+
+<div class="source">
+<pre>    create external dataset Lineitem('LineitemType)
+    using hdfs
+    ((&quot;hdfs&quot;=&quot;HDFS_URL&quot;),(&quot;path&quot;=&quot;HDFS_PATH&quot;),(&quot;input-format&quot;=&quot;text-input-format&quot;),(&quot;format&quot;=&quot;delimited-text&quot;),(&quot;delimiter&quot;=&quot;|&quot;));
+</pre></div>
+<p>Once you have copied the source data file to your HDFS instance, substitute the values of HDFS_URL and HDFS_PATH in the above statement. In your web-browser, navigate to <a class="externalLink" href="http://127.0.0.1:19001">http://127.0.0.1:19001</a> and execute the above statement with substituted values.</p>
+<p>You may now run the sample query in next section.</p></div></div></div>
+<div class="section">
+<h2><a name="WritingQueriesAgainstAnExternalDataset" id="WritingQueriesAgainstAnExternalDataset">Writing Queries against an External Dataset</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Writing_Queries_against_an_External_Dataset_Back_to_TOC"></a></h2>
+<p>You may write AQL queries against an external dataset. Following is an example AQL query that applies a filter and returns an ordered result.</p>
+
+<div class="source">
+<pre>    use dataverse ExternalFileDemo;
+
+    for $c in dataset('Lineitem')
+    where $c.l_orderkey &lt;= 3
+    order by $c.l_orderkey, $c.l_linenumber
+    return $c
+</pre></div>
+<p>The expected result is:</p>
+
+<div class="source">
+<pre>    { &quot;l_orderkey&quot;: 1, &quot;l_partkey&quot;: 156, &quot;l_suppkey&quot;: 4, &quot;l_linenumber&quot;: 1, &quot;l_quantity&quot;: 17, &quot;l_extendedprice&quot;: 17954.55d, &quot;l_discount&quot;: 0.04d, &quot;l_tax&quot;: 0.02d, &quot;l_returnflag&quot;: &quot;N&quot;, &quot;l_linestatus&quot;: &quot;O&quot;, &quot;l_shipdate&quot;: &quot;1996-03-13&quot;, &quot;l_commitdate&quot;: &quot;1996-02-12&quot;, &quot;l_receiptdate&quot;: &quot;1996-03-22&quot;, &quot;l_shipinstruct&quot;: &quot;DELIVER IN PERSON&quot;, &quot;l_shipmode&quot;: &quot;TRUCK&quot;, &quot;l_comment&quot;: &quot;egular courts above the&quot; }
+    { &quot;l_orderkey&quot;: 1, &quot;l_partkey&quot;: 68, &quot;l_suppkey&quot;: 9, &quot;l_linenumber&quot;: 2, &quot;l_quantity&quot;: 36, &quot;l_extendedprice&quot;: 34850.16d, &quot;l_discount&quot;: 0.09d, &quot;l_tax&quot;: 0.06d, &quot;l_returnflag&quot;: &quot;N&quot;, &quot;l_linestatus&quot;: &quot;O&quot;, &quot;l_shipdate&quot;: &quot;1996-04-12&quot;, &quot;l_commitdate&quot;: &quot;1996-02-28&quot;, &quot;l_receiptdate&quot;: &quot;1996-04-20&quot;, &quot;l_shipinstruct&quot;: &quot;TAKE BACK RETURN&quot;, &quot;l_shipmode&quot;: &quot;MAIL&quot;, &quot;l_comment&quot;: &quot;ly final dependencies: slyly bold &quot; }
+    { &quot;l_orderkey&quot;: 1, &quot;l_partkey&quot;: 64, &quot;l_suppkey&quot;: 5, &quot;l_linenumber&quot;: 3, &quot;l_quantity&quot;: 8, &quot;l_extendedprice&quot;: 7712.48d, &quot;l_discount&quot;: 0.1d, &quot;l_tax&quot;: 0.02d, &quot;l_returnflag&quot;: &quot;N&quot;, &quot;l_linestatus&quot;: &quot;O&quot;, &quot;l_shipdate&quot;: &quot;1996-01-29&quot;, &quot;l_commitdate&quot;: &quot;1996-03-05&quot;, &quot;l_receiptdate&quot;: &quot;1996-01-31&quot;, &quot;l_shipinstruct&quot;: &quot;TAKE BACK RETURN&quot;, &quot;l_shipmode&quot;: &quot;REG AIR&quot;, &quot;l_comment&quot;: &quot;riously. regular, express dep&quot; }
+    { &quot;l_orderkey&quot;: 1, &quot;l_partkey&quot;: 3, &quot;l_suppkey&quot;: 6, &quot;l_linenumber&quot;: 4, &quot;l_quantity&quot;: 28, &quot;l_extendedprice&quot;: 25284.0d, &quot;l_discount&quot;: 0.09d, &quot;l_tax&quot;: 0.06d, &quot;l_returnflag&quot;: &quot;N&quot;, &quot;l_linestatus&quot;: &quot;O&quot;, &quot;l_shipdate&quot;: &quot;1996-04-21&quot;, &quot;l_commitdate&quot;: &quot;1996-03-30&quot;, &quot;l_receiptdate&quot;: &quot;1996-05-16&quot;, &quot;l_shipinstruct&quot;: &quot;NONE&quot;, &quot;l_shipmode&quot;: &quot;AIR&quot;, &quot;l_comment&quot;: &quot;lites. fluffily even de&quot; }
+    { &quot;l_orderkey&quot;: 1, &quot;l_partkey&quot;: 25, &quot;l_suppkey&quot;: 8, &quot;l_linenumber&quot;: 5, &quot;l_quantity&quot;: 24, &quot;l_extendedprice&quot;: 22200.48d, &quot;l_discount&quot;: 0.1d, &quot;l_tax&quot;: 0.04d, &quot;l_returnflag&quot;: &quot;N&quot;, &quot;l_linestatus&quot;: &quot;O&quot;, &quot;l_shipdate&quot;: &quot;1996-03-30&quot;, &quot;l_commitdate&quot;: &quot;1996-03-14&quot;, &quot;l_receiptdate&quot;: &quot;1996-04-01&quot;, &quot;l_shipinstruct&quot;: &quot;NONE&quot;, &quot;l_shipmode&quot;: &quot;FOB&quot;, &quot;l_comment&quot;: &quot; pending foxes. slyly re&quot; }
+    { &quot;l_orderkey&quot;: 1, &quot;l_partkey&quot;: 16, &quot;l_suppkey&quot;: 3, &quot;l_linenumber&quot;: 6, &quot;l_quantity&quot;: 32, &quot;l_extendedprice&quot;: 29312.32d, &quot;l_discount&quot;: 0.07d, &quot;l_tax&quot;: 0.02d, &quot;l_returnflag&quot;: &quot;N&quot;, &quot;l_linestatus&quot;: &quot;O&quot;, &quot;l_shipdate&quot;: &quot;1996-01-30&quot;, &quot;l_commitdate&quot;: &quot;1996-02-07&quot;, &quot;l_receiptdate&quot;: &quot;1996-02-03&quot;, &quot;l_shipinstruct&quot;: &quot;DELIVER IN PERSON&quot;, &quot;l_shipmode&quot;: &quot;MAIL&quot;, &quot;l_comment&quot;: &quot;arefully slyly ex&quot; }
+    { &quot;l_orderkey&quot;: 2, &quot;l_partkey&quot;: 107, &quot;l_suppkey&quot;: 2, &quot;l_linenumber&quot;: 1, &quot;l_quantity&quot;: 38, &quot;l_extendedprice&quot;: 38269.8d, &quot;l_discount&quot;: 0.0d, &quot;l_tax&quot;: 0.05d, &quot;l_returnflag&quot;: &quot;N&quot;, &quot;l_linestatus&quot;: &quot;O&quot;, &quot;l_shipdate&quot;: &quot;1997-01-28&quot;, &quot;l_commitdate&quot;: &quot;1997-01-14&quot;, &quot;l_receiptdate&quot;: &quot;1997-02-02&quot;, &quot;l_shipinstruct&quot;: &quot;TAKE BACK RETURN&quot;, &quot;l_shipmode&quot;: &quot;RAIL&quot;, &quot;l_comment&quot;: &quot;ven requests. deposits breach a&quot; }
+    { &quot;l_orderkey&quot;: 3, &quot;l_partkey&quot;: 5, &quot;l_suppkey&quot;: 2, &quot;l_linenumber&quot;: 1, &quot;l_quantity&quot;: 45, &quot;l_extendedprice&quot;: 40725.0d, &quot;l_discount&quot;: 0.06d, &quot;l_tax&quot;: 0.0d, &quot;l_returnflag&quot;: &quot;R&quot;, &quot;l_linestatus&quot;: &quot;F&quot;, &quot;l_shipdate&quot;: &quot;1994-02-02&quot;, &quot;l_commitdate&quot;: &quot;1994-01-04&quot;, &quot;l_receiptdate&quot;: &quot;1994-02-23&quot;, &quot;l_shipinstruct&quot;: &quot;NONE&quot;, &quot;l_shipmode&quot;: &quot;AIR&quot;, &quot;l_comment&quot;: &quot;ongside of the furiously brave acco&quot; }
+    { &quot;l_orderkey&quot;: 3, &quot;l_partkey&quot;: 20, &quot;l_suppkey&quot;: 10, &quot;l_linenumber&quot;: 2, &quot;l_quantity&quot;: 49, &quot;l_extendedprice&quot;: 45080.98d, &quot;l_discount&quot;: 0.1d, &quot;l_tax&quot;: 0.0d, &quot;l_returnflag&quot;: &quot;R&quot;, &quot;l_linestatus&quot;: &quot;F&quot;, &quot;l_shipdate&quot;: &quot;1993-11-09&quot;, &quot;l_commitdate&quot;: &quot;1993-12-20&quot;, &quot;l_receiptdate&quot;: &quot;1993-11-24&quot;, &quot;l_shipinstruct&quot;: &quot;TAKE BACK RETURN&quot;, &quot;l_shipmode&quot;: &quot;RAIL&quot;, &quot;l_comment&quot;: &quot; unusual accounts. eve&quot; }
+    { &quot;l_orderkey&quot;: 3, &quot;l_partkey&quot;: 129, &quot;l_suppkey&quot;: 8, &quot;l_linenumber&quot;: 3, &quot;l_quantity&quot;: 27, &quot;l_extendedprice&quot;: 27786.24d, &quot;l_discount&quot;: 0.06d, &quot;l_tax&quot;: 0.07d, &quot;l_returnflag&quot;: &quot;A&quot;, &quot;l_linestatus&quot;: &quot;F&quot;, &quot;l_shipdate&quot;: &quot;1994-01-16&quot;, &quot;l_commitdate&quot;: &quot;1993-11-22&quot;, &quot;l_receiptdate&quot;: &quot;1994-01-23&quot;, &quot;l_shipinstruct&quot;: &quot;DELIVER IN PERSON&quot;, &quot;l_shipmode&quot;: &quot;SHIP&quot;, &quot;l_comment&quot;: &quot;nal foxes wake. &quot; }
+    { &quot;l_orderkey&quot;: 3, &quot;l_partkey&quot;: 30, &quot;l_suppkey&quot;: 5, &quot;l_linenumber&quot;: 4, &quot;l_quantity&quot;: 2, &quot;l_extendedprice&quot;: 1860.06d, &quot;l_discount&quot;: 0.01d, &quot;l_tax&quot;: 0.06d, &quot;l_returnflag&quot;: &quot;A&quot;, &quot;l_linestatus&quot;: &quot;F&quot;, &quot;l_shipdate&quot;: &quot;1993-12-04&quot;, &quot;l_commitdate&quot;: &quot;1994-01-07&quot;, &quot;l_receiptdate&quot;: &quot;1994-01-01&quot;, &quot;l_shipinstruct&quot;: &quot;NONE&quot;, &quot;l_shipmode&quot;: &quot;TRUCK&quot;, &quot;l_comment&quot;: &quot;y. fluffily pending d&quot; }
+    { &quot;l_orderkey&quot;: 3, &quot;l_partkey&quot;: 184, &quot;l_suppkey&quot;: 5, &quot;l_linenumber&quot;: 5, &quot;l_quantity&quot;: 28, &quot;l_extendedprice&quot;: 30357.04d, &quot;l_discount&quot;: 0.04d, &quot;l_tax&quot;: 0.0d, &quot;l_returnflag&quot;: &quot;R&quot;, &quot;l_linestatus&quot;: &quot;F&quot;, &quot;l_shipdate&quot;: &quot;1993-12-14&quot;, &quot;l_commitdate&quot;: &quot;1994-01-10&quot;, &quot;l_receiptdate&quot;: &quot;1994-01-01&quot;, &quot;l_shipinstruct&quot;: &quot;TAKE BACK RETURN&quot;, &quot;l_shipmode&quot;: &quot;FOB&quot;, &quot;l_comment&quot;: &quot;ages nag slyly pending&quot; }
+    { &quot;l_orderkey&quot;: 3, &quot;l_partkey&quot;: 63, &quot;l_suppkey&quot;: 8, &quot;l_linenumber&quot;: 6, &quot;l_quantity&quot;: 26, &quot;l_extendedprice&quot;: 25039.56d, &quot;l_discount&quot;: 0.1d, &quot;l_tax&quot;: 0.02d, &quot;l_returnflag&quot;: &quot;A&quot;, &quot;l_linestatus&quot;: &quot;F&quot;, &quot;l_shipdate&quot;: &quot;1993-10-29&quot;, &quot;l_commitdate&quot;: &quot;1993-12-18&quot;, &quot;l_receiptdate&quot;: &quot;1993-11-04&quot;, &quot;l_shipinstruct&quot;: &quot;TAKE BACK RETURN&quot;, &quot;l_shipmode&quot;: &quot;RAIL&quot;, &quot;l_comment&quot;: &quot;ges sleep after the caref&quot; }
+</pre></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>

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/aql/filters.html
----------------------------------------------------------------------
diff --git a/aql/filters.html b/aql/filters.html
new file mode 100644
index 0000000..33169a1
--- /dev/null
+++ b/aql/filters.html
@@ -0,0 +1,256 @@
+<!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 class="active">
+    
+            <a href="#"><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>Filter-Based LSM Index Acceleration</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="#Motivation">Motivation</a></li>
+  
+<li><a href="#FiltersInAsterixDB">Filters in AsterixDB</a></li>
+  
+<li><a href="#FiltersAndMergePolicies">Filters and Merge Policies</a></li>
+</ul></div>
+<div class="section">
+<h2><a name="Motivation" id="Motivation">Motivation</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Motivation_Back_to_TOC"></a></h2>
+<p>Traditional relational databases usually employ conventional index structures such as B+ trees due to their low read latency. However, such traditional index structures use in-place writes to perform updates, resulting in costly random writes to disk. Today&#x2019;s emerging applications often involve insert-intensive workloads for which the cost of random writes prohibits efficient ingestion of data. Consequently, popular NoSQL systems such as Cassandra, HBase, LevelDB, BigTable, etc. have adopted Log-Structured Merge (LSM) Trees as their storage structure. LSM-trees avoids the cost of random writes by batching updates into a component of the index that resides in main memory &#x2013; an <i>in-memory component</i>. When the space occupancy of the in-memory component exceeds a specified threshold, its entries are <i>flushed</i> to disk forming a new component &#x2013; a <i>disk component</i>. As disk components accumulate on disk, they are periodically merged together subject to 
 a <i>merge policy</i> that decides when and what to merge. The benefit of the LSM-trees comes at the cost of possibly sacrificing read efficiency, but, it has been shown in previous studies that these inefficiencies can be mostly mitigated.</p>
+<p>AsterixDB has also embraced LSM-trees, not just by using them as primary indexes, but also by using the same LSM-ification technique for all of its secondary index structures. In particular, AsterixDB adopted a generic framework for converting a class of indexes (that includes conventional B+ trees, R trees, and inverted indexes) into LSM-based secondary indexes, allowing higher data ingestion rates. In fact, for certain index structures, our results have shown that using an LSM-based version of an index can be made to significantly outperform its conventional counterpart for <i>both</i> ingestion and query speed (an example of such an index being the R-tree for spatial data).</p>
+<p>Since an LSM-based index naturally partitions data into multiple disk components, it is possible, when answering certain queries, to exploit partitioning to only access some components and safely filter out the remaining components, thus reducing query times. For instance, referring to our <a href="primer.html#ADM:_Modeling_Semistructed_Data_in_AsterixDB">TinySocial</a> example, suppose a user always retrieves tweets from the <tt>TweetMessages</tt> dataset based on the <tt>send-time</tt> field (e.g., tweets posted in the last 24 hours). Since there is not a secondary index on the <tt>send-time</tt> field, the only available option for AsterixDB would be to scan the whole <tt>TweetMessages</tt> dataset and then apply the predicate as a post-processing step. However, if disk components of the primary index were tagged with the minimum and maximum timestamp values of the records they contain, we could utilize the tagged information to directly access the primary index and prune comp
 onents that do not match the query predicate. Thus, we could save substantial cost by avoiding scanning the whole dataset and only access the relevant components. We simply call such tagging information that are associated with components, filters. (Note that even if there were a secondary index on <tt>send-time</tt> field, using filters could save substantial cost by avoiding accessing the secondary index, followed by probing the primary index for every fetched entry.) Moreover, the same filtering technique can also be used with any secondary LSM index (e.g., an LSM R-tree), in case the query contains multiple predicates (e.g., spatial and temporal predicates), to obtain similar pruning power.</p></div>
+<div class="section">
+<h2><a name="FiltersInAsterixDB" id="FiltersInAsterixDB">Filters in AsterixDB</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Filters_in_AsterixDB_Back_to_TOC"></a></h2>
+<p>We have added support for LSM-based filters to all of AsterixDB&#x2019;s index types. To enable the use of filters, the user must specify the filter&#x2019;s key when creating a dataset, as shown below:</p>
+<div class="section">
+<div class="section">
+<h4>Creating a Dataset with a Filter<a name="Creating_a_Dataset_with_a_Filter"></a></h4>
+
+<div class="source">
+<pre>    create dataset Tweets(TweetType) primary key tweetid with filter on send-time;
+</pre></div>
+<p>Filters can be created on any totally ordered datatype (i.e., any field that can be indexed using a B+ -tree), such as integers, doubles, floats, UUIDs, datetimes, etc.</p>
+<p>When a dataset with a filter is created, the name of the filter&#x2019;s key field is persisted in the <tt>Metadata.Dataset</tt> dataset (which is the metadata dataset that stores the details of each dataset in an AsterixDB instance) so that DML operations against the dataset can recognize the existence of filters and can update them or utilize them accordingly. Creating a dataset with a filter in AsterixDB implies that the primary and all secondary indexes of that dataset will maintain filters on their disk components. Once a filtered dataset is created, the user can use the dataset normally (just like any other dataset). AsterixDB will automatically maintain the filters and will leverage them to efficiently answer queries whenever possible (i.e., when a query has predicates on the filter&#x2019;s key).</p></div></div></div>
+<div class="section">
+<h2><a name="FiltersAndMergePolicies" id="FiltersAndMergePolicies">Filters and Merge Policies</a> <font size="4"><a href="#toc">[Back to TOC]</a></font><a name="Filters_and_Merge_Policies_Back_to_TOC"></a></h2>
+<p>The AsterixDB default merge policy, the prefix merge policy, relies on component sizes and the number of components to decide which components to merge. This merge policy has proven to provide excellent performance for both ingestion and queries. However, when evaluating our filtering solution with the prefix policy, we observed a behavior that can reduce filter effectiveness. In particular, we noticed that under the prefix merge policy, the disk components of a secondary index tend to be constantly merged into a single component. This is because the prefix policy relies on a single size parameter for all of the indexes of a dataset. This parameter is typically chosen based on the sizes of the disk components of the primary index, which tend to be much larger than the sizes of the secondary indexes&#x2019; disk components. This difference caused the prefix merge policy to behave similarly to the constant merge policy (i.e., relatively poorly) when applied to secondary indexes in 
 the sense that the secondary indexes are constantly merged into a single disk component. Consequently, the effectiveness of filters on secondary indexes was greatly reduced under the prefix-merge policy, but they were still effective when probing the primary index. Based on this behavior, we developed a new merge policy, an improved version of the prefix policy, called the correlated-prefix policy. The basic idea of this policy is that it delegates the decision of merging the disk components of all the indexes in a dataset to the primary index. When the policy decides that the primary index needs to be merged (using the same decision criteria as for the prefix policy), then it will issue successive merge requests to the I/O scheduler on behalf of all other indexes associated with the same dataset. The end result is that secondary indexes will always have the same number of disk components as their primary index under the correlated-prefix merge policy. This has improved query perfor
 mance, since disk components of secondary indexes now have a much better chance of being pruned.</p></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>



[04/13] incubator-asterixdb-site git commit: Initial commit with Till's changes

Posted by im...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/css/print.css
----------------------------------------------------------------------
diff --git a/css/print.css b/css/print.css
new file mode 100644
index 0000000..1cd02d9
--- /dev/null
+++ b/css/print.css
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/* $Id: print.css 1201871 2011-11-14 20:18:24Z simonetripodi $ */
+
+#banner, #footer, #leftcol, #breadcrumbs, .docs #toc, .docs .courtesylinks, #leftColumn, #navColumn {display: none !important;}
+#bodyColumn, body.docs div.docs {margin: 0 !important;border: none !important}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/css/site.css
----------------------------------------------------------------------
diff --git a/css/site.css b/css/site.css
new file mode 100644
index 0000000..055e7e2
--- /dev/null
+++ b/css/site.css
@@ -0,0 +1 @@
+/* You can override this file with your own styles */
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/csv.html
----------------------------------------------------------------------
diff --git a/csv.html b/csv.html
new file mode 100644
index 0000000..eda382a
--- /dev/null
+++ b/csv.html
@@ -0,0 +1,392 @@
+<!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>
+    
+                          <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>CSV Support in AsterixDB</h1>
+<div class="section">
+<h2>Introduction - Defining a datatype for CSV<a name="Introduction_-_Defining_a_datatype_for_CSV"></a></h2>
+<p>AsterixDB supports the CSV format for both data input and query result output. In both cases, the structure of the CSV data must be defined using a named ADM record datatype. The CSV format, limitations, and MIME type are defined by <a class="externalLink" href="https://tools.ietf.org/html/rfc4180">RFC 4180</a>.</p>
+<p>CSV is not as expressive as the full Asterix Data Model, meaning that not all data which can be represented in ADM can also be represented as CSV. So the form of this datatype is limited. First, obviously it may not contain any nested records or lists, as CSV has no way to represent nested data structures. All fields in the record type must be primitive. Second, the set of supported primitive types is limited to numerics (<tt>int8</tt>, <tt>int16</tt>, <tt>int32</tt>, <tt>int64</tt>, <tt>float</tt>, <tt>double</tt>) and <tt>string</tt>. On output, a few additional primitive types (<tt>boolean</tt>, datetime types) are supported and will be represented as strings.</p>
+<p>For the purposes of this document, we will use the following dataverse and datatype definitions:</p>
+
+<div class="source">
+<pre>drop dataverse csv if exists;
+create dataverse csv;
+use dataverse csv;
+
+create type &quot;csv_type&quot; as closed {
+    &quot;id&quot;: int32,
+    &quot;money&quot;: float,
+    &quot;name&quot;: string
+};
+
+create dataset &quot;csv_set&quot; (&quot;csv_type&quot;) primary key &quot;id&quot;;
+</pre></div>
+<p>Note: There is no explicit restriction against using an open datatype for CSV purposes, and you may have optional fields in the datatype (eg., <tt>id: int32?</tt>). However, the CSV format itself is rigid, so using either of these datatype features introduces possible failure modes on output which will be discussed below.</p></div>
+<div class="section">
+<h2>CSV Input<a name="CSV_Input"></a></h2>
+<p>CSV data may be loaded into a dataset using the normal &#x201c;load dataset&#x201d; mechanisms, utilizing the builtin &#x201c;delimited-text&#x201d; format. See <a href="aql/externaldata.html">Accessing External Data</a> for more details. Note that comma is the default value for the &#x201c;delimiter&#x201d; parameter, so it does not need to be explicitly specified.</p>
+<p>In this case, the datatype used to interpret the CSV data is the datatype associated with the dataset being loaded. So, to load a file that we have stored locally on the NC into our example dataset:</p>
+
+<div class="source">
+<pre>use dataverse csv;
+
+load dataset &quot;csv_set&quot; using localfs
+((&quot;path&quot;=&quot;127.0.0.1:///tmp/my_sample.csv&quot;),
+ (&quot;format&quot;=&quot;delimited-text&quot;));
+</pre></div>
+<p>So, if the file <tt>/tmp/my_sample.csv</tt> contained</p>
+
+<div class="source">
+<pre>1,18.50,&quot;Peter Krabnitz&quot;
+2,74.50,&quot;Jesse Stevens&quot;
+</pre></div>
+<p>then the preceding query would load it into the dataset <tt>csv_set</tt>.</p>
+<p>If your CSV file has a header (that is, the first line contains a set of field names, rather than actual data), you can instruct Asterix to ignore this header by adding the parameter <tt>&quot;header&quot;=&quot;true&quot;</tt>, eg.</p>
+
+<div class="source">
+<pre>load dataset &quot;csv_set&quot; using localfs
+((&quot;path&quot;=&quot;127.0.0.1:///tmp/my_header_sample.csv&quot;),
+ (&quot;format&quot;=&quot;delimited-text&quot;),
+ (&quot;header&quot;=&quot;true&quot;));
+</pre></div>
+<p>CSV data may also be loaded from HDFS; see <a href="aql/externaldata.html">Accessing External Data</a> for details. However please note that CSV files on HDFS cannot have headers. Attempting to specify &#x201c;header&#x201d;=&#x201c;true&#x201d; when reading from HDFS could result in non-header lines of data being skipped as well.</p></div>
+<div class="section">
+<h2>CSV Output<a name="CSV_Output"></a></h2>
+<p>Any query may be rendered as CSV when using AsterixDB&#x2019;s HTTP interface. To do so, there are two steps required: specify the record type which defines the schema of your CSV, and request that Asterix use the CSV output format.</p>
+<div class="section">
+<div class="section">
+<h4>Output Record Type<a name="Output_Record_Type"></a></h4>
+<p>Background: The result of any AQL query is an unordered list of <i>instances</i>, where each <i>instance</i> is an instance of an AQL datatype. When requesting CSV output, there are some restrictions on the legal datatypes in this unordered list due to the limited expressability of CSV:</p>
+
+<ol style="list-style-type: decimal">
+  
+<li>Each instance must be of a record type.</li>
+  
+<li>Each instance must be of the <i>same</i> record type.</li>
+  
+<li>The record type must conform to the content and type restrictions mentioned in the introduction.</li>
+</ol>
+<p>While it would be possible to structure your query to cast all result instances to a given type, it is not necessary. AQL offers a built-in feature which will automatically cast all top-level instances in the result to a specified named ADM record type. To enable this feature, use a <tt>set</tt> statement prior to the query to set the parameter <tt>output-record-type</tt> to the name of an ADM type. This type must have already been defined in the current dataverse.</p>
+<p>For example, the following request will ensure that all result instances are cast to the <tt>csv_type</tt> type declared earlier:</p>
+
+<div class="source">
+<pre>use dataverse csv;
+set output-record-type &quot;csv_type&quot;;
+
+for $n in dataset &quot;csv_set&quot; return $n;
+</pre></div>
+<p>In this case the casting is redundant since by definition every value in <tt>csv_set</tt> is already of type <tt>csv_type</tt>. But consider a more complex query where the result values are created by joining fields from different underlying datasets, etc.</p>
+<p>Two notes about <tt>output-record-type</tt>:</p>
+
+<ol style="list-style-type: decimal">
+  
+<li>This feature is not strictly related to CSV; it may be used with any output formats (in which case, any record datatype may be specified, not subject to the limitations specified in the introduction of this page).</li>
+  
+<li>When the CSV output format is requested, <tt>output-record-type</tt> is in fact required, not optional. This is because the type is used to determine the field names for the CSV header and to ensure that the ordering of fields in the output is consistent (which is obviously vital for the CSV to make any sense).</li>
+</ol></div>
+<div class="section">
+<h4>Request the CSV Output Format<a name="Request_the_CSV_Output_Format"></a></h4>
+<p>When sending requests to the Asterix HTTP API, Asterix decides what format to use for rendering the results in one of two ways:</p>
+
+<ul>
+  
+<li>
+<p>A HTTP query parameter named &#x201c;output&#x201d;, which must be set to one of  the following values: <tt>JSON</tt>, <tt>CSV</tt>, or <tt>ADM</tt>.</p></li>
+  
+<li>
+<p>Based on the <a class="externalLink" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1"><tt>Accept</tt> HTTP header</a></p></li>
+</ul>
+<p>By default, Asterix will produce JSON output. To select CSV output, pass the parameter <tt>output=CSV</tt>, or set the <tt>Accept</tt> header on your request to the MIME type <tt>text/csv</tt>. The details of how to accomplish this will of course depend on what tools you are using to contact the HTTP API. Here is an example from a Unix shell prompt using the command-line utility &#x201c;curl&#x201d; and specifying the &quot;output query parameter:</p>
+
+<div class="source">
+<pre>curl -G &quot;http://localhost:19002/query&quot; \
+    --data-urlencode 'output=CSV' \
+    --data-urlencode 'query=use dataverse csv;
+          set output-record-type &quot;csv_type&quot;;
+          for $n in dataset csv_set return $n;'
+</pre></div>
+<p>Alternately, the same query using the <tt>Accept</tt> header:</p>
+
+<div class="source">
+<pre>curl -G -H &quot;Accept: text/csv&quot; &quot;http://localhost:19002/query&quot; \
+    --data-urlencode 'query=use dataverse csv;
+          set output-record-type &quot;csv_type&quot;;
+          for $n in dataset csv_set return $n;'
+</pre></div>
+<p>Similarly, a trivial Java program to execute the above sample query and selecting CSV output via the <tt>Accept</tt> header would be:</p>
+
+<div class="source">
+<pre>import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLEncoder;
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+public class AsterixExample {
+    public static void main(String[] args) throws Exception {
+        String query = &quot;use dataverse csv; &quot; +
+            &quot;set output-record-type \&quot;csv_type\&quot;;&quot; +
+            &quot;for $n in dataset csv_set return $n&quot;;
+        URL asterix = new URL(&quot;http://localhost:19002/query?query=&quot; +
+                              URLEncoder.encode(query, &quot;UTF-8&quot;));
+        HttpURLConnection conn = (HttpURLConnection) asterix.openConnection();
+        conn.setRequestProperty(&quot;Accept&quot;, &quot;text/csv&quot;);
+        BufferedReader result = new BufferedReader
+            (new InputStreamReader(conn.getInputStream()));
+        String line;
+        while ((line = result.readLine()) != null) {
+            System.out.println(line);
+        }
+        result.close();
+    }
+}
+</pre></div>
+<p>For either of the above examples, the output would be:</p>
+
+<div class="source">
+<pre>1,18.5,&quot;Peter Krabnitz&quot;
+2,74.5,&quot;Jesse Stevens&quot;
+</pre></div>
+<p>assuming you had already run the previous examples to create the dataverse and populate the dataset.</p></div>
+<div class="section">
+<h4>Outputting CSV with a Header<a name="Outputting_CSV_with_a_Header"></a></h4>
+<p>By default, AsterixDB will produce CSV results with no header line. If you want a header, you may explicitly request it in one of two ways:</p>
+
+<ul>
+  
+<li>
+<p>By passing the HTTP query parameter &#x201c;header&#x201d; with the value &#x201c;present&#x201d;</p></li>
+  
+<li>
+<p>By specifying the MIME type {{text/csv; header=present}} in your HTTP Accept: header. This is consistent with RFC 4180.</p></li>
+</ul></div>
+<div class="section">
+<h4>Issues with open datatypes and optional fields<a name="Issues_with_open_datatypes_and_optional_fields"></a></h4>
+<p>As mentioned earlier, CSV is a rigid format. It cannot express records with different numbers of fields, which ADM allows through both open datatypes and optional fields.</p>
+<p>If your output record type contains optional fields, this will not result in any errors. If the output data of a query does not contain values for an optional field, this will be represented in CSV as <tt>null</tt>.</p>
+<p>If your output record type is open, this will also not result in any errors. If the output data of a query contains any open fields, the corresponding rows in the resulting CSV will contain more comma-separated values than the others. On each such row, the data from the closed fields in the type will be output first in the normal order, followed by the data from the open fields in an arbitrary order.</p>
+<p>According to RFC 4180 this is not strictly valid CSV (Section 2, rule 4, &#x201c;Each line <i>should</i> contain the same number of fields throughout the file&#x201d;). Hence it will likely not be handled consistently by all CSV processors. Some may throw a parsing error. If you attempt to load this data into AsterixDB later using <tt>load dataset</tt>, the extra fields will be silently ignored. For this reason it is recommended that you use only closed datatypes as output record types. AsterixDB allows to use an open record type only to support cases where the type already exists for other parts of your application.</p></div></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>

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/accessories-text-editor.png
----------------------------------------------------------------------
diff --git a/images/accessories-text-editor.png b/images/accessories-text-editor.png
new file mode 100644
index 0000000..abc3366
Binary files /dev/null and b/images/accessories-text-editor.png differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/add.gif
----------------------------------------------------------------------
diff --git a/images/add.gif b/images/add.gif
new file mode 100644
index 0000000..1cb3dbf
Binary files /dev/null and b/images/add.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/apache-maven-project-2.png
----------------------------------------------------------------------
diff --git a/images/apache-maven-project-2.png b/images/apache-maven-project-2.png
new file mode 100644
index 0000000..6c096ec
Binary files /dev/null and b/images/apache-maven-project-2.png differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/application-certificate.png
----------------------------------------------------------------------
diff --git a/images/application-certificate.png b/images/application-certificate.png
new file mode 100644
index 0000000..cc6aff6
Binary files /dev/null and b/images/application-certificate.png differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/asf_logo_wide.png
----------------------------------------------------------------------
diff --git a/images/asf_logo_wide.png b/images/asf_logo_wide.png
new file mode 100644
index 0000000..56a4369
Binary files /dev/null and b/images/asf_logo_wide.png differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/asterixlogo.png
----------------------------------------------------------------------
diff --git a/images/asterixlogo.png b/images/asterixlogo.png
new file mode 100644
index 0000000..45cd64f
Binary files /dev/null and b/images/asterixlogo.png differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/contact-new.png
----------------------------------------------------------------------
diff --git a/images/contact-new.png b/images/contact-new.png
new file mode 100644
index 0000000..ebc4316
Binary files /dev/null and b/images/contact-new.png differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/document-properties.png
----------------------------------------------------------------------
diff --git a/images/document-properties.png b/images/document-properties.png
new file mode 100644
index 0000000..34c2409
Binary files /dev/null and b/images/document-properties.png differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/drive-harddisk.png
----------------------------------------------------------------------
diff --git a/images/drive-harddisk.png b/images/drive-harddisk.png
new file mode 100644
index 0000000..d7ce475
Binary files /dev/null and b/images/drive-harddisk.png differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/egg-logo.png
----------------------------------------------------------------------
diff --git a/images/egg-logo.png b/images/egg-logo.png
new file mode 100644
index 0000000..c04e70d
Binary files /dev/null and b/images/egg-logo.png differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/fix.gif
----------------------------------------------------------------------
diff --git a/images/fix.gif b/images/fix.gif
new file mode 100644
index 0000000..b7eb3dc
Binary files /dev/null and b/images/fix.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/hyrax_ts.png
----------------------------------------------------------------------
diff --git a/images/hyrax_ts.png b/images/hyrax_ts.png
new file mode 100644
index 0000000..001c788
Binary files /dev/null and b/images/hyrax_ts.png differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/icon_error_sml.gif
----------------------------------------------------------------------
diff --git a/images/icon_error_sml.gif b/images/icon_error_sml.gif
new file mode 100644
index 0000000..12e9a01
Binary files /dev/null and b/images/icon_error_sml.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/icon_help_sml.gif
----------------------------------------------------------------------
diff --git a/images/icon_help_sml.gif b/images/icon_help_sml.gif
new file mode 100644
index 0000000..aaf20e6
Binary files /dev/null and b/images/icon_help_sml.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/icon_info_sml.gif
----------------------------------------------------------------------
diff --git a/images/icon_info_sml.gif b/images/icon_info_sml.gif
new file mode 100644
index 0000000..b776326
Binary files /dev/null and b/images/icon_info_sml.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/icon_success_sml.gif
----------------------------------------------------------------------
diff --git a/images/icon_success_sml.gif b/images/icon_success_sml.gif
new file mode 100644
index 0000000..0a19527
Binary files /dev/null and b/images/icon_success_sml.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/icon_warning_sml.gif
----------------------------------------------------------------------
diff --git a/images/icon_warning_sml.gif b/images/icon_warning_sml.gif
new file mode 100644
index 0000000..ac6ad6a
Binary files /dev/null and b/images/icon_warning_sml.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/image-x-generic.png
----------------------------------------------------------------------
diff --git a/images/image-x-generic.png b/images/image-x-generic.png
new file mode 100644
index 0000000..ab49efb
Binary files /dev/null and b/images/image-x-generic.png differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/internet-web-browser.png
----------------------------------------------------------------------
diff --git a/images/internet-web-browser.png b/images/internet-web-browser.png
new file mode 100644
index 0000000..307d6ac
Binary files /dev/null and b/images/internet-web-browser.png differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/logos/build-by-maven-black.png
----------------------------------------------------------------------
diff --git a/images/logos/build-by-maven-black.png b/images/logos/build-by-maven-black.png
new file mode 100644
index 0000000..919fd0f
Binary files /dev/null and b/images/logos/build-by-maven-black.png differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/logos/build-by-maven-white.png
----------------------------------------------------------------------
diff --git a/images/logos/build-by-maven-white.png b/images/logos/build-by-maven-white.png
new file mode 100644
index 0000000..7d44c9c
Binary files /dev/null and b/images/logos/build-by-maven-white.png differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/logos/maven-feather.png
----------------------------------------------------------------------
diff --git a/images/logos/maven-feather.png b/images/logos/maven-feather.png
new file mode 100644
index 0000000..b5ada83
Binary files /dev/null and b/images/logos/maven-feather.png differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/network-server.png
----------------------------------------------------------------------
diff --git a/images/network-server.png b/images/network-server.png
new file mode 100644
index 0000000..1d12e19
Binary files /dev/null and b/images/network-server.png differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/package-x-generic.png
----------------------------------------------------------------------
diff --git a/images/package-x-generic.png b/images/package-x-generic.png
new file mode 100644
index 0000000..8b7e9e6
Binary files /dev/null and b/images/package-x-generic.png differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/profiles/pre-release.png
----------------------------------------------------------------------
diff --git a/images/profiles/pre-release.png b/images/profiles/pre-release.png
new file mode 100644
index 0000000..d448e85
Binary files /dev/null and b/images/profiles/pre-release.png differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/profiles/retired.png
----------------------------------------------------------------------
diff --git a/images/profiles/retired.png b/images/profiles/retired.png
new file mode 100644
index 0000000..f89f6a2
Binary files /dev/null and b/images/profiles/retired.png differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/profiles/sandbox.png
----------------------------------------------------------------------
diff --git a/images/profiles/sandbox.png b/images/profiles/sandbox.png
new file mode 100644
index 0000000..f88b362
Binary files /dev/null and b/images/profiles/sandbox.png differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/remove.gif
----------------------------------------------------------------------
diff --git a/images/remove.gif b/images/remove.gif
new file mode 100644
index 0000000..fc65631
Binary files /dev/null and b/images/remove.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/rss.png
----------------------------------------------------------------------
diff --git a/images/rss.png b/images/rss.png
new file mode 100644
index 0000000..a9850ee
Binary files /dev/null and b/images/rss.png differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/update.gif
----------------------------------------------------------------------
diff --git a/images/update.gif b/images/update.gif
new file mode 100644
index 0000000..b2a6d0b
Binary files /dev/null and b/images/update.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/images/window-new.png
----------------------------------------------------------------------
diff --git a/images/window-new.png b/images/window-new.png
new file mode 100644
index 0000000..0e12ef9
Binary files /dev/null and b/images/window-new.png differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/img/glyphicons-halflings-white.png
----------------------------------------------------------------------
diff --git a/img/glyphicons-halflings-white.png b/img/glyphicons-halflings-white.png
new file mode 100644
index 0000000..3bf6484
Binary files /dev/null and b/img/glyphicons-halflings-white.png differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/img/glyphicons-halflings.png
----------------------------------------------------------------------
diff --git a/img/glyphicons-halflings.png b/img/glyphicons-halflings.png
new file mode 100644
index 0000000..a996999
Binary files /dev/null and b/img/glyphicons-halflings.png differ

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/index.html
----------------------------------------------------------------------
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..8013041
--- /dev/null
+++ b/index.html
@@ -0,0 +1,253 @@
+<!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>
+    
+                          <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</h1>
+<p>AsterixDB is a BDMS (Big Data Management System) with a rich feature set that sets it apart from other Big Data platforms. Its feature set makes it well-suited to modern needs such as web data warehousing and social data storage and analysis. AsterixDB has:</p>
+
+<ul>
+  
+<li>A semistructured NoSQL style data model (ADM) resulting from extending JSON  with object database ideas</li>
+  
+<li>An expressive and declarative query language (AQL) that supports a broad  range of queries and analysis over semistructured data</li>
+  
+<li>A parallel runtime query execution engine, Hyracks, that has been  scale-tested on up to 1000+ cores and 500+ disks</li>
+  
+<li>Partitioned LSM-based data storage and indexing to support efficient  ingestion and management of semistructured data</li>
+  
+<li>Support for query access to externally stored data (e.g., data in HDFS) as  well as to data stored natively by AsterixDB</li>
+  
+<li>A rich set of primitive data types, including spatial and temporal data in  addition to integer, floating point, and textual data</li>
+  
+<li>Secondary indexing options that include B+ trees, R trees, and inverted  keyword (exact and fuzzy) index types</li>
+  
+<li>Support for fuzzy and spatial queries as well as for more traditional  parametric queries</li>
+  
+<li>Basic transactional (concurrency and recovery) capabilities akin to those of  a NoSQL store</li>
+</ul>
+<div class="section">
+<div class="section">
+<h3>Disclaimer<a name="Disclaimer"></a></h3>
+<p>Apache AsterixDB is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.</p></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>



[08/13] incubator-asterixdb-site git commit: Initial commit with Till's changes

Posted by im...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-site/blob/ed124d8f/aql/primer-sql-like.html
----------------------------------------------------------------------
diff --git a/aql/primer-sql-like.html b/aql/primer-sql-like.html
new file mode 100644
index 0000000..bfacd1a
--- /dev/null
+++ b/aql/primer-sql-like.html
@@ -0,0 +1,832 @@
+<!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 class="active">
+    
+            <a href="#"><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>
+    
+                          <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 101: An ADM and AQL Primer (for SQL fans)</h1>
+<div class="section">
+<h2>Welcome to AsterixDB!<a name="Welcome_to_AsterixDB"></a></h2>
+<p>This document introduces the main features of AsterixDB&#x2019;s data model (ADM) and query language (AQL) by example. The example is a simple scenario involving (synthetic) sample data modeled after data from the social domain. This document describes a set of sample ADM datasets, together with a set of illustrative AQL queries (in a SQL-like form), to introduce you to the &#x201c;AsterixDB user experience&#x201d;. The complete set of steps required to create and load a handful of sample datasets, along with runnable queries and the expected results for each query, are included.</p>
+<p>This document assumes that you are at least vaguely familiar with AsterixDB and why you might want to use it. Most importantly, it assumes you already have a running instance of AsterixDB and that you know how to query it using AsterixDB&#x2019;s basic web interface. For more information on these topics, you should go through the steps in <a href="../install.html">Installing Asterix Using Managix</a> before reading this document and make sure that you have a running AsterixDB instance ready to go. To get your feet wet, you should probably start with a simple local installation of AsterixDB on your favorite machine, accepting all of the default settings that Managix offers. Later you can graduate to trying AsterixDB on a cluster, its real intended home (since it targets Big Data). (Note: With the exception of specifying the correct locations where you put the source data for this example, there should no changes needed in your ADM or AQL statements to run the examples locally and/
 or to run them on a cluster when you are ready to take that step.)</p>
+<p>As you read through this document, you should try each step for yourself on your own AsterixDB instance. Once you have reached the end, you will be fully armed and dangerous, with all the basic AsterixDB knowledge that you&#x2019;ll need to start down the path of modeling, storing, and querying your own semistructured data.</p>
+<p>&#x2014;-</p></div>
+<div class="section">
+<h2>ADM: Modeling Semistructed Data in AsterixDB<a name="ADM:_Modeling_Semistructed_Data_in_AsterixDB"></a></h2>
+<p>In this section you will learn all about modeling Big Data using ADM, the data model of the AsterixDB BDMS.</p>
+<div class="section">
+<h3>Dataverses, Datatypes, and Datasets<a name="Dataverses_Datatypes_and_Datasets"></a></h3>
+<p>The top-level organizing concept in the AsterixDB world is the <i>dataverse</i>. A dataverse&#x2014;short for &#x201c;data universe&#x201d;&#x2014;is a place (similar to a database in a relational DBMS) in which to create and manage the types, datasets, functions, and other artifacts for a given AsterixDB application. When you start using an AsterixDB instance for the first time, it starts out &#x201c;empty&#x201d;; it contains no data other than the AsterixDB system catalogs (which live in a special dataverse called the Metadata dataverse). To store your data in AsterixDB, you will first create a dataverse and then you use it for the <i>datatypes</i> and <i>datasets</i> for managing your own data. A datatype tells AsterixDB what you know (or more accurately, what you want it to know) a priori about one of the kinds of data instances that you want AsterixDB to hold for you. A dataset is a collection of data instances of a datatype, and AsterixDB makes sure that the data instances
  that you put in it conform to its specified type. Since AsterixDB targets semistructured data, you can use <i>open</i> datatypes and tell it as little or as much as you wish about your data up front; the more you tell it up front, the less information it will have to store repeatedly in the individual data instances that you give it. Instances of open datatypes are permitted to have additional content, beyond what the datatype says, as long as they at least contain the information prescribed by the datatype definition. Open typing allows data to vary from one instance to another and it leaves wiggle room for application evolution in terms of what might need to be stored in the future. If you want to restrict data instances in a dataset to have only what the datatype says, and nothing extra, you can define a <i>closed</i> datatype for that dataset and AsterixDB will keep users from storing objects that have extra data in them. Datatypes are open by default unless you tell AsterixDB 
 otherwise. Let&#x2019;s put these concepts to work</p>
+<p>Our little sample scenario involves hypothetical information about users of two popular social networks, Facebook and Twitter, and their messages. We&#x2019;ll start by defining a dataverse called &#x201c;TinySocial&#x201d; to hold our datatypes and datasets. The AsterixDB data model (ADM) is essentially a superset of JSON&#x2014;it&#x2019;s what you get by extending JSON with more data types and additional data modeling constructs borrowed from object databases. The following is how we can create the TinySocial dataverse plus a set of ADM types for modeling Twitter users, their Tweets, Facebook users, their users&#x2019; employment information, and their messages. (Note: Keep in mind that this is just a tiny and somewhat silly example intended for illustrating some of the key features of AsterixDB. :-))</p>
+
+<div class="source">
+<pre>    drop dataverse TinySocial if exists;
+    create dataverse TinySocial;
+    use dataverse TinySocial;
+
+    create type TwitterUserType as open {
+        screen-name: string,
+        lang: string,
+        friends_count: int32,
+        statuses_count: int32,
+        name: string,
+        followers_count: int32
+    }
+    create type TweetMessageType as closed {
+        tweetid: string,
+        user: TwitterUserType,
+        sender-location: point?,
+        send-time: datetime,
+        referred-topics: {{ string }},
+        message-text: string
+    }
+    create type EmploymentType as open {
+        organization-name: string,
+        start-date: date,
+        end-date: date?
+    }
+    create type FacebookUserType as closed {
+        id: int32,
+        alias: string,
+        name: string,
+        user-since: datetime,
+        friend-ids: {{ int32 }},
+        employment: [EmploymentType]
+    }
+    create type FacebookMessageType as closed {
+        message-id: int32,
+        author-id: int32,
+        in-response-to: int32?,
+        sender-location: point?,
+        message: string
+    }
+</pre></div>
+<p>The first three lines above tell AsterixDB to drop the old TinySocial dataverse, if one already exists, and then to create a brand new one and make it the focus of the statements that follow. The first type creation statement creates a datatype for holding information about Twitter users. It is a record type with a mix of integer and string data, very much like a (flat) relational tuple. The indicated fields are all mandatory, but because the type is open, additional fields are welcome. The second statement creates a datatype for Twitter messages; this shows how to specify a closed type. Interestingly (based on one of Twitter&#x2019;s APIs), each Twitter message actually embeds an instance of the sending user&#x2019;s information (current as of when the message was sent), so this is an example of a nested record in ADM. Twitter messages can optionally contain the sender&#x2019;s location, which is modeled via the sender-location field of spatial type <i>point</i>; the question ma
 rk following the field type indicates its optionality. An optional field is like a nullable field in SQL&#x2014;it may be present or missing, but when it&#x2019;s present, its data type will conform to the datatype&#x2019;s specification. The send-time field illustrates the use of a temporal primitive type, <i>datetime</i>. Lastly, the referred-topics field illustrates another way that ADM is richer than the relational model; this field holds a bag (a.k.a. an unordered list) of strings. Since the overall datatype definition for Twitter messages says &#x201c;closed&#x201d;, the fields that it lists are the only fields that instances of this type will be allowed to contain. The next two create type statements create a record type for holding information about one component of the employment history of a Facebook user and then a record type for holding the user information itself. The Facebook user type highlights a few additional ADM data model features. Its friend-ids field is a bag 
 of integers, presumably the Facebook user ids for this user&#x2019;s friends, and its employment field is an ordered list of employment records. The final create type statement defines a type for handling the content of a Facebook message in our hypothetical social data storage scenario.</p>
+<p>Before going on, we need to once again emphasize the idea that AsterixDB is aimed at storing and querying not just Big Data, but Big <i>Semistructured</i> Data. This means that most of the fields listed in the create type statements above could have been omitted without changing anything other than the resulting size of stored data instances on disk. AsterixDB stores its information about the fields defined a priori as separate metadata, whereas the information about other fields that are &#x201c;just there&#x201d; in instances of open datatypes is stored with each instance&#x2014;making for more bits on disk and longer times for operations affected by data size (e.g., dataset scans). The only fields that <i>must</i> be specified a priori are the primary key and any fields that you would like to build indexes on. (AsterixDB does not yet support auto-generated keys or indexes on the unspecified &#x201c;open&#x201d; fields of its data instances).</p></div>
+<div class="section">
+<h3>Creating Datasets and Indexes<a name="Creating_Datasets_and_Indexes"></a></h3>
+<p>Now that we have defined our datatypes, we can move on and create datasets to store the actual data. (If we wanted to, we could even have several named datasets based on any one of these datatypes.) We can do this as follows, utilizing the DDL capabilities of AsterixDB.</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    create dataset FacebookUsers(FacebookUserType)
+    primary key id;
+
+    create dataset FacebookMessages(FacebookMessageType)
+    primary key message-id;
+
+    create dataset TwitterUsers(TwitterUserType)
+    primary key screen-name;
+
+    create dataset TweetMessages(TweetMessageType)
+    primary key tweetid
+    hints(cardinality=100);
+
+    create index fbUserSinceIdx on FacebookUsers(user-since);
+    create index fbAuthorIdx on FacebookMessages(author-id) type btree;
+    create index fbSenderLocIndex on FacebookMessages(sender-location) type rtree;
+    create index fbMessageIdx on FacebookMessages(message) type keyword;
+
+    from $ds in dataset Metadata.Dataset select $ds;
+    from $ix in dataset Metadata.Index select $ix;
+</pre></div>
+<p>The ADM DDL statements above create four datasets for holding our social data in the TinySocial dataverse: FacebookUsers, FacebookMessages, TwitterUsers, and TweetMessages. The first statement creates the FacebookUsers data set. It specifies that this dataset will store data instances conforming to FacebookUserType and that it has a primary key which is the id field of each instance. The primary key information is used by AsterixDB to uniquely identify instances for the purpose of later lookup and for use in secondary indexes. Each AsterixDB dataset is stored (and indexed) in the form of a B+ tree on primary key; secondary indexes point to their indexed data by primary key. In AsterixDB clusters, the primary key is also used to hash-partition (a.k.a. shard) the dataset across the nodes of the cluster. The next three create dataset statements are similar. The last one illustrates an optional clause for providing useful hints to AsterixDB. In this case, the hint tells AsterixDB tha
 t the dataset definer is anticipating that the TweetMessages dataset will contain roughly 100 objects; knowing this can help AsterixDB to more efficiently manage and query this dataset. (AsterixDB does not yet gather and maintain data statistics; it will currently, abitrarily, assume a cardinality of one million objects per dataset in the absence of such an optional definition-time hint.)</p>
+<p>The create dataset statements above are followed by four more DDL statements, each of which creates a secondary index on a field of one of the datasets. The first one indexes the FacebookUsers dataset on its user-since field. This index will be a B+ tree index; its type is unspecified and <i>btree</i> is the default type. The other three illustrate how you can explicitly specify the desired type of index. In addition to btree, <i>rtree</i> and inverted <i>keyword</i> indexes are supported by AsterixDB. Indexes can also have composite keys, and more advanced text indexing is available as well (ngram(k), where k is the desired gram length).</p></div>
+<div class="section">
+<h3>Querying the Metadata Dataverse<a name="Querying_the_Metadata_Dataverse"></a></h3>
+<p>The last two statements above show how you can use queries in AQL to examine the AsterixDB system catalogs and tell what artifacts you have created. Just as relational DBMSs use their own tables to store their catalogs, AsterixDB uses its own datasets to persist descriptions of its datasets, datatypes, indexes, and so on. Running the first of the two queries above will list all of your newly created datasets, and it will also show you a full list of all the metadata datasets. (You can then explore from there on your own if you are curious) These last two queries also illustrate one other factoid worth knowing: AsterixDB allows queries to span dataverses by allowing the optional use of fully-qualified dataset names (i.e., <i>dataversename.datasetname</i>) to reference datasets that live in a dataverse other than the one that was named in the most recently executed <i>use dataverse</i> directive.</p>
+<p>&#x2014;-</p></div></div>
+<div class="section">
+<h2>Loading Data Into AsterixDB<a name="Loading_Data_Into_AsterixDB"></a></h2>
+<p>Okay, so far so good&#x2014;AsterixDB is now ready for data, so let&#x2019;s give it some data to store Our next task will be to load some sample data into the four datasets that we just defined. Here we will load a tiny set of records, defined in ADM format (a superset of JSON), into each dataset. In the boxes below you can see the actual data instances contained in each of the provided sample files. In order to load this data yourself, you should first store the four corresponding <tt>.adm</tt> files (whose URLs are indicated on top of each box below) into a filesystem directory accessible to your running AsterixDB instance. Take a few minutes to look carefully at each of the sample data sets. This will give you a better sense of the nature of the data that we are about to load and query. We should note that ADM format is a textual serialization of what AsterixDB will actually store; when persisted in AsterixDB, the data format will be binary and the data in the predefined fiel
 ds of the data instances will be stored separately from their associated field name and type metadata.</p>
+<p><a class="externalLink" href="http://asterixdb.googlecode.com/files/twu.adm">Twitter Users</a></p>
+
+<div class="source">
+<pre>    {&quot;screen-name&quot;:&quot;NathanGiesen@211&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:18,&quot;statuses_count&quot;:473,&quot;name&quot;:&quot;Nathan Giesen&quot;,&quot;followers_count&quot;:49416}
+    {&quot;screen-name&quot;:&quot;ColineGeyer@63&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:121,&quot;statuses_count&quot;:362,&quot;name&quot;:&quot;Coline Geyer&quot;,&quot;followers_count&quot;:17159}
+    {&quot;screen-name&quot;:&quot;NilaMilliron_tw&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:445,&quot;statuses_count&quot;:164,&quot;name&quot;:&quot;Nila Milliron&quot;,&quot;followers_count&quot;:22649}
+    {&quot;screen-name&quot;:&quot;ChangEwing_573&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:182,&quot;statuses_count&quot;:394,&quot;name&quot;:&quot;Chang Ewing&quot;,&quot;followers_count&quot;:32136}
+</pre></div>
+<p><a class="externalLink" href="http://asterixdb.googlecode.com/files/twm.adm">Tweet Messages</a></p>
+
+<div class="source">
+<pre>    {&quot;tweetid&quot;:&quot;1&quot;,&quot;user&quot;:{&quot;screen-name&quot;:&quot;NathanGiesen@211&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:39339,&quot;statuses_count&quot;:473,&quot;name&quot;:&quot;Nathan Giesen&quot;,&quot;followers_count&quot;:49416},&quot;sender-location&quot;:point(&quot;47.44,80.65&quot;),&quot;send-time&quot;:datetime(&quot;2008-04-26T10:10:00&quot;),&quot;referred-topics&quot;:{{&quot;t-mobile&quot;,&quot;customization&quot;}},&quot;message-text&quot;:&quot; love t-mobile its customization is good:)&quot;}
+    {&quot;tweetid&quot;:&quot;2&quot;,&quot;user&quot;:{&quot;screen-name&quot;:&quot;ColineGeyer@63&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:121,&quot;statuses_count&quot;:362,&quot;name&quot;:&quot;Coline Geyer&quot;,&quot;followers_count&quot;:17159},&quot;sender-location&quot;:point(&quot;32.84,67.14&quot;),&quot;send-time&quot;:datetime(&quot;2010-05-13T10:10:00&quot;),&quot;referred-topics&quot;:{{&quot;verizon&quot;,&quot;shortcut-menu&quot;}},&quot;message-text&quot;:&quot; like verizon its shortcut-menu is awesome:)&quot;}
+    {&quot;tweetid&quot;:&quot;3&quot;,&quot;user&quot;:{&quot;screen-name&quot;:&quot;NathanGiesen@211&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:39339,&quot;statuses_count&quot;:473,&quot;name&quot;:&quot;Nathan Giesen&quot;,&quot;followers_count&quot;:49416},&quot;sender-location&quot;:point(&quot;29.72,75.8&quot;),&quot;send-time&quot;:datetime(&quot;2006-11-04T10:10:00&quot;),&quot;referred-topics&quot;:{{&quot;motorola&quot;,&quot;speed&quot;}},&quot;message-text&quot;:&quot; like motorola the speed is good:)&quot;}
+    {&quot;tweetid&quot;:&quot;4&quot;,&quot;user&quot;:{&quot;screen-name&quot;:&quot;NathanGiesen@211&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:39339,&quot;statuses_count&quot;:473,&quot;name&quot;:&quot;Nathan Giesen&quot;,&quot;followers_count&quot;:49416},&quot;sender-location&quot;:point(&quot;39.28,70.48&quot;),&quot;send-time&quot;:datetime(&quot;2011-12-26T10:10:00&quot;),&quot;referred-topics&quot;:{{&quot;sprint&quot;,&quot;voice-command&quot;}},&quot;message-text&quot;:&quot; like sprint the voice-command is mind-blowing:)&quot;}
+    {&quot;tweetid&quot;:&quot;5&quot;,&quot;user&quot;:{&quot;screen-name&quot;:&quot;NathanGiesen@211&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:39339,&quot;statuses_count&quot;:473,&quot;name&quot;:&quot;Nathan Giesen&quot;,&quot;followers_count&quot;:49416},&quot;sender-location&quot;:point(&quot;40.09,92.69&quot;),&quot;send-time&quot;:datetime(&quot;2006-08-04T10:10:00&quot;),&quot;referred-topics&quot;:{{&quot;motorola&quot;,&quot;speed&quot;}},&quot;message-text&quot;:&quot; can't stand motorola its speed is terrible:(&quot;}
+    {&quot;tweetid&quot;:&quot;6&quot;,&quot;user&quot;:{&quot;screen-name&quot;:&quot;ColineGeyer@63&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:121,&quot;statuses_count&quot;:362,&quot;name&quot;:&quot;Coline Geyer&quot;,&quot;followers_count&quot;:17159},&quot;sender-location&quot;:point(&quot;47.51,83.99&quot;),&quot;send-time&quot;:datetime(&quot;2010-05-07T10:10:00&quot;),&quot;referred-topics&quot;:{{&quot;iphone&quot;,&quot;voice-clarity&quot;}},&quot;message-text&quot;:&quot; like iphone the voice-clarity is good:)&quot;}
+    {&quot;tweetid&quot;:&quot;7&quot;,&quot;user&quot;:{&quot;screen-name&quot;:&quot;ChangEwing_573&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:182,&quot;statuses_count&quot;:394,&quot;name&quot;:&quot;Chang Ewing&quot;,&quot;followers_count&quot;:32136},&quot;sender-location&quot;:point(&quot;36.21,72.6&quot;),&quot;send-time&quot;:datetime(&quot;2011-08-25T10:10:00&quot;),&quot;referred-topics&quot;:{{&quot;samsung&quot;,&quot;platform&quot;}},&quot;message-text&quot;:&quot; like samsung the platform is good&quot;}
+    {&quot;tweetid&quot;:&quot;8&quot;,&quot;user&quot;:{&quot;screen-name&quot;:&quot;NathanGiesen@211&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:39339,&quot;statuses_count&quot;:473,&quot;name&quot;:&quot;Nathan Giesen&quot;,&quot;followers_count&quot;:49416},&quot;sender-location&quot;:point(&quot;46.05,93.34&quot;),&quot;send-time&quot;:datetime(&quot;2005-10-14T10:10:00&quot;),&quot;referred-topics&quot;:{{&quot;t-mobile&quot;,&quot;shortcut-menu&quot;}},&quot;message-text&quot;:&quot; like t-mobile the shortcut-menu is awesome:)&quot;}
+    {&quot;tweetid&quot;:&quot;9&quot;,&quot;user&quot;:{&quot;screen-name&quot;:&quot;NathanGiesen@211&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:39339,&quot;statuses_count&quot;:473,&quot;name&quot;:&quot;Nathan Giesen&quot;,&quot;followers_count&quot;:49416},&quot;sender-location&quot;:point(&quot;36.86,74.62&quot;),&quot;send-time&quot;:datetime(&quot;2012-07-21T10:10:00&quot;),&quot;referred-topics&quot;:{{&quot;verizon&quot;,&quot;voicemail-service&quot;}},&quot;message-text&quot;:&quot; love verizon its voicemail-service is awesome&quot;}
+    {&quot;tweetid&quot;:&quot;10&quot;,&quot;user&quot;:{&quot;screen-name&quot;:&quot;ColineGeyer@63&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:121,&quot;statuses_count&quot;:362,&quot;name&quot;:&quot;Coline Geyer&quot;,&quot;followers_count&quot;:17159},&quot;sender-location&quot;:point(&quot;29.15,76.53&quot;),&quot;send-time&quot;:datetime(&quot;2008-01-26T10:10:00&quot;),&quot;referred-topics&quot;:{{&quot;verizon&quot;,&quot;voice-clarity&quot;}},&quot;message-text&quot;:&quot; hate verizon its voice-clarity is OMG:(&quot;}
+    {&quot;tweetid&quot;:&quot;11&quot;,&quot;user&quot;:{&quot;screen-name&quot;:&quot;NilaMilliron_tw&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:445,&quot;statuses_count&quot;:164,&quot;name&quot;:&quot;Nila Milliron&quot;,&quot;followers_count&quot;:22649},&quot;sender-location&quot;:point(&quot;37.59,68.42&quot;),&quot;send-time&quot;:datetime(&quot;2008-03-09T10:10:00&quot;),&quot;referred-topics&quot;:{{&quot;iphone&quot;,&quot;platform&quot;}},&quot;message-text&quot;:&quot; can't stand iphone its platform is terrible&quot;}
+    {&quot;tweetid&quot;:&quot;12&quot;,&quot;user&quot;:{&quot;screen-name&quot;:&quot;OliJackson_512&quot;,&quot;lang&quot;:&quot;en&quot;,&quot;friends_count&quot;:445,&quot;statuses_count&quot;:164,&quot;name&quot;:&quot;Oli Jackson&quot;,&quot;followers_count&quot;:22649},&quot;sender-location&quot;:point(&quot;24.82,94.63&quot;),&quot;send-time&quot;:datetime(&quot;2010-02-13T10:10:00&quot;),&quot;referred-topics&quot;:{{&quot;samsung&quot;,&quot;voice-command&quot;}},&quot;message-text&quot;:&quot; like samsung the voice-command is amazing:)&quot;}
+</pre></div>
+<p><a class="externalLink" href="http://asterixdb.googlecode.com/files/fbu.adm">Facebook Users</a></p>
+
+<div class="source">
+<pre>    {&quot;id&quot;:1,&quot;alias&quot;:&quot;Margarita&quot;,&quot;name&quot;:&quot;MargaritaStoddard&quot;,&quot;user-since&quot;:datetime(&quot;2012-08-20T10:10:00&quot;),&quot;friend-ids&quot;:{{2,3,6,10}},&quot;employment&quot;:[{&quot;organization-name&quot;:&quot;Codetechno&quot;,&quot;start-date&quot;:date(&quot;2006-08-06&quot;)}]}
+    {&quot;id&quot;:2,&quot;alias&quot;:&quot;Isbel&quot;,&quot;name&quot;:&quot;IsbelDull&quot;,&quot;user-since&quot;:datetime(&quot;2011-01-22T10:10:00&quot;),&quot;friend-ids&quot;:{{1,4}},&quot;employment&quot;:[{&quot;organization-name&quot;:&quot;Hexviafind&quot;,&quot;start-date&quot;:date(&quot;2010-04-27&quot;)}]}
+    {&quot;id&quot;:3,&quot;alias&quot;:&quot;Emory&quot;,&quot;name&quot;:&quot;EmoryUnk&quot;,&quot;user-since&quot;:datetime(&quot;2012-07-10T10:10:00&quot;),&quot;friend-ids&quot;:{{1,5,8,9}},&quot;employment&quot;:[{&quot;organization-name&quot;:&quot;geomedia&quot;,&quot;start-date&quot;:date(&quot;2010-06-17&quot;),&quot;end-date&quot;:date(&quot;2010-01-26&quot;)}]}
+    {&quot;id&quot;:4,&quot;alias&quot;:&quot;Nicholas&quot;,&quot;name&quot;:&quot;NicholasStroh&quot;,&quot;user-since&quot;:datetime(&quot;2010-12-27T10:10:00&quot;),&quot;friend-ids&quot;:{{2}},&quot;employment&quot;:[{&quot;organization-name&quot;:&quot;Zamcorporation&quot;,&quot;start-date&quot;:date(&quot;2010-06-08&quot;)}]}
+    {&quot;id&quot;:5,&quot;alias&quot;:&quot;Von&quot;,&quot;name&quot;:&quot;VonKemble&quot;,&quot;user-since&quot;:datetime(&quot;2010-01-05T10:10:00&quot;),&quot;friend-ids&quot;:{{3,6,10}},&quot;employment&quot;:[{&quot;organization-name&quot;:&quot;Kongreen&quot;,&quot;start-date&quot;:date(&quot;2010-11-27&quot;)}]}
+    {&quot;id&quot;:6,&quot;alias&quot;:&quot;Willis&quot;,&quot;name&quot;:&quot;WillisWynne&quot;,&quot;user-since&quot;:datetime(&quot;2005-01-17T10:10:00&quot;),&quot;friend-ids&quot;:{{1,3,7}},&quot;employment&quot;:[{&quot;organization-name&quot;:&quot;jaydax&quot;,&quot;start-date&quot;:date(&quot;2009-05-15&quot;)}]}
+    {&quot;id&quot;:7,&quot;alias&quot;:&quot;Suzanna&quot;,&quot;name&quot;:&quot;SuzannaTillson&quot;,&quot;user-since&quot;:datetime(&quot;2012-08-07T10:10:00&quot;),&quot;friend-ids&quot;:{{6}},&quot;employment&quot;:[{&quot;organization-name&quot;:&quot;Labzatron&quot;,&quot;start-date&quot;:date(&quot;2011-04-19&quot;)}]}
+    {&quot;id&quot;:8,&quot;alias&quot;:&quot;Nila&quot;,&quot;name&quot;:&quot;NilaMilliron&quot;,&quot;user-since&quot;:datetime(&quot;2008-01-01T10:10:00&quot;),&quot;friend-ids&quot;:{{3}},&quot;employment&quot;:[{&quot;organization-name&quot;:&quot;Plexlane&quot;,&quot;start-date&quot;:date(&quot;2010-02-28&quot;)}]}
+    {&quot;id&quot;:9,&quot;alias&quot;:&quot;Woodrow&quot;,&quot;name&quot;:&quot;WoodrowNehling&quot;,&quot;user-since&quot;:datetime(&quot;2005-09-20T10:10:00&quot;),&quot;friend-ids&quot;:{{3,10}},&quot;employment&quot;:[{&quot;organization-name&quot;:&quot;Zuncan&quot;,&quot;start-date&quot;:date(&quot;2003-04-22&quot;),&quot;end-date&quot;:date(&quot;2009-12-13&quot;)}]}
+    {&quot;id&quot;:10,&quot;alias&quot;:&quot;Bram&quot;,&quot;name&quot;:&quot;BramHatch&quot;,&quot;user-since&quot;:datetime(&quot;2010-10-16T10:10:00&quot;),&quot;friend-ids&quot;:{{1,5,9}},&quot;employment&quot;:[{&quot;organization-name&quot;:&quot;physcane&quot;,&quot;start-date&quot;:date(&quot;2007-06-05&quot;),&quot;end-date&quot;:date(&quot;2011-11-05&quot;)}]}
+</pre></div>
+<p><a class="externalLink" href="http://asterixdb.googlecode.com/files/fbm.adm">Facebook Messages</a></p>
+
+<div class="source">
+<pre>    {&quot;message-id&quot;:1,&quot;author-id&quot;:3,&quot;in-response-to&quot;:2,&quot;sender-location&quot;:point(&quot;47.16,77.75&quot;),&quot;message&quot;:&quot; love sprint its shortcut-menu is awesome:)&quot;}
+    {&quot;message-id&quot;:2,&quot;author-id&quot;:1,&quot;in-response-to&quot;:4,&quot;sender-location&quot;:point(&quot;41.66,80.87&quot;),&quot;message&quot;:&quot; dislike iphone its touch-screen is horrible&quot;}
+    {&quot;message-id&quot;:3,&quot;author-id&quot;:2,&quot;in-response-to&quot;:4,&quot;sender-location&quot;:point(&quot;48.09,81.01&quot;),&quot;message&quot;:&quot; like samsung the plan is amazing&quot;}
+    {&quot;message-id&quot;:4,&quot;author-id&quot;:1,&quot;in-response-to&quot;:2,&quot;sender-location&quot;:point(&quot;37.73,97.04&quot;),&quot;message&quot;:&quot; can't stand at&amp;t the network is horrible:(&quot;}
+    {&quot;message-id&quot;:5,&quot;author-id&quot;:6,&quot;in-response-to&quot;:2,&quot;sender-location&quot;:point(&quot;34.7,90.76&quot;),&quot;message&quot;:&quot; love sprint the customization is mind-blowing&quot;}
+    {&quot;message-id&quot;:6,&quot;author-id&quot;:2,&quot;in-response-to&quot;:1,&quot;sender-location&quot;:point(&quot;31.5,75.56&quot;),&quot;message&quot;:&quot; like t-mobile its platform is mind-blowing&quot;}
+    {&quot;message-id&quot;:7,&quot;author-id&quot;:5,&quot;in-response-to&quot;:15,&quot;sender-location&quot;:point(&quot;32.91,85.05&quot;),&quot;message&quot;:&quot; dislike sprint the speed is horrible&quot;}
+    {&quot;message-id&quot;:8,&quot;author-id&quot;:1,&quot;in-response-to&quot;:11,&quot;sender-location&quot;:point(&quot;40.33,80.87&quot;),&quot;message&quot;:&quot; like verizon the 3G is awesome:)&quot;}
+    {&quot;message-id&quot;:9,&quot;author-id&quot;:3,&quot;in-response-to&quot;:12,&quot;sender-location&quot;:point(&quot;34.45,96.48&quot;),&quot;message&quot;:&quot; love verizon its wireless is good&quot;}
+    {&quot;message-id&quot;:10,&quot;author-id&quot;:1,&quot;in-response-to&quot;:12,&quot;sender-location&quot;:point(&quot;42.5,70.01&quot;),&quot;message&quot;:&quot; can't stand motorola the touch-screen is terrible&quot;}
+    {&quot;message-id&quot;:11,&quot;author-id&quot;:1,&quot;in-response-to&quot;:1,&quot;sender-location&quot;:point(&quot;38.97,77.49&quot;),&quot;message&quot;:&quot; can't stand at&amp;t its plan is terrible&quot;}
+    {&quot;message-id&quot;:12,&quot;author-id&quot;:10,&quot;in-response-to&quot;:6,&quot;sender-location&quot;:point(&quot;42.26,77.76&quot;),&quot;message&quot;:&quot; can't stand t-mobile its voicemail-service is OMG:(&quot;}
+    {&quot;message-id&quot;:13,&quot;author-id&quot;:10,&quot;in-response-to&quot;:4,&quot;sender-location&quot;:point(&quot;42.77,78.92&quot;),&quot;message&quot;:&quot; dislike iphone the voice-command is bad:(&quot;}
+    {&quot;message-id&quot;:14,&quot;author-id&quot;:9,&quot;in-response-to&quot;:12,&quot;sender-location&quot;:point(&quot;41.33,85.28&quot;),&quot;message&quot;:&quot; love at&amp;t its 3G is good:)&quot;}
+    {&quot;message-id&quot;:15,&quot;author-id&quot;:7,&quot;in-response-to&quot;:11,&quot;sender-location&quot;:point(&quot;44.47,67.11&quot;),&quot;message&quot;:&quot; like iphone the voicemail-service is awesome&quot;}
+</pre></div>
+<p>It&#x2019;s loading time! We can use AQL <i>load</i> statements to populate our datasets with the sample records shown above. The following shows how loading can be done for data stored in <tt>.adm</tt> files in your local filesystem. <i>Note:</i> You <i>MUST</i> replace the <tt>&lt;Host Name&gt;</tt> and <tt>&lt;Absolute File Path&gt;</tt> placeholders in each load statement below with valid values based on the host IP address (or host name) for the machine and directory that you have downloaded the provided <tt>.adm</tt> files to. As you do so, be very, very careful to retain the two slashes in the load statements, i.e., do not delete the two slashes that appear in front of the absolute path to your <tt>.adm</tt> files. (This will lead to a three-slash character sequence at the start of each load statement&#x2019;s file input path specification.)</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    load dataset FacebookUsers using localfs
+    ((&quot;path&quot;=&quot;&lt;Host Name&gt;://&lt;Absolute File Path&gt;/fbu.adm&quot;),(&quot;format&quot;=&quot;adm&quot;));
+    load dataset FacebookMessages using localfs
+    ((&quot;path&quot;=&quot;&lt;Host Name&gt;://&lt;Absolute File Path&gt;/fbm.adm&quot;),(&quot;format&quot;=&quot;adm&quot;));
+    load dataset TwitterUsers using localfs
+    ((&quot;path&quot;=&quot;&lt;Host Name&gt;://&lt;Absolute File Path&gt;/twu.adm&quot;),(&quot;format&quot;=&quot;adm&quot;));
+    load dataset TweetMessages using localfs
+    ((&quot;path&quot;=&quot;&lt;Host Name&gt;://&lt;Absolute File Path&gt;/twm.adm&quot;),(&quot;format&quot;=&quot;adm&quot;));
+</pre></div>
+<p>&#x2014;-</p></div>
+<div class="section">
+<h2>AQL: Querying Your AsterixDB Data<a name="AQL:_Querying_Your_AsterixDB_Data"></a></h2>
+<p>Congratulations! You now have sample social data stored (and indexed) in AsterixDB. (You are part of an elite and adventurous group of individuals. :-)) Now that you have successfully loaded the provided sample data into the datasets that we defined, you can start running queries against them.</p>
+<p>The query language for AsterixDB is AQL&#x2014;the Asterix Query Language. AQL is loosely based on XQuery, the language developed and standardized in the early to mid 2000&#x2019;s by the World Wide Web Consortium (W3C) for querying semistructured data stored in their XML format. We have tossed all of the &#x201c;XML cruft&#x201d; out of their language but retained many of its core ideas. We did this because its design was developed over a period of years by a diverse committee of smart and experienced language designers, including &#x201c;SQL people&#x201d;, &#x201c;functional programming people&#x201d;, and &#x201c;XML people&#x201d;, all of whom were focused on how to design a new query language that operates well over semistructured data. (We decided to stand on their shoulders instead of starting from scratch and revisiting many of the same issues.) Note that AQL is not SQL and not based on SQL: In other words, AsterixDB is fully &#x201c;NoSQL compliant&#x201d;. :-)</p>
+<p>In this section we introduce AQL via a set of example queries, along with their expected results, based on the data above, to help you get started. Many of the most important features of AQL are presented in this set of representative queries. You can find more details in the document on the <a href="datamodel.html">Asterix Data Model (ADM)</a>, in the <a href="manual.html">AQL Reference Manual</a>, and a complete list of built-in functions is available in the <a href="functions.html">Asterix Functions</a> document.</p>
+<p>AQL is an expression language. Even the expression 1+1 is a valid AQL query that evaluates to 2. (Try it for yourself! Okay, maybe that&#x2019;s <i>not</i> the best use of a 512-node shared-nothing compute cluster.) Most useful AQL queries will be based on the <i>FLWOR</i> (pronounced &#x201c;flower&#x201d;) expression structure that AQL has borrowed from XQuery ((<a class="externalLink" href="http://en.wikipedia.org/wiki/FLWOR))">http://en.wikipedia.org/wiki/FLWOR))</a>. The FLWOR expression syntax supports both the incremental binding (<i>for</i>) of variables to ADM data instances in a dataset (or in the result of any AQL expression, actually) and the full binding (<i>let</i>) of variables to entire intermediate results in a fashion similar to temporary views in the SQL world. FLWOR is an acronym that is short for <i>for</i>-<i>let</i>-<i>where</i>-<i>order by</i>-<i>return</i>, naming five of the most frequently used clauses from the syntax of a full AQL query. AQL also inclu
 des <i>group by</i> and <i>limit</i> clauses, as you will see shortly. Roughly speaking, for SQL afficiandos, the <i>for</i> clause in AQL is like the <i>from</i> clause in SQL, the <i>return</i> clause in AQL is like the <i>return</i> clause in SQL (but appears at the end instead of the beginning of a query), the <i>let</i> clause in AQL is like SQL&#x2019;s <i>with</i> clause, and the <i>where</i> and <i>order by</i> clauses in both languages are similar.</p>
+<p>In order to allow SQL fans to write queries in their favored ways, AQL provides synonyms: <i>from</i> for <i>for</i>, <i>select</i> for <i>return</i>, <i>with</i> for <i>let</i>, and <i>keeping</i> for <i>with</i> in the group by clause.</p>
+<p>Enough talk! Let&#x2019;s go ahead and try writing some queries and see about learning AQL by example.</p>
+<div class="section">
+<h3>Query 0-A - Exact-Match Lookup<a name="Query_0-A_-_Exact-Match_Lookup"></a></h3>
+<p>For our first query, let&#x2019;s find a Facebook user based on his or her user id. Suppose the user we want is the user whose id is 8:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+    from $user in dataset FacebookUsers
+    where $user.id = 8
+    select $user;
+</pre></div>
+<p>The query&#x2019;s <i>for</i> clause binds the variable <tt>$user</tt> incrementally to the data instances residing in the dataset named FacebookUsers. Its <i>where</i> clause selects only those bindings having a user id of interest, filtering out the rest. The <i>return</i> clause returns the (entire) data instance for each binding that satisfies the predicate. Since this dataset is indexed on user id (its primary key), this query will be done via a quick index lookup.</p>
+<p>The expected result for our sample data is as follows:</p>
+
+<div class="source">
+<pre>    { &quot;id&quot;: 8, &quot;alias&quot;: &quot;Nila&quot;, &quot;name&quot;: &quot;NilaMilliron&quot;, &quot;user-since&quot;: datetime(&quot;2008-01-01T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 3 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;Plexlane&quot;, &quot;start-date&quot;: date(&quot;2010-02-28&quot;), &quot;end-date&quot;: null } ] }
+</pre></div></div>
+<div class="section">
+<h3>Query 0-B - Range Scan<a name="Query_0-B_-_Range_Scan"></a></h3>
+<p>AQL, like SQL, supports a variety of different predicates. For example, for our next query, let&#x2019;s find the Facebook users whose ids are in the range between 2 and 4:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    from $user in dataset FacebookUsers
+    where $user.id &gt;= 2 and $user.id &lt;= 4
+    select $user;
+</pre></div>
+<p>This query&#x2019;s expected result, also evaluable using the primary index on user id, is:</p>
+
+<div class="source">
+<pre>    { &quot;id&quot;: 2, &quot;alias&quot;: &quot;Isbel&quot;, &quot;name&quot;: &quot;IsbelDull&quot;, &quot;user-since&quot;: datetime(&quot;2011-01-22T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 1, 4 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;Hexviafind&quot;, &quot;start-date&quot;: date(&quot;2010-04-27&quot;), &quot;end-date&quot;: null } ] }
+    { &quot;id&quot;: 3, &quot;alias&quot;: &quot;Emory&quot;, &quot;name&quot;: &quot;EmoryUnk&quot;, &quot;user-since&quot;: datetime(&quot;2012-07-10T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 1, 5, 8, 9 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;geomedia&quot;, &quot;start-date&quot;: date(&quot;2010-06-17&quot;), &quot;end-date&quot;: date(&quot;2010-01-26&quot;) } ] }
+    { &quot;id&quot;: 4, &quot;alias&quot;: &quot;Nicholas&quot;, &quot;name&quot;: &quot;NicholasStroh&quot;, &quot;user-since&quot;: datetime(&quot;2010-12-27T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 2 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;Zamcorporation&quot;, &quot;start-date&quot;: date(&quot;2010-06-08&quot;), &quot;end-date&quot;: null } ] }
+</pre></div></div>
+<div class="section">
+<h3>Query 1 - Other Query Filters<a name="Query_1_-_Other_Query_Filters"></a></h3>
+<p>AQL can do range queries on any data type that supports the appropriate set of comparators. As an example, this next query retrieves the Facebook users who joined between July 22, 2010 and July 29, 2012:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+    from $user in dataset FacebookUsers
+    where $user.user-since &gt;= datetime('2010-07-22T00:00:00')
+      and $user.user-since &lt;= datetime('2012-07-29T23:59:59')
+    select $user;
+</pre></div>
+<p>The expected result for this query, also an indexable query, is as follows:</p>
+
+<div class="source">
+<pre>    { &quot;id&quot;: 2, &quot;alias&quot;: &quot;Isbel&quot;, &quot;name&quot;: &quot;IsbelDull&quot;, &quot;user-since&quot;: datetime(&quot;2011-01-22T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 1, 4 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;Hexviafind&quot;, &quot;start-date&quot;: date(&quot;2010-04-27&quot;), &quot;end-date&quot;: null } ] }
+    { &quot;id&quot;: 3, &quot;alias&quot;: &quot;Emory&quot;, &quot;name&quot;: &quot;EmoryUnk&quot;, &quot;user-since&quot;: datetime(&quot;2012-07-10T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 1, 5, 8, 9 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;geomedia&quot;, &quot;start-date&quot;: date(&quot;2010-06-17&quot;), &quot;end-date&quot;: date(&quot;2010-01-26&quot;) } ] }
+    { &quot;id&quot;: 4, &quot;alias&quot;: &quot;Nicholas&quot;, &quot;name&quot;: &quot;NicholasStroh&quot;, &quot;user-since&quot;: datetime(&quot;2010-12-27T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 2 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;Zamcorporation&quot;, &quot;start-date&quot;: date(&quot;2010-06-08&quot;), &quot;end-date&quot;: null } ] }
+    { &quot;id&quot;: 10, &quot;alias&quot;: &quot;Bram&quot;, &quot;name&quot;: &quot;BramHatch&quot;, &quot;user-since&quot;: datetime(&quot;2010-10-16T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 1, 5, 9 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;physcane&quot;, &quot;start-date&quot;: date(&quot;2007-06-05&quot;), &quot;end-date&quot;: date(&quot;2011-11-05&quot;) } ] }
+</pre></div></div>
+<div class="section">
+<h3>Query 2-A - Equijoin<a name="Query_2-A_-_Equijoin"></a></h3>
+<p>In addition to simply binding variables to data instances and returning them &#x201c;whole&#x201d;, an AQL query can construct new ADM instances to return based on combinations of its variable bindings. This gives AQL the power to do joins much like those done using multi-table <i>from</i> clauses in SQL. For example, suppose we wanted a list of all Facebook users paired with their associated messages, with the list enumerating the author name and the message text associated with each Facebook message. We could do this as follows in AQL:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    from $user in dataset FacebookUsers
+    from $message in dataset FacebookMessages
+    where $message.author-id = $user.id
+    select {
+    &quot;uname&quot;: $user.name,
+    &quot;message&quot;: $message.message
+    };
+</pre></div>
+<p>The result of this query is a sequence of new ADM instances, one for each author/message pair. Each instance in the result will be an ADM record containing two fields, &#x201c;uname&#x201d; and &#x201c;message&#x201d;, containing the user&#x2019;s name and the message text, respectively, for each author/message pair. (Note that &#x201c;uname&#x201d; and &#x201c;message&#x201d; are both simple AQL expressions themselves&#x2014;so in the most general case, even the resulting field names can be computed as part of the query, making AQL a very powerful tool for slicing and dicing semistructured data.)</p>
+<p>The expected result of this example AQL join query for our sample data set is:</p>
+
+<div class="source">
+<pre>    { &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;message&quot;: &quot; dislike iphone its touch-screen is horrible&quot; }
+    { &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;message&quot;: &quot; can't stand at&amp;t the network is horrible:(&quot; }
+    { &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;message&quot;: &quot; like verizon the 3G is awesome:)&quot; }
+    { &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;message&quot;: &quot; can't stand motorola the touch-screen is terrible&quot; }
+    { &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;message&quot;: &quot; can't stand at&amp;t its plan is terrible&quot; }
+    { &quot;uname&quot;: &quot;IsbelDull&quot;, &quot;message&quot;: &quot; like samsung the plan is amazing&quot; }
+    { &quot;uname&quot;: &quot;IsbelDull&quot;, &quot;message&quot;: &quot; like t-mobile its platform is mind-blowing&quot; }
+    { &quot;uname&quot;: &quot;EmoryUnk&quot;, &quot;message&quot;: &quot; love sprint its shortcut-menu is awesome:)&quot; }
+    { &quot;uname&quot;: &quot;EmoryUnk&quot;, &quot;message&quot;: &quot; love verizon its wireless is good&quot; }
+    { &quot;uname&quot;: &quot;VonKemble&quot;, &quot;message&quot;: &quot; dislike sprint the speed is horrible&quot; }
+    { &quot;uname&quot;: &quot;WillisWynne&quot;, &quot;message&quot;: &quot; love sprint the customization is mind-blowing&quot; }
+    { &quot;uname&quot;: &quot;SuzannaTillson&quot;, &quot;message&quot;: &quot; like iphone the voicemail-service is awesome&quot; }
+    { &quot;uname&quot;: &quot;WoodrowNehling&quot;, &quot;message&quot;: &quot; love at&amp;t its 3G is good:)&quot; }
+    { &quot;uname&quot;: &quot;BramHatch&quot;, &quot;message&quot;: &quot; can't stand t-mobile its voicemail-service is OMG:(&quot; }
+    { &quot;uname&quot;: &quot;BramHatch&quot;, &quot;message&quot;: &quot; dislike iphone the voice-command is bad:(&quot; }
+</pre></div></div>
+<div class="section">
+<h3>Query 2-B - Index join<a name="Query_2-B_-_Index_join"></a></h3>
+<p>By default, AsterixDB evaluates equijoin queries using hash-based join methods that work well for doing ad hoc joins of very large data sets (<a class="externalLink" href="http://en.wikipedia.org/wiki/Hash_join">http://en.wikipedia.org/wiki/Hash_join</a>). On a cluster, hash partitioning is employed as AsterixDB&#x2019;s divide-and-conquer strategy for computing large parallel joins. AsterixDB includes other join methods, but in the absence of data statistics and selectivity estimates, it doesn&#x2019;t (yet) have the know-how to intelligently choose among its alternatives. We therefore asked ourselves the classic question&#x2014;WWOD?&#x2014;What Would Oracle Do?&#x2014;and in the interim, AQL includes a clunky (but useful) hint-based mechanism for addressing the occasional need to suggest to AsterixDB which join method it should use for a particular AQL query.</p>
+<p>The following query is similar to Query 2-A but includes a suggestion to AsterixDB that it should consider employing an index-based nested-loop join technique to process the query:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    from $user in dataset FacebookUsers
+    from $message in dataset FacebookMessages
+    where $message.author-id /*+ indexnl */  = $user.id
+    select {
+    &quot;uname&quot;: $user.name,
+    &quot;message&quot;: $message.message
+    };
+</pre></div>
+<p>The expected result is (of course) the same as before, modulo the order of the instances. Result ordering is (intentionally) undefined in AQL in the absence of an <i>order by</i> clause. The query result for our sample data in this case is:</p>
+
+<div class="source">
+<pre>    { &quot;uname&quot;: &quot;EmoryUnk&quot;, &quot;message&quot;: &quot; love sprint its shortcut-menu is awesome:)&quot; }
+    { &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;message&quot;: &quot; dislike iphone its touch-screen is horrible&quot; }
+    { &quot;uname&quot;: &quot;IsbelDull&quot;, &quot;message&quot;: &quot; like samsung the plan is amazing&quot; }
+    { &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;message&quot;: &quot; can't stand at&amp;t the network is horrible:(&quot; }
+    { &quot;uname&quot;: &quot;WillisWynne&quot;, &quot;message&quot;: &quot; love sprint the customization is mind-blowing&quot; }
+    { &quot;uname&quot;: &quot;IsbelDull&quot;, &quot;message&quot;: &quot; like t-mobile its platform is mind-blowing&quot; }
+    { &quot;uname&quot;: &quot;VonKemble&quot;, &quot;message&quot;: &quot; dislike sprint the speed is horrible&quot; }
+    { &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;message&quot;: &quot; like verizon the 3G is awesome:)&quot; }
+    { &quot;uname&quot;: &quot;EmoryUnk&quot;, &quot;message&quot;: &quot; love verizon its wireless is good&quot; }
+    { &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;message&quot;: &quot; can't stand motorola the touch-screen is terrible&quot; }
+    { &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;message&quot;: &quot; can't stand at&amp;t its plan is terrible&quot; }
+    { &quot;uname&quot;: &quot;BramHatch&quot;, &quot;message&quot;: &quot; can't stand t-mobile its voicemail-service is OMG:(&quot; }
+    { &quot;uname&quot;: &quot;BramHatch&quot;, &quot;message&quot;: &quot; dislike iphone the voice-command is bad:(&quot; }
+    { &quot;uname&quot;: &quot;WoodrowNehling&quot;, &quot;message&quot;: &quot; love at&amp;t its 3G is good:)&quot; }
+    { &quot;uname&quot;: &quot;SuzannaTillson&quot;, &quot;message&quot;: &quot; like iphone the voicemail-service is awesome&quot; }
+</pre></div>
+<p>(It is worth knowing, with respect to influencing AsterixDB&#x2019;s query evaluation, that nested <i>for</i> clauses&#x2014;a.k.a. joins&#x2014; are currently evaluated with the &#x201c;outer&#x201d; clause probing the data of the &#x201c;inner&#x201d; clause.)</p></div>
+<div class="section">
+<h3>Query 3 - Nested Outer Join<a name="Query_3_-_Nested_Outer_Join"></a></h3>
+<p>In order to support joins between tables with missing/dangling join tuples, the designers of SQL ended up shoe-horning a subset of the relational algebra into SQL&#x2019;s <i>from</i> clause syntax&#x2014;and providing a variety of join types there for users to choose from. Left outer joins are particularly important in SQL, e.g., to print a summary of customers and orders, grouped by customer, without omitting those customers who haven&#x2019;t placed any orders yet.</p>
+<p>The AQL language supports nesting, both of queries and of query results, and the combination allows for an arguably cleaner/more natural approach to such queries. As an example, supposed we wanted, for each Facebook user, to produce a record that has his/her name plus a list of the messages written by that user. In SQL, this would involve a left outer join between users and messages, grouping by user, and having the user name repeated along side each message. In AQL, this sort of use case can be handled (more naturally) as follows:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    from $user in dataset FacebookUsers
+    select {
+    &quot;uname&quot;: $user.name,
+    &quot;messages&quot;: from $message in dataset FacebookMessages
+            where $message.author-id = $user.id
+            select $message.message
+    };
+</pre></div>
+<p>This AQL query binds the variable <tt>$user</tt> to the data instances in FacebookUsers; for each user, it constructs a result record containing a &#x201c;uname&#x201d; field with the user&#x2019;s name and a &#x201c;messages&#x201d; field with a nested collection of all messages for that user. The nested collection for each user is specified by using a correlated subquery. (Note: While it looks like nested loops could be involved in computing the result, AsterixDB recogizes the equivalence of such a query to an outerjoin, and it will use an efficient hash-based strategy when actually computing the query&#x2019;s result.)</p>
+<p>Here is this example query&#x2019;s expected output:</p>
+
+<div class="source">
+<pre>    { &quot;uname&quot;: &quot;MargaritaStoddard&quot;, &quot;messages&quot;: [ &quot; dislike iphone its touch-screen is horrible&quot;, &quot; can't stand at&amp;t the network is horrible:(&quot;, &quot; like verizon the 3G is awesome:)&quot;, &quot; can't stand motorola the touch-screen is terrible&quot;, &quot; can't stand at&amp;t its plan is terrible&quot; ] }
+    { &quot;uname&quot;: &quot;IsbelDull&quot;, &quot;messages&quot;: [ &quot; like samsung the plan is amazing&quot;, &quot; like t-mobile its platform is mind-blowing&quot; ] }
+    { &quot;uname&quot;: &quot;EmoryUnk&quot;, &quot;messages&quot;: [ &quot; love sprint its shortcut-menu is awesome:)&quot;, &quot; love verizon its wireless is good&quot; ] }
+    { &quot;uname&quot;: &quot;NicholasStroh&quot;, &quot;messages&quot;: [  ] }
+    { &quot;uname&quot;: &quot;VonKemble&quot;, &quot;messages&quot;: [ &quot; dislike sprint the speed is horrible&quot; ] }
+    { &quot;uname&quot;: &quot;WillisWynne&quot;, &quot;messages&quot;: [ &quot; love sprint the customization is mind-blowing&quot; ] }
+    { &quot;uname&quot;: &quot;SuzannaTillson&quot;, &quot;messages&quot;: [ &quot; like iphone the voicemail-service is awesome&quot; ] }
+    { &quot;uname&quot;: &quot;NilaMilliron&quot;, &quot;messages&quot;: [  ] }
+    { &quot;uname&quot;: &quot;WoodrowNehling&quot;, &quot;messages&quot;: [ &quot; love at&amp;t its 3G is good:)&quot; ] }
+    { &quot;uname&quot;: &quot;BramHatch&quot;, &quot;messages&quot;: [ &quot; dislike iphone the voice-command is bad:(&quot;, &quot; can't stand t-mobile its voicemail-service is OMG:(&quot; ] }
+</pre></div></div>
+<div class="section">
+<h3>Query 4 - Theta Join<a name="Query_4_-_Theta_Join"></a></h3>
+<p>Not all joins are expressible as equijoins and computable using equijoin-oriented algorithms. The join predicates for some use cases involve predicates with functions; AsterixDB supports the expression of such queries and will still evaluate them as best it can using nested loop based techniques (and broadcast joins in the parallel case).</p>
+<p>As an example of such a use case, suppose that we wanted, for each tweet T, to find all of the other tweets that originated from within a circle of radius of 1 surrounding tweet T&#x2019;s location. In AQL, this can be specified in a manner similar to the previous query using one of the built-in functions on the spatial data type instead of id equality in the correlated query&#x2019;s <i>where</i> clause:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    from $t in dataset TweetMessages
+    select {
+    &quot;message&quot;: $t.message-text,
+    &quot;nearby-messages&quot;: from $t2 in dataset TweetMessages
+                where spatial-distance($t.sender-location, $t2.sender-location) &lt;= 1
+                select { &quot;msgtxt&quot;:$t2.message-text}
+    };
+</pre></div>
+<p>Here is the expected result for this query:</p>
+
+<div class="source">
+<pre>    { &quot;message&quot;: &quot; love t-mobile its customization is good:)&quot;, &quot;nearby-messages&quot;: [ { &quot;msgtxt&quot;: &quot; love t-mobile its customization is good:)&quot; } ] }
+    { &quot;message&quot;: &quot; hate verizon its voice-clarity is OMG:(&quot;, &quot;nearby-messages&quot;: [ { &quot;msgtxt&quot;: &quot; like motorola the speed is good:)&quot; }, { &quot;msgtxt&quot;: &quot; hate verizon its voice-clarity is OMG:(&quot; } ] }
+    { &quot;message&quot;: &quot; can't stand iphone its platform is terrible&quot;, &quot;nearby-messages&quot;: [ { &quot;msgtxt&quot;: &quot; can't stand iphone its platform is terrible&quot; } ] }
+    { &quot;message&quot;: &quot; like samsung the voice-command is amazing:)&quot;, &quot;nearby-messages&quot;: [ { &quot;msgtxt&quot;: &quot; like samsung the voice-command is amazing:)&quot; } ] }
+    { &quot;message&quot;: &quot; like verizon its shortcut-menu is awesome:)&quot;, &quot;nearby-messages&quot;: [ { &quot;msgtxt&quot;: &quot; like verizon its shortcut-menu is awesome:)&quot; } ] }
+    { &quot;message&quot;: &quot; like motorola the speed is good:)&quot;, &quot;nearby-messages&quot;: [ { &quot;msgtxt&quot;: &quot; hate verizon its voice-clarity is OMG:(&quot; }, { &quot;msgtxt&quot;: &quot; like motorola the speed is good:)&quot; } ] }
+    { &quot;message&quot;: &quot; like sprint the voice-command is mind-blowing:)&quot;, &quot;nearby-messages&quot;: [ { &quot;msgtxt&quot;: &quot; like sprint the voice-command is mind-blowing:)&quot; } ] }
+    { &quot;message&quot;: &quot; can't stand motorola its speed is terrible:(&quot;, &quot;nearby-messages&quot;: [ { &quot;msgtxt&quot;: &quot; can't stand motorola its speed is terrible:(&quot; } ] }
+    { &quot;message&quot;: &quot; like iphone the voice-clarity is good:)&quot;, &quot;nearby-messages&quot;: [ { &quot;msgtxt&quot;: &quot; like iphone the voice-clarity is good:)&quot; } ] }
+    { &quot;message&quot;: &quot; like samsung the platform is good&quot;, &quot;nearby-messages&quot;: [ { &quot;msgtxt&quot;: &quot; like samsung the platform is good&quot; } ] }
+    { &quot;message&quot;: &quot; like t-mobile the shortcut-menu is awesome:)&quot;, &quot;nearby-messages&quot;: [ { &quot;msgtxt&quot;: &quot; like t-mobile the shortcut-menu is awesome:)&quot; } ] }
+    { &quot;message&quot;: &quot; love verizon its voicemail-service is awesome&quot;, &quot;nearby-messages&quot;: [ { &quot;msgtxt&quot;: &quot; love verizon its voicemail-service is awesome&quot; } ] }
+</pre></div></div>
+<div class="section">
+<h3>Query 5 - Fuzzy Join<a name="Query_5_-_Fuzzy_Join"></a></h3>
+<p>As another example of a non-equijoin use case, we could ask AsterixDB to find, for each Facebook user, all Twitter users with names &#x201c;similar&#x201d; to their name. AsterixDB supports a variety of &#x201c;fuzzy match&#x201d; functions for use with textual and set-based data. As one example, we could choose to use edit distance with a threshold of 3 as the definition of name similarity, in which case we could write the following query using AQL&#x2019;s operator-based syntax (~=) for testing whether or not two values are similar:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    set simfunction &quot;edit-distance&quot;;
+    set simthreshold &quot;3&quot;;
+    from $fbu in dataset FacebookUsers
+    select {
+        &quot;id&quot;: $fbu.id,
+        &quot;name&quot;: $fbu.name,
+        &quot;similar-users&quot;: from $t in dataset TweetMessages
+                with $tu := $t.user
+                where $tu.name ~= $fbu.name
+                select {
+                &quot;twitter-screenname&quot;: $tu.screen-name,
+                &quot;twitter-name&quot;: $tu.name
+                }
+    };
+</pre></div>
+<p>The expected result for this query against our sample data is:</p>
+
+<div class="source">
+<pre>    { &quot;id&quot;: 1, &quot;name&quot;: &quot;MargaritaStoddard&quot;, &quot;similar-users&quot;: [  ] }
+    { &quot;id&quot;: 2, &quot;name&quot;: &quot;IsbelDull&quot;, &quot;similar-users&quot;: [  ] }
+    { &quot;id&quot;: 3, &quot;name&quot;: &quot;EmoryUnk&quot;, &quot;similar-users&quot;: [  ] }
+    { &quot;id&quot;: 4, &quot;name&quot;: &quot;NicholasStroh&quot;, &quot;similar-users&quot;: [  ] }
+    { &quot;id&quot;: 5, &quot;name&quot;: &quot;VonKemble&quot;, &quot;similar-users&quot;: [  ] }
+    { &quot;id&quot;: 6, &quot;name&quot;: &quot;WillisWynne&quot;, &quot;similar-users&quot;: [  ] }
+    { &quot;id&quot;: 7, &quot;name&quot;: &quot;SuzannaTillson&quot;, &quot;similar-users&quot;: [  ] }
+    { &quot;id&quot;: 8, &quot;name&quot;: &quot;NilaMilliron&quot;, &quot;similar-users&quot;: [ { &quot;twitter-screenname&quot;: &quot;NilaMilliron_tw&quot;, &quot;twitter-name&quot;: &quot;Nila Milliron&quot; } ] }
+    { &quot;id&quot;: 9, &quot;name&quot;: &quot;WoodrowNehling&quot;, &quot;similar-users&quot;: [  ] }
+    { &quot;id&quot;: 10, &quot;name&quot;: &quot;BramHatch&quot;, &quot;similar-users&quot;: [  ] }
+</pre></div></div>
+<div class="section">
+<h3>Query 6 - Existential Quantification<a name="Query_6_-_Existential_Quantification"></a></h3>
+<p>The expressive power of AQL includes support for queries involving &#x201c;some&#x201d; (existentially quantified) and &#x201c;all&#x201d; (universally quantified) query semantics. As an example of an existential AQL query, here we show a query to list the Facebook users who are currently employed. Such employees will have an employment history containing a record with a null end-date value, which leads us to the following AQL query:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    from $fbu in dataset FacebookUsers
+    where (some $e in $fbu.employment satisfies is-null($e.end-date))
+    select $fbu;
+</pre></div>
+<p>The expected result in this case is:</p>
+
+<div class="source">
+<pre>    { &quot;id&quot;: 1, &quot;alias&quot;: &quot;Margarita&quot;, &quot;name&quot;: &quot;MargaritaStoddard&quot;, &quot;user-since&quot;: datetime(&quot;2012-08-20T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 2, 3, 6, 10 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;Codetechno&quot;, &quot;start-date&quot;: date(&quot;2006-08-06&quot;), &quot;end-date&quot;: null } ] }
+    { &quot;id&quot;: 2, &quot;alias&quot;: &quot;Isbel&quot;, &quot;name&quot;: &quot;IsbelDull&quot;, &quot;user-since&quot;: datetime(&quot;2011-01-22T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 1, 4 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;Hexviafind&quot;, &quot;start-date&quot;: date(&quot;2010-04-27&quot;), &quot;end-date&quot;: null } ] }
+    { &quot;id&quot;: 4, &quot;alias&quot;: &quot;Nicholas&quot;, &quot;name&quot;: &quot;NicholasStroh&quot;, &quot;user-since&quot;: datetime(&quot;2010-12-27T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 2 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;Zamcorporation&quot;, &quot;start-date&quot;: date(&quot;2010-06-08&quot;), &quot;end-date&quot;: null } ] }
+    { &quot;id&quot;: 5, &quot;alias&quot;: &quot;Von&quot;, &quot;name&quot;: &quot;VonKemble&quot;, &quot;user-since&quot;: datetime(&quot;2010-01-05T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 3, 6, 10 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;Kongreen&quot;, &quot;start-date&quot;: date(&quot;2010-11-27&quot;), &quot;end-date&quot;: null } ] }
+    { &quot;id&quot;: 6, &quot;alias&quot;: &quot;Willis&quot;, &quot;name&quot;: &quot;WillisWynne&quot;, &quot;user-since&quot;: datetime(&quot;2005-01-17T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 1, 3, 7 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;jaydax&quot;, &quot;start-date&quot;: date(&quot;2009-05-15&quot;), &quot;end-date&quot;: null } ] }
+    { &quot;id&quot;: 7, &quot;alias&quot;: &quot;Suzanna&quot;, &quot;name&quot;: &quot;SuzannaTillson&quot;, &quot;user-since&quot;: datetime(&quot;2012-08-07T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 6 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;Labzatron&quot;, &quot;start-date&quot;: date(&quot;2011-04-19&quot;), &quot;end-date&quot;: null } ] }
+    { &quot;id&quot;: 8, &quot;alias&quot;: &quot;Nila&quot;, &quot;name&quot;: &quot;NilaMilliron&quot;, &quot;user-since&quot;: datetime(&quot;2008-01-01T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 3 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;Plexlane&quot;, &quot;start-date&quot;: date(&quot;2010-02-28&quot;), &quot;end-date&quot;: null } ] }
+</pre></div></div>
+<div class="section">
+<h3>Query 7 - Universal Quantification<a name="Query_7_-_Universal_Quantification"></a></h3>
+<p>As an example of a universal AQL query, here we show a query to list the Facebook users who are currently unemployed. Such employees will have an employment history containing no records with null end-date values, leading us to the following AQL query:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    from $fbu in dataset FacebookUsers
+    where (every $e in $fbu.employment satisfies not(is-null($e.end-date)))
+    select $fbu;
+</pre></div>
+<p>Here is the expected result for our sample data:</p>
+
+<div class="source">
+<pre>    { &quot;id&quot;: 3, &quot;alias&quot;: &quot;Emory&quot;, &quot;name&quot;: &quot;EmoryUnk&quot;, &quot;user-since&quot;: datetime(&quot;2012-07-10T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 1, 5, 8, 9 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;geomedia&quot;, &quot;start-date&quot;: date(&quot;2010-06-17&quot;), &quot;end-date&quot;: date(&quot;2010-01-26&quot;) } ] }
+    { &quot;id&quot;: 9, &quot;alias&quot;: &quot;Woodrow&quot;, &quot;name&quot;: &quot;WoodrowNehling&quot;, &quot;user-since&quot;: datetime(&quot;2005-09-20T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 3, 10 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;Zuncan&quot;, &quot;start-date&quot;: date(&quot;2003-04-22&quot;), &quot;end-date&quot;: date(&quot;2009-12-13&quot;) } ] }
+    { &quot;id&quot;: 10, &quot;alias&quot;: &quot;Bram&quot;, &quot;name&quot;: &quot;BramHatch&quot;, &quot;user-since&quot;: datetime(&quot;2010-10-16T10:10:00.000Z&quot;), &quot;friend-ids&quot;: {{ 1, 5, 9 }}, &quot;employment&quot;: [ { &quot;organization-name&quot;: &quot;physcane&quot;, &quot;start-date&quot;: date(&quot;2007-06-05&quot;), &quot;end-date&quot;: date(&quot;2011-11-05&quot;) } ] }
+</pre></div></div>
+<div class="section">
+<h3>Query 8 - Simple Aggregation<a name="Query_8_-_Simple_Aggregation"></a></h3>
+<p>Like SQL, the AQL language of AsterixDB provides support for computing aggregates over large amounts of data. As a very simple example, the following AQL query computes the total number of Facebook users:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    count(from $fbu in dataset FacebookUsers select $fbu);
+</pre></div>
+<p>In AQL, aggregate functions can be applied to arbitrary subquery results; in this case, the count function is applied to the result of a query that enumerates the Facebook users. The expected result here is:</p>
+
+<div class="source">
+<pre>    10
+</pre></div></div>
+<div class="section">
+<h3>Query 9-A - Grouping and Aggregation<a name="Query_9-A_-_Grouping_and_Aggregation"></a></h3>
+<p>Also like SQL, AQL supports grouped aggregation. For every Twitter user, the following group-by/aggregate query counts the number of tweets sent by that user:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    from $t in dataset TweetMessages
+    group by $uid := $t.user.screen-name keeping $t
+    select {
+    &quot;user&quot;: $uid,
+    &quot;count&quot;: count($t)
+    };
+</pre></div>
+<p>The <i>for</i> clause incrementally binds $t to tweets, and the <i>group by</i> clause groups the tweets by its issuer&#x2019;s Twitter screen-name. Unlike SQL, where data is tabular&#x2014;flat&#x2014;the data model underlying AQL allows for nesting. Thus, following the <i>group by</i> clause, the <i>return</i> clause in this query sees a sequence of $t groups, with each such group having an associated $uid variable value (i.e., the tweeting user&#x2019;s screen name). In the context of the return clause, due to &#x201c;&#x2026; with $t &#x2026;&#x201d;, $uid is bound to the tweeter&#x2019;s id and $t is bound to the <i>set</i> of tweets issued by that tweeter. The return clause constructs a result record containing the tweeter&#x2019;s user id and the count of the items in the associated tweet set. The query result will contain one such record per screen name. This query also illustrates another feature of AQL; notice that each user&#x2019;s screen name is accessed via a path s
 yntax that traverses each tweet&#x2019;s nested record structure.</p>
+<p>Here is the expected result for this query over the sample data:</p>
+
+<div class="source">
+<pre>    { &quot;user&quot;: &quot;ChangEwing_573&quot;, &quot;count&quot;: 1 }
+    { &quot;user&quot;: &quot;ColineGeyer@63&quot;, &quot;count&quot;: 3 }
+    { &quot;user&quot;: &quot;NathanGiesen@211&quot;, &quot;count&quot;: 6 }
+    { &quot;user&quot;: &quot;NilaMilliron_tw&quot;, &quot;count&quot;: 1 }
+    { &quot;user&quot;: &quot;OliJackson_512&quot;, &quot;count&quot;: 1 }
+</pre></div></div>
+<div class="section">
+<h3>Query 9-B - (Hash-Based) Grouping and Aggregation<a name="Query_9-B_-_Hash-Based_Grouping_and_Aggregation"></a></h3>
+<p>As for joins, AsterixDB has multiple evaluation strategies available for processing grouped aggregate queries. For grouped aggregation, the system knows how to employ both sort-based and hash-based aggregation methods, with sort-based methods being used by default and a hint being available to suggest that a different approach be used in processing a particular AQL query.</p>
+<p>The following query is similar to Query 9-A, but adds a hash-based aggregation hint:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    from $t in dataset TweetMessages
+    /*+ hash*/
+    group by $uid := $t.user.screen-name keeping $t
+    select {
+    &quot;user&quot;: $uid,
+    &quot;count&quot;: count($t)
+    };
+</pre></div>
+<p>Here is the expected result:</p>
+
+<div class="source">
+<pre>    { &quot;user&quot;: &quot;OliJackson_512&quot;, &quot;count&quot;: 1 }
+    { &quot;user&quot;: &quot;ColineGeyer@63&quot;, &quot;count&quot;: 3 }
+    { &quot;user&quot;: &quot;NathanGiesen@211&quot;, &quot;count&quot;: 6 }
+    { &quot;user&quot;: &quot;NilaMilliron_tw&quot;, &quot;count&quot;: 1 }
+    { &quot;user&quot;: &quot;ChangEwing_573&quot;, &quot;count&quot;: 1 }
+</pre></div></div>
+<div class="section">
+<h3>Query 10 - Grouping and Limits<a name="Query_10_-_Grouping_and_Limits"></a></h3>
+<p>In some use cases it is not necessary to compute the entire answer to a query. In some cases, just having the first <i>N</i> or top <i>N</i> results is sufficient. This is expressible in AQL using the <i>limit</i> clause combined with the <i>order by</i> clause.</p>
+<p>The following AQL query returns the top 3 Twitter users based on who has issued the most tweets:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    from $t in dataset TweetMessages
+    group by $uid := $t.user.screen-name keeping $t
+    let $c := count($t)
+    order by $c desc
+    limit 3
+    select {
+        &quot;user&quot;: $uid,
+        &quot;count&quot;: $c
+    };
+</pre></div>
+<p>The expected result for this query is:</p>
+
+<div class="source">
+<pre>    { &quot;user&quot;: &quot;NathanGiesen@211&quot;, &quot;count&quot;: 6 }
+    { &quot;user&quot;: &quot;ColineGeyer@63&quot;, &quot;count&quot;: 3 }
+    { &quot;user&quot;: &quot;NilaMilliron_tw&quot;, &quot;count&quot;: 1 }
+</pre></div></div>
+<div class="section">
+<h3>Query 11 - Left Outer Fuzzy Join<a name="Query_11_-_Left_Outer_Fuzzy_Join"></a></h3>
+<p>As a last example of AQL and its query power, the following query, for each tweet, finds all of the tweets that are similar based on the topics that they refer to:</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    set simfunction &quot;jaccard&quot;;
+    set simthreshold &quot;0.3&quot;;
+    from $t in dataset TweetMessages
+    select {
+        &quot;tweet&quot;: $t,
+        &quot;similar-tweets&quot;: from $t2 in dataset TweetMessages
+                where  $t2.referred-topics ~= $t.referred-topics
+                and $t2.tweetid != $t.tweetid
+                select $t2.referred-topics
+    };
+</pre></div>
+<p>This query illustrates several things worth knowing in order to write fuzzy queries in AQL. First, as mentioned earlier, AQL offers an operator-based syntax for seeing whether two values are &#x201c;similar&#x201d; to one another or not. Second, recall that the referred-topics field of records of datatype TweetMessageType is a bag of strings. This query sets the context for its similarity join by requesting that Jaccard-based similarity semantics (<a class="externalLink" href="http://en.wikipedia.org/wiki/Jaccard_index">http://en.wikipedia.org/wiki/Jaccard_index</a>) be used for the query&#x2019;s similarity operator and that a similarity index of 0.3 be used as its similarity threshold.</p>
+<p>The expected result for this fuzzy join query is:</p>
+
+<div class="source">
+<pre>    { &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;1&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;NathanGiesen@211&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: 39339, &quot;statuses_count&quot;: 473, &quot;name&quot;: &quot;Nathan Giesen&quot;, &quot;followers_count&quot;: 49416 }, &quot;sender-location&quot;: point(&quot;47.44,80.65&quot;), &quot;send-time&quot;: datetime(&quot;2008-04-26T10:10:00.000Z&quot;), &quot;referred-topics&quot;: {{ &quot;t-mobile&quot;, &quot;customization&quot; }}, &quot;message-text&quot;: &quot; love t-mobile its customization is good:)&quot; }, &quot;similar-tweets&quot;: [ {{ &quot;t-mobile&quot;, &quot;shortcut-menu&quot; }} ] }
+    { &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;10&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;ColineGeyer@63&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: 121, &quot;statuses_count&quot;: 362, &quot;name&quot;: &quot;Coline Geyer&quot;, &quot;followers_count&quot;: 17159 }, &quot;sender-location&quot;: point(&quot;29.15,76.53&quot;), &quot;send-time&quot;: datetime(&quot;2008-01-26T10:10:00.000Z&quot;), &quot;referred-topics&quot;: {{ &quot;verizon&quot;, &quot;voice-clarity&quot; }}, &quot;message-text&quot;: &quot; hate verizon its voice-clarity is OMG:(&quot; }, &quot;similar-tweets&quot;: [ {{ &quot;iphone&quot;, &quot;voice-clarity&quot; }}, {{ &quot;verizon&quot;, &quot;voicemail-service&quot; }}, {{ &quot;verizon&quot;, &quot;shortcut-menu&quot; }} ] }
+    { &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;11&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;NilaMilliron_tw&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: 445, &quot;statuses_count&quot;: 164, &quot;name&quot;: &quot;Nila Milliron&quot;, &quot;followers_count&quot;: 22649 }, &quot;sender-location&quot;: point(&quot;37.59,68.42&quot;), &quot;send-time&quot;: datetime(&quot;2008-03-09T10:10:00.000Z&quot;), &quot;referred-topics&quot;: {{ &quot;iphone&quot;, &quot;platform&quot; }}, &quot;message-text&quot;: &quot; can't stand iphone its platform is terrible&quot; }, &quot;similar-tweets&quot;: [ {{ &quot;iphone&quot;, &quot;voice-clarity&quot; }}, {{ &quot;samsung&quot;, &quot;platform&quot; }} ] }
+    { &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;12&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;OliJackson_512&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: 445, &quot;statuses_count&quot;: 164, &quot;name&quot;: &quot;Oli Jackson&quot;, &quot;followers_count&quot;: 22649 }, &quot;sender-location&quot;: point(&quot;24.82,94.63&quot;), &quot;send-time&quot;: datetime(&quot;2010-02-13T10:10:00.000Z&quot;), &quot;referred-topics&quot;: {{ &quot;samsung&quot;, &quot;voice-command&quot; }}, &quot;message-text&quot;: &quot; like samsung the voice-command is amazing:)&quot; }, &quot;similar-tweets&quot;: [ {{ &quot;samsung&quot;, &quot;platform&quot; }}, {{ &quot;sprint&quot;, &quot;voice-command&quot; }} ] }
+    { &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;2&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;ColineGeyer@63&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: 121, &quot;statuses_count&quot;: 362, &quot;name&quot;: &quot;Coline Geyer&quot;, &quot;followers_count&quot;: 17159 }, &quot;sender-location&quot;: point(&quot;32.84,67.14&quot;), &quot;send-time&quot;: datetime(&quot;2010-05-13T10:10:00.000Z&quot;), &quot;referred-topics&quot;: {{ &quot;verizon&quot;, &quot;shortcut-menu&quot; }}, &quot;message-text&quot;: &quot; like verizon its shortcut-menu is awesome:)&quot; }, &quot;similar-tweets&quot;: [ {{ &quot;verizon&quot;, &quot;voicemail-service&quot; }}, {{ &quot;verizon&quot;, &quot;voice-clarity&quot; }}, {{ &quot;t-mobile&quot;, &quot;shortcut-menu&quot; }} ] }
+    { &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;3&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;NathanGiesen@211&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: 39339, &quot;statuses_count&quot;: 473, &quot;name&quot;: &quot;Nathan Giesen&quot;, &quot;followers_count&quot;: 49416 }, &quot;sender-location&quot;: point(&quot;29.72,75.8&quot;), &quot;send-time&quot;: datetime(&quot;2006-11-04T10:10:00.000Z&quot;), &quot;referred-topics&quot;: {{ &quot;motorola&quot;, &quot;speed&quot; }}, &quot;message-text&quot;: &quot; like motorola the speed is good:)&quot; }, &quot;similar-tweets&quot;: [ {{ &quot;motorola&quot;, &quot;speed&quot; }} ] }
+    { &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;4&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;NathanGiesen@211&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: 39339, &quot;statuses_count&quot;: 473, &quot;name&quot;: &quot;Nathan Giesen&quot;, &quot;followers_count&quot;: 49416 }, &quot;sender-location&quot;: point(&quot;39.28,70.48&quot;), &quot;send-time&quot;: datetime(&quot;2011-12-26T10:10:00.000Z&quot;), &quot;referred-topics&quot;: {{ &quot;sprint&quot;, &quot;voice-command&quot; }}, &quot;message-text&quot;: &quot; like sprint the voice-command is mind-blowing:)&quot; }, &quot;similar-tweets&quot;: [ {{ &quot;samsung&quot;, &quot;voice-command&quot; }} ] }
+    { &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;5&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;NathanGiesen@211&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: 39339, &quot;statuses_count&quot;: 473, &quot;name&quot;: &quot;Nathan Giesen&quot;, &quot;followers_count&quot;: 49416 }, &quot;sender-location&quot;: point(&quot;40.09,92.69&quot;), &quot;send-time&quot;: datetime(&quot;2006-08-04T10:10:00.000Z&quot;), &quot;referred-topics&quot;: {{ &quot;motorola&quot;, &quot;speed&quot; }}, &quot;message-text&quot;: &quot; can't stand motorola its speed is terrible:(&quot; }, &quot;similar-tweets&quot;: [ {{ &quot;motorola&quot;, &quot;speed&quot; }} ] }
+    { &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;6&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;ColineGeyer@63&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: 121, &quot;statuses_count&quot;: 362, &quot;name&quot;: &quot;Coline Geyer&quot;, &quot;followers_count&quot;: 17159 }, &quot;sender-location&quot;: point(&quot;47.51,83.99&quot;), &quot;send-time&quot;: datetime(&quot;2010-05-07T10:10:00.000Z&quot;), &quot;referred-topics&quot;: {{ &quot;iphone&quot;, &quot;voice-clarity&quot; }}, &quot;message-text&quot;: &quot; like iphone the voice-clarity is good:)&quot; }, &quot;similar-tweets&quot;: [ {{ &quot;verizon&quot;, &quot;voice-clarity&quot; }}, {{ &quot;iphone&quot;, &quot;platform&quot; }} ] }
+    { &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;7&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;ChangEwing_573&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: 182, &quot;statuses_count&quot;: 394, &quot;name&quot;: &quot;Chang Ewing&quot;, &quot;followers_count&quot;: 32136 }, &quot;sender-location&quot;: point(&quot;36.21,72.6&quot;), &quot;send-time&quot;: datetime(&quot;2011-08-25T10:10:00.000Z&quot;), &quot;referred-topics&quot;: {{ &quot;samsung&quot;, &quot;platform&quot; }}, &quot;message-text&quot;: &quot; like samsung the platform is good&quot; }, &quot;similar-tweets&quot;: [ {{ &quot;iphone&quot;, &quot;platform&quot; }}, {{ &quot;samsung&quot;, &quot;voice-command&quot; }} ] }
+    { &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;8&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;NathanGiesen@211&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: 39339, &quot;statuses_count&quot;: 473, &quot;name&quot;: &quot;Nathan Giesen&quot;, &quot;followers_count&quot;: 49416 }, &quot;sender-location&quot;: point(&quot;46.05,93.34&quot;), &quot;send-time&quot;: datetime(&quot;2005-10-14T10:10:00.000Z&quot;), &quot;referred-topics&quot;: {{ &quot;t-mobile&quot;, &quot;shortcut-menu&quot; }}, &quot;message-text&quot;: &quot; like t-mobile the shortcut-menu is awesome:)&quot; }, &quot;similar-tweets&quot;: [ {{ &quot;t-mobile&quot;, &quot;customization&quot; }}, {{ &quot;verizon&quot;, &quot;shortcut-menu&quot; }} ] }
+    { &quot;tweet&quot;: { &quot;tweetid&quot;: &quot;9&quot;, &quot;user&quot;: { &quot;screen-name&quot;: &quot;NathanGiesen@211&quot;, &quot;lang&quot;: &quot;en&quot;, &quot;friends_count&quot;: 39339, &quot;statuses_count&quot;: 473, &quot;name&quot;: &quot;Nathan Giesen&quot;, &quot;followers_count&quot;: 49416 }, &quot;sender-location&quot;: point(&quot;36.86,74.62&quot;), &quot;send-time&quot;: datetime(&quot;2012-07-21T10:10:00.000Z&quot;), &quot;referred-topics&quot;: {{ &quot;verizon&quot;, &quot;voicemail-service&quot; }}, &quot;message-text&quot;: &quot; love verizon its voicemail-service is awesome&quot; }, &quot;similar-tweets&quot;: [ {{ &quot;verizon&quot;, &quot;voice-clarity&quot; }}, {{ &quot;verizon&quot;, &quot;shortcut-menu&quot; }} ] }
+</pre></div></div>
+<div class="section">
+<h3>Inserting New Data<a name="Inserting_New_Data"></a></h3>
+<p>In addition to loading and querying data, AsterixDB supports incremental additions to datasets via the AQL <i>insert</i> statement.</p>
+<p>The following example adds a new tweet by user &#x201c;<a class="externalLink" href="mailto:NathanGiesen@211">NathanGiesen@211</a>&#x201d; to the TweetMessages dataset. (An astute reader may notice that this tweet was issued a half an hour after his last tweet, so his counts have all gone up in the interim, although he appears not to have moved in the last half hour.)</p>
+
+<div class="source">
+<pre>    use dataverse TinySocial;
+
+    insert into dataset TweetMessages
+    (
+       {&quot;tweetid&quot;:&quot;13&quot;,
+        &quot;user&quot;:
+            {&quot;screen-name&quot;:&quot;NathanGiesen@211&quot;,
+             &quot;lang&quot;:&quot;en&quot;,
+             &quot;friends_count&quot;:39345,
+             &quot;statuses_count&quot;:479,
+             &quot;name&quot;:&quot;Nathan Giesen&quot;,
+             &quot;followers_count&quot;:49420
+            },
+        &quot;sender-location&quot;:point(&quot;47.44,80.65&quot;),
+        &quot;send-time&quot;:datetime(&quot;2008-04-26T10:10:35&quot;),
+        &quot;referred-topics&quot;:{{&quot;tweeting&quot;}},
+        &quot;message-text&quot;:&quot;tweety tweet, my fellow tweeters!&quot;
+       }
+    );
+</pre></div>
+<p>In general, the data to be inserted may be specified using any valid AQL query expression. The insertion of a single object instance, as in this example, is just a speci

<TRUNCATED>