Added: incubator/s2graph/site/docs/api/query/query_edge.html
URL: 
http://svn.apache.org/viewvc/incubator/s2graph/site/docs/api/query/query_edge.html?rev=1856470&view=auto
==============================================================================
--- incubator/s2graph/site/docs/api/query/query_edge.html (added)
+++ incubator/s2graph/site/docs/api/query/query_edge.html Thu Mar 28 11:04:32 
2019
@@ -0,0 +1,1001 @@
+
+
+<!DOCTYPE html>
+<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
+<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
+<head>
+  <meta charset="utf-8">
+  
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  
+  <title>Edge Queries &mdash; S2Graph 0.0.2 documentation</title>
+  
+
+  
+  
+  
+  
+
+  
+  <script type="text/javascript" 
src="../../_static/js/modernizr.min.js"></script>
+  
+    
+      <script type="text/javascript" id="documentation_options" 
data-url_root="../../" src="../../_static/documentation_options.js"></script>
+        <script type="text/javascript" src="../../_static/jquery.js"></script>
+        <script type="text/javascript" 
src="../../_static/underscore.js"></script>
+        <script type="text/javascript" 
src="../../_static/doctools.js"></script>
+        <script type="text/javascript" 
src="../../_static/language_data.js"></script>
+    
+    <script type="text/javascript" src="../../_static/js/theme.js"></script>
+
+    
+
+  
+  <link rel="stylesheet" href="../../_static/css/s2graph_style.css" 
type="text/css" />
+  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
+    <link rel="index" title="Index" href="../../genindex.html" />
+    <link rel="search" title="Search" href="../../search.html" />
+    <link rel="next" title="Query Vertices" href="query_vertex.html" />
+    <link rel="prev" title="Query Options" href="query_options.html" /> 
+</head>
+
+<body class="wy-body-for-nav">
+
+   
+  <div class="wy-grid-for-nav">
+    
+    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
+      <div class="wy-side-scroll">
+        <div class="wy-side-nav-search" >
+          
+
+          
+            <a href="../../index.html" class="icon icon-home"> S2Graph
+          
+
+          
+          </a>
+
+          
+            
+            
+          
+
+          
+<div role="search">
+  <form id="rtd-search-form" class="wy-form" action="../../search.html" 
method="get">
+    <input type="text" name="q" placeholder="Search docs" />
+    <input type="hidden" name="check_keywords" value="yes" />
+    <input type="hidden" name="area" value="default" />
+  </form>
+</div>
+
+          
+        </div>
+
+        <div class="wy-menu wy-menu-vertical" data-spy="affix" 
role="navigation" aria-label="main navigation">
+          
+            
+            
+              
+            
+            
+              <p class="caption"><span class="caption-text">S2Graph 
Documentation</span></p>
+<ul class="current">
+<li class="toctree-l1"><a class="reference internal" 
href="../../getting_started/index.html">Getting Started</a></li>
+<li class="toctree-l1"><a class="reference internal" 
href="../../getting_started/your_first_graph.html">Your First S2Graph</a></li>
+<li class="toctree-l1 current"><a class="reference internal" 
href="../index.html">HTTP API Glossary</a><ul class="current">
+<li class="toctree-l2"><a class="reference internal" 
href="../management/index.html">Management APIs</a></li>
+<li class="toctree-l2"><a class="reference internal" 
href="../mutate/index.html">Mutate APIs</a></li>
+<li class="toctree-l2 current"><a class="reference internal" 
href="index.html">Query APIs</a><ul class="current">
+<li class="toctree-l3"><a class="reference internal" 
href="query_options.html">Query Options</a></li>
+<li class="toctree-l3 current"><a class="current reference internal" 
href="#">Edge Queries</a><ul>
+<li class="toctree-l4"><a class="reference internal" 
href="#checkedges-post-graphs-checkedges">checkEdges - <code class="docutils 
literal notranslate"><span class="pre">POST</span> <span 
class="pre">/graphs/checkEdges</span></code></a></li>
+<li class="toctree-l4"><a class="reference internal" 
href="#getedges-post-graphs-getedges">getEdges - <code class="docutils literal 
notranslate"><span class="pre">POST</span> <span 
class="pre">/graphs/getEdges</span></code></a></li>
+</ul>
+</li>
+<li class="toctree-l3"><a class="reference internal" 
href="query_vertex.html">Query Vertices</a></li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+
+            
+          
+        </div>
+      </div>
+    </nav>
+
+    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
+
+      
+      <nav class="wy-nav-top" aria-label="top navigation">
+        
+          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
+          <a href="../../index.html">S2Graph</a>
+        
+      </nav>
+
+
+      <div class="wy-nav-content">
+        
+        <div class="rst-content">
+        
+          
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<div role="navigation" aria-label="breadcrumbs navigation">
+
+  <ul class="wy-breadcrumbs">
+    
+      <li><a href="../../index.html">Docs</a> &raquo;</li>
+        
+          <li><a href="../index.html">HTTP API Glossary</a> &raquo;</li>
+        
+          <li><a href="index.html">Query APIs</a> &raquo;</li>
+        
+      <li>Edge Queries</li>
+    
+    
+      <li class="wy-breadcrumbs-aside">
+        
+            
+            <a href="../../_sources/api/query/query_edge.rst.txt" 
rel="nofollow"> View page source</a>
+          
+        
+      </li>
+    
+  </ul>
+
+  
+  <hr/>
+</div>
+          <div role="main" class="document" itemscope="itemscope" 
itemtype="http://schema.org/Article";>
+           <div itemprop="articleBody">
+            
+  <div class="section" id="edge-queries">
+<h1>Edge Queries<a class="headerlink" href="#edge-queries" title="Permalink to 
this headline">¶</a></h1>
+<p>S2Graph provides a query DSL which has been reported to have a pretty steep 
learning curve.
+One tip is to try to understand each features by projecting it to that of a 
RDBMS such MySQL.
+This doesn’t work all the time, but there are many similarities between 
S2Graph and a conventional RDBMS.
+For example, S2Graphs “getEdges” is used to fetch data and traverse 
multiple steps. This is very similar to the “SELECT” query in MySQL.</p>
+<p>Traversing each step is similar to <code class="docutils literal 
notranslate"><span class="pre">join</span></code> operation in RDBMS. One thing 
to note here is that users must start their traverse from smaller set to 
terminate BFS early as soon as possible.
+Another tip is to not be shy to ask! Ask any questions on our <a 
class="reference external" 
href="https://groups.google.com/forum/#!forum/s2graph";>mailing list</a>. list 
or open an issue at our <a class="reference external" 
href="https://github.com/apache/incubator-s2graph";>github</a> with the problems 
that you’re having with S2Graph.</p>
+<div class="section" id="checkedges-post-graphs-checkedges">
+<h2>checkEdges - <code class="docutils literal notranslate"><span 
class="pre">POST</span> <span class="pre">/graphs/checkEdges</span></code><a 
class="headerlink" href="#checkedges-post-graphs-checkedges" title="Permalink 
to this headline">¶</a></h2>
+<p>return edge for given vertex pair only if edge exist.
+This is more <code class="docutils literal notranslate"><span 
class="pre">general</span></code> way to check edge existence between any given 
vertex pairs comparing using <code class="docutils literal notranslate"><span 
class="pre">_to</span></code> on query parameter</p>
+</div>
+<div class="section" id="getedges-post-graphs-getedges">
+<h2>getEdges - <code class="docutils literal notranslate"><span 
class="pre">POST</span> <span class="pre">/graphs/getEdges</span></code><a 
class="headerlink" href="#getedges-post-graphs-getedges" title="Permalink to 
this headline">¶</a></h2>
+<p>Select edges with query.</p>
+<p><strong>Duplicate Policy</strong></p>
+<p>Here is a very basic query to fetch all edges that start from source vertex 
“101”.</p>
+<div class="code bash highlight-default notranslate"><div 
class="highlight"><pre><span></span><span class="n">curl</span> <span 
class="o">-</span><span class="n">XPOST</span> <span 
class="n">localhost</span><span class="p">:</span><span 
class="mi">9000</span><span class="o">/</span><span 
class="n">graphs</span><span class="o">/</span><span class="n">getEdges</span> 
<span class="o">-</span><span class="n">H</span> <span 
class="s1">&#39;Content-Type: Application/json&#39;</span> <span 
class="o">-</span><span class="n">d</span> <span class="s1">&#39;</span>
+<span class="p">{</span>
+
+    <span class="s2">&quot;srcVertices&quot;</span><span class="p">:</span> 
<span class="p">[</span>
+        <span class="p">{</span>
+            <span class="s2">&quot;serviceName&quot;</span><span 
class="p">:</span> <span class="s2">&quot;s2graph&quot;</span><span 
class="p">,</span>
+            <span class="s2">&quot;columnName&quot;</span><span 
class="p">:</span> <span class="s2">&quot;user_id_test&quot;</span><span 
class="p">,</span>
+            <span class="s2">&quot;id&quot;</span><span class="p">:</span> 
<span class="mi">101</span>
+        <span class="p">}</span>
+    <span class="p">],</span>
+    <span class="s2">&quot;steps&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+        <span class="p">{</span>
+            <span class="s2">&quot;step&quot;</span><span class="p">:</span> 
<span class="p">[</span>
+                <span class="p">{</span>
+                    <span class="s2">&quot;label&quot;</span><span 
class="p">:</span> <span 
class="s2">&quot;s2graph_label_test_weak&quot;</span><span class="p">,</span>
+                    <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span>
+                    <span class="s2">&quot;offset&quot;</span><span 
class="p">:</span> <span class="mi">0</span><span class="p">,</span>
+                    <span class="s2">&quot;limit&quot;</span><span 
class="p">:</span> <span class="mi">10</span><span class="p">,</span>
+                    <span class="s2">&quot;duplicate&quot;</span><span 
class="p">:</span> <span class="s2">&quot;raw&quot;</span>
+                <span class="p">}</span>
+            <span class="p">]</span>
+        <span class="p">}</span>
+    <span class="p">]</span>
+<span class="p">}</span><span class="s1">&#39;</span>
+</pre></div>
+</div>
+<p><code class="docutils literal notranslate"><span class="pre">Notice</span> 
<span class="pre">the</span> <span class="pre">&quot;duplicate&quot;</span> 
<span class="pre">field</span></code>. If a target label’s consistency level 
is <code class="docutils literal notranslate"><span 
class="pre">weak</span></code> and multiple edges exist with the same (from, 
to, label, direction) id, then the query is expect to have a policy for 
handling edge duplicates. S2Graph provides four duplicate policies on edges.</p>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<ul class="last simple">
+<li>raw: Allow duplicates and return all edges.</li>
+<li>first: Return only the first edge if multiple edges exist. This is 
default.</li>
+<li>countSum: Return only one edge, and return how many duplicates exist.</li>
+<li>sum: Return only one edge, and return sum of the scores.</li>
+</ul>
+</div>
+<p>With duplicate “raw”, there are actually three edges with the same 
(from, to, label, direction) id.</p>
+<div class="code bash highlight-default notranslate"><div 
class="highlight"><pre><span></span><span class="p">{</span>
+  <span class="s2">&quot;size&quot;</span><span class="p">:</span> <span 
class="mi">3</span><span class="p">,</span>
+  <span class="s2">&quot;degrees&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;from&quot;</span><span class="p">:</span> 
<span class="mi">101</span><span class="p">,</span>
+          <span class="s2">&quot;label&quot;</span><span class="p">:</span> 
<span class="s2">&quot;s2graph_label_test_weak&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;_degree&quot;</span><span class="p">:</span> 
<span class="mi">3</span>
+      <span class="p">}</span>
+  <span class="p">],</span>
+  <span class="s2">&quot;results&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;cacheRemain&quot;</span><span 
class="p">:</span> <span class="o">-</span><span class="mi">29</span><span 
class="p">,</span>
+          <span class="s2">&quot;from&quot;</span><span class="p">:</span> 
<span class="mi">101</span><span class="p">,</span>
+          <span class="s2">&quot;to&quot;</span><span class="p">:</span> <span 
class="s2">&quot;10&quot;</span><span class="p">,</span>
+          <span class="s2">&quot;label&quot;</span><span class="p">:</span> 
<span class="s2">&quot;s2graph_label_test_weak&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">6</span><span class="p">,</span>
+          <span class="s2">&quot;timestamp&quot;</span><span 
class="p">:</span> <span class="mi">6</span><span class="p">,</span>
+          <span class="s2">&quot;score&quot;</span><span class="p">:</span> 
<span class="mi">1</span><span class="p">,</span>
+          <span class="s2">&quot;props&quot;</span><span class="p">:</span> 
<span class="p">{</span>
+              <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">6</span><span class="p">,</span>
+              <span class="s2">&quot;time&quot;</span><span class="p">:</span> 
<span class="o">-</span><span class="mi">30</span><span class="p">,</span>
+              <span class="s2">&quot;weight&quot;</span><span 
class="p">:</span> <span class="mi">0</span><span class="p">,</span>
+              <span class="s2">&quot;is_hidden&quot;</span><span 
class="p">:</span> <span class="n">false</span><span class="p">,</span>
+              <span class="s2">&quot;is_blocked&quot;</span><span 
class="p">:</span> <span class="n">false</span>
+          <span class="p">}</span>
+      <span class="p">},</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;cacheRemain&quot;</span><span 
class="p">:</span> <span class="o">-</span><span class="mi">29</span><span 
class="p">,</span>
+          <span class="s2">&quot;from&quot;</span><span class="p">:</span> 
<span class="mi">101</span><span class="p">,</span>
+          <span class="s2">&quot;to&quot;</span><span class="p">:</span> <span 
class="s2">&quot;10&quot;</span><span class="p">,</span>
+          <span class="s2">&quot;label&quot;</span><span class="p">:</span> 
<span class="s2">&quot;s2graph_label_test_weak&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">5</span><span class="p">,</span>
+          <span class="s2">&quot;timestamp&quot;</span><span 
class="p">:</span> <span class="mi">5</span><span class="p">,</span>
+          <span class="s2">&quot;score&quot;</span><span class="p">:</span> 
<span class="mi">1</span><span class="p">,</span>
+          <span class="s2">&quot;props&quot;</span><span class="p">:</span> 
<span class="p">{</span>
+              <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">5</span><span class="p">,</span>
+              <span class="s2">&quot;time&quot;</span><span class="p">:</span> 
<span class="o">-</span><span class="mi">10</span><span class="p">,</span>
+              <span class="s2">&quot;weight&quot;</span><span 
class="p">:</span> <span class="mi">0</span><span class="p">,</span>
+              <span class="s2">&quot;is_hidden&quot;</span><span 
class="p">:</span> <span class="n">false</span><span class="p">,</span>
+              <span class="s2">&quot;is_blocked&quot;</span><span 
class="p">:</span> <span class="n">false</span>
+          <span class="p">}</span>
+      <span class="p">},</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;cacheRemain&quot;</span><span 
class="p">:</span> <span class="o">-</span><span class="mi">29</span><span 
class="p">,</span>
+          <span class="s2">&quot;from&quot;</span><span class="p">:</span> 
<span class="mi">101</span><span class="p">,</span>
+          <span class="s2">&quot;to&quot;</span><span class="p">:</span> <span 
class="s2">&quot;10&quot;</span><span class="p">,</span>
+          <span class="s2">&quot;label&quot;</span><span class="p">:</span> 
<span class="s2">&quot;s2graph_label_test_weak&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">4</span><span class="p">,</span>
+          <span class="s2">&quot;timestamp&quot;</span><span 
class="p">:</span> <span class="mi">4</span><span class="p">,</span>
+          <span class="s2">&quot;score&quot;</span><span class="p">:</span> 
<span class="mi">1</span><span class="p">,</span>
+          <span class="s2">&quot;props&quot;</span><span class="p">:</span> 
<span class="p">{</span>
+              <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">4</span><span class="p">,</span>
+              <span class="s2">&quot;time&quot;</span><span class="p">:</span> 
<span class="mi">0</span><span class="p">,</span>
+              <span class="s2">&quot;weight&quot;</span><span 
class="p">:</span> <span class="mi">0</span><span class="p">,</span>
+              <span class="s2">&quot;is_hidden&quot;</span><span 
class="p">:</span> <span class="n">false</span><span class="p">,</span>
+              <span class="s2">&quot;is_blocked&quot;</span><span 
class="p">:</span> <span class="n">false</span>
+          <span class="p">}</span>
+      <span class="p">}</span>
+  <span class="p">],</span>
+  <span class="s2">&quot;impressionId&quot;</span><span class="p">:</span> 
<span class="mi">1972178414</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>Duplicate “countSum” returns only one edge with the score sum of 3.</p>
+<div class="code bash highlight-default notranslate"><div 
class="highlight"><pre><span></span> <span class="p">{</span>
+   <span class="s2">&quot;size&quot;</span><span class="p">:</span> <span 
class="mi">1</span><span class="p">,</span>
+   <span class="s2">&quot;degrees&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+       <span class="p">{</span>
+           <span class="s2">&quot;from&quot;</span><span class="p">:</span> 
<span class="mi">101</span><span class="p">,</span>
+           <span class="s2">&quot;label&quot;</span><span class="p">:</span> 
<span class="s2">&quot;s2graph_label_test_weak&quot;</span><span 
class="p">,</span>
+           <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span>
+           <span class="s2">&quot;_degree&quot;</span><span class="p">:</span> 
<span class="mi">3</span>
+       <span class="p">}</span>
+   <span class="p">],</span>
+   <span class="s2">&quot;results&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+       <span class="p">{</span>
+           <span class="s2">&quot;cacheRemain&quot;</span><span 
class="p">:</span> <span class="o">-</span><span class="mi">135</span><span 
class="p">,</span>
+           <span class="s2">&quot;from&quot;</span><span class="p">:</span> 
<span class="mi">101</span><span class="p">,</span>
+           <span class="s2">&quot;to&quot;</span><span class="p">:</span> 
<span class="s2">&quot;10&quot;</span><span class="p">,</span>
+           <span class="s2">&quot;label&quot;</span><span class="p">:</span> 
<span class="s2">&quot;s2graph_label_test_weak&quot;</span><span 
class="p">,</span>
+           <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span>
+           <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">4</span><span class="p">,</span>
+           <span class="s2">&quot;timestamp&quot;</span><span 
class="p">:</span> <span class="mi">4</span><span class="p">,</span>
+           <span class="s2">&quot;score&quot;</span><span class="p">:</span> 
<span class="mi">3</span><span class="p">,</span>
+           <span class="s2">&quot;props&quot;</span><span class="p">:</span> 
<span class="p">{</span>
+               <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">4</span><span class="p">,</span>
+               <span class="s2">&quot;time&quot;</span><span 
class="p">:</span> <span class="mi">0</span><span class="p">,</span>
+               <span class="s2">&quot;weight&quot;</span><span 
class="p">:</span> <span class="mi">0</span><span class="p">,</span>
+               <span class="s2">&quot;is_hidden&quot;</span><span 
class="p">:</span> <span class="n">false</span><span class="p">,</span>
+               <span class="s2">&quot;is_blocked&quot;</span><span 
class="p">:</span> <span class="n">false</span>
+           <span class="p">}</span>
+       <span class="p">}</span>
+   <span class="p">],</span>
+   <span class="s2">&quot;impressionId&quot;</span><span class="p">:</span> 
<span class="mi">1972178414</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p><strong>Select Option Example</strong></p>
+<p>In case you want to control the fields shown in the result edges, use the 
“select” option.</p>
+<div class="code bash highlight-default notranslate"><div 
class="highlight"><pre><span></span><span class="p">{</span>
+  <span class="s2">&quot;select&quot;</span><span class="p">:</span> <span 
class="p">[</span><span class="s2">&quot;from&quot;</span><span 
class="p">,</span> <span class="s2">&quot;to&quot;</span><span 
class="p">,</span> <span class="s2">&quot;label&quot;</span><span 
class="p">],</span>
+  <span class="s2">&quot;srcVertices&quot;</span><span class="p">:</span> 
<span class="p">[</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;serviceName&quot;</span><span 
class="p">:</span> <span class="s2">&quot;s2graph&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;columnName&quot;</span><span 
class="p">:</span> <span class="s2">&quot;user_id_test&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;id&quot;</span><span class="p">:</span> <span 
class="mi">101</span>
+      <span class="p">}</span>
+  <span class="p">],</span>
+  <span class="s2">&quot;steps&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;step&quot;</span><span class="p">:</span> 
<span class="p">[</span>
+              <span class="p">{</span>
+                  <span class="s2">&quot;label&quot;</span><span 
class="p">:</span> <span 
class="s2">&quot;s2graph_label_test_weak&quot;</span><span class="p">,</span>
+                  <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span>
+                  <span class="s2">&quot;offset&quot;</span><span 
class="p">:</span> <span class="mi">0</span><span class="p">,</span>
+                  <span class="s2">&quot;limit&quot;</span><span 
class="p">:</span> <span class="mi">10</span><span class="p">,</span>
+                  <span class="s2">&quot;duplicate&quot;</span><span 
class="p">:</span> <span class="s2">&quot;raw&quot;</span>
+              <span class="p">}</span>
+          <span class="p">]</span>
+      <span class="p">}</span>
+  <span class="p">]</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>S2Graph will return only those fields in the result.</p>
+<div class="code bash highlight-default notranslate"><div 
class="highlight"><pre><span></span><span class="p">{</span>
+  <span class="s2">&quot;size&quot;</span><span class="p">:</span> <span 
class="mi">3</span><span class="p">,</span>
+  <span class="s2">&quot;degrees&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;from&quot;</span><span class="p">:</span> 
<span class="mi">101</span><span class="p">,</span>
+          <span class="s2">&quot;label&quot;</span><span class="p">:</span> 
<span class="s2">&quot;s2graph_label_test_weak&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;_degree&quot;</span><span class="p">:</span> 
<span class="mi">3</span>
+      <span class="p">}</span>
+  <span class="p">],</span>
+  <span class="s2">&quot;results&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;from&quot;</span><span class="p">:</span> 
<span class="mi">101</span><span class="p">,</span>
+          <span class="s2">&quot;to&quot;</span><span class="p">:</span> <span 
class="s2">&quot;10&quot;</span><span class="p">,</span>
+          <span class="s2">&quot;label&quot;</span><span class="p">:</span> 
<span class="s2">&quot;s2graph_label_test_weak&quot;</span>
+      <span class="p">},</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;from&quot;</span><span class="p">:</span> 
<span class="mi">101</span><span class="p">,</span>
+          <span class="s2">&quot;to&quot;</span><span class="p">:</span> <span 
class="s2">&quot;10&quot;</span><span class="p">,</span>
+          <span class="s2">&quot;label&quot;</span><span class="p">:</span> 
<span class="s2">&quot;s2graph_label_test_weak&quot;</span>
+      <span class="p">},</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;from&quot;</span><span class="p">:</span> 
<span class="mi">101</span><span class="p">,</span>
+          <span class="s2">&quot;to&quot;</span><span class="p">:</span> <span 
class="s2">&quot;10&quot;</span><span class="p">,</span>
+          <span class="s2">&quot;label&quot;</span><span class="p">:</span> 
<span class="s2">&quot;s2graph_label_test_weak&quot;</span>
+      <span class="p">}</span>
+  <span class="p">],</span>
+  <span class="s2">&quot;impressionId&quot;</span><span class="p">:</span> 
<span class="mi">1972178414</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>Default value of the “select” option is an empty array which means that 
all edge fields are returned.</p>
+<p><strong>groupBy Option Example</strong></p>
+<p>Result edges can be grouped by a given field.</p>
+<div class="code bash highlight-default notranslate"><div 
class="highlight"><pre><span></span><span class="p">{</span>
+   <span class="s2">&quot;select&quot;</span><span class="p">:</span> <span 
class="p">[</span><span class="s2">&quot;from&quot;</span><span 
class="p">,</span> <span class="s2">&quot;to&quot;</span><span 
class="p">,</span> <span class="s2">&quot;label&quot;</span><span 
class="p">,</span> <span class="s2">&quot;direction&quot;</span><span 
class="p">,</span> <span class="s2">&quot;timestamp&quot;</span><span 
class="p">,</span> <span class="s2">&quot;score&quot;</span><span 
class="p">,</span> <span class="s2">&quot;time&quot;</span><span 
class="p">,</span> <span class="s2">&quot;weight&quot;</span><span 
class="p">,</span> <span class="s2">&quot;is_hidden&quot;</span><span 
class="p">,</span> <span class="s2">&quot;is_blocked&quot;</span><span 
class="p">],</span>
+   <span class="s2">&quot;groupBy&quot;</span><span class="p">:</span> <span 
class="p">[</span><span class="s2">&quot;from&quot;</span><span 
class="p">,</span> <span class="s2">&quot;to&quot;</span><span 
class="p">,</span> <span class="s2">&quot;label&quot;</span><span 
class="p">],</span>
+   <span class="s2">&quot;srcVertices&quot;</span><span class="p">:</span> 
<span class="p">[</span>
+       <span class="p">{</span>
+           <span class="s2">&quot;serviceName&quot;</span><span 
class="p">:</span> <span class="s2">&quot;s2graph&quot;</span><span 
class="p">,</span>
+           <span class="s2">&quot;columnName&quot;</span><span 
class="p">:</span> <span class="s2">&quot;user_id_test&quot;</span><span 
class="p">,</span>
+           <span class="s2">&quot;id&quot;</span><span class="p">:</span> 
<span class="mi">101</span>
+       <span class="p">}</span>
+   <span class="p">],</span>
+   <span class="s2">&quot;steps&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+       <span class="p">{</span>
+           <span class="s2">&quot;step&quot;</span><span class="p">:</span> 
<span class="p">[</span>
+               <span class="p">{</span>
+                   <span class="s2">&quot;label&quot;</span><span 
class="p">:</span> <span 
class="s2">&quot;s2graph_label_test_weak&quot;</span><span class="p">,</span>
+                   <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span>
+                   <span class="s2">&quot;offset&quot;</span><span 
class="p">:</span> <span class="mi">0</span><span class="p">,</span>
+                   <span class="s2">&quot;limit&quot;</span><span 
class="p">:</span> <span class="mi">10</span><span class="p">,</span>
+                   <span class="s2">&quot;duplicate&quot;</span><span 
class="p">:</span> <span class="s2">&quot;raw&quot;</span>
+               <span class="p">}</span>
+           <span class="p">]</span>
+       <span class="p">}</span>
+   <span class="p">]</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>You can see the result edges are grouped by their “from”, “to”, and 
“label” fields.</p>
+<div class="code bash highlight-default notranslate"><div 
class="highlight"><pre><span></span><span class="p">{</span>
+  <span class="s2">&quot;size&quot;</span><span class="p">:</span> <span 
class="mi">1</span><span class="p">,</span>
+  <span class="s2">&quot;results&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;groupBy&quot;</span><span class="p">:</span> 
<span class="p">{</span>
+              <span class="s2">&quot;from&quot;</span><span class="p">:</span> 
<span class="mi">101</span><span class="p">,</span>
+              <span class="s2">&quot;to&quot;</span><span class="p">:</span> 
<span class="s2">&quot;10&quot;</span><span class="p">,</span>
+              <span class="s2">&quot;label&quot;</span><span 
class="p">:</span> <span class="s2">&quot;s2graph_label_test_weak&quot;</span>
+          <span class="p">},</span>
+          <span class="s2">&quot;agg&quot;</span><span class="p">:</span> 
<span class="p">[</span>
+              <span class="p">{</span>
+                  <span class="s2">&quot;from&quot;</span><span 
class="p">:</span> <span class="mi">101</span><span class="p">,</span>
+                  <span class="s2">&quot;to&quot;</span><span 
class="p">:</span> <span class="s2">&quot;10&quot;</span><span 
class="p">,</span>
+                  <span class="s2">&quot;label&quot;</span><span 
class="p">:</span> <span 
class="s2">&quot;s2graph_label_test_weak&quot;</span><span class="p">,</span>
+                  <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span>
+                  <span class="s2">&quot;timestamp&quot;</span><span 
class="p">:</span> <span class="mi">6</span><span class="p">,</span>
+                  <span class="s2">&quot;score&quot;</span><span 
class="p">:</span> <span class="mi">1</span><span class="p">,</span>
+                  <span class="s2">&quot;props&quot;</span><span 
class="p">:</span> <span class="p">{</span>
+                      <span class="s2">&quot;time&quot;</span><span 
class="p">:</span> <span class="o">-</span><span class="mi">30</span><span 
class="p">,</span>
+                      <span class="s2">&quot;weight&quot;</span><span 
class="p">:</span> <span class="mi">0</span><span class="p">,</span>
+                      <span class="s2">&quot;is_hidden&quot;</span><span 
class="p">:</span> <span class="n">false</span><span class="p">,</span>
+                      <span class="s2">&quot;is_blocked&quot;</span><span 
class="p">:</span> <span class="n">false</span>
+                  <span class="p">}</span>
+              <span class="p">},</span>
+              <span class="p">{</span>
+                  <span class="s2">&quot;from&quot;</span><span 
class="p">:</span> <span class="mi">101</span><span class="p">,</span>
+                  <span class="s2">&quot;to&quot;</span><span 
class="p">:</span> <span class="s2">&quot;10&quot;</span><span 
class="p">,</span>
+                  <span class="s2">&quot;label&quot;</span><span 
class="p">:</span> <span 
class="s2">&quot;s2graph_label_test_weak&quot;</span><span class="p">,</span>
+                  <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span>
+                  <span class="s2">&quot;timestamp&quot;</span><span 
class="p">:</span> <span class="mi">5</span><span class="p">,</span>
+                  <span class="s2">&quot;score&quot;</span><span 
class="p">:</span> <span class="mi">1</span><span class="p">,</span>
+                  <span class="s2">&quot;props&quot;</span><span 
class="p">:</span> <span class="p">{</span>
+                      <span class="s2">&quot;time&quot;</span><span 
class="p">:</span> <span class="o">-</span><span class="mi">10</span><span 
class="p">,</span>
+                      <span class="s2">&quot;weight&quot;</span><span 
class="p">:</span> <span class="mi">0</span><span class="p">,</span>
+                      <span class="s2">&quot;is_hidden&quot;</span><span 
class="p">:</span> <span class="n">false</span><span class="p">,</span>
+                      <span class="s2">&quot;is_blocked&quot;</span><span 
class="p">:</span> <span class="n">false</span>
+                  <span class="p">}</span>
+              <span class="p">},</span>
+              <span class="p">{</span>
+                  <span class="s2">&quot;from&quot;</span><span 
class="p">:</span> <span class="mi">101</span><span class="p">,</span>
+                  <span class="s2">&quot;to&quot;</span><span 
class="p">:</span> <span class="s2">&quot;10&quot;</span><span 
class="p">,</span>
+                  <span class="s2">&quot;label&quot;</span><span 
class="p">:</span> <span 
class="s2">&quot;s2graph_label_test_weak&quot;</span><span class="p">,</span>
+                  <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span>
+                  <span class="s2">&quot;timestamp&quot;</span><span 
class="p">:</span> <span class="mi">4</span><span class="p">,</span>
+                  <span class="s2">&quot;score&quot;</span><span 
class="p">:</span> <span class="mi">1</span><span class="p">,</span>
+                  <span class="s2">&quot;props&quot;</span><span 
class="p">:</span> <span class="p">{</span>
+                      <span class="s2">&quot;time&quot;</span><span 
class="p">:</span> <span class="mi">0</span><span class="p">,</span>
+                      <span class="s2">&quot;weight&quot;</span><span 
class="p">:</span> <span class="mi">0</span><span class="p">,</span>
+                      <span class="s2">&quot;is_hidden&quot;</span><span 
class="p">:</span> <span class="n">false</span><span class="p">,</span>
+                      <span class="s2">&quot;is_blocked&quot;</span><span 
class="p">:</span> <span class="n">false</span>
+                  <span class="p">}</span>
+              <span class="p">}</span>
+          <span class="p">]</span>
+      <span class="p">}</span>
+  <span class="p">],</span>
+  <span class="s2">&quot;impressionId&quot;</span><span class="p">:</span> 
<span class="mi">1972178414</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p><strong>filterOut option example</strong></p>
+<p>You can also run two queries concurrently, and filter the result of one 
query with the result of the other.</p>
+<div class="code bash highlight-default notranslate"><div 
class="highlight"><pre><span></span><span class="p">{</span>
+  <span class="s2">&quot;filterOutFields&quot;</span><span class="p">:</span> 
<span class="p">[</span><span class="s2">&quot;_to&quot;</span><span 
class="p">],</span>
+  <span class="s2">&quot;filterOut&quot;</span><span class="p">:</span> <span 
class="p">{</span>
+      <span class="s2">&quot;srcVertices&quot;</span><span class="p">:</span> 
<span class="p">[</span>
+          <span class="p">{</span>
+              <span class="s2">&quot;serviceName&quot;</span><span 
class="p">:</span> <span class="s2">&quot;s2graph&quot;</span><span 
class="p">,</span>
+              <span class="s2">&quot;columnName&quot;</span><span 
class="p">:</span> <span class="s2">&quot;user_id_test&quot;</span><span 
class="p">,</span>
+              <span class="s2">&quot;id&quot;</span><span class="p">:</span> 
<span class="mi">100</span>
+          <span class="p">}</span>
+      <span class="p">],</span>
+      <span class="s2">&quot;steps&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+          <span class="p">{</span>
+              <span class="s2">&quot;step&quot;</span><span class="p">:</span> 
<span class="p">[</span>
+                  <span class="p">{</span>
+                      <span class="s2">&quot;label&quot;</span><span 
class="p">:</span> <span 
class="s2">&quot;s2graph_label_test_weak&quot;</span><span class="p">,</span>
+                      <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span>
+                      <span class="s2">&quot;offset&quot;</span><span 
class="p">:</span> <span class="mi">0</span><span class="p">,</span>
+                      <span class="s2">&quot;limit&quot;</span><span 
class="p">:</span> <span class="mi">10</span><span class="p">,</span>
+                      <span class="s2">&quot;duplicate&quot;</span><span 
class="p">:</span> <span class="s2">&quot;raw&quot;</span>
+                  <span class="p">}</span>
+              <span class="p">]</span>
+          <span class="p">}</span>
+      <span class="p">]</span>
+  <span class="p">},</span>
+  <span class="s2">&quot;srcVertices&quot;</span><span class="p">:</span> 
<span class="p">[</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;serviceName&quot;</span><span 
class="p">:</span> <span class="s2">&quot;s2graph&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;columnName&quot;</span><span 
class="p">:</span> <span class="s2">&quot;user_id_test&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;id&quot;</span><span class="p">:</span> <span 
class="mi">101</span>
+      <span class="p">}</span>
+  <span class="p">],</span>
+  <span class="s2">&quot;steps&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;step&quot;</span><span class="p">:</span> 
<span class="p">[</span>
+              <span class="p">{</span>
+                  <span class="s2">&quot;label&quot;</span><span 
class="p">:</span> <span 
class="s2">&quot;s2graph_label_test_weak&quot;</span><span class="p">,</span>
+                  <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span>
+                  <span class="s2">&quot;offset&quot;</span><span 
class="p">:</span> <span class="mi">0</span><span class="p">,</span>
+                  <span class="s2">&quot;limit&quot;</span><span 
class="p">:</span> <span class="mi">10</span><span class="p">,</span>
+                  <span class="s2">&quot;duplicate&quot;</span><span 
class="p">:</span> <span class="s2">&quot;raw&quot;</span>
+              <span class="p">}</span>
+          <span class="p">]</span>
+      <span class="p">}</span>
+  <span class="p">]</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>S2Graph will run two concurrent queries, one in the main step, and another 
in the filter out clause. Here is more practical example.</p>
+<p>The main query from the above will traverse a graph of users and news 
articles as follows:</p>
+<ol class="arabic simple">
+<li>Fetch the list of news articles that user Alec read.</li>
+<li>Get the categories of the result edges of step one.</li>
+<li>Fetch other articles that were published in same category.</li>
+</ol>
+<p>Meanwhile, Alec does not want to get articles that he already read. This 
can be taken care of with the following query in the filterOut option:
+Articles that Alec has already read.</p>
+<div class="code bash highlight-default notranslate"><div 
class="highlight"><pre><span></span><span class="p">{</span>
+  <span class="s2">&quot;size&quot;</span><span class="p">:</span> <span 
class="mi">5</span><span class="p">,</span>
+  <span class="s2">&quot;degrees&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;from&quot;</span><span class="p">:</span> 
<span class="s2">&quot;Alec&quot;</span><span class="p">,</span>
+          <span class="s2">&quot;label&quot;</span><span class="p">:</span> 
<span class="s2">&quot;daumnews_user_view_news&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;_degree&quot;</span><span class="p">:</span> 
<span class="mi">6</span>
+      <span class="p">}</span>
+  <span class="p">],</span>
+  <span class="s2">&quot;results&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;cacheRemain&quot;</span><span 
class="p">:</span> <span class="o">-</span><span class="mi">19</span><span 
class="p">,</span>
+          <span class="s2">&quot;from&quot;</span><span class="p">:</span> 
<span class="s2">&quot;Alec&quot;</span><span class="p">,</span>
+          <span class="s2">&quot;to&quot;</span><span class="p">:</span> <span 
class="mi">20150803143507760</span><span class="p">,</span>
+          <span class="s2">&quot;label&quot;</span><span class="p">:</span> 
<span class="s2">&quot;daumnews_user_view_news&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">1438591888454</span><span class="p">,</span>
+          <span class="s2">&quot;timestamp&quot;</span><span 
class="p">:</span> <span class="mi">1438591888454</span><span class="p">,</span>
+          <span class="s2">&quot;score&quot;</span><span class="p">:</span> 
<span class="mf">0.9342237306639056</span><span class="p">,</span>
+          <span class="s2">&quot;props&quot;</span><span class="p">:</span> 
<span class="p">{</span>
+              <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">1438591888454</span>
+          <span class="p">}</span>
+      <span class="p">},</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;cacheRemain&quot;</span><span 
class="p">:</span> <span class="o">-</span><span class="mi">19</span><span 
class="p">,</span>
+          <span class="s2">&quot;from&quot;</span><span class="p">:</span> 
<span class="s2">&quot;Alec&quot;</span><span class="p">,</span>
+          <span class="s2">&quot;to&quot;</span><span class="p">:</span> <span 
class="mi">20150803150406010</span><span class="p">,</span>
+          <span class="s2">&quot;label&quot;</span><span class="p">:</span> 
<span class="s2">&quot;daumnews_user_view_news&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">1438591143640</span><span class="p">,</span>
+          <span class="s2">&quot;timestamp&quot;</span><span 
class="p">:</span> <span class="mi">1438591143640</span><span class="p">,</span>
+          <span class="s2">&quot;score&quot;</span><span class="p">:</span> 
<span class="mf">0.9333716513280771</span><span class="p">,</span>
+          <span class="s2">&quot;props&quot;</span><span class="p">:</span> 
<span class="p">{</span>
+              <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">1438591143640</span>
+          <span class="p">}</span>
+      <span class="p">},</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;cacheRemain&quot;</span><span 
class="p">:</span> <span class="o">-</span><span class="mi">19</span><span 
class="p">,</span>
+          <span class="s2">&quot;from&quot;</span><span class="p">:</span> 
<span class="s2">&quot;Alec&quot;</span><span class="p">,</span>
+          <span class="s2">&quot;to&quot;</span><span class="p">:</span> <span 
class="mi">20150803144908340</span><span class="p">,</span>
+          <span class="s2">&quot;label&quot;</span><span class="p">:</span> 
<span class="s2">&quot;daumnews_user_view_news&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">1438581933262</span><span class="p">,</span>
+          <span class="s2">&quot;timestamp&quot;</span><span 
class="p">:</span> <span class="mi">1438581933262</span><span class="p">,</span>
+          <span class="s2">&quot;score&quot;</span><span class="p">:</span> 
<span class="mf">0.922898833570944</span><span class="p">,</span>
+          <span class="s2">&quot;props&quot;</span><span class="p">:</span> 
<span class="p">{</span>
+              <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">1438581933262</span>
+          <span class="p">}</span>
+      <span class="p">},</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;cacheRemain&quot;</span><span 
class="p">:</span> <span class="o">-</span><span class="mi">19</span><span 
class="p">,</span>
+          <span class="s2">&quot;from&quot;</span><span class="p">:</span> 
<span class="s2">&quot;Alec&quot;</span><span class="p">,</span>
+          <span class="s2">&quot;to&quot;</span><span class="p">:</span> <span 
class="mi">20150803124627492</span><span class="p">,</span>
+          <span class="s2">&quot;label&quot;</span><span class="p">:</span> 
<span class="s2">&quot;daumnews_user_view_news&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">1438581485765</span><span class="p">,</span>
+          <span class="s2">&quot;timestamp&quot;</span><span 
class="p">:</span> <span class="mi">1438581485765</span><span class="p">,</span>
+          <span class="s2">&quot;score&quot;</span><span class="p">:</span> 
<span class="mf">0.9223930035297659</span><span class="p">,</span>
+          <span class="s2">&quot;props&quot;</span><span class="p">:</span> 
<span class="p">{</span>
+              <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">1438581485765</span>
+          <span class="p">}</span>
+      <span class="p">},</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;cacheRemain&quot;</span><span 
class="p">:</span> <span class="o">-</span><span class="mi">19</span><span 
class="p">,</span>
+          <span class="s2">&quot;from&quot;</span><span class="p">:</span> 
<span class="s2">&quot;Alec&quot;</span><span class="p">,</span>
+          <span class="s2">&quot;to&quot;</span><span class="p">:</span> <span 
class="mi">20150803113311090</span><span class="p">,</span>
+          <span class="s2">&quot;label&quot;</span><span class="p">:</span> 
<span class="s2">&quot;daumnews_user_view_news&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">1438580536376</span><span class="p">,</span>
+          <span class="s2">&quot;timestamp&quot;</span><span 
class="p">:</span> <span class="mi">1438580536376</span><span class="p">,</span>
+          <span class="s2">&quot;score&quot;</span><span class="p">:</span> 
<span class="mf">0.9213207756669546</span><span class="p">,</span>
+          <span class="s2">&quot;props&quot;</span><span class="p">:</span> 
<span class="p">{</span>
+              <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">1438580536376</span>
+          <span class="p">}</span>
+      <span class="p">}</span>
+  <span class="p">],</span>
+  <span class="s2">&quot;impressionId&quot;</span><span class="p">:</span> 
<span class="mi">354266627</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>Without “filterOut”</p>
+<div class="code bash highlight-default notranslate"><div 
class="highlight"><pre><span></span><span class="p">{</span>
+  <span class="s2">&quot;size&quot;</span><span class="p">:</span> <span 
class="mi">2</span><span class="p">,</span>
+  <span class="s2">&quot;degrees&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;from&quot;</span><span class="p">:</span> 
<span class="mi">1028</span><span class="p">,</span>
+          <span class="s2">&quot;label&quot;</span><span class="p">:</span> 
<span class="s2">&quot;daumnews_news_belongto_category&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;in&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;_degree&quot;</span><span class="p">:</span> 
<span class="mi">2</span>
+      <span class="p">}</span>
+  <span class="p">],</span>
+  <span class="s2">&quot;results&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;cacheRemain&quot;</span><span 
class="p">:</span> <span class="o">-</span><span class="mi">33</span><span 
class="p">,</span>
+          <span class="s2">&quot;from&quot;</span><span class="p">:</span> 
<span class="mi">1028</span><span class="p">,</span>
+          <span class="s2">&quot;to&quot;</span><span class="p">:</span> <span 
class="mi">20150803105805092</span><span class="p">,</span>
+          <span class="s2">&quot;label&quot;</span><span class="p">:</span> 
<span class="s2">&quot;daumnews_news_belongto_category&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;in&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">1438590169146</span><span class="p">,</span>
+          <span class="s2">&quot;timestamp&quot;</span><span 
class="p">:</span> <span class="mi">1438590169146</span><span class="p">,</span>
+          <span class="s2">&quot;score&quot;</span><span class="p">:</span> 
<span class="mf">0.9342777143725886</span><span class="p">,</span>
+          <span class="s2">&quot;props&quot;</span><span class="p">:</span> 
<span class="p">{</span>
+              <span class="s2">&quot;updateTime&quot;</span><span 
class="p">:</span> <span class="mi">20150803172249144</span><span 
class="p">,</span>
+              <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">1438590169146</span>
+          <span class="p">}</span>
+      <span class="p">},</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;cacheRemain&quot;</span><span 
class="p">:</span> <span class="o">-</span><span class="mi">33</span><span 
class="p">,</span>
+          <span class="s2">&quot;from&quot;</span><span class="p">:</span> 
<span class="mi">1028</span><span class="p">,</span>
+          <span class="s2">&quot;to&quot;</span><span class="p">:</span> <span 
class="mi">20150803143507760</span><span class="p">,</span>
+          <span class="s2">&quot;label&quot;</span><span class="p">:</span> 
<span class="s2">&quot;daumnews_news_belongto_category&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;in&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">1438581548486</span><span class="p">,</span>
+          <span class="s2">&quot;timestamp&quot;</span><span 
class="p">:</span> <span class="mi">1438581548486</span><span class="p">,</span>
+          <span class="s2">&quot;score&quot;</span><span class="p">:</span> 
<span class="mf">0.9342777143725886</span><span class="p">,</span>
+          <span class="s2">&quot;props&quot;</span><span class="p">:</span> 
<span class="p">{</span>
+              <span class="s2">&quot;updateTime&quot;</span><span 
class="p">:</span> <span class="mi">20150803145908490</span><span 
class="p">,</span>
+              <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">1438581548486</span>
+          <span class="p">}</span>
+      <span class="p">}</span>
+  <span class="p">],</span>
+  <span class="s2">&quot;impressionId&quot;</span><span class="p">:</span> 
<span class="o">-</span><span class="mi">14034523</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>with “filterOut”</p>
+<div class="code bash highlight-default notranslate"><div 
class="highlight"><pre><span></span><span class="p">{</span>
+  <span class="s2">&quot;size&quot;</span><span class="p">:</span> <span 
class="mi">1</span><span class="p">,</span>
+  <span class="s2">&quot;degrees&quot;</span><span class="p">:</span> <span 
class="p">[],</span>
+  <span class="s2">&quot;results&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;cacheRemain&quot;</span><span 
class="p">:</span> <span class="mi">85957406</span><span class="p">,</span>
+          <span class="s2">&quot;from&quot;</span><span class="p">:</span> 
<span class="mi">1028</span><span class="p">,</span>
+          <span class="s2">&quot;to&quot;</span><span class="p">:</span> <span 
class="mi">20150803105805092</span><span class="p">,</span>
+          <span class="s2">&quot;label&quot;</span><span class="p">:</span> 
<span class="s2">&quot;daumnews_news_belongto_category&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;in&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">1438590169146</span><span class="p">,</span>
+          <span class="s2">&quot;timestamp&quot;</span><span 
class="p">:</span> <span class="mi">1438590169146</span><span class="p">,</span>
+          <span class="s2">&quot;score&quot;</span><span class="p">:</span> 
<span class="mf">0.9343106784173475</span><span class="p">,</span>
+          <span class="s2">&quot;props&quot;</span><span class="p">:</span> 
<span class="p">{</span>
+              <span class="s2">&quot;updateTime&quot;</span><span 
class="p">:</span> <span class="mi">20150803172249144</span><span 
class="p">,</span>
+              <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">1438590169146</span>
+          <span class="p">}</span>
+      <span class="p">}</span>
+  <span class="p">],</span>
+  <span class="s2">&quot;impressionId&quot;</span><span class="p">:</span> 
<span class="o">-</span><span class="mi">14034523</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>Note that article <code class="docutils literal notranslate"><span 
class="pre">20150803143507760</span></code> has been filtered out.</p>
+<p><strong>nextStepLimit Example</strong></p>
+<p>S2Graph provides step-level aggregation so that users can take the top K 
items from the aggregated results.</p>
+<p><strong>nextStepThreshold Example</strong></p>
+<p><strong>sample Example</strong></p>
+<div class="code bash highlight-default notranslate"><div 
class="highlight"><pre><span></span><span class="n">curl</span> <span 
class="o">-</span><span class="n">XPOST</span> <span 
class="n">localhost</span><span class="p">:</span><span 
class="mi">9000</span><span class="o">/</span><span 
class="n">graphs</span><span class="o">/</span><span class="n">getEdges</span> 
<span class="o">-</span><span class="n">H</span> <span 
class="s1">&#39;Content-Type: Application/json&#39;</span> <span 
class="o">-</span><span class="n">d</span> <span class="s1">&#39;</span>
+<span class="p">{</span>
+  <span class="s2">&quot;srcVertices&quot;</span><span class="p">:</span> 
<span class="p">[{</span><span class="s2">&quot;serviceName&quot;</span><span 
class="p">:</span> <span class="s2">&quot;s2graph&quot;</span><span 
class="p">,</span> <span class="s2">&quot;columnName&quot;</span><span 
class="p">:</span> <span class="s2">&quot;account_id&quot;</span><span 
class="p">,</span> <span class="s2">&quot;id&quot;</span><span 
class="p">:</span><span class="mi">1</span><span class="p">}],</span>
+  <span class="s2">&quot;steps&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+    <span class="p">{</span><span class="s2">&quot;sample&quot;</span><span 
class="p">:</span><span class="mi">2</span><span class="p">,</span><span 
class="s2">&quot;step&quot;</span><span class="p">:</span> <span 
class="p">[{</span><span class="s2">&quot;label&quot;</span><span 
class="p">:</span> <span class="s2">&quot;graph_test&quot;</span><span 
class="p">,</span> <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span> <span class="s2">&quot;offset&quot;</span><span 
class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span 
class="s2">&quot;limit&quot;</span><span class="p">:</span> <span 
class="mi">10</span><span class="p">,</span> <span 
class="s2">&quot;scoring&quot;</span><span class="p">:</span> <span 
class="p">{</span><span class="s2">&quot;time&quot;</span><span 
class="p">:</span> <span class="mi">1</span><span class="p">,</span> <span 
class="s2">&quot;weight&quot;</span><span clas
 s="p">:</span> <span class="mi">1</span><span class="p">}}]}</span>
+  <span class="p">]</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p><strong>transform Example</strong></p>
+<p>With typical two-step query, S2Graph will start the second step from the 
“_to” (vertex id) values of the first steps’ result. With the 
“transform” option, you can actually use any single field from the result 
edges’ properties of step one.</p>
+<p>Add a “transform” option to the query from example 1.</p>
+<div class="code bash highlight-default notranslate"><div 
class="highlight"><pre><span></span><span class="p">{</span>
+  <span class="s2">&quot;select&quot;</span><span class="p">:</span> <span 
class="p">[],</span>
+  <span class="s2">&quot;srcVertices&quot;</span><span class="p">:</span> 
<span class="p">[</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;serviceName&quot;</span><span 
class="p">:</span> <span class="s2">&quot;s2graph&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;columnName&quot;</span><span 
class="p">:</span> <span class="s2">&quot;user_id_test&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;id&quot;</span><span class="p">:</span> <span 
class="mi">101</span>
+      <span class="p">}</span>
+  <span class="p">],</span>
+  <span class="s2">&quot;steps&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;step&quot;</span><span class="p">:</span> 
<span class="p">[</span>
+              <span class="p">{</span>
+                  <span class="s2">&quot;label&quot;</span><span 
class="p">:</span> <span 
class="s2">&quot;s2graph_label_test_weak&quot;</span><span class="p">,</span>
+                  <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span>
+                  <span class="s2">&quot;offset&quot;</span><span 
class="p">:</span> <span class="mi">0</span><span class="p">,</span>
+                  <span class="s2">&quot;limit&quot;</span><span 
class="p">:</span> <span class="mi">10</span><span class="p">,</span>
+                  <span class="s2">&quot;duplicate&quot;</span><span 
class="p">:</span> <span class="s2">&quot;raw&quot;</span><span 
class="p">,</span>
+                  <span class="s2">&quot;transform&quot;</span><span 
class="p">:</span> <span class="p">[</span>
+                      <span class="p">[</span><span 
class="s2">&quot;_to&quot;</span><span class="p">],</span>
+                      <span class="p">[</span><span 
class="s2">&quot;time.$&quot;</span><span class="p">,</span> <span 
class="s2">&quot;time&quot;</span><span class="p">]</span>
+                  <span class="p">]</span>
+              <span class="p">}</span>
+          <span class="p">]</span>
+      <span class="p">}</span>
+  <span class="p">]</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>Note that we have six resulting edges. We have two transform rules, the 
first one simply fetches edges with their target vertex IDs (such as “to”: 
“10”), and the second rule will fetch the same edges but with the 
“time” values replacing vertex IDs (such as “to”: “to”: 
“time.-30”).</p>
+<div class="code bash highlight-default notranslate"><div 
class="highlight"><pre><span></span><span class="p">{</span>
+  <span class="s2">&quot;size&quot;</span><span class="p">:</span> <span 
class="mi">6</span><span class="p">,</span>
+  <span class="s2">&quot;degrees&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;from&quot;</span><span class="p">:</span> 
<span class="mi">101</span><span class="p">,</span>
+          <span class="s2">&quot;label&quot;</span><span class="p">:</span> 
<span class="s2">&quot;s2graph_label_test_weak&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;_degree&quot;</span><span class="p">:</span> 
<span class="mi">3</span>
+      <span class="p">},</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;from&quot;</span><span class="p">:</span> 
<span class="mi">101</span><span class="p">,</span>
+          <span class="s2">&quot;label&quot;</span><span class="p">:</span> 
<span class="s2">&quot;s2graph_label_test_weak&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;_degree&quot;</span><span class="p">:</span> 
<span class="mi">3</span>
+      <span class="p">}</span>
+  <span class="p">],</span>
+  <span class="s2">&quot;results&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;cacheRemain&quot;</span><span 
class="p">:</span> <span class="o">-</span><span class="mi">8</span><span 
class="p">,</span>
+          <span class="s2">&quot;from&quot;</span><span class="p">:</span> 
<span class="mi">101</span><span class="p">,</span>
+          <span class="s2">&quot;to&quot;</span><span class="p">:</span> <span 
class="s2">&quot;10&quot;</span><span class="p">,</span>
+          <span class="s2">&quot;label&quot;</span><span class="p">:</span> 
<span class="s2">&quot;s2graph_label_test_weak&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">6</span><span class="p">,</span>
+          <span class="s2">&quot;timestamp&quot;</span><span 
class="p">:</span> <span class="mi">6</span><span class="p">,</span>
+          <span class="s2">&quot;score&quot;</span><span class="p">:</span> 
<span class="mi">1</span><span class="p">,</span>
+          <span class="s2">&quot;props&quot;</span><span class="p">:</span> 
<span class="p">{</span>
+              <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">6</span><span class="p">,</span>
+              <span class="s2">&quot;time&quot;</span><span class="p">:</span> 
<span class="o">-</span><span class="mi">30</span><span class="p">,</span>
+              <span class="s2">&quot;weight&quot;</span><span 
class="p">:</span> <span class="mi">0</span><span class="p">,</span>
+              <span class="s2">&quot;is_hidden&quot;</span><span 
class="p">:</span> <span class="n">false</span><span class="p">,</span>
+              <span class="s2">&quot;is_blocked&quot;</span><span 
class="p">:</span> <span class="n">false</span>
+          <span class="p">}</span>
+      <span class="p">},</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;cacheRemain&quot;</span><span 
class="p">:</span> <span class="o">-</span><span class="mi">8</span><span 
class="p">,</span>
+          <span class="s2">&quot;from&quot;</span><span class="p">:</span> 
<span class="mi">101</span><span class="p">,</span>
+          <span class="s2">&quot;to&quot;</span><span class="p">:</span> <span 
class="s2">&quot;time.-30&quot;</span><span class="p">,</span>
+          <span class="s2">&quot;label&quot;</span><span class="p">:</span> 
<span class="s2">&quot;s2graph_label_test_weak&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">6</span><span class="p">,</span>
+          <span class="s2">&quot;timestamp&quot;</span><span 
class="p">:</span> <span class="mi">6</span><span class="p">,</span>
+          <span class="s2">&quot;score&quot;</span><span class="p">:</span> 
<span class="mi">1</span><span class="p">,</span>
+          <span class="s2">&quot;props&quot;</span><span class="p">:</span> 
<span class="p">{</span>
+              <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">6</span><span class="p">,</span>
+              <span class="s2">&quot;time&quot;</span><span class="p">:</span> 
<span class="o">-</span><span class="mi">30</span><span class="p">,</span>
+              <span class="s2">&quot;weight&quot;</span><span 
class="p">:</span> <span class="mi">0</span><span class="p">,</span>
+              <span class="s2">&quot;is_hidden&quot;</span><span 
class="p">:</span> <span class="n">false</span><span class="p">,</span>
+              <span class="s2">&quot;is_blocked&quot;</span><span 
class="p">:</span> <span class="n">false</span>
+          <span class="p">}</span>
+      <span class="p">},</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;cacheRemain&quot;</span><span 
class="p">:</span> <span class="o">-</span><span class="mi">8</span><span 
class="p">,</span>
+          <span class="s2">&quot;from&quot;</span><span class="p">:</span> 
<span class="mi">101</span><span class="p">,</span>
+          <span class="s2">&quot;to&quot;</span><span class="p">:</span> <span 
class="s2">&quot;10&quot;</span><span class="p">,</span>
+          <span class="s2">&quot;label&quot;</span><span class="p">:</span> 
<span class="s2">&quot;s2graph_label_test_weak&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">5</span><span class="p">,</span>
+          <span class="s2">&quot;timestamp&quot;</span><span 
class="p">:</span> <span class="mi">5</span><span class="p">,</span>
+          <span class="s2">&quot;score&quot;</span><span class="p">:</span> 
<span class="mi">1</span><span class="p">,</span>
+          <span class="s2">&quot;props&quot;</span><span class="p">:</span> 
<span class="p">{</span>
+              <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">5</span><span class="p">,</span>
+              <span class="s2">&quot;time&quot;</span><span class="p">:</span> 
<span class="o">-</span><span class="mi">10</span><span class="p">,</span>
+              <span class="s2">&quot;weight&quot;</span><span 
class="p">:</span> <span class="mi">0</span><span class="p">,</span>
+              <span class="s2">&quot;is_hidden&quot;</span><span 
class="p">:</span> <span class="n">false</span><span class="p">,</span>
+              <span class="s2">&quot;is_blocked&quot;</span><span 
class="p">:</span> <span class="n">false</span>
+          <span class="p">}</span>
+      <span class="p">},</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;cacheRemain&quot;</span><span 
class="p">:</span> <span class="o">-</span><span class="mi">8</span><span 
class="p">,</span>
+          <span class="s2">&quot;from&quot;</span><span class="p">:</span> 
<span class="mi">101</span><span class="p">,</span>
+          <span class="s2">&quot;to&quot;</span><span class="p">:</span> <span 
class="s2">&quot;time.-10&quot;</span><span class="p">,</span>
+          <span class="s2">&quot;label&quot;</span><span class="p">:</span> 
<span class="s2">&quot;s2graph_label_test_weak&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">5</span><span class="p">,</span>
+          <span class="s2">&quot;timestamp&quot;</span><span 
class="p">:</span> <span class="mi">5</span><span class="p">,</span>
+          <span class="s2">&quot;score&quot;</span><span class="p">:</span> 
<span class="mi">1</span><span class="p">,</span>
+          <span class="s2">&quot;props&quot;</span><span class="p">:</span> 
<span class="p">{</span>
+              <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">5</span><span class="p">,</span>
+              <span class="s2">&quot;time&quot;</span><span class="p">:</span> 
<span class="o">-</span><span class="mi">10</span><span class="p">,</span>
+              <span class="s2">&quot;weight&quot;</span><span 
class="p">:</span> <span class="mi">0</span><span class="p">,</span>
+              <span class="s2">&quot;is_hidden&quot;</span><span 
class="p">:</span> <span class="n">false</span><span class="p">,</span>
+              <span class="s2">&quot;is_blocked&quot;</span><span 
class="p">:</span> <span class="n">false</span>
+          <span class="p">}</span>
+      <span class="p">},</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;cacheRemain&quot;</span><span 
class="p">:</span> <span class="o">-</span><span class="mi">8</span><span 
class="p">,</span>
+          <span class="s2">&quot;from&quot;</span><span class="p">:</span> 
<span class="mi">101</span><span class="p">,</span>
+          <span class="s2">&quot;to&quot;</span><span class="p">:</span> <span 
class="s2">&quot;10&quot;</span><span class="p">,</span>
+          <span class="s2">&quot;label&quot;</span><span class="p">:</span> 
<span class="s2">&quot;s2graph_label_test_weak&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">4</span><span class="p">,</span>
+          <span class="s2">&quot;timestamp&quot;</span><span 
class="p">:</span> <span class="mi">4</span><span class="p">,</span>
+          <span class="s2">&quot;score&quot;</span><span class="p">:</span> 
<span class="mi">1</span><span class="p">,</span>
+          <span class="s2">&quot;props&quot;</span><span class="p">:</span> 
<span class="p">{</span>
+              <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">4</span><span class="p">,</span>
+              <span class="s2">&quot;time&quot;</span><span class="p">:</span> 
<span class="mi">0</span><span class="p">,</span>
+              <span class="s2">&quot;weight&quot;</span><span 
class="p">:</span> <span class="mi">0</span><span class="p">,</span>
+              <span class="s2">&quot;is_hidden&quot;</span><span 
class="p">:</span> <span class="n">false</span><span class="p">,</span>
+              <span class="s2">&quot;is_blocked&quot;</span><span 
class="p">:</span> <span class="n">false</span>
+          <span class="p">}</span>
+      <span class="p">},</span>
+      <span class="p">{</span>
+          <span class="s2">&quot;cacheRemain&quot;</span><span 
class="p">:</span> <span class="o">-</span><span class="mi">8</span><span 
class="p">,</span>
+          <span class="s2">&quot;from&quot;</span><span class="p">:</span> 
<span class="mi">101</span><span class="p">,</span>
+          <span class="s2">&quot;to&quot;</span><span class="p">:</span> <span 
class="s2">&quot;time.0&quot;</span><span class="p">,</span>
+          <span class="s2">&quot;label&quot;</span><span class="p">:</span> 
<span class="s2">&quot;s2graph_label_test_weak&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span>
+          <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">4</span><span class="p">,</span>
+          <span class="s2">&quot;timestamp&quot;</span><span 
class="p">:</span> <span class="mi">4</span><span class="p">,</span>
+          <span class="s2">&quot;score&quot;</span><span class="p">:</span> 
<span class="mi">1</span><span class="p">,</span>
+          <span class="s2">&quot;props&quot;</span><span class="p">:</span> 
<span class="p">{</span>
+              <span class="s2">&quot;_timestamp&quot;</span><span 
class="p">:</span> <span class="mi">4</span><span class="p">,</span>
+              <span class="s2">&quot;time&quot;</span><span class="p">:</span> 
<span class="mi">0</span><span class="p">,</span>
+              <span class="s2">&quot;weight&quot;</span><span 
class="p">:</span> <span class="mi">0</span><span class="p">,</span>
+              <span class="s2">&quot;is_hidden&quot;</span><span 
class="p">:</span> <span class="n">false</span><span class="p">,</span>
+              <span class="s2">&quot;is_blocked&quot;</span><span 
class="p">:</span> <span class="n">false</span>
+          <span class="p">}</span>
+      <span class="p">}</span>
+  <span class="p">],</span>
+  <span class="s2">&quot;impressionId&quot;</span><span class="p">:</span> 
<span class="mi">1972178414</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p><strong>Two-Step Traversal Example</strong></p>
+<p>The following query will fetch a user’s (id 1) friends of friends by 
chaining multiple steps:</p>
+<div class="code bash highlight-default notranslate"><div 
class="highlight"><pre><span></span><span class="p">{</span>
+  <span class="s2">&quot;srcVertices&quot;</span><span class="p">:</span> 
<span class="p">[{</span><span class="s2">&quot;serviceName&quot;</span><span 
class="p">:</span> <span class="s2">&quot;s2graph&quot;</span><span 
class="p">,</span> <span class="s2">&quot;columnName&quot;</span><span 
class="p">:</span> <span class="s2">&quot;account_id&quot;</span><span 
class="p">,</span> <span class="s2">&quot;id&quot;</span><span 
class="p">:</span><span class="mi">1</span><span class="p">}],</span>
+  <span class="s2">&quot;steps&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+    <span class="p">{</span>
+        <span class="s2">&quot;step&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+          <span class="p">{</span><span 
class="s2">&quot;label&quot;</span><span class="p">:</span> <span 
class="s2">&quot;friends&quot;</span><span class="p">,</span> <span 
class="s2">&quot;direction&quot;</span><span class="p">:</span> <span 
class="s2">&quot;out&quot;</span><span class="p">,</span> <span 
class="s2">&quot;limit&quot;</span><span class="p">:</span> <span 
class="mi">100</span><span class="p">}</span>
+        <span class="p">]</span>
+    <span class="p">},</span>
+    <span class="p">{</span>
+        <span class="s2">&quot;step&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+          <span class="p">{</span><span 
class="s2">&quot;label&quot;</span><span class="p">:</span> <span 
class="s2">&quot;friends&quot;</span><span class="p">,</span> <span 
class="s2">&quot;direction&quot;</span><span class="p">:</span> <span 
class="s2">&quot;out&quot;</span><span class="p">,</span> <span 
class="s2">&quot;limit&quot;</span><span class="p">:</span> <span 
class="mi">10</span><span class="p">}</span>
+        <span class="p">]</span>
+    <span class="p">}</span>
+  <span class="p">]</span>
+<span class="p">}</span><span class="s1">&#39;</span>
+</pre></div>
+</div>
+<p><strong>Three-Step Traversal Example</strong></p>
+<p>Add more steps for wider traversals. Be gentle on the limit options since 
the number of visited edges will increase exponentially and become very heavy 
on the system.</p>
+<p><strong>More examples</strong></p>
+<p>Example 1. From label “graph_test”, select the first 100 edges that 
start from vertex “account_id = 1”, with default sorting.</p>
+<div class="code bash highlight-default notranslate"><div 
class="highlight"><pre><span></span><span class="n">curl</span> <span 
class="o">-</span><span class="n">XPOST</span> <span 
class="n">localhost</span><span class="p">:</span><span 
class="mi">9000</span><span class="o">/</span><span 
class="n">graphs</span><span class="o">/</span><span class="n">getEdges</span> 
<span class="o">-</span><span class="n">H</span> <span 
class="s1">&#39;Content-Type: Application/json&#39;</span> <span 
class="o">-</span><span class="n">d</span> <span class="s1">&#39;</span>
+<span class="p">{</span>
+    <span class="s2">&quot;srcVertices&quot;</span><span class="p">:</span> 
<span class="p">[{</span><span class="s2">&quot;serviceName&quot;</span><span 
class="p">:</span> <span class="s2">&quot;s2graph&quot;</span><span 
class="p">,</span> <span class="s2">&quot;columnName&quot;</span><span 
class="p">:</span> <span class="s2">&quot;account_id&quot;</span><span 
class="p">,</span> <span class="s2">&quot;id&quot;</span><span 
class="p">:</span><span class="mi">1</span><span class="p">}],</span>
+    <span class="s2">&quot;steps&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+      <span class="p">[{</span><span class="s2">&quot;label&quot;</span><span 
class="p">:</span> <span class="s2">&quot;graph_test&quot;</span><span 
class="p">,</span> <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;out&quot;</span><span 
class="p">,</span> <span class="s2">&quot;offset&quot;</span><span 
class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span 
class="s2">&quot;limit&quot;</span><span class="p">:</span> <span 
class="mi">100</span>
+      <span class="p">}]</span>
+    <span class="p">]</span>
+<span class="p">}</span><span class="s1">&#39;</span>
+</pre></div>
+</div>
+<p>Example 2. Now select between the 50th and 100th edges from the same 
query.</p>
+<div class="code bash highlight-default notranslate"><div 
class="highlight"><pre><span></span><span class="n">curl</span> <span 
class="o">-</span><span class="n">XPOST</span> <span 
class="n">localhost</span><span class="p">:</span><span 
class="mi">9000</span><span class="o">/</span><span 
class="n">graphs</span><span class="o">/</span><span class="n">getEdges</span> 
<span class="o">-</span><span class="n">H</span> <span 
class="s1">&#39;Content-Type: Application/json&#39;</span> <span 
class="o">-</span><span class="n">d</span> <span class="s1">&#39;</span>
+<span class="p">{</span>
+    <span class="s2">&quot;srcVertices&quot;</span><span class="p">:</span> 
<span class="p">[{</span><span class="s2">&quot;serviceName&quot;</span><span 
class="p">:</span> <span class="s2">&quot;s2graph&quot;</span><span 
class="p">,</span> <span class="s2">&quot;columnName&quot;</span><span 
class="p">:</span> <span class="s2">&quot;account_id&quot;</span><span 
class="p">,</span> <span class="s2">&quot;id&quot;</span><span 
class="p">:</span><span class="mi">1</span><span class="p">}],</span>
+    <span class="s2">&quot;steps&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+      <span class="p">[{</span><span class="s2">&quot;label&quot;</span><span 
class="p">:</span> <span class="s2">&quot;graph_test&quot;</span><span 
class="p">,</span> <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;in&quot;</span><span 
class="p">,</span> <span class="s2">&quot;offset&quot;</span><span 
class="p">:</span> <span class="mi">50</span><span class="p">,</span> <span 
class="s2">&quot;limit&quot;</span><span class="p">:</span> <span 
class="mi">50</span><span class="p">}]</span>
+    <span class="p">]</span>
+<span class="p">}</span><span class="s1">&#39;</span>
+</pre></div>
+</div>
+<p>Example 3. Now add a time range filter so that you will only get the edges 
that were inserted between 1416214118000 and 1416300000000.</p>
+<div class="code bash highlight-default notranslate"><div 
class="highlight"><pre><span></span><span class="n">curl</span> <span 
class="o">-</span><span class="n">XPOST</span> <span 
class="n">localhost</span><span class="p">:</span><span 
class="mi">9000</span><span class="o">/</span><span 
class="n">graphs</span><span class="o">/</span><span class="n">getEdges</span> 
<span class="o">-</span><span class="n">H</span> <span 
class="s1">&#39;Content-Type: Application/json&#39;</span> <span 
class="o">-</span><span class="n">d</span> <span class="s1">&#39;</span>
+<span class="p">{</span>
+    <span class="s2">&quot;srcVertices&quot;</span><span class="p">:</span> 
<span class="p">[{</span><span class="s2">&quot;serviceName&quot;</span><span 
class="p">:</span> <span class="s2">&quot;s2graph&quot;</span><span 
class="p">,</span> <span class="s2">&quot;columnName&quot;</span><span 
class="p">:</span> <span class="s2">&quot;account_id&quot;</span><span 
class="p">,</span> <span class="s2">&quot;id&quot;</span><span 
class="p">:</span><span class="mi">1</span><span class="p">}],</span>
+    <span class="s2">&quot;steps&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+      <span class="p">[{</span><span class="s2">&quot;label&quot;</span><span 
class="p">:</span> <span class="s2">&quot;graph_test&quot;</span><span 
class="p">,</span> <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;in&quot;</span><span 
class="p">,</span> <span class="s2">&quot;offset&quot;</span><span 
class="p">:</span> <span class="mi">50</span><span class="p">,</span> <span 
class="s2">&quot;limit&quot;</span><span class="p">:</span> <span 
class="mi">50</span><span class="p">,</span> <span 
class="s2">&quot;duration&quot;</span><span class="p">:</span> <span 
class="p">{</span><span class="s2">&quot;from&quot;</span><span 
class="p">:</span> <span class="mi">1416214118000</span><span 
class="p">,</span> <span class="s2">&quot;to&quot;</span><span 
class="p">:</span> <span class="mi">1416300000000</span><span 
class="p">}]</span>
+    <span class="p">]</span>
+<span class="p">}</span><span class="s1">&#39;</span>
+</pre></div>
+</div>
+<p>Example 4. Now add scoring rule to sort the result by indexed properties 
“time” and “weight”, with weights of 1.5 and 10, respectively.</p>
+<div class="code bash highlight-default notranslate"><div 
class="highlight"><pre><span></span><span class="n">curl</span> <span 
class="o">-</span><span class="n">XPOST</span> <span 
class="n">localhost</span><span class="p">:</span><span 
class="mi">9000</span><span class="o">/</span><span 
class="n">graphs</span><span class="o">/</span><span class="n">getEdges</span> 
<span class="o">-</span><span class="n">H</span> <span 
class="s1">&#39;Content-Type: Application/json&#39;</span> <span 
class="o">-</span><span class="n">d</span> <span class="s1">&#39;</span>
+<span class="p">{</span>
+    <span class="s2">&quot;srcVertices&quot;</span><span class="p">:</span> 
<span class="p">[{</span><span class="s2">&quot;serviceName&quot;</span><span 
class="p">:</span> <span class="s2">&quot;s2graph&quot;</span><span 
class="p">,</span> <span class="s2">&quot;columnName&quot;</span><span 
class="p">:</span> <span class="s2">&quot;account_id&quot;</span><span 
class="p">,</span> <span class="s2">&quot;id&quot;</span><span 
class="p">:</span><span class="mi">1</span><span class="p">}],</span>
+    <span class="s2">&quot;steps&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+      <span class="p">[{</span><span class="s2">&quot;label&quot;</span><span 
class="p">:</span> <span class="s2">&quot;graph_test&quot;</span><span 
class="p">,</span> <span class="s2">&quot;direction&quot;</span><span 
class="p">:</span> <span class="s2">&quot;in&quot;</span><span 
class="p">,</span> <span class="s2">&quot;offset&quot;</span><span 
class="p">:</span> <span class="mi">50</span><span class="p">,</span> <span 
class="s2">&quot;limit&quot;</span><span class="p">:</span> <span 
class="mi">50</span><span class="p">,</span> <span 
class="s2">&quot;duration&quot;</span><span class="p">:</span> <span 
class="p">{</span><span class="s2">&quot;from&quot;</span><span 
class="p">:</span> <span class="mi">1416214118000</span><span 
class="p">,</span> <span class="s2">&quot;to&quot;</span><span 
class="p">:</span> <span class="mi">1416214218000</span><span 
class="p">},</span> <span class="s2">&quot;scoring&quot;</span><span 
class="p">:</span> <span class="p">{</span><span class="s2">&quot;
 time&quot;</span><span class="p">:</span> <span class="mf">1.5</span><span 
class="p">,</span> <span class="s2">&quot;weight&quot;</span><span 
class="p">:</span> <span class="mi">10</span><span class="p">}]</span>
+    <span class="p">]</span>
+<span class="p">}</span><span class="s1">&#39;</span>
+</pre></div>
+</div>
+<p>Example 5. Make a two-step query to fetch friends of friends of a user 
“account_id = 1”. (Limit the first step by 10 friends and the second step 
by 100.)</p>
+<div class="code bash highlight-default notranslate"><div 
class="highlight"><pre><span></span><span class="n">curl</span> <span 
class="o">-</span><span class="n">XPOST</span> <span 
class="n">localhost</span><span class="p">:</span><span 
class="mi">9000</span><span class="o">/</span><span 
class="n">graphs</span><span class="o">/</span><span class="n">getEdges</span> 
<span class="o">-</span><span class="n">H</span> <span 
class="s1">&#39;Content-Type: Application/json&#39;</span> <span 
class="o">-</span><span class="n">d</span> <span class="s1">&#39;</span>
+<span class="p">{</span>
+    <span class="s2">&quot;srcVertices&quot;</span><span class="p">:</span> 
<span class="p">[{</span><span class="s2">&quot;serviceName&quot;</span><span 
class="p">:</span> <span class="s2">&quot;s2graph&quot;</span><span 
class="p">,</span> <span class="s2">&quot;columnName&quot;</span><span 
class="p">:</span> <span class="s2">&quot;account_id&quot;</span><span 
class="p">,</span> <span class="s2">&quot;id&quot;</span><span 
class="p">:</span><span class="mi">1</span><span class="p">}],</span>
+    <span class="s2">&quot;steps&quot;</span><span class="p">:</span> <span 
class="p">[</span>

[... 83 lines stripped ...]

Reply via email to