3 ms·
> while most of the queries could also be translated to relational SQL, Cypher's linear construction using WITH clauses is far, far easier to reason about, IMO.
by leeoniya 2y ago
> while most of the queries could also be translated to relational SQL, Cypher's linear construction using WITH clauses is far, far easier to reason about, IMO.
https://prql-lang.org/ https://prql-lang.org/
- CharlieDigital 2y agoDidn't look too deeply, but one of the keys with Cypher (at least in the context of graph databases) is that it has a nice way of representing `JOIN` operations as graph traversals. MATCH (p:Person)-[r]-(c:Company) RETURN p.Name, c.Name Where `r` can represent any relationship (AKA `JOIN`) between the two collections `Person` and `Company` such as `WORKS_AT`, `EMPLOYED_BY`, `CONTRACTOR_FOR`, etc. So I'd say that linear queries are one of the things I like about Cypher, but the clean abstraction of complex `JOIN` operations is another huge one.
- UltraSane 2y agoThe neat thing about Neo4j is that the [r] isn't a join, it is an actual relationship stored on disk.
- refset 2y agoLike a many-to-many join table?
- CharlieDigital 2y agoLike a many-to-many set of join tables because the `[r]` can represent any relationship between any two collections.
- UltraSane 2y ago[dead]
- inkyoto 2y ago> […] Where `r` can represent any relationship […] … and «-[r]-» can represent any relationship direction, which obviates the need for constructing separate queries for inverse traversing relationships. Kinda like running a compiler forward and backward.