WendelLana commented on issue #1004:
URL: https://github.com/apache/age/issues/1004#issuecomment-1694720029

   @rafsun42 Based on the queries that I provided, openCypher supports all of 
them except for the label expression using `&`.  Both Neo4j and openCypher 
don't allow multiple labels in edges, but we can use them in MATCH clauses and 
expressions, for example:
   ```
   MATCH ()-[:ACTED_IN|:DIRECTED]->(:Movie)
   ```
   So, openCypher supports label expressions using the PIPES symbol, denoted as 
`|`. However, Neo4j supports label expression with an extended set of logical 
operators and also relationship type expressions. Some examples:
   
   **Nested expression**
   Find all nodes that either have both labels `A` and `B`, or have label `C`
   ```
   MATCH (n:(A&B)|C)-[]->(m)
   ```
   **NOT expression**
   Find all nodes that do not contain the `A` label
   ```
   MATCH (n:!A)
   ```
   **Wildcard expression**
   Find all the nodes that contain at least one label
   ```
   MATCH (n:%)
   ```
   
   **References**:
   [Cypher Query Language 
Reference](https://github.com/opencypher/openCypher/blob/master/docs/openCypher9.pdf)
 
   [Neo4j Label 
Expressions](https://neo4j.com/docs/cypher-manual/current/syntax/expressions/#label-expressions)
   [Neo4j Relationship Type 
Expressions](https://neo4j.com/docs/cypher-manual/current/syntax/expressions/#relationship-type-expressions)


-- 
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