MatheusFarias03 commented on issue #111:
URL: https://github.com/apache/age-viewer/issues/111#issuecomment-1387493439

   Sure! When I type `git status` on the terminal, it shows that I'm on the 
`main` branch:
   ```
   git status
   On branch main
   Your branch is up to date with 'origin/main'.
   
   nothing to commit, working tree clean
   ```
   
   Now, how I am executing the query.
   
   First, I created the graph:
   ```sql
   SELECT * FROM ag_catalog.create_graph('goodreads_db');
   ```
   
   Then I created a "User" vertex:
   ```sql
   SELECT * FROM cypher ('goodreads_db', $$                                     
                
   CREATE (a :User {first_name: 'Matheus', last_name: 'Matsumoto', country: 
'Brazil', read: 9, reading:2 }) RETURN a                                        
                                              
   $$) as (a agtype);
   ```
   
   I also created a "Book" vertex:
   ```sql
   SELECT * FROM cypher ('goodreads_db', $$                                     
                
   CREATE (a :Book {title: 'To Kill a Mockingbird', author: 'Harper Lee', 
rating: 4.27, pages: 336, language: 'English', ratings: 5574002, reviews: 
107847}) 
   RETURN a                                      
   $$) as (a agtype);
   ```
   
   And after this, I created an edge between "User" and "Book" with a "READ" 
label:
   ```sql
   SELECT * FROM cypher ('goodreads_db', $$                                     
                
   MATCH (a :User), (b :Book)                                                   
                       
   WHERE a.first_name = 'Matheus' AND b.title = 'To Kill a Mockingbird'         
                       
   CREATE (a)-[e:READ {rating: 4}]->(b)                                         
                       
   RETURN e                                                                     
                       
   $$) as (e agtype);
   ```
   
   So I kept doing it like this, also adding the vertices with "Author" label 
and adding the edge with "AUTHOR_OF" label between them. Now I have about 17 
nodes and 22 edges. I go to where I installed AGE Viewer and execute the `npm 
run setup` and `npm run start` commands to use AGE Viewer.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@age.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to