you get an error, b/c WITH creates a boundary which declares which variables are available in the next query part.
If you leave off the WITH cypher adds an implicit WITH between two query parts that it can identify (e.g. read followed by write) that carries over _ALL_ the context to the next part which is often much more than you need.
If you use with you can declare explicitly what you need, making the query easier to understand and the execution more efficient.
As you don't declare relationship1, relationship2 in your WITH they are not available in the next query part, so DELETE cannot see them.
As WITH is very similar to return, it is also possible to use aggregates there which allows you to create new intermediate results that look differently from the subgraphs you queried first (which allows you to work on the aggregates, e.g. create a HAVING using WITH and WHERE)
Am 20.05.2012 um 09:45 schrieb Johnny Weng Luu: