You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@age.apache.org by jo...@apache.org on 2021/10/20 21:45:26 UTC

[incubator-age-website] branch asf-site updated: Added DELETE clause documentation

This is an automated email from the ASF dual-hosted git repository.

joshinnis pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/incubator-age-website.git


The following commit(s) were added to refs/heads/asf-site by this push:
     new 30db827  Added DELETE clause documentation
30db827 is described below

commit 30db827f04b61ba454056a23075b04a559ddc3ab
Author: Josh Innis <Jo...@gmail.com>
AuthorDate: Wed Oct 20 14:44:48 2021 -0700

    Added DELETE clause documentation
---
 docs/_sources/clauses/delete.md.txt | 132 ++++++++++++++++++++++++++++++++++++
 docs/clauses/delete.html            | 114 ++++++++++++++++++++++++++++++-
 docs/searchindex.js                 |   2 +-
 docs/src/docs/clauses/delete.md     | 132 ++++++++++++++++++++++++++++++++++++
 4 files changed, 378 insertions(+), 2 deletions(-)

diff --git a/docs/_sources/clauses/delete.md.txt b/docs/_sources/clauses/delete.md.txt
index 309e7da..b318f69 100644
--- a/docs/_sources/clauses/delete.md.txt
+++ b/docs/_sources/clauses/delete.md.txt
@@ -1 +1,133 @@
 # DELETE
+
+The DELETE clause is used to delete graph elements—nodes, relationships orpaths.
+
+## Terminal DELETE clauses
+
+A delete clause that is not followed by another clause is called a terminal clause. When a cypher query ends with a terminal clause, no results will be returned from the cypher function call. However, the cypher function call still requires a column list definition. When cypher ends with a terminal node, define a single value in the column list definition: no data will be returned in this variable.
+
+
+## Introduction
+
+For removing properties, see REMOVE.
+
+You cannot delete a node without also deleting edges that start or end on said vertex. Either explicitly delete the vertices,or use DETACH DELETE.
+
+
+## Delete single vertex
+
+To delete a vertex, use the DELETE clause.
+
+Query
+
+
+```
+SELECT * 
+FROM cypher('graph_name', $$
+	MATCH (v:Useless)
+	DELETE v
+$$) as (v agtype);
+```
+
+
+Nothing is returned from this query.
+
+
+<table>
+  <tr>
+   <td><strong>v</strong>
+   </td>
+  </tr>
+  <tr>
+   <td>(0 rows)
+   </td>
+  </tr>
+</table>
+
+## Delete all vertices and edges
+
+Running a Match clause will collect all nodes, use the DETACH option to first delete a vertice's edges then delete the vertex itself.
+
+Query
+
+
+```
+SELECT * 
+FROM cypher('graph_name', $$
+	MATCH (v:Useless)
+	DELETE v
+$$) as (v agtype);
+```
+
+
+Nothing is returned from this query.
+
+
+<table>
+  <tr>
+   <td><strong>v</strong>
+   </td>
+  </tr>
+  <tr>
+   <td>(0 rows)
+   </td>
+  </tr>
+</table>
+
+## Delete edges only
+
+To delete an edge, use the match clause to find your edges, then add the variable to the DELETE.
+
+Query
+```
+SELECT * 
+FROM cypher('graph_name', $$
+	MATCH (n {name: 'Andres'})-[r:KNOWS]->()
+	DELETE r
+$$) as (v agtype);
+```
+
+
+Nothing is returned from this query.
+
+
+<table>
+  <tr>
+   <td><strong>v</strong>
+   </td>
+  </tr>
+  <tr>
+   <td>(0 rows)
+   </td>
+  </tr>
+</table>
+
+## Return a deleted vertex
+
+In AGE, you can return vertices that have been deleted.
+
+Query
+```
+SELECT *
+FROM cypher('graph_name', $$
+	MATCH (n {name: 'A'})
+	DELETE n
+	RETURN n
+$$) as (a agtype);
+
+```
+
+<table>
+  <tr>
+   <td><strong>v</strong>
+   </td>
+  </tr>
+  <tr><td>{"id": 281474976710659, "label": "", "properties": {"name": "A"}}::vertex</td></tr>
+  <tr>
+   <td>(1 rows)
+   </td>
+  </tr>
+</table>
+
+
+
diff --git a/docs/clauses/delete.html b/docs/clauses/delete.html
index 98c6ca5..1ff137c 100644
--- a/docs/clauses/delete.html
+++ b/docs/clauses/delete.html
@@ -115,7 +115,15 @@
 <li class="toctree-l1"><a class="reference internal" href="create.html">CREATE</a></li>
 <li class="toctree-l1"><a class="reference internal" href="set.html">SET</a></li>
 <li class="toctree-l1"><a class="reference internal" href="remove.html">REMOVE</a></li>
