Elssky commented on issue #614:
URL: 
https://github.com/apache/incubator-graphar/issues/614#issuecomment-2325788250

   
   
   ## Neo4j Cypher statements involving tags can be mainly divided into the 
following categories:
   
   ### 1. **Creation**
   
   - **Create nodes with labels**:
   ```cypher
   CREATE (n:Label {property: value})
   ```
   - **Add a label to existing nodes**:
   ```cypher
   MATCH (n) SET n:NewLabel
   ```
   
   ### 2. **Deletion and Renaming**
   
   - **Remove all labels from nodes**:
   ```cypher
   MATCH (n) REMOVE LABELS(n)
   ```
   - **Rename a label (by adding a new label and removing the old one)**:
   ```cypher
   MATCH (n:OldLabel) SET n:NewLabel REMOVE n:OldLabel
   ```
   
   ### 3. **Querying and Filtering**
   
   - **Query nodes with a specific label**:
   ```cypher
   MATCH (n:Label) RETURN n
   ```
   - **Query nodes with multiple labels**:
   ```cypher
   MATCH (n:Label1:Label2) RETURN n
   ```
   - **Query nodes with a specific label and property**:
   ```cypher
   MATCH (n:Label {property: value}) RETURN n
   ```
   - **Check if a node has a specific label**:
   ```cypher
   MATCH (n) WHERE n:Label RETURN n
   ```
   ### 4. **Statistics and Information**
   
   - **Count the number of nodes with a specific label**:
   ```cypher
   MATCH (n:Label) RETURN COUNT(n)
   ```
   - **Query all labels**:
   ```cypher
   CALL db.labels() YIELD label RETURN label
   ```
   
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to