This is an automated email from the ASF dual-hosted git repository.
ako pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/age.git
The following commit(s) were added to refs/heads/master by this push:
new cee1d967 Update README.md (#1728)
cee1d967 is described below
commit cee1d967d04c2ebe114c35c53485ea9249d4604f
Author: Marco Aurélio Silva de Souza Júnior
<[email protected]>
AuthorDate: Wed Apr 10 02:14:19 2024 -0300
Update README.md (#1728)
- Review the Quick Start section in order to make it more concise and less
redundant.
- The commands weren't working if issued in the written order.
- I kept only the commands that create entities with labels and properties,
rather than separate commands for each step.
---
README.md | 58 +++++++++-------------------------------------------------
1 file changed, 9 insertions(+), 49 deletions(-)
diff --git a/README.md b/README.md
index 7e214f79..5d1ebbae 100644
--- a/README.md
+++ b/README.md
@@ -225,58 +225,23 @@ To create a graph, use the create_graph function located
in the ag_catalog names
SELECT create_graph('graph_name');
```
-To create a single vertex, use the CREATE clause.
-
-```bash
-SELECT *
-FROM cypher('graph_name', $$
- CREATE (n)
-$$) as (v agtype);
-```
-
-
-To create a single vertex with the label, use the CREATE clause.
-
-```bash
-SELECT *
-FROM cypher('graph_name', $$
- CREATE (:label)
-$$) as (v agtype);
-```
-
To create a single vertex with label and properties, use the CREATE clause.
```bash
SELECT *
FROM cypher('graph_name', $$
- CREATE (:label {property:value})
+ CREATE (:label {property:"Node A"})
$$) as (v agtype);
```
-To query the graph, you can use the MATCH clause.
-
```bash
SELECT *
FROM cypher('graph_name', $$
- MATCH (v)
- RETURN v
+ CREATE (:label {property:"Node B"})
$$) as (v agtype);
```
-You can use the following to create an edge, for example, between two nodes.
-
-```bash
-SELECT *
-FROM cypher('graph_name', $$
- MATCH (a:label), (b:label)
- WHERE a.property = 'Node A' AND b.property = 'Node B'
- CREATE (a)-[e:RELTYPE]->(b)
- RETURN e
-$$) as (e agtype);
-```
-
-
-To create an edge and set properties.
+To create an edge between two nodes and set its properties:
```bash
SELECT *
@@ -288,19 +253,14 @@ FROM cypher('graph_name', $$
$$) as (e agtype);
```
-Example
+And to query the connected nodes:
-```bash
-SELECT *
-FROM cypher('graph_name', $$
- MATCH (a:Person), (b:Person)
- WHERE a.name = 'Node A' AND b.name = 'Node B'
- CREATE (a)-[e:RELTYPE {name:a.name + '<->' + b.name}]->(b)
- RETURN e
-$$) as (e agtype);
```
-
-
+SELECT * from cypher('graph_name', $$
+ MATCH (V)-[R]-(V2)
+ RETURN V,R,V2
+$$) as (V agtype, R agtype, V2 agtype);
+```
<h2><img height="20" src="/img/gettingstarted.svg"> Language
Specific Drivers</h2>