-<li class="toctree-l1 current"><a class="current reference internal" href="#">DELETE</a></li>
+<li class="toctree-l1 current"><a class="current reference internal" href="#">DELETE</a><ul>
+<li class="toctree-l2"><a class="reference internal" href="#terminal-delete-clauses">Terminal DELETE clauses</a></li>
+<li class="toctree-l2"><a class="reference internal" href="#introduction">Introduction</a></li>
+<li class="toctree-l2"><a class="reference internal" href="#delete-single-vertex">Delete single vertex</a></li>
+<li class="toctree-l2"><a class="reference internal" href="#delete-all-vertices-and-edges">Delete all vertices and edges</a></li>
+<li class="toctree-l2"><a class="reference internal" href="#delete-edges-only">Delete edges only</a></li>
+<li class="toctree-l2"><a class="reference internal" href="#return-a-deleted-vertex">Return a deleted vertex</a></li>
+</ul>
+</li>
 </ul>
 <p class="caption" role="heading"><span class="caption-text">Functions</span></p>
 <ul>
@@ -208,6 +216,110 @@
             
   <div class="tex2jax_ignore mathjax_ignore section" id="delete">
 <h1>DELETE<a class="headerlink" href="#delete" title="Permalink to this headline">¶</a></h1>
+<p>The DELETE clause is used to delete graph elements—nodes, relationships orpaths.</p>
+<div class="section" id="terminal-delete-clauses">
+<h2>Terminal DELETE clauses<a class="headerlink" href="#terminal-delete-clauses" title="Permalink to this headline">¶</a></h2>
+<p>A delete clause that is not followed by another clause is called a terminal clause. When a cypher query ends with a terminal clause, no results will be returned from the cypher function call. However, the cypher function call still requires a column list definition. When cypher ends with a terminal node, define a single value in the column list definition: no data will be returned in this variable.</p>
+</div>
+<div class="section" id="introduction">
+<h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
+<p>For removing properties, see REMOVE.</p>
+<p>You cannot delete a node without also deleting edges that start or end on said vertex. Either explicitly delete the vertices,or use DETACH DELETE.</p>
+</div>
+<div class="section" id="delete-single-vertex">
+<h2>Delete single vertex<a class="headerlink" href="#delete-single-vertex" title="Permalink to this headline">¶</a></h2>
+<p>To delete a vertex, use the DELETE clause.</p>
+<p>Query</p>
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>SELECT * 
+FROM cypher(&#39;graph_name&#39;, $$
+	MATCH (v:Useless)
+	DELETE v
+$$) as (v agtype);
+</pre></div>
+</div>
+<p>Nothing is returned from this query.</p>
+<table>
+  <tr>
+   <td><strong>v</strong>
+   </td>
+  </tr>
+  <tr>
+   <td>(0 rows)
+   </td>
+  </tr>
+</table>
+</div>
+<div class="section" id="delete-all-vertices-and-edges">
+<h2>Delete all vertices and edges<a class="headerlink" href="#delete-all-vertices-and-edges" title="Permalink to this headline">¶</a></h2>
+<p>Running a Match clause will collect all nodes, use the DETACH option to first delete a vertice’s edges then delete the vertex itself.</p>
+<p>Query</p>
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>SELECT * 
+FROM cypher(&#39;graph_name&#39;, $$
+	MATCH (v:Useless)
+	DELETE v
+$$) as (v agtype);
+</pre></div>
+</div>
+<p>Nothing is returned from this query.</p>
+<table>
+  <tr>
+   <td><strong>v</strong>
+   </td>
+  </tr>
+  <tr>
+   <td>(0 rows)
+   </td>
+  </tr>
+</table>
+</div>
+<div class="section" id="delete-edges-only">
+<h2>Delete edges only<a class="headerlink" href="#delete-edges-only" title="Permalink to this headline">¶</a></h2>
+<p>To delete an edge, use the match clause to find your edges, then add the variable to the DELETE.</p>
+<p>Query</p>
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>SELECT * 
+FROM cypher(&#39;graph_name&#39;, $$
+	MATCH (n {name: &#39;Andres&#39;})-[r:KNOWS]-&gt;()
+	DELETE r
+$$) as (v agtype);
+</pre></div>
+</div>
+<p>Nothing is returned from this query.</p>
+<table>
+  <tr>
+   <td><strong>v</strong>
+   </td>
+  </tr>
+  <tr>
+   <td>(0 rows)
+   </td>
+  </tr>
+</table>
+</div>
+<div class="section" id="return-a-deleted-vertex">
+<h2>Return a deleted vertex<a class="headerlink" href="#return-a-deleted-vertex" title="Permalink to this headline">¶</a></h2>
+<p>In AGE, you can return vertices that have been deleted.</p>
+<p>Query</p>
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>SELECT *
+FROM cypher(&#39;graph_name&#39;, $$
+	MATCH (n {name: &#39;A&#39;})
+	DELETE n
+	RETURN n
+$$) as (a agtype);
+
+</pre></div>
+</div>
+<table>
+  <tr>
+   <td><strong>v</strong>
+   </td>
+  </tr>
+  <tr><td>{"id": 281474976710659, "label": "", "properties": {"name": "A"}}::vertex</td></tr>
+  <tr>
+   <td>(1 rows)
+   </td>
+  </tr>
+</table>
+</div>
 </div>
 
 
diff --git a/docs/searchindex.js b/docs/searchindex.js
index 081c23c..a47e41d 100644
--- a/docs/searchindex.js
+++ b/docs/searchindex.js
@@ -1 +1 @@
-Search.setIndex({docnames:["advanced/advanced","advanced/advanced_overview","advanced/plpgsql","advanced/prepared_statements","clauses/create","clauses/delete","clauses/limit","clauses/match","clauses/order_by","clauses/remove","clauses/return","clauses/set","clauses/skip","clauses/with","functions/aggregate_functions","functions/list_functions","functions/logarithmic_functions","functions/numeric_functions","functions/predicate_functions","functions/scalar_functions","functions/string_f [...]
\ No newline at end of file
+Search.setIndex({docnames:["advanced/advanced","advanced/advanced_overview","advanced/plpgsql","advanced/prepared_statements","clauses/create","clauses/delete","clauses/limit","clauses/match","clauses/order_by","clauses/remove","clauses/return","clauses/set","clauses/skip","clauses/with","functions/aggregate_functions","functions/list_functions","functions/logarithmic_functions","functions/numeric_functions","functions/predicate_functions","functions/scalar_functions","functions/string_f [...]
\ No newline at end of file
diff --git a/docs/src/docs/clauses/delete.md b/docs/src/docs/clauses/delete.md
index 309e7da..b318f69 100644
--- a/docs/src/docs/clauses/delete.md
+++ b/docs/src/docs/clauses/delete.md
@@ -1 +1,133 @@
 # DELETE
+
+The DELETE clause is used to delete graph elements—nodes, relationships orpaths.
+
+## Terminal DELETE clauses
+
+A delete clause that is not followed by another clause is called a terminal clause. When a cypher query ends with a terminal clause, no results will be returned from the cypher function call. However, the cypher function call still requires a column list definition. When cypher ends with a terminal node, define a single value in the column list definition: no data will be returned in this variable.
+
+
+## Introduction
+
+For removing properties, see REMOVE.
+
+You cannot delete a node without also deleting edges that start or end on said vertex. Either explicitly delete the vertices,or use DETACH DELETE.
+
+
+## Delete single vertex
+
+To delete a vertex, use the DELETE clause.
+
+Query
+
+
+```
+SELECT * 
+FROM cypher('graph_name', $$
+	MATCH (v:Useless)
+	DELETE v
+$$) as (v agtype);
+```
+
+
+Nothing is returned from this query.
+
+
+<table>
+  <tr>
+   <td><strong>v</strong>
+   </td>
+  </tr>
+  <tr>
+   <td>(0 rows)
+   </td>
+  </tr>
+</table>
+
+## Delete all vertices and edges
+
+Running a Match clause will collect all nodes, use the DETACH option to first delete a vertice's edges then delete the vertex itself.
+
+Query
+
+
+```
+SELECT * 
+FROM cypher('graph_name', $$
+	MATCH (v:Useless)
+	DELETE v
+$$) as (v agtype);
+```
+
+
+Nothing is returned from this query.
+
+
+<table>
+  <tr>
+   <td><strong>v</strong>
+   </td>
+  </tr>
+  <tr>
+   <td>(0 rows)
+   </td>
+  </tr>
+</table>
+
+## Delete edges only
+
+To delete an edge, use the match clause to find your edges, then add the variable to the DELETE.
+
+Query
+```
+SELECT * 
+FROM cypher('graph_name', $$
+	MATCH (n {name: 'Andres'})-[r:KNOWS]->()
+	DELETE r
+$$) as (v agtype);
+```
+
+
+Nothing is returned from this query.
+
+
+<table>
+  <tr>
+   <td><strong>v</strong>
+   </td>
+  </tr>
+  <tr>
+   <td>(0 rows)
+   </td>
+  </tr>
+</table>
+
+## Return a deleted vertex
+
+In AGE, you can return vertices that have been deleted.
+
+Query
+```
+SELECT *
+FROM cypher('graph_name', $$
+	MATCH (n {name: 'A'})
+	DELETE n
+	RETURN n
+$$) as (a agtype);
+
+```
+
+<table>
+  <tr>
+   <td><strong>v</strong>
+   </td>
+  </tr>
+  <tr><td>{"id": 281474976710659, "label": "", "properties": {"name": "A"}}::vertex</td></tr>
+  <tr>
+   <td>(1 rows)
+   </td>
+  </tr>
+</table>
+
+
+